refactor okvs_init

This commit is contained in:
4am 2019-09-20 19:46:46 -04:00
parent 6983328969
commit 661e4b35fb
4 changed files with 5 additions and 11 deletions

View File

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

View File

@ -64,15 +64,13 @@
;------------------------------------------------------------------------------
; okvs_init
;
; in: stack contains 2 bytes of parameters:
; +1 [word] handle to storage space
; in: A/Y = handle to storage space
; out: $00/$01 clobbered
; $02/$03 clobbered
; all registers clobbered
;------------------------------------------------------------------------------
okvs_init
+PARAMS_ON_STACK 2
jsr GetStoreAddress
jsr GetStoreAddressFromAY
; PTR -> store
; Y = 0
tya

View File

@ -32,8 +32,8 @@ ParseKeyValueList
+PARAMS_ON_STACK 5
+LDPARAM 1
+STAY @store1
+STAY @store2
jsr okvs_init ; reset key/value store
+LDPARAM 3
+STAY $FE
@ -55,8 +55,6 @@ ParseKeyValueList
bcs +
dey
+ sty $FF
jsr okvs_init ; reset key/value store
@store1 !word $FDFD ; SMC
ldy #$00 ; index into ($FE) pointing to current character
@newkey ldx #$00 ; X = index into current key

View File

@ -28,8 +28,8 @@ ParseGamesList
+PARAMS_ON_STACK 4
+LDPARAM 1
+STAY @store1
+STAY @store2
jsr okvs_init ; reset key/value store
+LDPARAM 3
+STAY $FE
@ -47,8 +47,6 @@ ParseGamesList
bcs +
dey
+ sty $FF
jsr okvs_init ; reset key/value store
@store1 !word $FDFD ; SMC
ldy #$00 ; index into ($FE) pointing to current character
@newkey ldx #$00 ; X = index into current key