mirror of
https://github.com/a2-4am/4sports.git
synced 2024-06-01 09:41:32 +00:00
38 lines
870 B
Plaintext
38 lines
870 B
Plaintext
|
;license:MIT
|
||
|
;(c) 2018-9 by 4am
|
||
|
;
|
||
|
; cheat-related UI functions
|
||
|
;
|
||
|
; Public functions:
|
||
|
; - ToggleCheat
|
||
|
;
|
||
|
|
||
|
;------------------------------------------------------------------------------
|
||
|
; ToggleCheat
|
||
|
; toggle whether cheats are enabled (global flag) and update the preferences
|
||
|
; file with the new status
|
||
|
;
|
||
|
; does not update UI
|
||
|
;
|
||
|
; in: none
|
||
|
; out: X = 0
|
||
|
; Z = 1
|
||
|
; all other registers and flags clobbered
|
||
|
;------------------------------------------------------------------------------
|
||
|
ToggleCheat
|
||
|
ldx #$B0
|
||
|
lda MachineStatus
|
||
|
eor #CHEATS_ENABLED
|
||
|
sta MachineStatus
|
||
|
and #CHEATS_ENABLED
|
||
|
beq +
|
||
|
inx
|
||
|
+ stx @val
|
||
|
jsr pref_set
|
||
|
!word kCheat
|
||
|
!word @pref
|
||
|
; X = 0, Z = 1
|
||
|
rts
|
||
|
@pref !byte 1
|
||
|
@val !byte $FD
|