diff --git a/Makefile b/Makefile index ecf9fc9bc..277896d73 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ CADIUS=cadius # https://bitbucket.org/magli143/exomizer/wiki/Home EXOMIZER=exomizer mem -q -P23 -lnone -dsk: md asm compress +dsk: md asm cp res/blank.2mg build/"$(DISK)" >>build/log cp res/_FileInformation.txt build/ >>build/log $(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" "build/LAUNCHER.SYSTEM" >>build/log diff --git a/res/GAMES.CONF b/res/GAMES.CONF index 828aada85..0a031659f 100755 --- a/res/GAMES.CONF +++ b/res/GAMES.CONF @@ -1 +1 @@ -0000,AGENT.USA=Agent U S A 1110,AIRHEART=Airheart 0001,ALCAZAR=Alcazar 1001,ALIEN.AMBUSH=Alien Ambush 0001,ALIEN.DOWNPOUR=Alien Downpour 0001,ALIEN.MUNCHIES=Alien Munchies 0001,ALIEN.TYPHOON=Alien Typhoon 0000,ANKH=Ankh 0001,CIDER.SPIDER=Apple Cider Spider 0001,APPLE.PANIC=Apple Panic 0001,AQUATRON=Aquatron 0000,ARGOS=Argos 1001,ARKANOID=Arkanoid 0001,ASTEROID.BLASTR=Asteroid Blaster 1001,AXIS.ASSASSIN=Axis Assassin 0000,AZTEC=Aztec 1111,BAD.DUDES=Bad Dudes 1000,BALLBLAZER=Ballblazer 1110,BATMAN=Batman 0001,BATTLE.CRUISER=Battle Cruiser 0001,BATTLEZONE=Battlezone 1001,BCS.QUEST=BC's Quest For Tires 0001,BEER.RUN=Beer Run 0100,BEJEWELED=Bejeweled 0000,BELLHOP=Bellhop 0001,BERZAP=Berzap 0000,BEYOND.WOLFEN=Beyond Castle Wolfenstein 0000,BUDGETRILOGY=Bill Budge's Trilogy 1000,BLACK.MAGIC=Black Magic 0000,BLISTER.BALL=Blister Ball 0000,BLOCKCHAIN=BlockChain 0001,BOLO=Bolo 0001,BOUNCING.KMNGAS=Bouncing Kamungas 0001,BRAINTEASERBLVD=Brainteaser Boulevard 1011,BRUCE.LEE=Bruce Lee 1001,BUBBLE.BOBBLE=Bubble Bobble 0001,BUCK.ROGERS=Buck Rogers: Planet of Zoom 0002,BURGERTIME=BurgerTime 0001,BUZZARD.BAIT=Buzzard Bait 0110,CALI.GAMES=California Games 0001,CANNONBALL.BLTZ=Cannonball Blitz 0001,CANYON.CLIMBER=Canyon Climber 0000,CAPTN.GOODNIGHT=Captain Goodnight 0000,WOLFEN84=Castle Wolfenstein 1001,CEILING.ZERO=Ceiling Zero 0001,CENTIPEDE=Centipede 0001,CHAMP.LODERUN=Championship Lode Runner 1000,CHOPLIFTER=Choplifter 0101,COMMANDO=Commando 0002,CONAN=Conan 0001,CONGO.BONGO=Congo Bongo 0001,CRAZY.MAZEY=Crazy Mazey 0001,CRIME.WAVE=Crime Wave 1001,CRISIS.MOUNTAIN=Crisis Mountain 0001,CROSSFIRE=Crossfire 0001,CUBIT=Cubit 0000,CYBERSTRIKE=Cyber Strike 0001,CYCLOD=Cyclod 1000,DAVIDS.MAGIC=David's Midnight Magic 0110,DEATH.SWORD=Death Sword 1001,DEFENDER=Defender 0110,D.GENERATION=D-Generation 0001,DIAMOND.MINE=Diamond Mine 0001,DIG.DUG=Dig Dug 1001,DINO.EGGS=Dino Eggs 1001,DONKEY.KONG=Donkey Kong 1001,DRELBS=Drelbs 0001,DROL=Drol 0000,DUNG.BEETLES=Dung Beetles 0001,EGGS.IT=Eggs-It 0000,EPOCH=Epoch 0001,FALCONS=Falcons 0001,FIREBIRD=Firebird 0100,FLAPPLE.BIRD=Flapple Bird 0000,FS2=Flight Simulator II 0000,FLIP.OUT=Flip Out 1101,FORCE.7=Force 7 1000,FORMULA.1=Formula 1 Racer 0001,FREE.FALL=Free Fall 0001,FROGGER=Frogger 1001,FROGGER.II=Frogger II 0000,FUJI.SPEED.WAY=Fuji Crowded Speedway 0001,GALAXY.GATES=Galaxy Gates 1001,GAMMA.GOBLINS=Gamma Goblins 0101,GAUNTLET=Gauntlet 0001,GENETIC.DRIFT=Genetic Drift 0001,GENIUS=Genius 0001,GENIUS.2=Genius 2 0001,GOLD.RUSH=Gold Rush 0001,GORGON=Gorgon 0001,GREMLINS=Gremlins 0001,GUARDIAN=Guardian 0000,GUMBALL=Gumball 0000,HADRON=Hadron 0001,HARD.HAT.MACK=Hard Hat Mack 0000,HEAD.ON=Head On 1110,HEAVY.BARREL=Heavy Barrel 1002,HERO=H E R O 0000,HIGH.RISE=High Rise 0000,HORIZON.V=Horizon V 0001,HUNGRYBOY=Hungry Boy 0000,HYPER.HEAD.ON=Hyper Head On 0100,IKARI.WARRIORS=Ikari Warriors 1000,IMPOSSIBLE.MISS=Impossible Mission 0110,INDIANA.JONES=Indiana Jones 1000,INTL.GRAN.PRIX=International Gran Prix 0001,JOUST=Joust 0000,JUGGLER=Juggler 0001,JUMPMAN=Jumpman 0000,JUNGLE.HUNT=Jungle Hunt 1000,KAMIKAZE=Kamikaze 0000,KARATEKA=Karateka 0001,KID.NIKI=Kid Niki 0000,LABYRINTH=Labyrinth 0001,LADY.TUT=Lady Tut 0001,LANCASTER=Lancaster 1000,LASER.BOUNCE=Laser Bounce 0001,LAZER.SILK=Lazer Silk 0001,LODE.RUNNER=Lode Runner 1000,LOST.TOMB=Lost Tomb 1000,MAD.BOMBER=Mad Bomber 1100,MARBLE.MADNESS=Marble Madness 0001,MARIO.BROS=Mario Bros. 1000,MINER.2049ER=Miner 2049er 1001,MINER.2049.II=Miner 2049er II 1001,MINGS.CHALLENGE=Ming's Challenge 0001,MONTEZUMA=Montezuma's Revenge 0001,MOON.PATROL=Moon Patrol 0000,MR.COOL=Mr. Cool 1001,MR.DO=Mr. Do! 1001,MR.ROBOT=Mr. Robot 0001,MS.PACMAN=Ms. Pacman 0000,NIBBLER=Nibbler 1000,NIGHT.MISSION=Night Mission Pinball 0000,NIGHT.STALKER=Night Stalker 0000,NIGHTMARE=Nightmare Gallery 0000,NORAD=N O R A D 1000,ONE.ON.ONE=One on One 0000,ORBITRON=Orbitron 0000,ORILEYS.MINE=O'Riley's Mine 0000,OOTW=Out of This World 0000,OUTPOST=Outpost 0000,PAC.MAN=Pac-Man 0100,PAPERBOY=Paperboy 1001,PENETRATOR=Penetrator 0001,PEST.PATROL=Pest Patrol 1000,PHANTOMS.FIVE=Phantoms Five 0000,PHASER.FIRE=Phaser Fire 0000,PHOTAR=Photar 0000,PICNIC.PARANOIA=Picnic Paranoia 0000,PIEMAN=Pie-Man 0110,PIPEDREAM=Pipe Dream 1000,PITFALL.II=Pitfall II 0000,PITSTOP.II=Pitstop II 0000,PLASMANIA=Plasmania 1110,PLATOON=Platoon 0000,POLLYWOG=Pollywog 0001,POOYAN=Pooyan 0110,PRINCEUNP=Prince of Persia 1110,QIX=Qix 1000,QUADRANT.6112=Quadrant 6112 0110,RADWARRIOR=Radwarrior 0110,RAMPAGE=Rampage 0001,RANDAMN=Randamn 0000,RASTER.BLASTER=Raster Blaster 1000,RED.ALERT=Red Alert 1110,RENEGADE=Renegade 0000,REPTON=Repton 0000,RESCUE.RAIDERS=Rescue Raiders 0000,RIBBIT=Ribbit 0000,ROADBLOCK=Roadblock 0110,ROBOCOP=Robocop 0000,ROBOTRON=Robotron 2084 0000,RUSSKI.DUCK=Russki Duck 0000,SABOTAGE=Sabotage 0001,SAMMY.LIGHTFOOT=Sammy Lightfoot 0000,SEA.DRAGON=Sea Dragon 0000,SEAFOX=Seafox 0001,SERPENTINE=Serpentine 1000,SHAMUS=Shamus 0000,SHORT.CIRCUIT=Short Circuit 0000,SHUFFLEBOARD=Shuffleboard 0000,SITUATION.CRTCL=Situation Critical 1000,SKYFOX=Skyfox 0000,SNACK.ATTACK=Snack Attack 0000,SNAKE.BYTE=Snake Byte 0001,SNEAKERS=Sneakers 0000,SNOGGLE=Snoggle 0110,SOKO.BAN=Soko-Ban 1000,SOLO.FLIGHT=Solo Flight 1000,SPACE.EGGS=Space Eggs 0000,SPACE.QUARKS=Space Quarks 0000,SPACE.RAIDERS=Space Raiders 0000,SPARE.CHANGE=Spare Change 0000,SPDWAY.CLASSIC=Speedway Classic 0110,SPIDERBOT=Spiderbot 0000,SPIDER.RAID=Spider Raid 0000,SPY.HUNTER=Spy Hunter 0001,SPYS.DEMISE=Spy's Demise 0110,SS.BASEBALL=Street Sports Baseball 0110,SS.BASKETBALL=Street Sports Basketball 0110,SS.FOOTBALL=Street Sports Football 0110,SS.SOCCER=Street Sports Soccer 1000,STARBLASTER=Starblaster 0000,STAR.BLAZER=Star Blazer 1000,STARGATE=Stargate 0000,STAR.THIEF=Star Thief 0000,STATION.5=Station 5 0000,STELLAR.7=Stellar 7 0000,SUCCESSION=Succession 0000,SUICIDE=Suicide! 0000,SUMMER.GAMES=Summer Games 0000,SUMMER.GAMES.II=Summer Games II 1001,SUPER.ZAXXON=Super Zaxxon 0000,SWASHBUCKLER=Swashbuckler 0000,TAG.TEAM=Tag Team Wrestling 0001,TAPPER=Tapper 0113,TECHNOCOP=TechnoCop 0010,TETRIS=Tetris 0000,THE.BILESTOAD=The Bilestoad 0110,SUMMER.EDITION=The Games: Summer Edition 0110,WINTER.EDITION=The Games: Winter Edition 1000,GOONIES=The Goonies 0000,SPY.STRIKES.BAK=The Spy Strikes Back 0010,THEXDER=Thexder 0000,THIEF=Thief 0001,THRESHOLD=Threshold 0000,THUNDERBOMBS=Thunder Bombs 1000,TOMAHAWK=Tomahawk 0000,TRACK.AND.FIELD=Track & Field 0000,TRIAD=Triad 1001,TUBEWAY=Tubeway ][ 0000,TUNNEL.TERROR=Tunnel Terror 0001,TWERPS=Twerps 0001,UP.N.DOWN=Up'n Down 0110,VICTORY.ROAD=Victory Road 0000,VINDICATOR=Vindicator 0000,WARP.DESTROYER=Warp Destroyer 0001,WAVY.NAVY=Wavy Navy 1111,WINGS.OF.FURY=Wings of Fury 0000,WINTER.GAMES=Winter Games 1001,XEVIOUS=Xevious 1001,ZAXXON=Zaxxon 0000,ZENITH=Zenith [eof] # # 4cade master game list # # Format: # ABC,directory=name # # A=1 if game requires joystick, 0 if playable on keyboard # B=1 if game requires 128K, 0 if playable on 64K # C=1 if game has DHGR title, 0 is HGR # D=cheat mode category # 0=no cheats (yet!) # 1=infinite lives # 2=infinite lives & weapons # 3=invincibility # # all other values for A -> ignore entire line (allows inline comments) # A line beginning with '[' terminates the parsing # \ No newline at end of file +0000,AGENT.USA=Agent U S A 1110,AIRHEART 0001,ALCAZAR 1001,ALIEN.AMBUSH=Alien Ambush 0001,ALIEN.DOWNPOUR=Alien Downpour 0001,ALIEN.MUNCHIES=Alien Munchies 0001,ALIEN.TYPHOON=Alien Typhoon 0000,ANKH 0001,CIDER.SPIDER=Apple Cider Spider 0001,APPLE.PANIC=Apple Panic 0001,AQUATRON 0000,ARGOS 1001,ARKANOID 0001,ASTEROID.BLASTR=Asteroid Blaster 1001,AXIS.ASSASSIN=Axis Assassin 0000,AZTEC 1111,BAD.DUDES=Bad Dudes 1000,BALLBLAZER 1110,BATMAN 0001,BATTLE.CRUISER=Battle Cruiser 0001,BATTLEZONE 1001,BCS.QUEST=BC's Quest For Tires 0001,BEER.RUN=Beer Run 0100,BEJEWELED 0000,BELLHOP 0001,BERZAP 0000,BEYOND.WOLFEN=Beyond Castle Wolfenstein 0000,BUDGETRILOGY=Bill Budge's Trilogy 1000,BLACK.MAGIC=Black Magic 0000,BLISTER.BALL=Blister Ball 0000,BLOCKCHAIN=BlockChain 0001,BOLO 0001,BOUNCING.KMNGAS=Bouncing Kamungas 0001,BRAINTEASERBLVD=Brainteaser Boulevard 1011,BRUCE.LEE=Bruce Lee 1001,BUBBLE.BOBBLE=Bubble Bobble 0001,BUCK.ROGERS=Buck Rogers: Planet of Zoom 0002,BURGERTIME=BurgerTime 0001,BUZZARD.BAIT=Buzzard Bait 0110,CALI.GAMES=California Games 0001,CANNONBALL.BLTZ=Cannonball Blitz 0001,CANYON.CLIMBER=Canyon Climber 0000,CAPTN.GOODNIGHT=Captain Goodnight 0000,WOLFEN84=Castle Wolfenstein 1001,CEILING.ZERO=Ceiling Zero 0001,CENTIPEDE 0001,CHAMP.LODERUN=Championship Lode Runner 1000,CHOPLIFTER 0101,COMMANDO 0002,CONAN 0001,CONGO.BONGO=Congo Bongo 0001,CRAZY.MAZEY=Crazy Mazey 0001,CRIME.WAVE=Crime Wave 1001,CRISIS.MOUNTAIN=Crisis Mountain 0001,CROSSFIRE 0001,CUBIT 0000,CYBERSTRIKE=Cyber Strike 0001,CYCLOD 1000,DAVIDS.MAGIC=David's Midnight Magic 0110,DEATH.SWORD=Death Sword 1001,DEFENDER 0110,D.GENERATION=D-Generation 0001,DIAMOND.MINE=Diamond Mine 0001,DIG.DUG=Dig Dug 1001,DINO.EGGS=Dino Eggs 1001,DONKEY.KONG=Donkey Kong 1001,DRELBS 0001,DROL 0000,DUNG.BEETLES=Dung Beetles 0001,EGGS.IT=Eggs-It 0000,EPOCH 0001,FALCONS 0001,FIREBIRD 0100,FLAPPLE.BIRD=Flapple Bird 0000,FS2=Flight Simulator II 0000,FLIP.OUT=Flip Out 1101,FORCE.7=Force 7 1000,FORMULA.1=Formula 1 Racer 0001,FREE.FALL=Free Fall 0001,FROGGER 1001,FROGGER.II=Frogger II 0000,FUJI.SPEED.WAY=Fuji Crowded Speedway 0001,GALAXY.GATES=Galaxy Gates 1001,GAMMA.GOBLINS=Gamma Goblins 0101,GAUNTLET 0001,GENETIC.DRIFT=Genetic Drift 0001,GENIUS 0001,GENIUS.2=Genius 2 0001,GOLD.RUSH=Gold Rush 0001,GORGON 0001,GREMLINS 0001,GUARDIAN 0000,GUMBALL 0000,HADRON 0001,HARD.HAT.MACK=Hard Hat Mack 0000,HEAD.ON=Head On 1110,HEAVY.BARREL=Heavy Barrel 1002,HERO=H E R O 0000,HIGH.RISE=High Rise 0000,HORIZON.V=Horizon V 0001,HUNGRYBOY=Hungry Boy 0000,HYPER.HEAD.ON=Hyper Head On 0100,IKARI.WARRIORS=Ikari Warriors 1000,IMPOSSIBLE.MISS=Impossible Mission 0110,INDIANA.JONES=Indiana Jones 1000,INTL.GRAN.PRIX=International Gran Prix 0001,JOUST 0000,JUGGLER 0001,JUMPMAN 0000,JUNGLE.HUNT=Jungle Hunt 1000,KAMIKAZE 0000,KARATEKA 0001,KID.NIKI=Kid Niki 0000,LABYRINTH 0001,LADY.TUT=Lady Tut 0001,LANCASTER 1000,LASER.BOUNCE=Laser Bounce 0001,LAZER.SILK=Lazer Silk 0001,LODE.RUNNER=Lode Runner 1000,LOST.TOMB=Lost Tomb 1000,MAD.BOMBER=Mad Bomber 1100,MARBLE.MADNESS=Marble Madness 0001,MARIO.BROS=Mario Bros. 1000,MINER.2049ER=Miner 2049er 1001,MINER.2049.II=Miner 2049er II 1001,MINGS.CHALLENGE=Ming's Challenge 0001,MONTEZUMA=Montezuma's Revenge 0001,MOON.PATROL=Moon Patrol 0000,MR.COOL=Mr. Cool 1001,MR.DO=Mr. Do! 1001,MR.ROBOT=Mr. Robot 0001,MS.PACMAN=Ms. Pacman 0000,NIBBLER 1000,NIGHT.MISSION=Night Mission Pinball 0000,NIGHT.STALKER=Night Stalker 0000,NIGHTMARE=Nightmare Gallery 0000,NORAD=N O R A D 1000,ONE.ON.ONE=One on One 0000,ORBITRON 0000,ORILEYS.MINE=O'Riley's Mine 0000,OOTW=Out of This World 0000,OUTPOST 0000,PAC.MAN=Pac-Man 0100,PAPERBOY 1001,PENETRATOR 0001,PEST.PATROL=Pest Patrol 1000,PHANTOMS.FIVE=Phantoms Five 0000,PHASER.FIRE=Phaser Fire 0000,PHOTAR 0000,PICNIC.PARANOIA=Picnic Paranoia 0000,PIEMAN=Pie-Man 0110,PIPEDREAM=Pipe Dream 1000,PITFALL.II=Pitfall II 0000,PITSTOP.II=Pitstop II 0000,PLASMANIA 1110,PLATOON 0000,POLLYWOG 0001,POOYAN 0110,PRINCEUNP=Prince of Persia 1110,QIX 1000,QUADRANT.6112=Quadrant 6112 0110,RADWARRIOR=Radwarrior 0110,RAMPAGE 0001,RANDAMN 0000,RASTER.BLASTER=Raster Blaster 1000,RED.ALERT=Red Alert 1110,RENEGADE=Renegade 0000,REPTON 0000,RESCUE.RAIDERS=Rescue Raiders 0000,RIBBIT 0000,ROADBLOCK 0110,ROBOCOP 0000,ROBOTRON=Robotron 2084 0000,RUSSKI.DUCK=Russki Duck 0000,SABOTAGE 0001,SAMMY.LIGHTFOOT=Sammy Lightfoot 0000,SEA.DRAGON=Sea Dragon 0000,SEAFOX 0001,SERPENTINE 1000,SHAMUS 0000,SHORT.CIRCUIT=Short Circuit 0000,SHUFFLEBOARD=Shuffleboard 0000,SITUATION.CRTCL=Situation Critical 1000,SKYFOX 0000,SNACK.ATTACK=Snack Attack 0000,SNAKE.BYTE=Snake Byte 0001,SNEAKERS 0000,SNOGGLE 0110,SOKO.BAN=Soko-Ban 1000,SOLO.FLIGHT=Solo Flight 1000,SPACE.EGGS=Space Eggs 0000,SPACE.QUARKS=Space Quarks 0000,SPACE.RAIDERS=Space Raiders 0000,SPARE.CHANGE=Spare Change 0000,SPDWAY.CLASSIC=Speedway Classic 0110,SPIDERBOT 0000,SPIDER.RAID=Spider Raid 0000,SPY.HUNTER=Spy Hunter 0001,SPYS.DEMISE=Spy's Demise 0110,SS.BASEBALL=Street Sports Baseball 0110,SS.BASKETBALL=Street Sports Basketball 0110,SS.FOOTBALL=Street Sports Football 0110,SS.SOCCER=Street Sports Soccer 1000,STARBLASTER=Starblaster 0000,STAR.BLAZER=Star Blazer 1000,STARGATE 0000,STAR.THIEF=Star Thief 0000,STATION.5=Station 5 0000,STELLAR.7=Stellar 7 0000,SUCCESSION 0000,SUICIDE=Suicide! 0000,SUMMER.GAMES=Summer Games 0000,SUMMER.GAMES.II=Summer Games II 1001,SUPER.ZAXXON=Super Zaxxon 0000,SWASHBUCKLER 0000,TAG.TEAM=Tag Team Wrestling 0001,TAPPER 0113,TECHNOCOP=TechnoCop 0010,TETRIS 0000,THE.BILESTOAD=The Bilestoad 0110,SUMMER.EDITION=The Games: Summer Edition 0110,WINTER.EDITION=The Games: Winter Edition 1000,GOONIES=The Goonies 0000,SPY.STRIKES.BAK=The Spy Strikes Back 0010,THEXDER 0000,THIEF 0001,THRESHOLD 0000,THUNDERBOMBS=Thunder Bombs 1000,TOMAHAWK 0000,TRACK.AND.FIELD=Track & Field 0000,TRIAD 1001,TUBEWAY=Tubeway ][ 0000,TUNNEL.TERROR=Tunnel Terror 0001,TWERPS 0001,UP.N.DOWN=Up'n Down 0110,VICTORY.ROAD=Victory Road 0000,VINDICATOR 0000,WARP.DESTROYER=Warp Destroyer 0001,WAVY.NAVY=Wavy Navy 1111,WINGS.OF.FURY=Wings of Fury 0000,WINTER.GAMES=Winter Games 1001,XEVIOUS 1001,ZAXXON 0000,ZENITH [eof] # # 4cade master game list # # Format: # ABC,directory=name # # A=1 if game requires joystick, 0 if playable on keyboard # B=1 if game requires 128K, 0 if playable on 64K # C=1 if game has DHGR title, 0 is HGR # D=cheat mode category # 0=no cheats (yet!) # 1=infinite lives # 2=infinite lives & weapons # 3=invincibility # # all other values for A -> ignore entire line (allows inline comments) # A line beginning with '[' terminates the parsing # \ No newline at end of file diff --git a/src/4cade.a b/src/4cade.a index 0107fa405..1f91c7217 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -121,6 +121,8 @@ gAttractModeStore gFXStore gDFXStore !word $6000 +gSearchStore + !word $8000 gSlideshowStore !word $0800 gGlobalPrefsStore diff --git a/src/constants.a b/src/constants.a index 2b8bf2263..e32164f56 100644 --- a/src/constants.a +++ b/src/constants.a @@ -6,10 +6,10 @@ ; YE OLDE GRAND UNIFIED MEMORY MAP ; ; LC RAM BANK 1 -; D000..E8DF - persistent data structures (per-game cheat categories, +; D000..E694 - persistent data structures (per-game cheat categories, ; gGlobalPrefsStore, gGamesListStore) ; ...unused... -; EB2C..FFF9 - main program code +; EAB9..FFF9 - main program code ; FFFA..FFFF - NMI, reset, IRQ vectors ; ; LC RAM BANK 2 @@ -123,7 +123,7 @@ EnableAccelerator = DisableAccelerator+3 MOCKINGBOARD_SLOT = %00001111 HAS_SPEECH = %10000000 -; AND masks for game info bitfield (after game title in gGamesList) +; AND masks for game info bitfield (after game display name in gGamesListStore) HAS_DHGR_TITLE = %10000000 ; this one is hard-coded via BMI instead of AND/BNE CHEAT_CATEGORY = %00001111 @@ -136,5 +136,5 @@ SUPPORTS_SHR = %00110000 CHEATS_ENABLED = %00001000 ; VBL functions -WaitForVBL = $FCB2 -UnwaitForVBL = $FCC7 +WaitForVBL = $FCB0 +UnwaitForVBL = $FCC5 diff --git a/src/glue.launch.a b/src/glue.launch.a index c575f9e58..459de435f 100644 --- a/src/glue.launch.a +++ b/src/glue.launch.a @@ -5,8 +5,9 @@ ; ; Public functions ; - GetGameToLaunch -; - GetGameInfo -; - GetGameInfoInActionSlideshow +; - FindGame +; - FindGameInActionSlideshow +; - GetGameDisplayName ; - PlayGame ; - Launch ; @@ -22,32 +23,24 @@ gGameToLaunch=*+1 +LDADDR gGamesListStore jmp okvs_nth -GetGameInfo +FindGame ; in: A/Y points to game filename ; out: C clear if game exists in gGamesListStore, and -; A/Y points to game display name (but see hack notes below) ; X = game index, or #$FF if the game doesn't really exist but -; we want to return a successful result anyway (really, read the -; hack notes, they're important) -; C set if game does not exist (this can happen because slideshows -; list games that require a joystick, but the games list parser -; filters out joystick-only games if the machine doesn't have a -; joystick) - ldx #$60 - +HIDE_NEXT_2_BYTES -GetGameInfoInActionSlideshow - ldx #$EA - stx @maybeExit +; we want to return a successful result anyway +; C set if game does not exist, and +; X clobbered (this can happen because slideshows list games +; that require a joystick, but the games list parser filters out +; joystick-only games if the machine doesn't have a joystick) +; A,Y always clobbered +STAY @key - +STAY @slideshowKey - jsr okvs_get + jsr okvs_find !word gGamesListStore @key !word $FDFD ; SMC bcc @exit ; Hack to allow self-running demos that don't correspond to a game ; filename. If the name ends in a '.', accept it unconditionally. -; The filename is its own display name. Launching this fake game -; will of course fail, so don't do that. + ldx #$FF +LDAY @key +STAY PARAM ldy #0 @@ -57,30 +50,78 @@ GetGameInfoInActionSlideshow cmp #"." beq @forceGoodResult sec -@maybeExit - !byte $00 ; SMC -; if the key is still not found, AND the caller said to try this, then try -; getting the value of the current record from gSlideshowStore -; (some games have multiple action screenshots, in which case the filename of -; the action screenshot is not the game name, but the value is) - jsr okvs_get - !word gSlideshowStore -@slideshowKey - !word $FDFD ; SMC - +STAY @key3 - jsr okvs_get - !word gGamesListStore -@key3 !word $FDFD ; SMC -; note that the game might still not be found (C will be set by okvs_get), -; which can happen if the game can't be played due to memory or joystick -; requirements rts @forceGoodResult - +LDAY @key - ldx #$FF clc @exit rts +FindGameInActionSlideshow +; in: A/Y points to game filename +; out: C clear if game exists, and +; X = game index, and +; A/Y points to game display name + game info bitfield +; C set if game can't be found by any means + +STAY @sskey + jsr FindGame + bcc + +; if the game was not found, try getting the value of the current record from +; gSlideshowStore (some games have multiple action screenshots, in which case +; the key is only the screenshot filename, and the value is the actual game +; filename) + jsr okvs_get + !word gSlideshowStore +@sskey !word $FDFD ; SMC + jsr FindGame + bcs @exit ++ + jsr GetGameDisplayName + clc +@exit rts + +GetGameDisplayName +; in: A/Y contains address of a key in gGamesListStore +; out: A/Y contains address of game display name + game info bitfield +; (this might be just the corresponding value in gGamesListStore, +; or it might be a temporary buffer in main memory that we constructed +; out of thin air) +; gValLen possibly clobbered (up to gValLen+MaxInputLength) +; X preserved + +STAY SAVE + jsr okvs_get_current ; get value for this key + ; (PTR) -> truncated game display name + info bitfield + ldy #0 + lda (PTR), y ; A = length of truncated game display name + info bitfield + cmp #1 ; 1 means there's no title, just info bitfield (1 byte) + beq + + +LDAY PTR + rts ++ ; game display name is truncated, we must expand it + iny ; Y = 1 + lda (PTR), y ; A = game info bitfield + pha ; save on stack + dey + lda (SAVE), y ; A = length of key + tay + iny + sty @len + sty gValLen + lda #$24 ; BIT opcode + sta @or + ldy #1 +- lda (SAVE), y +@or ora #$20 ; SMC (opcode) + sta gValLen, y + lda #$09 ; OR opcode + sta @or +@next iny +@len=*+1 + cpy #$FD ; SMC + bne - + pla + sta gValLen, y + +LDADDR gValLen + rts + PlayGame jsr GetGameToLaunch ; A/Y = address of game filename diff --git a/src/okvs.a b/src/okvs.a index 229287485..9ee1239b9 100644 --- a/src/okvs.a +++ b/src/okvs.a @@ -9,6 +9,7 @@ ; - okvs_append(address, key, value, max_len) add new key/value pair ; - okvs_update(address, key, value) update key/value pair ; - okvs_get(address, key) get value by key lookup +; - okvs_find(address, key) get key by key lookup ; - okvs_nth(address, n) get key by numeric index ; - okvs_next(address, n) get next key by numeric index ; - okvs_iter(address, callback) iterate through keys @@ -206,21 +207,26 @@ okvs_append rts ;------------------------------------------------------------------------------ -; okvs_get +; okvs_find / okvs_get ; ; in: stack contains 4 bytes of parameters: ; +1 [word] handle to storage space ; +3 [word] address of key -; out: if C clear, key was found -; A/Y = lo/hi address of value -; X = numeric index of key -; if C set, key was not found and all registers are clobbered +; out: if C clear, record was found +; A/Y = lo/hi address of key (okvs_find) or value (okvs_get) +; X = numeric index of found record +; if C set, keyrecord was not found and all registers are clobbered ; all other flags clobbered ; $00/$01 clobbered ; $02/$03 clobbered ; $04/$05 clobbered ;------------------------------------------------------------------------------ +okvs_find + lda #$60 + +HIDE_NEXT_2_BYTES okvs_get + lda #$EA + sta @maybeGetValue +PARAMS_ON_STACK 4 jsr GetStoreAddress ; PTR -> store @@ -255,18 +261,14 @@ okvs_get KEYLEN = *+1 cpy #$D1 ; SMC bne @matchKeyLoop + +LDAY DEST + clc +@maybeGetValue + brk ; SMC + jsr okvs_get_current +LDAY PTR clc - adc KEYLEN - bcc + - iny - clc -+ adc #2 - sta PTR - bcc + - iny - clc -+ rts + rts @next jsr derefptr ; PTR -> next record inx @max = *+1 diff --git a/src/parse.games.a b/src/parse.games.a index f191b7f7d..04deb166c 100644 --- a/src/parse.games.a +++ b/src/parse.games.a @@ -38,6 +38,7 @@ ParseGamesList cmp #$0D ; CR bne @skipLine @newkey ldx #$00 ; X = index into current key + stx gValLen ; initialize value length (in case this line has no value) @emptyline jsr IncAndGetChar ; get first filter character ('1' if game requires joystick) cmp #$0D ; ignore blank line @@ -70,6 +71,8 @@ ParseGamesList jsr IncAndGetChar @gatherKey jsr IncAndGetChar + cmp #$0D ; CR -> finalize key, no value + beq @endKey cmp #$3D ; '=' ends the key beq @endKey sta gKey,x @@ -77,6 +80,8 @@ ParseGamesList bpl @gatherKey @endKey stx gKeyLen ldx #$00 ; now X = index into the current value + cmp #$0D + beq @endValue @gatherValue jsr IncAndGetChar cmp #$0D ; CR ends the value @@ -86,8 +91,8 @@ ParseGamesList bpl @gatherValue @endValue pla ; pop cheat category - sta gVal,x ; store after game title - pla ; pop DHGR title + sta gVal,x ; store after game display name + pla ; pop has-DHGR-title flag lsr ror ora gVal,x @@ -103,7 +108,6 @@ ParseGamesList !byte 0 pla ; pop saved Y tay - clc - bcc @newkey ; always branches + jmp @newkey @exit rts diff --git a/src/textrank.a b/src/textrank.a index c5e0cdba7..e0497f3d6 100644 --- a/src/textrank.a +++ b/src/textrank.a @@ -4,16 +4,17 @@ ; text rank - an implementation of the Quicksilver search rank algorithm ; ; Public functions +; - BuildSearchStore ; - ResetTextRank ; - TextRankCallback (as okvs_iter_values callback) ; ; Public variables ; - InputLength ; [byte] number of characters typed in search mode ; - InputBuffer ; [25 bytes] characters typed in search mode -; - SelectedIndex ; [byte] index in gGamesListStore of currently selected game in search mode +; - SelectedIndex ; [byte] index in gSearchStore of currently selected game in search mode ; - MatchCount ; [byte] number of games that match InputBuffer ; - BestMatchScore ; [byte] raw ranking score (0-100) of current best match (updated during TextRankCallback) -; - BestMatchIndex ; [byte] index in gGamesListStore of current best match (updated during TextRankCallback) +; - BestMatchIndex ; [byte] index in gSearchStore of current best match (updated during TextRankCallback) MaxInputLength = 26 InputLength @@ -21,6 +22,33 @@ InputLength InputBuffer !text " " +BuildSearchStore + jsr SwitchToBank2 + jsr EnableAcceleratorAndSwitchToBank1 + +LDADDR gSearchStore + jsr okvs_init + + jsr okvs_iter + !word gGamesListStore + !word @callback + rts +@callback +; callback called by okvs_iter on gGamesListStore + +; in: A/Y contains address of filename +; X contains 0-based index of the current record in gGamesListStore +; out: all registers and flags clobbered + +STAY @key + jsr GetGameDisplayName + +STAY @value +@append + jsr okvs_append + !word gSearchStore +@key !word $FDFD ; SMC +@value !word $FDFD ; SMC + !byte 0 + rts + ;------------------------------------------------------------------------------ ; ResetTextRank ; reset the Match variables to allow re-scanning (e.g. because of backspace) @@ -38,20 +66,20 @@ ResetTextRank ;------------------------------------------------------------------------------ ; TextRankCallback -; callback called by okvs_iter_values on gGamesListStore -; to calculate a ranking score for a single game title +; callback called by okvs_iter_values on gSearchStore +; to calculate a ranking score for a single game display name ; against the current InputBuffer -; in: A/Y contains address of game title -; X contains 0-based index of the current record in gGamesListStore +; in: A/Y contains address of game display name +; X contains 0-based index of the current record in gSearchStore ; out: all registers and flags clobbered -; MatchCount possibly incremented (if this title was a match at all) -; BestMatchScore and BestMatchIndex possibly updated (if this title +; MatchCount possibly incremented (if this game was a match at all) +; BestMatchScore and BestMatchIndex possibly updated (if this game ; was the best match so far) ;------------------------------------------------------------------------------ TextRankCallback - stx tmpx ; X = OKVS index of this title - +STAY zpstring ; A/Y = address of this title + stx tmpx ; X = OKVS index of this game + +STAY zpstring ; A/Y = address of this game display name +LDADDR InputLength +STAY zpword ldy #0 diff --git a/src/ui.attract.dhgr.a b/src/ui.attract.dhgr.a index cc027ba37..ac836f8a1 100644 --- a/src/ui.attract.dhgr.a +++ b/src/ui.attract.dhgr.a @@ -181,7 +181,7 @@ DHGRTitleCallback +STAY + - jsr GetGameInfo + jsr FindGame ; if game is not found (C will be set here), it means it can't be played on ; this machine due to memory or joystick requirements, so we don't display ; it in slideshows @@ -213,12 +213,12 @@ DHGRActionCallback +STAY + - jsr GetGameInfoInActionSlideshow + jsr FindGameInActionSlideshow ; if game name is not found (C will be set here), it means the game ; can't be played due to memory or joystick requirements, so we hide ; it from slideshows bcs DHGRRTS - +STAY SAVE ; (SAVE) -> game title + +STAY SAVE ; (SAVE) -> game display name + game info bitfield stx gGameToLaunch jsr LoadAuxFile ; load compressed DHGR screenshot at aux $3FF8 @@ -238,7 +238,7 @@ DrawGameTitleInActionSlideshowHGR sta VTAB lda #0 ; solid horizontal bar character jsr @resetline - lda (SAVE),y ; (SAVE) -> game title, Y = 0, so A = title length + 1 + lda (SAVE),y ; (SAVE) -> game display name, Y = 0, so A = display length + 1 clc adc #$02 sta gPathname @@ -248,7 +248,7 @@ DrawGameTitleInActionSlideshowHGR inc VTAB lda #" " jsr @resetline - lda (SAVE),y ; A = title length + 1 + lda (SAVE),y ; A = display length + 1 tay dey - lda (SAVE),y diff --git a/src/ui.attract.gr.a b/src/ui.attract.gr.a index 0b227706e..3c38efdf1 100644 --- a/src/ui.attract.gr.a +++ b/src/ui.attract.gr.a @@ -95,7 +95,7 @@ GRActionCallback +STAY + - jsr GetGameInfoInActionSlideshow + jsr FindGameInActionSlideshow ; if game name is not found (C will be set here), it means the game ; can't be played due to memory or joystick requirements, so we hide ; it from slideshows diff --git a/src/ui.attract.hgr.a b/src/ui.attract.hgr.a index 224691f12..c010733c6 100644 --- a/src/ui.attract.hgr.a +++ b/src/ui.attract.hgr.a @@ -112,7 +112,7 @@ HGRTitleCallback +STAY + - jsr GetGameInfo + jsr FindGame ; if game is not found (C will be set here), it means it can't be played on ; this machine due to memory or joystick requirements, so we don't display ; it in slideshows @@ -144,14 +144,14 @@ HGRActionCallback +STAY + - jsr GetGameInfoInActionSlideshow + jsr FindGameInActionSlideshow ; if game name is not found (C will be set here), it means the game ; can't be played due to memory or joystick requirements, so we hide ; it from slideshows bcs HGRRTS ; found the game - +STAY SAVE ; (SAVE) -> game title + +STAY SAVE ; (SAVE) -> game display name + game info bitfield stx gGameToLaunch jsr LoadFile ; load compressed HGR screenshot at $3FF8 diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 3c695cbec..62ad513c9 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -137,7 +137,7 @@ RunAttractModule ; language card or auxiliary memory. +LDAY @key - jsr GetGameInfo + jsr FindGame bcs ATTRTS ; if game doesn't exist, skip the demo cpx #$FF beq + diff --git a/src/ui.attract.shr.a b/src/ui.attract.shr.a index 109cbb9fe..47f9f409a 100644 --- a/src/ui.attract.shr.a +++ b/src/ui.attract.shr.a @@ -88,7 +88,7 @@ SHRArtworkCallback +STAY @sfname - jsr GetGameInfo + jsr FindGame ; if game is not found (C will be set here), it means it can't be played on ; this machine due to memory or joystick requirements, so we don't display ; it in slideshows diff --git a/src/ui.offscreen.a b/src/ui.offscreen.a index 5e03d627e..ca2340810 100644 --- a/src/ui.offscreen.a +++ b/src/ui.offscreen.a @@ -89,9 +89,9 @@ LoadGameTitleOffscreen bit MachineStatus ; if < 128K, don't bother checking for DHGR title bvc @hgr jsr okvs_get_current - ; (PTR) -> game title + bitfield of game info + ; (PTR) -> game display name + bitfield of game info ; Y = 0 - lda (PTR),y ; A = game title length + 1 + lda (PTR),y ; A = game display name length + 1 sta SAVE tay lda (PTR),y ; A = game info bitfield diff --git a/src/ui.overlay.a b/src/ui.overlay.a index 81ce73a72..0a4f9cce0 100644 --- a/src/ui.overlay.a +++ b/src/ui.overlay.a @@ -109,10 +109,11 @@ DrawUI beq @doneWithLine2 jsr GetGameToLaunch - jsr okvs_get_current - ; (PTR) -> game title + bitfield of game info - ; Y = 0 - lda (PTR),y ; A = game title length + 1 + jsr GetGameDisplayName + ; A/Y -> game display name + bitfield of game info + +STAY PTR + ldy #0 + lda (PTR),y ; A = game display name length + 1 sta SAVE tay lda (PTR),y ; A = game info bitfield @@ -178,7 +179,7 @@ DrawUI ldy #0 @dotloop iny - lda (PTR),y ; (PTR) still points to game title + lda (PTR),y ; (PTR) still points to game display name + game info bitfield ora #$20 ; force lower-case always cmp InputBuffer,x bne + diff --git a/src/ui.search.mode.a b/src/ui.search.mode.a index 4209b90dd..4010499b9 100644 --- a/src/ui.search.mode.a +++ b/src/ui.search.mode.a @@ -100,6 +100,7 @@ SearchMode ldx #$FF txs stx gGameToLaunch ; $FF = no game selected + jsr BuildSearchStore jsr Home ; clear screen (switches to text mode) jsr OnInputChanged ; draw UI offscreen jsr HGRMode ; show HGR screen @@ -187,8 +188,8 @@ FindMatchingTitle jsr ResetTextRank - jsr okvs_iter_values ; iterate through all game titles - !word gGamesListStore ; and rank them for the best match + jsr okvs_iter_values ; iterate through all game display names + !word gSearchStore ; and rank them for the best match !word TextRankCallback ; to the current input buffer lda MatchCount ; any matches at all?