mirror of
https://github.com/a2-4am/4cade.git
synced 2024-11-28 00:52:00 +00:00
28 lines
532 B
Plaintext
28 lines
532 B
Plaintext
;license:MIT
|
|
;(c) 2018-9 by 4am
|
|
;
|
|
; cheat-related UI functions
|
|
;
|
|
; Public functions:
|
|
; - ToggleCheat
|
|
;
|
|
|
|
ToggleCheat
|
|
; in: none
|
|
; out: X = 0, Z = 1 (guaranteed by pref_set)
|
|
; all other registers and flags clobbered
|
|
ldx #$B0
|
|
lda MachineStatus
|
|
eor #CHEATS_ENABLED
|
|
sta MachineStatus
|
|
and #CHEATS_ENABLED
|
|
beq +
|
|
inx
|
|
+ stx @val
|
|
jsr pref_set
|
|
!word kCheat
|
|
!word @pref
|
|
rts
|
|
@pref !byte 1
|
|
@val !byte $FD
|