2019-09-16 16:57:53 +00:00
|
|
|
;license:MIT
|
|
|
|
;(c) 2018-9 by 4am
|
|
|
|
;
|
|
|
|
; cheat-related UI functions
|
|
|
|
;
|
|
|
|
; Public functions:
|
2019-09-16 17:36:48 +00:00
|
|
|
; - ToggleCheat
|
2019-09-16 16:57:53 +00:00
|
|
|
;
|
|
|
|
|
2019-09-16 17:36:48 +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
|
2019-09-16 17:36:48 +00:00
|
|
|
lda gCheatsEnabled
|
|
|
|
eor #$80
|
|
|
|
sta gCheatsEnabled
|
|
|
|
beq +
|
2019-09-24 19:31:44 +00:00
|
|
|
inx
|
|
|
|
+ stx @val
|
2019-09-16 17:36:48 +00:00
|
|
|
jsr pref_set
|
|
|
|
!word kCheat
|
|
|
|
!word @pref
|
|
|
|
rts
|
|
|
|
@pref !byte 1
|
|
|
|
@val !byte $FD
|