move cheat category and DHGR title bits to gGamesList OKVS

no more separate gCheatsAvailable array
This commit is contained in:
4am 2020-03-08 21:32:14 -04:00
parent b2b28f6288
commit 8f5f1dbdd8
4 changed files with 22 additions and 13 deletions

View File

@ -119,7 +119,7 @@ gDFXStore
gSlideshowStore
!word $0800
gGlobalPrefsStore
!word $D100
!word $D000
gGamesListStore
!word $FDFD ; SMC
SwitchToBank2

View File

@ -108,8 +108,6 @@ gValLen = $1F80
gVal = $1F81
; LC RAM 1
gCheatsAvailable = $D000 ; master cheats table, indexed by game index in gGamesListStore
; 1 byte per game, so max size = 256 games
MockingboardStuff = $FFF8 ; bit 7 = 1 if speech chip present (Mockingboard "C")
; bit 6 = 1 if Mockingboard "B" (stereo) found (else Mockingboard "A")
; bit 4-5 unused

View File

@ -85,6 +85,15 @@ ParseGamesList
inx
bpl @gatherValue
@endValue
pla ; pop cheat category
sta gVal,x ; store after game title
pla ; pop DHGR title
clc
ror
ror
ora gVal,x
sta gVal,x ; store in bit 7 of same byte as cheat category
inx
stx gValLen
tya
pha ; okvs functions clobber everything but we need Y
@ -93,13 +102,8 @@ ParseGamesList
!word gKeyLen
!word gValLen
!byte 0
; X = new OKVS length
pla ; pop saved Y
tay
pla ; pop cheat category
dex ; X = new OKVS length - 1
sta gCheatsAvailable,x
pla ; pop DHGR title
clc
bcc @newkey ; always branches

View File

@ -96,10 +96,14 @@ DrawUI
jsr GetGameToLaunch
jsr okvs_get_current
; (PTR) -> game title
lda (PTR),y ; copy game title into UI line 2
sta SAVE ; title length
inc SAVE
; (PTR) -> game title + bitfield of game info
; Y = 0
lda (PTR),y ; A = game title length + 1
sta SAVE
tay
lda (PTR),y ; A = game info bitfield
sta gGameToLaunchInfo
ldy #0
- iny
@printCursor
lda #$FD ; SMC
@ -229,7 +233,10 @@ CheckCheats
ldx gGameToLaunch
inx
beq +
ldy gCheatsAvailable-1,x
gGameToLaunchInfo=*+1
lda #$FD ; SMC
and #$03
tay
+
lda kCheatDescriptionLo,y
sta SAVE