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, ; D000..E5F4 - persistent data structures (per-game cheat categories,
; gGlobalPrefsStore, gGamesListStore) ; gGlobalPrefsStore, gGamesListStore)
; ...unused... ; ...unused...
; EA5C..FFF9 - main program code ; EABB..FFF9 - main program code
; FFFA..FFFF - NMI, reset, IRQ vectors ; FFFA..FFFF - NMI, reset, IRQ vectors
; ;
; LC RAM BANK 2 ; LC RAM BANK 2

View File

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

View File

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

View File

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