mirror of
https://github.com/a2-4am/4cade.git
synced 2024-12-26 20:30:29 +00:00
add okvs_get_current [needs docs]
This commit is contained in:
parent
bf940d29d7
commit
241a870eec
@ -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...
|
||||||
; EC22..FFF9 - main program code
|
; EC28..FFF9 - main program code
|
||||||
; FFFA..FFFF - NMI, reset, IRQ vectors
|
; FFFA..FFFF - NMI, reset, IRQ vectors
|
||||||
;
|
;
|
||||||
; LC RAM BANK 2
|
; LC RAM BANK 2
|
||||||
|
11
src/okvs.a
11
src/okvs.a
@ -284,6 +284,17 @@ okvs_get
|
|||||||
@fail sec
|
@fail sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
okvs_get_current
|
||||||
|
+STAY PTR
|
||||||
|
ldy #0
|
||||||
|
lda (PTR),y
|
||||||
|
clc
|
||||||
|
adc PTR
|
||||||
|
sta PTR
|
||||||
|
bcc +
|
||||||
|
inc PTR+1
|
||||||
|
+ jmp incptr
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; okvs_next
|
; okvs_next
|
||||||
; get (N+1)th key, with wraparound
|
; get (N+1)th key, with wraparound
|
||||||
|
@ -103,17 +103,12 @@ MiniAttractMode
|
|||||||
ldx #$FD ; SMC
|
ldx #$FD ; SMC
|
||||||
+LDADDR gAttractModeStore
|
+LDADDR gAttractModeStore
|
||||||
jsr okvs_nth ; get the next module on the list
|
jsr okvs_nth ; get the next module on the list
|
||||||
+STAY @key
|
+STAY SAVE
|
||||||
|
jsr okvs_get_current ; get module type
|
||||||
jsr okvs_get ; get module type
|
|
||||||
!word gAttractModeStore
|
|
||||||
@key !word $FDFD ; SMC
|
|
||||||
+STAY PTR
|
|
||||||
|
|
||||||
ldy #1
|
ldy #1
|
||||||
lda (PTR),y
|
lda (PTR),y
|
||||||
tax ; X = module type
|
tax ; X = module type
|
||||||
+LDAY @key ; A/Y = address of module name
|
+LDAY SAVE ; A/Y = address of module name
|
||||||
jsr RunAttractModule ; execute the module
|
jsr RunAttractModule ; execute the module
|
||||||
|
|
||||||
inc @MiniAttractIndex
|
inc @MiniAttractIndex
|
||||||
|
@ -184,15 +184,10 @@ DrawUI
|
|||||||
|
|
||||||
+LDADDR gGamesListStore
|
+LDADDR gGamesListStore
|
||||||
jsr okvs_nth
|
jsr okvs_nth
|
||||||
+STAY + ; (A/Y) -> game filename
|
jsr okvs_get_current
|
||||||
|
; (PTR) -> game title
|
||||||
jsr okvs_get
|
|
||||||
!word gGamesListStore
|
|
||||||
+ !word $FDFD
|
|
||||||
+STAY SRC ; (SRC) -> game title
|
|
||||||
|
|
||||||
ldy #0 ; copy game title into UI line 2
|
ldy #0 ; copy game title into UI line 2
|
||||||
lda (SRC),y
|
lda (PTR),y
|
||||||
sta SAVE ; title length
|
sta SAVE ; title length
|
||||||
inc SAVE
|
inc SAVE
|
||||||
- iny
|
- iny
|
||||||
@ -205,7 +200,7 @@ DrawUI
|
|||||||
lda #$FD ; SMC
|
lda #$FD ; SMC
|
||||||
+HIDE_NEXT_2_BYTES
|
+HIDE_NEXT_2_BYTES
|
||||||
@printTitleChar
|
@printTitleChar
|
||||||
lda (SRC),y
|
lda (PTR),y
|
||||||
sta UILine2,y
|
sta UILine2,y
|
||||||
cpy #MaxInputLength+1
|
cpy #MaxInputLength+1
|
||||||
bcc -
|
bcc -
|
||||||
@ -263,7 +258,7 @@ DrawUI
|
|||||||
ldy #0
|
ldy #0
|
||||||
@dotloop
|
@dotloop
|
||||||
iny
|
iny
|
||||||
lda (SRC),y ; (SRC) still points to game title
|
lda (PTR),y ; (PTR) still points to game title
|
||||||
+LOW_ASCII_TO_LOWER
|
+LOW_ASCII_TO_LOWER
|
||||||
cmp InputBuffer,x
|
cmp InputBuffer,x
|
||||||
bne +
|
bne +
|
||||||
|
Loading…
Reference in New Issue
Block a user