refactor ToggleCheats

This commit is contained in:
4am 2019-09-24 15:31:44 -04:00
parent 5bc3ef8ab4
commit 2f302ce8b0
2 changed files with 4 additions and 5 deletions

View File

@ -9,7 +9,7 @@
; D000..E5F4 - persistent data structures (per-game cheat categories,
; gGlobalPrefsStore, gGamesListStore)
; ...unused...
; EC85..FFF9 - main program code
; EC89..FFF9 - main program code
; FFFA..FFFF - NMI, reset, IRQ vectors
;
; LC RAM BANK 2

View File

@ -11,14 +11,13 @@ ToggleCheat
; in: none
; out: all registers clobbered
; X = 0, Z = 1 (guaranteed by pref_set)
ldx #$B0
lda gCheatsEnabled
eor #$80
sta gCheatsEnabled
beq +
lda #$B1
+HIDE_NEXT_2_BYTES
+ lda #$B0
sta @val
inx
+ stx @val
jsr pref_set
!word kCheat
!word @pref