diff --git a/Makefile b/Makefile index a32e76b..a765a15 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ PYTHON=python3 # version 3.1.0 or later EXOMIZER=exomizer mem -q -P23 -lnone -dsk: index asmproboot asmlauncher +dsk: index asmproboot asmlauncher extract cp res/blank.hdv build/"$(DISK)" cp res/_FileInformation.txt build/ $(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" build/LAUNCHER.SYSTEM -C >>build/log @@ -56,26 +56,26 @@ dsk: index asmproboot asmlauncher $(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" "$$f" -C >>build/log; \ done for f in \ - res/DEMO \ - res/TITLE.ANIMATED \ - res/ICONS \ + res/TITLE.ANIMATED \ + res/ICONS \ build/FX \ build/PRELAUNCH; do \ rm -f "$$f"/.DS_Store; \ $(CADIUS) ADDFOLDER build/"$(DISK)" "/$(VOLUME)/$$(basename $$f)" "$$f" -C >>build/log; \ done - for i in 1 2 3 4 5 6; do \ - $(CADIUS) RENAMEFILE build/"$(DISK)" "/$(VOLUME)/DEMO/SPCARTOON.$${i}$${i}" "SPCARTOON.$${i}." >>build/log; \ - done - $(PARALLEL) '$(CADIUS) EXTRACTVOLUME {} build/X/ >>build/log' ::: res/dsk/*.po - rm -f build/X/**/.DS_Store build/X/**/PRODOS* build/X/**/LOADER.SYSTEM* $(CADIUS) CREATEFOLDER build/"$(DISK)" "/$(VOLUME)/X/" -C >>build/log for f in build/X/*; do \ $(CADIUS) ADDFOLDER build/"$(DISK)" "/$(VOLUME)/X/$$(basename $$f)" "$$f" -C >>build/log; \ done bin/changebootloader.sh build/"$(DISK)" build/proboothd -index: preconditions md asmfx asmprelaunch compress +extract: preconditions md + $(PARALLEL) '$(CADIUS) EXTRACTVOLUME {} build/X/ >>build/log' ::: res/dsk/*.po + rm -f build/X/**/.DS_Store build/X/**/PRODOS* build/X/**/LOADER.SYSTEM* + for f in $$(grep '^....1' res/GAMES.CONF | awk '!/^$$|^#/' | awk -F, '/,/ { print $$2 }' | awk -F= '{ print $$1 }'); do mv build/X/"$$(basename $$f)"/"$$(basename $$f)"* build/X.INDEXED/; rm -rf build/X/"$$(basename $$f)"; done + (for f in build/X.INDEXED/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a -p build/TOTAL.DATA build/X.INDEXED > build/XSINGLE.IDX + +index: preconditions md asmfx asmprelaunch asmdemo compress extract # # precompute binary data structure for mega-attract mode configuration file # @@ -156,6 +156,19 @@ index: preconditions md asmfx asmprelaunch compress # [ -f build/index ] || ((for f in res/ARTWORK.SHR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ARTWORK.SHR > build/ARTWORK.IDX) # +# precompute indexed files for demo launchers +# note: these can not be padded because some of them are loaded too close to $C000 +# + [ -f build/index ] || ((for f in build/DEMO/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA build/DEMO > build/DEMO.IDX) + [ -f build/index ] || bin/addfile.sh build/DEMO.IDX build/TOTAL.DATA > src/index/demo.idx.a + +# +# precompute indexed files for single-load game binaries +# note: these can be padded because they are loaded at a time when all of main memory is clobber-able +# + [ -f build/index ] || ((for f in build/X.INDEXED/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a -p build/TOTAL.DATA build/X.INDEXED > build/XSINGLE.IDX) + [ -f build/index ] || bin/addfile.sh build/XSINGLE.IDX build/TOTAL.DATA > src/index/xsingle.idx.a +# # create search indexes for each variation of (game-requires-joystick) X (game-requires-128K) # in the form of OKVS data structures, plus game counts in the form of source files # @@ -210,10 +223,13 @@ index: preconditions md asmfx asmprelaunch compress [ -f build/index ] || bin/addfile.sh res/JOYSTICK build/TOTAL.DATA > src/index/joystick.idx.a touch build/index -asmlauncher: md +asmlauncher: preconditions md $(ACME) -DBUILDNUMBER=`git rev-list --count HEAD` src/4cade.a 2>build/relbase.log $(ACME) -r build/4cade.lst -DBUILDNUMBER=`git rev-list --count HEAD` -DRELBASE=`cat build/relbase.log | grep "RELBASE =" | cut -d"=" -f2 | cut -d"(" -f2 | cut -d")" -f1` src/4cade.a +asmdemo: preconditions md + $(PARALLEL) 'if grep -q "^!to" "{}"; then $(ACME) "{}"; fi' ::: src/demo/*.a + asmfx: preconditions md $(PARALLEL) 'if grep -q "^!to" "{}"; then $(ACME) "{}"; fi' ::: src/fx/*.a @@ -254,7 +270,7 @@ mount: dsk osascript bin/V2Make.scpt "`pwd`" bin/4cade.vii build/"$(DISK)" md: - mkdir -p build/X build/FX.INDEXED build/FX build/PRELAUNCH.INDEXED build/PRELAUNCH build/ATTRACT build/SS build/GAMEHELP + mkdir -p build/X build/X.INDEXED build/FX build/FX.INDEXED build/PRELAUNCH build/PRELAUNCH.INDEXED build/ATTRACT build/SS build/GAMEHELP build/DEMO touch build/log clean: diff --git a/res/ATTRACT.CONF b/res/ATTRACT.CONF index 2cdfb9d..1b46b38 100644 --- a/res/ATTRACT.CONF +++ b/res/ATTRACT.CONF @@ -1,7 +1,40 @@ +# +# Mega-Attract-Mode configuration file +# +# Mega-Attract-Mode is split into modules. Each module can be a short +# slideshow, a self-running demo (like a game's built-in 'attract mode'), or +# even just a single screenshot. 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 global prefs file. +# +# The same format is used by the per-game attract mode configuration files. +# +# Format: +# key=value +# +# |key| must be unique within this file +# +# |value| must be one of +# 0 = self-running demo (|key| is an executable binary file in /DEMO/) +# 1 = HGR title slideshow (|key| is a file in /SS/ containing files in /TITLE.HGR/) +# 2 = HGR action slideshow (|key| is a file in /SS/ containing files in /ACTION.HGR/) +# 3 = DHGR title slideshow (|key| is a file in /SS/ containing files in /TITLE.DHGR/) +# 4 = DHGR action slideshow (|key| is a file in /SS/ containing files in /ACTION.DHGR/) +# 5 = SHR box art slideshow (|key| is a file in /SS/ containing files in /ARTWORK.SHR/) +# 6 = GR action slideshow (|key| is a file in /SS/ containing files in /ACTION.GR/) +# A = single HGR file (|key| is arbitrary path from program root directory) +# B = single DHGR file (|key| is arbitrary path from program root directory) +# C = single SHR file (|key| is arbitrary path from program root directory) +# D = single GR file (|key| is arbitrary path from program root directory) +# +# Blank lines and lines beginning with '#' are ignored (like this one!) +# A line beginning with '[' terminates the parsing +# + #set 1 FAVORITES.CONF=1 ACTCOMPIL.CONF=2 -FORMULA.1.RACER=0 +#FORMULA.1.RACER=0 DHGR1.CONF=3 ACTNZ.CONF=2 CATBOXING.CONF=1 @@ -11,7 +44,7 @@ SHR1.CONF=5 #set 2 TITLENZ.CONF=1 ACTKARATE.CONF=2 -TRACK.AND.FIELD=0 +#TRACK.AND.FIELD=0 ACTDHGR3.CONF=4 ACTWINGAM.CONF=2 CATBASEB.CONF=1 @@ -69,36 +102,3 @@ TITLEABC.CONF=1 CATWRESTLE.CONF=1 [eof] - -# -# Mega-Attract-Mode configuration file -# -# Mega-Attract-Mode is split into modules. Each module can be a short -# slideshow, a self-running demo (like a game's built-in 'attract mode'), or -# even just a single screenshot. 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 global prefs file. -# -# The same format is used by the per-game attract mode configuration files. -# -# Format: -# key=value -# -# |key| must be unique within this file -# -# |value| must be one of -# 0 = self-running demo (|key| is an executable binary file in /DEMO/) -# 1 = HGR title slideshow (|key| is a file in /SS/ containing files in /TITLE.HGR/) -# 2 = HGR action slideshow (|key| is a file in /SS/ containing files in /ACTION.HGR/) -# 3 = DHGR title slideshow (|key| is a file in /SS/ containing files in /TITLE.DHGR/) -# 4 = DHGR action slideshow (|key| is a file in /SS/ containing files in /ACTION.DHGR/) -# 5 = SHR box art slideshow (|key| is a file in /SS/ containing files in /ARTWORK.SHR/) -# 6 = GR action slideshow (|key| is a file in /SS/ containing files in /ACTION.GR/) -# A = single HGR file (|key| is arbitrary path from program root directory) -# B = single DHGR file (|key| is arbitrary path from program root directory) -# C = single SHR file (|key| is arbitrary path from program root directory) -# D = single GR file (|key| is arbitrary path from program root directory) -# -# Blank lines and lines beginning with '#' are ignored (like this one!) -# A line beginning with '[' terminates the parsing -# diff --git a/res/CREDITS b/res/CREDITS index 42013f1..088e543 100644 --- a/res/CREDITS +++ b/res/CREDITS @@ -2,7 +2,7 @@ ~ - revision 01 / serial number 20210216 + revision 01 / serial number 20221012 ~ @@ -21,5 +21,5 @@ ports & rwts * * * * * * * * * * *qkumba - archive.org/details/TotalReplay + archive.org/details/TotalReplay2 [eof] diff --git a/res/GAMES.CONF b/res/GAMES.CONF index 6c6a25d..073b265 100755 --- a/res/GAMES.CONF +++ b/res/GAMES.CONF @@ -1,54 +1,8 @@ -0000,AUTOBAHN=Autobahn -0110,BATTLE.CHESS=Battle Chess -0000,BLACK.BELT=Black Belt -0000,BOP.N.WRESTLE=Bop'n Wrestle -0110,CALI.GAMES=California Games -1100,BASEBALL=Championship Baseball -1100,CHAMP.BSKETBALL=Championship Basketball -0100,CHAMP.WRESTLE=Championship Wrestling -1000,CMPTR.FOOSBALL=Computer Foosball -1000,DIVE.BOMBER=Dive Bomber -1000,FIGHT.NIGHT=Fight Night -0000,FS2=Flight Simulator II -1000,FORMULA.1.RACER=Formula 1 Racer -1000,FUJI.SPEED.WAY=Fuji Crowded Speedway -1000,HARDBALL=Hardball -1000,INTL.GRAN.PRIX=International Gran Prix -1000,INTL.HOCKEY=International Hockey -1000,KARATE.CHAMP=Karate Champ -1000,ONE.ON.ONE=One on One -1000,POOL=Pool -0000,SHUFFLEBOARD=Shuffleboard -0000,SKI.CRAZED=Ski Crazed -1000,SOLO.FLIGHT=Solo Flight -0000,SPDWAY.CLASSIC=Speedway Classic -0110,SS.BASEBALL=Street Sports Baseball -0110,SS.BASKETBALL=Street Sports Basketball -0110,SS.FOOTBALL=Street Sports Football -0110,SS.SOCCER=Street Sports Soccer -0000,SUMMER.GAMES=Summer Games -0000,SUMMER.GAMES.II=Summer Games II -0000,SUPER.HUEY=Super Huey -0100,SUPER.ICEHOCKEY=Superstar Ice Hockey -0000,TAG.TEAM=Tag Team Wrestling -1111,TEST.DRIVE=Test Drive -0000,AMER.CHALLENGE=The American Challenge -1000,THE.DAM.BUSTERS=The Dam Busters -0110,SUMMER.EDITION=The Games: Summer Edition -0110,WINTER.EDITION=The Games: Winter Edition -1000,TOMAHAWK=Tomahawk -0000,TRACK.AND.FIELD=Track & Field -0000,WINTER.GAMES=Winter Games -0110,WORLD.GAMES=World Games -0000,WORLD.KARATE=World Karate Championship - -[eof] - # # Master game list # # Format: -# ABCD,directory=name +# ABCDE,directory=name # # A=1 if game requires joystick, 0 if playable on keyboard # B=1 if game requires 128K, 0 if playable on 64K @@ -58,11 +12,58 @@ # 1=infinite lives # 2=infinite weapons # 3=infinite lives & weapons -# 4=invincibility -# 5=has in-game cheats -# -# if no name, it will be calculated from the directory when we need to display it +# 4=infinite lives & time +# 5=infinite time +# 6=invincibility +# 7=has in-game cheats +# E=1 if game is single-load and can be stored in TOTAL.DATA # # all other values for A -> ignore entire line (allows inline comments) # A line beginning with '[' terminates the parsing # + +00000,AUTOBAHN=Autobahn +01100,BATTLE.CHESS=Battle Chess +00000,BLACK.BELT=Black Belt +00000,BOP.N.WRESTLE=Bop'n Wrestle +01100,CALI.GAMES=California Games +#11000,BASEBALL=Championship Baseball +11000,CHAMP.BSKETBALL=Championship Basketball +01000,CHAMP.WRESTLE=Championship Wrestling +10000,CMPTR.FOOSBALL=Computer Foosball +10000,DIVE.BOMBER=Dive Bomber +10000,FIGHT.NIGHT=Fight Night +00000,FS2=Flight Simulator II +10000,FORMULA.1.RACER=Formula 1 Racer +10000,FUJI.SPEED.WAY=Fuji Crowded Speedway +10000,HARDBALL=Hardball +10000,INTL.GRAN.PRIX=International Gran Prix +10000,INTL.HOCKEY=International Hockey +10000,KARATE.CHAMP=Karate Champ +10000,ONE.ON.ONE=One on One +10000,POOL=Pool +00000,SHUFFLEBOARD=Shuffleboard +00000,SKI.CRAZED=Ski Crazed +10000,SOLO.FLIGHT=Solo Flight +00000,SPDWAY.CLASSIC=Speedway Classic +01100,SS.BASEBALL=Street Sports Baseball +01100,SS.BASKETBALL=Street Sports Basketball +01100,SS.FOOTBALL=Street Sports Football +01100,SS.SOCCER=Street Sports Soccer +00000,SUMMER.GAMES=Summer Games +00000,SUMMER.GAMES.II=Summer Games II +00000,SUPER.HUEY=Super Huey +01000,SUPER.ICEHOCKEY=Superstar Ice Hockey +00000,TAG.TEAM=Tag Team Wrestling +11110,TEST.DRIVE=Test Drive +00000,AMER.CHALLENGE=The American Challenge +10000,THE.DAM.BUSTERS=The Dam Busters +01100,SUMMER.EDITION=The Games: Summer Edition +01100,WINTER.EDITION=The Games: Winter Edition +10000,TOMAHAWK=Tomahawk +00000,TRACK.AND.FIELD=Track & Field +00000,WINTER.GAMES=Winter Games +01100,WORLD.GAMES=World Games +00000,WORLD.KARATE=World Karate Championship + +[eof] diff --git a/res/_FileInformation.txt b/res/_FileInformation.txt index 634f205..e2a0301 100644 --- a/res/_FileInformation.txt +++ b/res/_FileInformation.txt @@ -1,17 +1,7 @@ # This file is maintained by hand LAUNCHER.SYSTEM=Type(FF),AuxType(2000),Access(C3) -PREFS.CONF=Type(04),AuxType(8000),Access(C3) -GAMES.CONF=Type(04),AuxType(8000),Access(C3) -ATTRACT.CONF=Type(04),AuxType(8000),Access(C3) -FX.CONF=Type(04),AuxType(8000),Access(C3) -DFX.CONF=Type(04),AuxType(8000),Access(C3) -COVER=Type(06),AuxType(2000),Access(C3) -TITLE=Type(06),AuxType(2000),Access(C3) -HELP=Type(06),AuxType(2000),Access(C3) -CREDITS=Type(04),AuxType(8000),Access(C3) -HELPTEXT=Type(04),AuxType(8000),Access(C3) -DECRUNCH=Type(06),AuxType(0200),Access(C3) -JOYSTICK=Type(06),AuxType(0800),Access(C3) +TOTAL.DATA=Type(06),AuxType(0000),Access(C3) +PREFS.CONF=Type(04),AuxType(0000),Access(C3) Finder.Data=Type(C9),AuxType(0000),Access(E7) Finder.Root=Type(C9),AuxType(0000),Access(E7) diff --git a/res/dsk/championship baseball PRODOS (san inc pack).po b/res/dsk/championship baseball PRODOS (san inc pack).po deleted file mode 100644 index be3f46c..0000000 Binary files a/res/dsk/championship baseball PRODOS (san inc pack).po and /dev/null differ diff --git a/res/history.md b/res/history.md index 198c42b..b6ce5d5 100644 --- a/res/history.md +++ b/res/history.md @@ -3,7 +3,6 @@ ## New games - Autobahn -- Championship Baseball - Championship Basketball - Championship Wrestling - Computer Foosball diff --git a/res/notes/cover.txt b/res/notes/cover.txt new file mode 100644 index 0000000..6d46f91 --- /dev/null +++ b/res/notes/cover.txt @@ -0,0 +1,56 @@ +GOLF- +POOL- +CHESS-- +SOCCER- +BOXING- +DIVING- +FLYING- +HOCKEY- +KARATE- +RACING-- +SKIING- +TENNIS- +RUNNING- +SKATING- +SURFING- +ARCHERY- +SAILING--- +CHECKERS-- +BASEBALL-- +FOOSBALL-- +WRESTLING- +BILLIARDS- +POLEVAULT- +BICYCLING +BASKETBALL- +GYMNASTICS +SHUFFLEBOARD- +KAYAKING- +SWIMMING- +SHOTPUT + +.0123456789012345678901234567890123456789 +0B A S E B A L L S H U F F L E B O A R D +1 S A I L I N G W R E S T L I N G G O L F +2C H E S S S O C C E R B I L L I A R D S +3 S W I M M I N G H O C K E Y K A R A T E +4C H E C K E R S S K I I N G R A C I N G +5 P O O L B A S K E T B A L L F L Y I N G +6G Y M N A S T I C S E Q U E S T R I A N +7 P O L E V A U L T D I V I N G C H E S S +8T E N N I S B O X I N G K A Y A K I N G +9 R A C I N G I N S T A N T S A I L I N G +0S K A T I N G R E P L A Y R U N N I N G +1 W R E S T L I N G S O C C E R C H E S S +2S U R F I N G F E N C I N G R O W I N G +3 C Y C L I N G A R C H E R Y S L A L O M +4S O C C E R C H E S S W R E S T L I N G +5 K A Y A K I N G T E N N I S B O X I N G +6C H E S S B I L L I A R D S K A R A T E +7 S H U F F L E B O A R D B A S E B A L L +8F L Y I N G P O O L B A S K E T B A L L +9 S K I I N G C H E C K E R S R A C I N G +0G O L F S A I L I N G W R E S T L I N G +1 B L A C K J A C K C H E S S S O C C E R +2K A R A T E H O C K E Y S W I M M I N G +3 E Q U E S T R I A N G Y M N A S T I C S diff --git a/src/4cade.a b/src/4cade.a index e35da6f..27b38f5 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -148,6 +148,9 @@ SwitchToBank2 rts !source "src/prodos.path.a" ; paths end up on the same page +; iLoadXSingle (label is in constants.a) + jmp LoadXSingle ; no direct calling - target can move + ; iAddToPath (label is in constants.a) jmp AddToPath ; no direct calling - target can move diff --git a/src/constants.a b/src/constants.a index 33ed210..2d5ebb9 100644 --- a/src/constants.a +++ b/src/constants.a @@ -166,6 +166,7 @@ gSearchIndex = $6000 gSearchCache = $A000 ; LC RAM 1 & 2 +iLoadXSingle = $FFE9 iAddToPath = $FFEC iLoadFileDirect = $FFEF ; note: you really want LC RAM 2 banked in before calling this WaitForVBL = $FFF2 @@ -189,7 +190,10 @@ HAS_SPEECH = %11000000 ; AND masks for game info bitfield (after game display name in gSearchStore) HAS_DHGR_TITLE = %10000000 ; this one is hard-coded via BMI instead of AND/BNE +IS_SINGLE_LOAD = %01000000 CHEAT_CATEGORY = %00001111 +; ^^ +; ++-- your bits here! ; AND masks for MachineStatus HAS_JOYSTICK = %10000000 diff --git a/src/glue.launch.a b/src/glue.launch.a index 5df13a2..d7db8a0 100644 --- a/src/glue.launch.a +++ b/src/glue.launch.a @@ -9,6 +9,9 @@ ; - FindGame ; - PlayGame ; - Launch +; - Joystick +; - LoadXSingle +; - LoadStandardPrelaunch ; ; Public variables: ; - gGameToLaunch - 0-based index into gSearchStore (word) @@ -117,28 +120,44 @@ FindGame ;------------------------------------------------------------------------------ PlayGame jsr GetGameToLaunch - ; A/Y = address of game filename + ; A/Y = address of game filename in gSearchIndex PlayGameInAY +ST16 SAVE +ST16 @pfile + +ST16 xfile + jsr okvs_next_field + jsr okvs_next_field_PTR_is_already_set + ; (PTR) -> length-prefixed game info bitfield + ; Y = 0 + iny ; Y = 1 + lda (PTR), y ; A = game info bitfield + and #IS_SINGLE_LOAD + php jsr ClearScreens ; avoid seeing code load into the HGR page ; (clobbers $106, must do now before loading prelaunch code) jsr LoadIndexedFile ; load prelaunch index file -- !word gSearchCache +- !word gSearchCache ; clobber gSearchCache which we no longer need !word kPrelaunchIndexRecord - jsr okvs_find + jsr okvs_find ; find this game's prelaunch index record !word - @pfile !word $FDFD ; SMC - +ST16 @indexRecordPtr + +ST16 @prelaunchIndexRecordPtr - jsr LoadIndexedFile + jsr LoadIndexedFile ; load this game's prelaunch code into $0106 !word $0106 -@indexRecordPtr +@prelaunchIndexRecordPtr !word $FDFD ; SMC + plp + beq @loadFromSubdirectory + + jsr LoadXSingle_NameIsAlreadySet + jmp Launch + +@loadFromSubdirectory ; we start by placing the subdirectory name at gPathname+kGameDirectoryLen ; to leave room for the GameDirectory name as the parent @@ -197,6 +216,47 @@ Launch sta launchpatch jmp LaunchInternal +;------------------------------------------------------------------------------ +; LoadXSingle/LoadXSingle_NameIsAlreadySet/LoadXFile +; load an indexed file via an extended index record that also contains starting +; address information +; +; in: A/Y points to game filename (must be listed in xsingle OKVS) +; out: all flags & registers clobbered +;------------------------------------------------------------------------------ +LoadXSingle ; entry point used by demos to load additional resources + +ST16 xfile +LoadXSingle_NameIsAlreadySet ; entry point used by PlayGame + jsr LoadIndexedFile ; load xsingle index file (contains pointers to game binaries) +- !word gSearchCache ; clobber search cache which we no longer need + !word kXSingleRecord +LoadXFile ; entry point used by attract mode to load self-running demo + jsr okvs_find ; find this game's extended index record + !word - +xfile !word $FDFD ; SMC + +ST16 @xsingleIndexRecordPtr + jsr okvs_next_field + ldy #5 + lda (PTR), y ; get game load address (stored immediately after index record) + sta @xsingleAddr + iny + lda (PTR), y + sta @xsingleAddr+1 + + jsr LoadIndexedFile ; load this game binary +@xsingleAddr + !word $FDFD ; SMC +@xsingleIndexRecordPtr + !word $FDFD ; SMC + rts + +;------------------------------------------------------------------------------ +; Joystick +; launch joystick calibration program +; +; in: none +; out: exits via Launch +;------------------------------------------------------------------------------ Joystick jsr LoadStandardPrelaunch diff --git a/src/hw.mockingboard.a b/src/hw.mockingboard.a index 72e3fd1..18a6680 100644 --- a/src/hw.mockingboard.a +++ b/src/hw.mockingboard.a @@ -26,8 +26,29 @@ ; zp $80-$82 clobbered ; A/Y clobbered ;------------------------------------------------------------------------------ + +MAGIC_Z80_LOCATION=$FFD + GetMockingboardStuff +ST16 @callback+1 + + ; from mgcaret + ; https://github.com/a2-4am/4cade/issues/483 + ; the Mockingboard init can accidentally enable the Softcard Z80 + ; and can crash the machine + ; solved by loading a small Z80 routine at $0FFD (FFFDh in the Z80 space): + ; $32 $00 $E4 $C3 FD FF which is + ; NOP + ; LD (E400h),A ; card is at $E400 due to memory translation + ; JP FFFDh + ; returns the system to 6502 mode and leaves it in the same state as the Z80 after RESET: + ; ready to execute the instruction at 0000h (from the Z80 perspective) + ldx #5 +- lda magic_z80_bytes, x + sta MAGIC_Z80_LOCATION, x + dex + bpl - + lda ROM_MACHINEID cmp #$06 bne @not_iic @@ -259,3 +280,6 @@ GetMockingboardStuff @callback jmp $FDFD ; SMC + +magic_z80_bytes + !byte $32, $00, $E4, $C3, $FD, $FF diff --git a/src/hw.vbl.init.a b/src/hw.vbl.init.a index de55884..7006481 100644 --- a/src/hw.vbl.init.a +++ b/src/hw.vbl.init.a @@ -22,7 +22,7 @@ BuildVBLFunction beq @build_iic ; //c family lda romid_mac cmp #ROMID_IIECARD - beq @build_none ; broken in some versions, disable + beq @build_iiecard ; Mac Apple IIe card sec jsr idroutine ; check for IIgs bcs @NotGS @@ -45,6 +45,21 @@ BuildVBLFunction lda #$4C sta UnwaitForVBL rts + +@build_iiecard + lda $FBBE ; check IIe card software version because v2.2.2d1 is broken + cmp #$03 ; $03 = v2.2.x + bne @NotGS ; all other versions are ok + + ldy #$08 ; Found v2.2.x but don't know which one, so test if VBL works + ldx #$00 +- bit $C019 + bmi @NotGS + dex + bne - + dey ; keep checking for ~22,000 cycles (a little over 1/50 of a second) + bne - ; if no VBL by then fall through to @build_none + @build_none lda #$60 sta WaitForVBL diff --git a/src/index/artwork.idx.a b/src/index/artwork.idx.a index c97a3ff..6d326f3 100644 --- a/src/index/artwork.idx.a +++ b/src/index/artwork.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1467651 + !be24 1467566 !le16 496 diff --git a/src/index/attract.idx.a b/src/index/attract.idx.a index 5c4d15b..977c9dd 100644 --- a/src/index/attract.idx.a +++ b/src/index/attract.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1456330 - !le16 917 + !be24 1456298 + !le16 879 diff --git a/src/index/cache00.idx.a b/src/index/cache00.idx.a index 51b97c0..06d4c36 100644 --- a/src/index/cache00.idx.a +++ b/src/index/cache00.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1449958 + !be24 1449982 !le16 214 diff --git a/src/index/cache01.idx.a b/src/index/cache01.idx.a index 50749c4..0e66979 100644 --- a/src/index/cache01.idx.a +++ b/src/index/cache01.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1451223 + !be24 1451247 !le16 458 diff --git a/src/index/cache10.idx.a b/src/index/cache10.idx.a index c46d33f..fda6697 100644 --- a/src/index/cache10.idx.a +++ b/src/index/cache10.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1452760 + !be24 1452784 !le16 399 diff --git a/src/index/cache11.idx.a b/src/index/cache11.idx.a index 988a868..71b08f4 100644 --- a/src/index/cache11.idx.a +++ b/src/index/cache11.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1454845 + !be24 1454828 !le16 688 diff --git a/src/index/count11.a b/src/index/count11.a index 27c64ac..5ee285f 100644 --- a/src/index/count11.a +++ b/src/index/count11.a @@ -3,4 +3,4 @@ ; ; This file is automatically generated ; -!word 43 +!word 42 diff --git a/src/index/coverfade.idx.a b/src/index/coverfade.idx.a index 9404c0d..b706f2a 100644 --- a/src/index/coverfade.idx.a +++ b/src/index/coverfade.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1468147 + !be24 1468062 !le16 306 diff --git a/src/index/credits.idx.a b/src/index/credits.idx.a index 9a24bc6..8fb9496 100644 --- a/src/index/credits.idx.a +++ b/src/index/credits.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1468797 - !le16 256 + !be24 1468712 + !le16 257 diff --git a/src/index/decrunch.idx.a b/src/index/decrunch.idx.a index 934a81b..ffaca53 100644 --- a/src/index/decrunch.idx.a +++ b/src/index/decrunch.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1469053 + !be24 1468969 !le16 303 diff --git a/src/index/demo.idx.a b/src/index/demo.idx.a new file mode 100644 index 0000000..ef6f6f1 --- /dev/null +++ b/src/index/demo.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/DEMO.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 1449391 + !le16 12 diff --git a/src/index/dfx.idx.a b/src/index/dfx.idx.a index d2a74c8..e88458e 100644 --- a/src/index/dfx.idx.a +++ b/src/index/dfx.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1459887 + !be24 1459817 !le16 1640 diff --git a/src/index/dgr.fizzle.idx.a b/src/index/dgr.fizzle.idx.a index c75c77c..2717b09 100644 --- a/src/index/dgr.fizzle.idx.a +++ b/src/index/dgr.fizzle.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1468529 + !be24 1468444 !le16 67 diff --git a/src/index/dgr.idx.a b/src/index/dgr.idx.a index 8cd5a09..085a220 100644 --- a/src/index/dgr.idx.a +++ b/src/index/dgr.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1467639 + !be24 1467554 !le16 12 diff --git a/src/index/dhgr.idx.a b/src/index/dhgr.idx.a index a8d4fe8..e1c250b 100644 --- a/src/index/dhgr.idx.a +++ b/src/index/dhgr.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1466848 + !be24 1466763 !le16 739 diff --git a/src/index/dtitle.idx.a b/src/index/dtitle.idx.a index 59c3784..d4b28fa 100644 --- a/src/index/dtitle.idx.a +++ b/src/index/dtitle.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1465184 + !be24 1465099 !le16 216 diff --git a/src/index/fx.idx.a b/src/index/fx.idx.a index b8317d9..ed5d032 100644 --- a/src/index/fx.idx.a +++ b/src/index/fx.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1457247 + !be24 1457177 !le16 2640 diff --git a/src/index/gamehelp.idx.a b/src/index/gamehelp.idx.a index 11d95f7..58cba5b 100644 --- a/src/index/gamehelp.idx.a +++ b/src/index/gamehelp.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1461885 - !le16 797 + !be24 1461815 + !le16 782 diff --git a/src/index/gr.fizzle.idx.a b/src/index/gr.fizzle.idx.a index 8a42fe1..7cbb7c0 100644 --- a/src/index/gr.fizzle.idx.a +++ b/src/index/gr.fizzle.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1468453 + !be24 1468368 !le16 76 diff --git a/src/index/gr.idx.a b/src/index/gr.idx.a index d317fb7..dcb3d44 100644 --- a/src/index/gr.idx.a +++ b/src/index/gr.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1467587 + !be24 1467502 !le16 52 diff --git a/src/index/helptext.idx.a b/src/index/helptext.idx.a index 419bed7..59a3cec 100644 --- a/src/index/helptext.idx.a +++ b/src/index/helptext.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1468596 + !be24 1468511 !le16 201 diff --git a/src/index/hgr0.idx.a b/src/index/hgr0.idx.a index 7b75a15..41b4e45 100644 --- a/src/index/hgr0.idx.a +++ b/src/index/hgr0.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1465400 + !be24 1465315 !le16 335 diff --git a/src/index/hgr1.idx.a b/src/index/hgr1.idx.a index 7268bbf..4fc0f14 100644 --- a/src/index/hgr1.idx.a +++ b/src/index/hgr1.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1465735 + !be24 1465650 !le16 69 diff --git a/src/index/hgr2.idx.a b/src/index/hgr2.idx.a index 1c22429..412edc2 100644 --- a/src/index/hgr2.idx.a +++ b/src/index/hgr2.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1465804 + !be24 1465719 !le16 81 diff --git a/src/index/hgr3.idx.a b/src/index/hgr3.idx.a index e97138a..646e071 100644 --- a/src/index/hgr3.idx.a +++ b/src/index/hgr3.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1465885 + !be24 1465800 !le16 62 diff --git a/src/index/hgr4.idx.a b/src/index/hgr4.idx.a index c65ea53..e6c90d8 100644 --- a/src/index/hgr4.idx.a +++ b/src/index/hgr4.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1465947 + !be24 1465862 !le16 623 diff --git a/src/index/hgr5.idx.a b/src/index/hgr5.idx.a index e1811b9..eb3c6de 100644 --- a/src/index/hgr5.idx.a +++ b/src/index/hgr5.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1466570 + !be24 1466485 !le16 274 diff --git a/src/index/hgr6.idx.a b/src/index/hgr6.idx.a index 7b7b6d9..8a12fa0 100644 --- a/src/index/hgr6.idx.a +++ b/src/index/hgr6.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1466844 + !be24 1466759 !le16 4 diff --git a/src/index/joystick.idx.a b/src/index/joystick.idx.a index 7ecb7b1..b904386 100644 --- a/src/index/joystick.idx.a +++ b/src/index/joystick.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1469356 + !be24 1469272 !le16 2370 diff --git a/src/index/miniattract0.idx.a b/src/index/miniattract0.idx.a index 0553abd..80440ca 100644 --- a/src/index/miniattract0.idx.a +++ b/src/index/miniattract0.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1463744 + !be24 1463659 !le16 381 diff --git a/src/index/miniattract1.idx.a b/src/index/miniattract1.idx.a index 0bb7600..60ab4a3 100644 --- a/src/index/miniattract1.idx.a +++ b/src/index/miniattract1.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1464125 + !be24 1464040 !le16 420 diff --git a/src/index/prelaunch.idx.a b/src/index/prelaunch.idx.a index 17b4594..e285c70 100644 --- a/src/index/prelaunch.idx.a +++ b/src/index/prelaunch.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1455533 - !le16 797 + !be24 1455516 + !le16 782 diff --git a/src/index/search00.idx.a b/src/index/search00.idx.a index 7bce29c..e3fe647 100644 --- a/src/index/search00.idx.a +++ b/src/index/search00.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1449391 + !be24 1449415 !le16 567 diff --git a/src/index/search01.idx.a b/src/index/search01.idx.a index e933912..29fc52c 100644 --- a/src/index/search01.idx.a +++ b/src/index/search01.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1450172 + !be24 1450196 !le16 1051 diff --git a/src/index/search10.idx.a b/src/index/search10.idx.a index ee7b820..cea445b 100644 --- a/src/index/search10.idx.a +++ b/src/index/search10.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1451681 + !be24 1451705 !le16 1079 diff --git a/src/index/search11.idx.a b/src/index/search11.idx.a index 50f87b8..1587829 100644 --- a/src/index/search11.idx.a +++ b/src/index/search11.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1453159 - !le16 1686 + !be24 1453183 + !le16 1645 diff --git a/src/index/sfx.idx.a b/src/index/sfx.idx.a index 545d192..c1d731e 100644 --- a/src/index/sfx.idx.a +++ b/src/index/sfx.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1461527 + !be24 1461457 !le16 358 diff --git a/src/index/slideshow.idx.a b/src/index/slideshow.idx.a index bd558bf..a4b9660 100644 --- a/src/index/slideshow.idx.a +++ b/src/index/slideshow.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1462682 + !be24 1462597 !le16 1062 diff --git a/src/index/title.idx.a b/src/index/title.idx.a index ae59f34..01a4298 100644 --- a/src/index/title.idx.a +++ b/src/index/title.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 1464545 + !be24 1464460 !le16 639 diff --git a/src/index/xsingle.idx.a b/src/index/xsingle.idx.a new file mode 100644 index 0000000..5ac122f --- /dev/null +++ b/src/index/xsingle.idx.a @@ -0,0 +1,8 @@ +; +; Index record for build/XSINGLE.IDX +; +; This file is automatically generated +; + !byte 0 + !be24 1449403 + !le16 12 diff --git a/src/macros.a b/src/macros.a index ee9670d..dd81d7b 100755 --- a/src/macros.a +++ b/src/macros.a @@ -297,9 +297,14 @@ ; these are mostly for prelaunchers -- code in the main program should keep track of which bank is active to minimize code size !macro ENABLE_ACCEL { + +ENABLE_ACCEL_LC + +READ_ROM_NO_WRITE +} + +; leave LC active on exit +!macro ENABLE_ACCEL_LC { +READ_RAM2_NO_WRITE jsr EnableAccelerator - +READ_ROM_NO_WRITE } !macro DISABLE_ACCEL { @@ -517,6 +522,13 @@ bne - } +!macro LOAD_XSINGLE .title { + +READ_RAM1_WRITE_RAM1 + +LDADDR .title + jsr iLoadXSingle + +READ_ROM_NO_WRITE +} + ; Macros for demo launchers that need to check whether they should run ; on the current machine. Exit demo if the requirements are not met. !macro GAME_REQUIRES_JOYSTICK { diff --git a/src/prodos.path.a b/src/prodos.path.a index d215200..12d72cb 100644 --- a/src/prodos.path.a +++ b/src/prodos.path.a @@ -59,6 +59,9 @@ kSearchCacheRecord kPrelaunchIndexRecord !source "src/index/prelaunch.idx.a" +kDemoIndexRecord + !source "src/index/demo.idx.a" + kAttractModeIndexRecord !source "src/index/attract.idx.a" @@ -149,6 +152,9 @@ kDecrunchRecord kJoystickRecord !source "src/index/joystick.idx.a" +kXSingleRecord + !source "src/index/xsingle.idx.a" + kTotalDataFile !byte 10 !raw "TOTAL.DATA" @@ -157,10 +163,6 @@ kAnimatedTitleDirectory !byte 15 !raw "TITLE.ANIMATED/" -kDemoDirectory - !byte 5 - !raw "DEMO/" - kGameDirectory !byte 2 !raw "X/" diff --git a/src/textrank.a b/src/textrank.a index f510bf3..f5b0f13 100644 --- a/src/textrank.a +++ b/src/textrank.a @@ -34,12 +34,14 @@ InputBuffer ; out: gSearchStore populated ;------------------------------------------------------------------------------ ReloadSearchIndex - jsr LoadIndexedFile ; load appropriate search index into $8200 - !word gSearchIndex - !word kSearchIndexRecord jsr LoadIndexedFile ; load appropriate search cache into $B000 !word gSearchCache !word kSearchCacheRecord +ReloadSearchIndexOnly + jsr LoadIndexedFile ; load appropriate search index into $6000 +SearchIndexHandle + !word gSearchIndex + !word kSearchIndexRecord rts FindTitleInCache diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 0508d56..900916d 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -71,7 +71,12 @@ MegaAttractMode bpl MegaAttractMode cmp #$8D ; Enter plays the game shown on screen. bne + ; Any other key switches to Search Mode. + jsr ReloadSearchIndexOnly +LD16 gLastMegaAttractGame + +ST16 @game + jsr okvs_find + !word SearchIndexHandle +@game !word $FDFD ; SMC jsr PlayGameInAY ; (might return if user hits Ctrl-Reset) + jmp SearchMode @@ -190,7 +195,6 @@ ATTRTS rts ;------------------------------------------------------------------------------ RunAttractModule +ST16 @key - +ST16 @key2 cpx #$30 bne @NotDemo @@ -212,14 +216,17 @@ RunAttractModule bpl - +LDADDR DemoFilename +ST16 gLastMegaAttractGame ; save game filename in LC in case user hits Return to launch + +ST16 xfile jsr ClearScreens ; avoid seeing code load into the HGR page ; (clobbers $106, must do now before loading prelaunch code) jsr LoadStandardPrelaunch ; load standard prelaunch code (|Launch| will call it) - jsr LoadFile ; load self-running demo into its default address (varies) - !word kDemoDirectory -@key !word $FDFD - !word 0 + + jsr LoadIndexedFile ; load demo index file +- !word gSearchCache + !word kDemoIndexRecord + + jsr LoadXFile ; load self-running demo into its default address (varies) jmp Launch ; will return to caller via |Reenter| ; not a demo, so maybe a slideshow or single screenshot @@ -235,7 +242,7 @@ RunAttractModule !word kAttractModeSlideshowIndexRecord jsr okvs_find !word - -@key2 !word $FDFD ; SMC +@key !word $FDFD ; SMC +ST16 + jsr LoadIndexedFile !word $800 diff --git a/src/ui.wait.a b/src/ui.wait.a index 69b0de5..2d00328 100644 --- a/src/ui.wait.a +++ b/src/ui.wait.a @@ -79,7 +79,7 @@ WaitForKeyFor30Seconds ;------------------------------------------------------------------------------ CoverFade jsr ForceHGRMode - jsr LoadTitleOffscreen + jsr LoadCoverOffscreen jsr ShowOtherPage lda OffscreenPage beq CoverFade