mirror of
https://github.com/a2-4am/4cade.git
synced 2025-02-18 14:30:52 +00:00
scaffolding of Play routine
This commit is contained in:
parent
76d49fda57
commit
689ed36499
@ -39,6 +39,11 @@ Main
|
|||||||
|
|
||||||
jsr BlankHGR
|
jsr BlankHGR
|
||||||
@loop
|
@loop
|
||||||
|
lda $C000
|
||||||
|
cmp #$8D
|
||||||
|
bne +
|
||||||
|
jsr Play
|
||||||
|
+
|
||||||
bit $C010
|
bit $C010
|
||||||
jsr AttractMode
|
jsr AttractMode
|
||||||
jmp @loop
|
jmp @loop
|
||||||
|
@ -7,9 +7,12 @@
|
|||||||
; - AttractMode
|
; - AttractMode
|
||||||
;
|
;
|
||||||
; Public variables
|
; Public variables
|
||||||
; - gAttractIndex ; [byte] numeric index of Mega-Attract Module
|
; - gCurrentAttractIndex ; [byte] numeric index in gAttractModeStore of current Mega-Attract Module
|
||||||
; - gFXIndex ; [byte] numeric index of HGR transition effect
|
; - gCurrentlyVisibleSlideshowIndex ; [byte] numeric index in gSlideshowStore of currently visible slideshow picture
|
||||||
; - gDFXIndex ; [byte] numeric index of DHGR transition effect
|
; (only valid during slideshows, not updated once a key is pressed)
|
||||||
|
; - gAttractIndex ; [byte] numeric index in gAttractModeStore of next Mega-Attract Module
|
||||||
|
; - gFXIndex ; [byte] numeric index in gFXStore of next HGR transition effect
|
||||||
|
; - gDFXIndex ; [byte] numeric index in gDFXStore of next DHGR transition effect
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; AttractMode
|
; AttractMode
|
||||||
@ -51,6 +54,8 @@ gAttractIndex
|
|||||||
!byte 0
|
!byte 0
|
||||||
+STAY @key
|
+STAY @key
|
||||||
|
|
||||||
|
lda gAttractIndex
|
||||||
|
sta gCurrentAttractIndex
|
||||||
inc gAttractIndex ; increment module index for next time
|
inc gAttractIndex ; increment module index for next time
|
||||||
jsr okvs_len
|
jsr okvs_len
|
||||||
!word gAttractModeStore
|
!word gAttractModeStore
|
||||||
@ -173,6 +178,63 @@ kAttractModeConfFile
|
|||||||
!text "ATTRACT.CONF"
|
!text "ATTRACT.CONF"
|
||||||
@kAttractModeConfFile_e
|
@kAttractModeConfFile_e
|
||||||
|
|
||||||
|
Play
|
||||||
|
jsr LoadFile ; load attract-mode configuration file at $8000
|
||||||
|
!word kAttractModeConfFile
|
||||||
|
jsr ParseKeyValueList ; parse attract-mode configuration into OKVS data structure at $6000
|
||||||
|
!word gAttractModeStore
|
||||||
|
!word ldrlo2 ; (ldrlo2) points to last load address, so $8000
|
||||||
|
!byte 0
|
||||||
|
|
||||||
|
jsr okvs_nth ; get filename of current attract-mode module
|
||||||
|
!word gAttractModeStore
|
||||||
|
gCurrentAttractIndex
|
||||||
|
!byte $FD ; set in AttractMode
|
||||||
|
+STAY @key
|
||||||
|
jsr okvs_get
|
||||||
|
!word gAttractModeStore
|
||||||
|
@key !word $FDFD ; SMC
|
||||||
|
+STAY PTR
|
||||||
|
ldy #1
|
||||||
|
lda (PTR),y
|
||||||
|
and #$0F
|
||||||
|
bne @playFromSlideshow
|
||||||
|
|
||||||
|
; we reached here by pressing <RETURN> during a self-running demo,
|
||||||
|
; which means that @key points to the filename of the game we want to play
|
||||||
|
+LDAY @key
|
||||||
|
jmp Go
|
||||||
|
|
||||||
|
@playFromSlideshow
|
||||||
|
; we reached here by pressing <RETURN> during a slideshow
|
||||||
|
; gSlideshowStore is still in memory, and gCurrentlyVisibleSlideshowIndex
|
||||||
|
; is the index into gSlideshowStore of the picture that is being displayed
|
||||||
|
jsr okvs_nth
|
||||||
|
!word gSlideshowStore
|
||||||
|
gCurrentlyVisibleSlideshowIndex
|
||||||
|
!byte $FD ; set in HGRTitleCallback, HGRActionCallback, DHGRTitleCallback
|
||||||
|
+STAY @sskey
|
||||||
|
+STAY @sskey2
|
||||||
|
jsr okvs_get
|
||||||
|
!word gGamesListStore
|
||||||
|
@sskey !word $FDFD ; SMC
|
||||||
|
bcs +
|
||||||
|
+LDAY @sskey
|
||||||
|
jmp Go
|
||||||
|
+
|
||||||
|
; if the key is not found, try getting the value of the current record
|
||||||
|
; from gSlideshowStore and using that instead
|
||||||
|
; (some games have multiple action screenshots, value points to the key in gGamesListStore)
|
||||||
|
jsr okvs_get
|
||||||
|
!word gSlideshowStore
|
||||||
|
@sskey2 !word $FDFD ; SMC
|
||||||
|
bcc Go
|
||||||
|
rts
|
||||||
|
Go
|
||||||
|
+STAY PTR
|
||||||
|
|
||||||
|
brk
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; internal functions
|
; internal functions
|
||||||
|
|
||||||
@ -188,11 +250,13 @@ kAttractModeConfFile
|
|||||||
; $2000..$BFFF clobbered by graphics data and transition code
|
; $2000..$BFFF clobbered by graphics data and transition code
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
HGRTitleCallback
|
HGRTitleCallback
|
||||||
ldx $C000
|
+STAY PTR
|
||||||
|
|
||||||
|
lda $C000
|
||||||
bpl +
|
bpl +
|
||||||
rts
|
rts
|
||||||
+
|
+
|
||||||
+STAY PTR
|
stx gCurrentlyVisibleSlideshowIndex
|
||||||
|
|
||||||
; load HGR screenshot at $4000
|
; load HGR screenshot at $4000
|
||||||
+LOAD_FILE kHGRTitleDirectory, PTR
|
+LOAD_FILE kHGRTitleDirectory, PTR
|
||||||
@ -212,14 +276,16 @@ HGRTitleCallback
|
|||||||
; $2000..$BFFF clobbered by graphics data and transition code
|
; $2000..$BFFF clobbered by graphics data and transition code
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
HGRActionCallback
|
HGRActionCallback
|
||||||
ldx $C000
|
|
||||||
bpl +
|
|
||||||
rts
|
|
||||||
+
|
|
||||||
+STAY PTR
|
+STAY PTR
|
||||||
+STAY @key
|
+STAY @key
|
||||||
+STAY @key2
|
+STAY @key2
|
||||||
|
|
||||||
|
lda $C000
|
||||||
|
bpl +
|
||||||
|
rts
|
||||||
|
+
|
||||||
|
stx gCurrentlyVisibleSlideshowIndex
|
||||||
|
|
||||||
; load HGR screenshot at $4000
|
; load HGR screenshot at $4000
|
||||||
+LOAD_FILE kHGRActionDirectory, PTR
|
+LOAD_FILE kHGRActionDirectory, PTR
|
||||||
|
|
||||||
@ -297,12 +363,15 @@ HGRActionCallback
|
|||||||
; $2000..$5FFF/aux clobbered
|
; $2000..$5FFF/aux clobbered
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
DHGRTitleCallback
|
DHGRTitleCallback
|
||||||
ldx $C000
|
+STAY PTR
|
||||||
|
|
||||||
|
lda $C000
|
||||||
bpl +
|
bpl +
|
||||||
rts
|
rts
|
||||||
+
|
+
|
||||||
|
stx gCurrentlyVisibleSlideshowIndex
|
||||||
|
|
||||||
; load DHGR screenshot at $4000/main and $4000/aux
|
; load DHGR screenshot at $4000/main and $4000/aux
|
||||||
+STAY PTR
|
|
||||||
jsr ResetPath
|
jsr ResetPath
|
||||||
+LDADDR kDHGRTitleDirectory
|
+LDADDR kDHGRTitleDirectory
|
||||||
jsr AddToPath
|
jsr AddToPath
|
||||||
|
Loading…
x
Reference in New Issue
Block a user