4cade/src/ui.cheats.a

27 lines
492 B
Plaintext
Raw Normal View History

2019-09-16 16:57:53 +00:00
;license:MIT
;(c) 2018-9 by 4am
;
; cheat-related UI functions
;
; Public functions:
; - ToggleCheat
2019-09-16 16:57:53 +00:00
;
ToggleCheat
; in: none
2019-09-24 19:32:24 +00:00
; out: X = 0, Z = 1 (guaranteed by pref_set)
; all other registers and flags clobbered
2019-09-24 19:31:44 +00:00
ldx #$B0
lda gCheatsEnabled
eor #$80
sta gCheatsEnabled
beq +
2019-09-24 19:31:44 +00:00
inx
+ stx @val
jsr pref_set
!word kCheat
!word @pref
rts
@pref !byte 1
@val !byte $FD