From 2b3a4e24ceee06c1e858dbe122b68e05a960806c Mon Sep 17 00:00:00 2001 From: 4am Date: Sun, 11 Nov 2018 08:42:53 -0500 Subject: [PATCH] fix remaining ParseKeyValueList calling parameters --- res/attract-mode.txt | 12 +++++------ src/4cade.a | 1 + src/4cade.init.a | 5 ++++- src/parse.games.a | 4 +++- src/parse.prefs.a | 3 --- src/ui.attract.mode.a | 48 +++++++++++++++++++++++-------------------- 6 files changed, 40 insertions(+), 33 deletions(-) diff --git a/res/attract-mode.txt b/res/attract-mode.txt index b67d90b46..fbf2a2703 100644 --- a/res/attract-mode.txt +++ b/res/attract-mode.txt @@ -5,7 +5,7 @@ 12:Aquatron AQUATRON 001 13:Arkanoid ARKANOID 101 19:Bolo BOLO 001 - 21:BurgerTime BURGERTIME 001 +* 21:BurgerTime BURGERTIME 001 23:Canyon Climber CANYONCLIMBER 001 25:Choplifter CHOPLIFTER 101 27:Conan CONAN 001 @@ -22,13 +22,13 @@ 56:Lady Tut LADYTUT 01 57:Lost Tomb LOSTTOMB 01 62:Mr. Cool MRCOOL 01 - 63:Mr. Do MRDO 101 +X 63:Mr. Do MRDO 101 66:Nibbler NIBBLER 001 70:O'Riley's Mine ORILEYSMINE 01 72:Pac-Man PACMAN 001 74:Pest Patrol PESTPATROL 01 75:Pie-Man PIEMAN 01 - 77:Pitfall II PITFALLII 01 +* 77:Pitfall II PITFALLII 01 78:Plasmania PLASMANIA 01 79:Pooyan POOYAN 01 80:Prince of Persia PRINCEOFPERSIA 011 @@ -36,10 +36,10 @@ 85:Ribbit RIBBIT 01 86:Robotron 2084 ROBOTRON2084 01 91:Snake Byte SNAKEBYTE 01 - 92:Sneakers SNEAKERS 001 +* 92:Sneakers SNEAKERS 001 93:Snoggle SNOGGLE 01 95:Spider Raid SPIDERRAID 01 - 97:Spy Hunter SPYHUNTER 01 +* 97:Spy Hunter SPYHUNTER 01 98:Spy's Demise SPYSDEMISE 01 99:Starblaster STARBLASTER 01 100:Stargate STARGATE 01 @@ -49,4 +49,4 @@ 108:Thunder Bombs THUNDERBOMBS 001 109:Track N Field TRACKNFIELD 001 110:Tubeway ][ TUBEWAYII 01 - 112:Wavy Navy WAVYNAVY 001 +* 112:Wavy Navy WAVYNAVY 001 diff --git a/src/4cade.a b/src/4cade.a index a38ae1765..509e6f258 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -27,6 +27,7 @@ Main !source "src/okvs.a" !source "src/wait.a" !source "src/parse.common.a" + !source "src/parse.prefs.a" !source "src/parse.games.a" gGlobalPrefsStore !word *+2 ; address of first okvs store diff --git a/src/4cade.init.a b/src/4cade.init.a index 905a43be5..b35ea6f20 100644 --- a/src/4cade.init.a +++ b/src/4cade.init.a @@ -58,7 +58,7 @@ OneTimeSetup jsr LoadFile ; load preferences file !word kGlobalPrefsFilename - jsr ParseKeyValueText ; parse contents into global prefs store + jsr ParseKeyValueList ; parse contents into global prefs store !word gGlobalPrefsStore !word ldrlo2 ; (ldrlo2) points to last load address !byte 16 @@ -78,6 +78,7 @@ OneTimeSetup jsr ParseKeyValueList ; parse HGR transition effects list !word gFXStore !word ldrlo2 ; (ldrlo2) points to last load address + !byte 0 +LDAY SRC +STAY gDFXStore ; save pointer to free space for next store @@ -86,6 +87,7 @@ OneTimeSetup jsr ParseKeyValueList ; parse DHGR transition effects list !word gDFXStore !word ldrlo2 ; (ldrlo2) points to last load address + !byte 0 +LDAY SRC +STAY gAttractModeStore ; save pointer to free space for next store @@ -94,6 +96,7 @@ OneTimeSetup jsr ParseKeyValueList ; parse attract-mode configuration !word gAttractModeStore !word ldrlo2 ; (ldrlo2) points to last load address + !byte 0 +LDAY SRC +STAY gSlideshowStore ; save pointer to free space for next store diff --git a/src/parse.games.a b/src/parse.games.a index 0d2f7f63c..06d79b14b 100644 --- a/src/parse.games.a +++ b/src/parse.games.a @@ -59,7 +59,7 @@ ParseGamesList cmp #$0D ; ignore blank line beq @newkey cmp #$5B ; '[' ends the parsing - beq .parseKeyValueDone + beq @exit cmp #$30 ; '0' -> no filtering on joystick beq @filterOnMemory cmp #$31 ; not '0' or '1' or '[' or CR -> ignore entire line (e.g. comment) @@ -113,3 +113,5 @@ ParseGamesList cmp #$0D ; CR bne @skipLine beq @newkey ; always branches + +@exit rts diff --git a/src/parse.prefs.a b/src/parse.prefs.a index 252f329ee..64be4fb44 100644 --- a/src/parse.prefs.a +++ b/src/parse.prefs.a @@ -17,9 +17,6 @@ ; - kNextDFX ; -gGlobalPrefsStore - !word 0 - kGlobalPrefsBuffer !word $0800 diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 9e1e63aea..96497b6c9 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -43,6 +43,9 @@ AttractMode ; to the |Reenter| entry point. ; All demos are strictly 48K / main memory. No demo uses the ; language card or auxiliary memory. + + jsr Home ; clear text screen and switch to it during loading + +LOAD_PATH kDemoDirectory ldy gPathname iny @@ -59,8 +62,8 @@ AttractMode +LOAD_FILE_IMM @key - ldx #(@end_prelaunch-@prelaunch-1) -- lda @prelaunch,x ; copy pre-launch code to main memory + ldx #(End_Prelaunch-Prelaunch-1) +- lda Prelaunch,x ; copy pre-launch code to main memory sta $100,x dex bpl - @@ -71,24 +74,6 @@ AttractMode bpl - jmp $106 ; jump to pre-launch code -@prelaunch ; this runs from main memory - lda $C088 ; entry point used by some self-running demos - jmp Reenter - +READ_ROM_NO_WRITE ; entry point to launch game (called above) - jsr $FE89 ; initialize machine like a cold boot - jsr $FE93 ; (many games assume a 'clean slate') - sta $C000 - sta $C002 - sta $C004 - sta $C00C - sta $C00E - jsr $FB2F - jsr $FC58 - ldx #$FF - txs - jmp (ldrlo2) ; jump to game -@end_prelaunch - @Slideshow ; HGR or DHGR slideshow pha ; save module type (1=HGR, 2=DHGR) @@ -97,6 +82,7 @@ AttractMode jsr ParseKeyValueList ; parse slideshow configuration !word gSlideshowStore !word ldrlo2 ; (ldrlo2) points to load address + !byte 0 pla ; restore module type cmp #$01 beq @HGRSlideshow @@ -237,10 +223,10 @@ ClearHGR1 Home ldx #(@end-@start-1) - lda @start,x - sta $300,x + sta $100,x dex bpl - - jmp $300 + jmp $100 @start ; this will be run from main memory +READ_ROM_NO_WRITE @@ -251,3 +237,21 @@ Home +READ_RAM1_WRITE_RAM1 rts @end + +Prelaunch ; this runs from main memory + lda $C088 ; entry point used by some self-running demos + jmp Reenter + +READ_ROM_NO_WRITE ; entry point to launch game (called above) + jsr $FE89 ; initialize machine like a cold boot + jsr $FE93 ; (many games assume a 'clean slate') + sta $C000 + sta $C002 + sta $C004 + sta $C00C + sta $C00E + jsr $FB2F + jsr $FC58 + ldx #$FF + txs + jmp (ldrlo2) ; jump to game +End_Prelaunch