diff --git a/src/constants.a b/src/constants.a index ea36a3430..c6a5348d3 100644 --- a/src/constants.a +++ b/src/constants.a @@ -9,7 +9,7 @@ ; D000..E611 - persistent data structures (per-game cheat categories, ; gGlobalPrefsStore, gGamesListStore) ; ...unused... -; ECA6..FFF9 - main program code +; ECBB..FFF9 - main program code ; FFFA..FFFF - NMI, reset, IRQ vectors ; ; LC RAM BANK 2 diff --git a/src/glue.launch.a b/src/glue.launch.a index 1b47b1e61..000009896 100644 --- a/src/glue.launch.a +++ b/src/glue.launch.a @@ -85,7 +85,7 @@ PlayGame jsr GetGameToLaunch ; A/Y = address of game filename +STAY SAVE - +STAY @pfile ; assume we're loading a game-specific prelaunch file + +STAY @pfile jsr ClearScreens ; avoid seeing code load into the HGR page ; (clobbers $106, must do now before loading prelaunch code) diff --git a/src/ui.attract.dhgr.a b/src/ui.attract.dhgr.a index cc1a1bab6..21c5e154d 100644 --- a/src/ui.attract.dhgr.a +++ b/src/ui.attract.dhgr.a @@ -42,8 +42,7 @@ DHGRSingle !word kRootDirectory + !word $FDFD ; SMC jsr LoadDHGRTransition ; load transition effect code at $6000 - +LDADDR $6000 - jsr ExecuteTransitionAndWait + jsr ExecuteTransitionAt6000AndWait ; switch back to HGR mode with initial blank screen on exit ; /!\ execution falls through here to BlankHGR ;------------------------------------------------------------------------------ @@ -142,8 +141,7 @@ DHGRTitleCallback !word kDHGRTitleDirectory + !word $FDFD - +LDADDR $6000 - jmp ExecuteTransitionAndWait + jmp ExecuteTransitionAt6000AndWait ;------------------------------------------------------------------------------ ; DHGRActionCallback [private] @@ -175,5 +173,4 @@ DHGRActionCallback !word kDHGRActionDirectory + !word $FDFD - +LDADDR $6000 - ; /!\ execution falls through to ui.wait/ExecuteTransitionAndWait + ; /!\ execution falls through to ui.wait/ExecuteTransitionAt6000AndWait diff --git a/src/ui.attract.gr.a b/src/ui.attract.gr.a index 65f7c955b..00e793386 100644 --- a/src/ui.attract.gr.a +++ b/src/ui.attract.gr.a @@ -24,8 +24,7 @@ GRSingle @fname !word $FDFD ; SMC !word $6000 jsr .LoadGRTransition ; load transition effect code at $6400 - +LDADDR $6400 - jsr ExecuteTransitionAndWait + jsr ExecuteTransitionAt6400AndWait jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit ;------------------------------------------------------------------------------ @@ -97,5 +96,4 @@ GRRTS rts + !word $FDFD ; SMC !word $6000 - +LDADDR $6400 - jmp ExecuteTransitionAndWait + jmp ExecuteTransitionAt6400AndWait diff --git a/src/ui.attract.hgr.a b/src/ui.attract.hgr.a index 8cb5b4b95..bb484b048 100644 --- a/src/ui.attract.hgr.a +++ b/src/ui.attract.hgr.a @@ -30,7 +30,7 @@ HGRSingle @fname !word $FDFD ; SMC !word $4000 jsr LoadHGRTransition ; load transition effect code at $6000 - jmp .transition + jmp ExecuteTransitionAt6000AndWait ;------------------------------------------------------------------------------ ; LoadHGRTransition [private] @@ -99,7 +99,7 @@ HGRTitleCallback + !word $FDFD ; SMC !word $4000 - jmp .transition + jmp ExecuteTransitionAt6000AndWait ;------------------------------------------------------------------------------ ; HGRActionCallback [private] @@ -158,9 +158,7 @@ HGRActionCallback lda #3 ; solid vertical bar character jsr @drawline -.transition - +LDADDR $6000 - jmp ExecuteTransitionAndWait + jmp ExecuteTransitionAt6000AndWait @resetline ldy #40 - sta gPathname,y diff --git a/src/ui.attract.shr.a b/src/ui.attract.shr.a index d62d968d8..ca6ff4339 100644 --- a/src/ui.attract.shr.a +++ b/src/ui.attract.shr.a @@ -30,8 +30,7 @@ SHRSingle + !word $FDFD ; SMC !word $2000 jsr LoadSHRTransition - +LDADDR $A000 - jsr ExecuteTransitionAndWait + jsr ExecuteTransitionAtA000AndWait jmp BlankHGR ;------------------------------------------------------------------------------ @@ -81,8 +80,7 @@ SHRArtworkCallback @sfname !word $FDFD !word $2000 - +LDADDR $A000 - jmp ExecuteTransitionAndWait + jmp ExecuteTransitionAtA000AndWait ;------------------------------------------------------------------------------ ; .BlankSHR [private] diff --git a/src/ui.overlay.a b/src/ui.overlay.a index 62022b91f..f97090e1e 100644 --- a/src/ui.overlay.a +++ b/src/ui.overlay.a @@ -226,7 +226,7 @@ DrawUI CheckCheats ldy #kCheatsEnabled ldx gGameToLaunch - inx + cpx #$FF beq + ldy gCheatsAvailable,x + diff --git a/src/ui.wait.a b/src/ui.wait.a index 0fe8133b0..5a8a3dbed 100644 --- a/src/ui.wait.a +++ b/src/ui.wait.a @@ -7,6 +7,15 @@ ; - WaitForKeyFor30Seconds ; - CoverFade +ExecuteTransitionAt6000AndWait + ldy #$60 + +HIDE_NEXT_2_BYTES +ExecuteTransitionAt6400AndWait + ldy #$64 + +HIDE_NEXT_2_BYTES +ExecuteTransitionAtA000AndWait + ldy #$A0 + ; /!\ execution falls through here from ui.attract.dhgr/DHGRActionCallback ;------------------------------------------------------------------------------ ; ExecuteTransitionAndWait @@ -17,6 +26,7 @@ ; out: all flags and registers clobbered ;------------------------------------------------------------------------------ ExecuteTransitionAndWait + lda #0 +STAY @j+1 @j jsr $FDFD ; SMC call transition effect code ldx #$20 ; picture is showing so now we wait