diff --git a/res/attract.conf b/res/attract.conf index 072ce3612..b82418255 100644 --- a/res/attract.conf +++ b/res/attract.conf @@ -1 +1 @@ -# # Mega-Attract-Mode configuration file # # Mega-Attract-Mode is split into modules. Each module can be a # short slideshow or a self-running demo (like a game's built-in # 'attract mode'). Modules are run in the order listed here, one # after the next, until interrupted by user input. The last-run # module is tracked in the master prefs file. # # Format: # key=value # # value must be one of # 1 for HGR slideshow (key is a file containing a list of HGR graphics) # 2 for DHGR slideshow (key is a file containing a list of DHGR graphics) # 3 for self-running demo (key is an executable binary file) # # Blank lines and lines beginning with '#' are ignored (like this one!) # A line beginning with '[' terminates the parsing # DHGR.CONF=2 FAVORITES.CONF=1 #SHORT.CONF=1 #SNEAKERS=3 EFG.CONF=1 #WAVY.NAVY=3 ACTIVISION.CONF=1 CD.CONF=1 BRODERBUND.CONF=1 T.CONF=1 ATARI.CONF=1 SIERRA.CONF=1 PQR.CONF=1 DATAMOST.CONF=1 MNO.CONF=1 DATASOFT.CONF=1 S.CONF=1 MICROFUN.CONF=1 AB.CONF=1 PICCADILLY.CONF=1 HIJKL.CONF=1 SIRIUS.CONF=1 [eof] \ No newline at end of file +# # Mega-Attract-Mode configuration file # # Mega-Attract-Mode is split into modules. Each module can be a # short slideshow or a self-running demo (like a game's built-in # 'attract mode'). Modules are run in the order listed here, one # after the next, until interrupted by user input. The last-run # module is tracked in the master prefs file. # # Format: # key=value # # value must be one of # 1 for HGR slideshow (key is a file containing a list of HGR graphics) # 2 for DHGR slideshow (key is a file containing a list of DHGR graphics) # 3 for self-running demo (key is an executable binary file) # # Blank lines and lines beginning with '#' are ignored (like this one!) # A line beginning with '[' terminates the parsing # SHORT.CONF=1 SPARE.CHANGE=3 DHGR.CONF=2 FAVORITES.CONF=1 #SNEAKERS=3 EFG.CONF=1 #WAVY.NAVY=3 ACTIVISION.CONF=1 CD.CONF=1 BRODERBUND.CONF=1 T.CONF=1 ATARI.CONF=1 SIERRA.CONF=1 PQR.CONF=1 DATAMOST.CONF=1 MNO.CONF=1 DATASOFT.CONF=1 S.CONF=1 MICROFUN.CONF=1 AB.CONF=1 PICCADILLY.CONF=1 HIJKL.CONF=1 SIRIUS.CONF=1 [eof] \ No newline at end of file diff --git a/res/demo/PITFALL.II b/res/demo/PITFALL.II new file mode 100755 index 000000000..efbf0bbb6 Binary files /dev/null and b/res/demo/PITFALL.II differ diff --git a/res/demo/SPARE.CHANGE b/res/demo/SPARE.CHANGE new file mode 100755 index 000000000..be33a90cf Binary files /dev/null and b/res/demo/SPARE.CHANGE differ diff --git a/res/demo/SPARE.CHANGE.A b/res/demo/SPARE.CHANGE.A new file mode 100755 index 000000000..1dca79b03 Binary files /dev/null and b/res/demo/SPARE.CHANGE.A differ diff --git a/res/demo/SPARE.CHANGE.B b/res/demo/SPARE.CHANGE.B new file mode 100755 index 000000000..cf1717b7a Binary files /dev/null and b/res/demo/SPARE.CHANGE.B differ diff --git a/res/demo/SPARE.CHANGE.C b/res/demo/SPARE.CHANGE.C new file mode 100755 index 000000000..7b4b5062d Binary files /dev/null and b/res/demo/SPARE.CHANGE.C differ diff --git a/res/demo/SPARE.CHANGE.D b/res/demo/SPARE.CHANGE.D new file mode 100755 index 000000000..66b6fc7b1 Binary files /dev/null and b/res/demo/SPARE.CHANGE.D differ diff --git a/res/demo/SPARE.CHANGE.E b/res/demo/SPARE.CHANGE.E new file mode 100755 index 000000000..a907c2502 Binary files /dev/null and b/res/demo/SPARE.CHANGE.E differ diff --git a/res/demo/SPARE.CHANGE.F b/res/demo/SPARE.CHANGE.F new file mode 100755 index 000000000..825f6f652 Binary files /dev/null and b/res/demo/SPARE.CHANGE.F differ diff --git a/res/demo/SPARE.CHANGE.G b/res/demo/SPARE.CHANGE.G new file mode 100755 index 000000000..a7478c8ca Binary files /dev/null and b/res/demo/SPARE.CHANGE.G differ diff --git a/res/demo/SPARE.CHANGE.H b/res/demo/SPARE.CHANGE.H new file mode 100755 index 000000000..cb20c46cb Binary files /dev/null and b/res/demo/SPARE.CHANGE.H differ diff --git a/res/demo/SPARE.CHANGE.I b/res/demo/SPARE.CHANGE.I new file mode 100755 index 000000000..02f8fd630 Binary files /dev/null and b/res/demo/SPARE.CHANGE.I differ diff --git a/res/demo/SPARE.CHANGE.J b/res/demo/SPARE.CHANGE.J new file mode 100755 index 000000000..0528a4d90 Binary files /dev/null and b/res/demo/SPARE.CHANGE.J differ diff --git a/res/demo/SPARE.CHANGE.K b/res/demo/SPARE.CHANGE.K new file mode 100755 index 000000000..ab1d61318 Binary files /dev/null and b/res/demo/SPARE.CHANGE.K differ diff --git a/res/demo/SPARE.CHANGE.L b/res/demo/SPARE.CHANGE.L new file mode 100755 index 000000000..8abfbf997 Binary files /dev/null and b/res/demo/SPARE.CHANGE.L differ diff --git a/res/demo/SPARE.CHANGE.M b/res/demo/SPARE.CHANGE.M new file mode 100755 index 000000000..7f37c6140 Binary files /dev/null and b/res/demo/SPARE.CHANGE.M differ diff --git a/res/demo/SPARE.CHANGE.N b/res/demo/SPARE.CHANGE.N new file mode 100755 index 000000000..eb2023ae7 Binary files /dev/null and b/res/demo/SPARE.CHANGE.N differ diff --git a/res/demo/SPARE.CHANGE.O b/res/demo/SPARE.CHANGE.O new file mode 100755 index 000000000..3afd8508f Binary files /dev/null and b/res/demo/SPARE.CHANGE.O differ diff --git a/res/demo/SPARE.CHANGE.P b/res/demo/SPARE.CHANGE.P new file mode 100755 index 000000000..375370509 Binary files /dev/null and b/res/demo/SPARE.CHANGE.P differ diff --git a/res/demo/SPARE.CHANGE.Q b/res/demo/SPARE.CHANGE.Q new file mode 100755 index 000000000..937e86826 Binary files /dev/null and b/res/demo/SPARE.CHANGE.Q differ diff --git a/res/demo/SPARE.CHANGE.R b/res/demo/SPARE.CHANGE.R new file mode 100755 index 000000000..8ed2a57c7 Binary files /dev/null and b/res/demo/SPARE.CHANGE.R differ diff --git a/res/demo/SPARE.CHANGE.S b/res/demo/SPARE.CHANGE.S new file mode 100755 index 000000000..e4cb1e261 Binary files /dev/null and b/res/demo/SPARE.CHANGE.S differ diff --git a/res/demo/SPARE.CHANGE.T b/res/demo/SPARE.CHANGE.T new file mode 100755 index 000000000..7a647c30c Binary files /dev/null and b/res/demo/SPARE.CHANGE.T differ diff --git a/res/demo/SPARE.CHANGE.Z b/res/demo/SPARE.CHANGE.Z new file mode 100755 index 000000000..3e7700fd9 Binary files /dev/null and b/res/demo/SPARE.CHANGE.Z differ diff --git a/res/demo/SPY.HUNTER b/res/demo/SPY.HUNTER new file mode 100755 index 000000000..a29311731 Binary files /dev/null and b/res/demo/SPY.HUNTER differ diff --git a/res/demo/_FileInformation.txt b/res/demo/_FileInformation.txt index 12a2c5945..7e2170cfb 100644 --- a/res/demo/_FileInformation.txt +++ b/res/demo/_FileInformation.txt @@ -5,3 +5,27 @@ WAVY.NAVY.1=Type(06),AuxType(0000),Access(C3) LODE.RUNNER=Type(06),AuxType(1F00),Access(C3) LODE.RUNNER.1=Type(06),AuxType(0000),Access(C3) LODE.RUNNER.M=Type(06),AuxType(0000),Access(C3) +PITFALL.II=Type(06),AuxType(08E5),Access(C3) +SPY.HUNTER=Type(06),AuxType(0B87),Access(C3) +SPARE.CHANGE=Type(06),AuxType(2700),Access(C3) +SPARE.CHANGE.A=Type(06),AuxType(8E00),Access(C3) +SPARE.CHANGE.B=Type(06),AuxType(8E00),Access(C3) +SPARE.CHANGE.C=Type(06),AuxType(8E00),Access(C3) +SPARE.CHANGE.D=Type(06),AuxType(8E00),Access(C3) +SPARE.CHANGE.E=Type(06),AuxType(8E00),Access(C3) +SPARE.CHANGE.F=Type(06),AuxType(8E00),Access(C3) +SPARE.CHANGE.G=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.H=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.I=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.J=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.K=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.L=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.M=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.N=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.O=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.P=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.Q=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.R=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.S=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.T=Type(06),AuxType(9600),Access(C3) +SPARE.CHANGE.Z=Type(06),AuxType(B400),Access(C3) diff --git a/src/4cade.a b/src/4cade.a index aeb2e69f7..35134a9bb 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -4,11 +4,12 @@ !source "src/constants.a" !source "src/macros.a" + + ; first-run initialization, relocates code to language card and continues from Main !source "src/4cade.init.a" FirstMover !pseudopc $D000 { -!zone Reenter ; self-running demos should call this to exit back to 4cade +READ_RAM1_WRITE_RAM1 Main @@ -19,18 +20,6 @@ Main jsr AttractMode jmp - -Reboot - ldx #(@end-@start-1) -- lda @start,x - sta $300,x - dex - bpl - - jmp $300 -@start - +READ_ROM_NO_WRITE - jmp $FAA6 -@end - ; these routines will only be called after relocating to language card !source "src/ui.attract.mode.a" !source "src/prodos.path.a" diff --git a/src/4cade.init.a b/src/4cade.init.a index 09715ab54..6f1be4e8b 100644 --- a/src/4cade.init.a +++ b/src/4cade.init.a @@ -1,4 +1,4 @@ - sta $C00E + sta $C00E ; 40-column sta $C00C sta $C004 sta $C002 @@ -42,8 +42,8 @@ ; ProRWTS2 has its own function to relocate itself !source "src/prorwts2.a" - ; these routines will only be called once, from main memory, before relocating to language card ProRWTSBuffer + ; these routines will only be called once, from main memory, before relocating to language card !source "src/hw.memcheck.a" !source "src/hw.joystick.a" !source "src/hw.normfast.a" diff --git a/src/parse.prefs.a b/src/parse.prefs.a new file mode 100644 index 000000000..33320f4cb --- /dev/null +++ b/src/parse.prefs.a @@ -0,0 +1,169 @@ +;license:MIT +;(c) 2018 by 4am +; +; Parser for global preferences file +; +; Public functions +; - SaveGlobalPreferences +; +; Public variables +; - gGlobalPrefsStore word address of prefs okvs +; +; Public constants (all length-prefixed strings) +; - kGlobalPrefsFilename +; - kLastPlayed +; - kNextAttract +; - kNextFX +; - kNextDFX +; + +gGlobalPrefsStore + !word 0 + +kGlobalPrefsFilename + !byte 10 + !raw "PREFS.CONF" + +kLastPlayed + !byte 10 + !raw "LASTPLAYED" +kNextAttract + !byte 11 + !raw "NEXTATTRACT" +kNextFX + !byte 6 + !raw "NEXTFX" +kNextDFX + !byte 7 + !raw "NEXTDFX" + +;------------------------------------------------------------------------------ +; SaveGlobalPreferences +; save global options and state to file +; +; in: none +; out: all registers and flags clobbered +;------------------------------------------------------------------------------ +SaveGlobalPreferences + +LDADDR kGlobalPrefsBuffer + +STAY $FE + + +LDADDR @kFluff1 + jsr @addString + + jsr @addBooleanFromStore + !word kForce40 + + jsr @addBooleanFromStore + !word kForceUpper + + jsr @addBooleanFromStore + !word kScriptToFile + + jsr @addBooleanFromStore + !word kAutoScript + + +LDADDR @kFluff2 + jsr @addString + + jsr @addStringFromStore + !word kLastPlayed + + +LDADDR @kFluff3 + jsr @addString + + jsr okvs_iter + !word gGamesListStore + !word @addGameToPrefs + + +LDADDR @kEOF + jsr @addString + + lda $FE + sta @filelen + lda $FF + sec + sbc #>kGlobalPrefsBuffer + sta @filelen+1 + + jsr SaveFile + !word kGlobalPrefsFilename + !byte 4 ; filetype=TXT + !word 0 ; auxtype=0000 + !word kGlobalPrefsBuffer +@filelen !word $FDFD ; SMC + !word kProDOSFileBuffer + + stz gGlobalPrefsDirty +@exit rts + +@addGameToPrefs + +STAY + + jsr @addStringFromStore ++ !word $FDFD ; SMC + rts + +@addBooleanFromStore + lda #$24 ; BIT opcode + +HIDE_NEXT_2_BYTES +@addStringFromStore + lda #$80 ; BRA opcode + sta @skipOverBooleanLogic + +PARAMS_ON_STACK 2 + +LDPARAM 1 + +STAY @key + jsr @addString + +LDADDR @kEquals + jsr @addString + jsr okvs_get + !word gGlobalPrefsStore +@key !word $FDFD ; SMC +@skipOverBooleanLogic + bra + ; SMC (opcode may become BIT) + +STAY PTR + ldy #1 + lda (PTR),y + ora #$30 + sta (PTR),y + +LDAY PTR ++ jsr @addString + +LDADDR @kLF + jmp @addString + +@addString + +STAY $00 + lda ($00) + inc + sta @len + ldy #1 +- lda ($00),y + sta ($FE) ++ iny + inc $FE + bne + + inc $FF +@len=*+1 ++ cpy #$FD ; SMC + bne - + rts + +@kEquals !byte 1 + !raw "=" +@kLF !byte 1 + !byte $0D +@kFluff1 !byte @kFluff1_e-@kFluff1_b +@kFluff1_b + !raw "# 4cade preferences file",$0D + !raw "# Do not edit by hand.",$0D + !raw "# Or do. I'm a comment, not a cop.",$0D,$0D + !raw "# value=game directory listed in GAMES.CONF, or empty",$0D +@kFluff1_e +@kFluff2 !byte 24 + !byte $0D + !raw "# value=game directory",$0D +@kFluff3 !byte 58 + !byte $0D + !raw "# key=game directory, value=filename of selected version",$0D +@kEOF !byte 7 + !byte $0D + !raw "[eof]",$0D diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 99f4c8f8a..9e1e63aea 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -71,7 +71,6 @@ AttractMode bpl - jmp $106 ; jump to pre-launch code -!pseudopc $100 { @prelaunch ; this runs from main memory lda $C088 ; entry point used by some self-running demos jmp Reenter @@ -89,7 +88,6 @@ AttractMode txs jmp (ldrlo2) ; jump to game @end_prelaunch -} @Slideshow ; HGR or DHGR slideshow pha ; save module type (1=HGR, 2=DHGR)