From 8f4eb28ff24255d3902eada15ae627e0f25f410f Mon Sep 17 00:00:00 2001 From: Ivan Tatarinov Date: Tue, 6 Apr 2021 16:39:29 +0300 Subject: [PATCH] modflash/addrom.bat: optimized process of adding new ROM (automated slot number calculation) --- modflash/addrom.bat | 100 ++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 55 deletions(-) diff --git a/modflash/addrom.bat b/modflash/addrom.bat index 067ea06..cee4039 100644 --- a/modflash/addrom.bat +++ b/modflash/addrom.bat @@ -1,55 +1,45 @@ -GenRom xdnlh17 "ZX Spectrum 48K" roms\48.rom 48.tap -GenRom xtdnh1 "ZX Spectrum 128K EN" roms\128en.rom 128en.tap -GenRom xt "ZX Spectrum +2A EN" roms\plus3en41.rom plus3en41.tap -GenRom xdlh "48K Cargando Leches" roms\leches.rom leches.tap -GenRom xdnlh17 "Inves Spectrum+" roms\inves.rom inves.tap -GenRom xdnlh17 "Microdigital TK95" roms\tk95.rom tk95.tap -GenRom xdnlh17 "Looking Glass 1.07" roms\lg18v07.rom lg18v07.tap -GenRom xdnmlh17 "Timex Computer 2048" roms\tc2048.rom tc2048.tap -GenRom xmh1 "Timex Computer 2068" roms\tc2068.rom tc2068.tap -GenRom xpch1 "Pentagon 128" roms\pentagon.rom pentagon.tap -GenRom xdlh17 "Pokemon" roms\pokemon.rom pokemon.tap -GenRom xdnlh17 "Gosh Wonderful v1.33" roms\gw03v33.rom gw03v33.tap -GenRom xdh1 "SE Basic IV 4.0 Anya" roms\se.rom se.tap -GenRom xtdnh1 "Derby+" roms\derbyp.rom derbyp.tap -GenRom xt "DivMMC +3e ES 1.43" roms\plus3es143.rom plus3es143.tap -GenRom xt "Next +3e 1.53" roms\next.rom next.tap -GenRom xth1ru "BBC Micro" roms\BBCBasic.rom BBCBasic.tap -GenRom xth1ru "Jupiter Ace" roms\jupace.rom jupace.tap -GenRom xth1ru "ZX81" roms\zx81.rom zx81.tap -GenRom xlh17ru "Manic Miner (1983)" roms\ManicMiner.rom ManicMiner.tap -GenRom xlh17ru "Jet Set Willy (1984)" roms\JetSetWilly.rom JetSetWilly.tap -GenRom xlh17ru "Jet Pac (1983)" roms\JetPac.rom JetPac.tap -GenRom xlh17ru "Cookie (1983)" roms\Cookie.rom Cookie.tap -GenRom xlh17ru "Tranz Am (1983)" roms\TranzAm.rom TranzAm.tap -GenRom xlh17ru "Planetoids (1983)" roms\Planetoids.rom Planetoids.tap -GenRom xlh17ru "Space Raiders (1983)" roms\SpaceRaiders.rom SpaceRaiders.tap -GenRom xlh17ru "Misco Jones (2013)" roms\MiscoJones.rom MisĀ­coJones.tap -AddItem ROM 0 48.tap -AddItem ROM 1 128en.tap -AddItem ROM 3 plus3en41.tap -AddItem ROM 7 leches.tap -AddItem ROM 8 inves.tap -AddItem ROM 9 tk95.tap -AddItem ROM 10 lg18v07.tap -AddItem ROM 11 tc2048.tap -AddItem ROM 12 tc2068.tap -AddItem ROM 14 pentagon.tap -AddItem ROM 16 pokemon.tap -AddItem ROM 17 gw03v33.tap -AddItem ROM 18 se.tap -AddItem ROM 20 derbyp.tap -AddItem ROM 22 plus3es143.tap -AddItem ROM 26 next.tap -AddItem ROM 30 BBCBasic.tap -AddItem ROM 32 jupace.tap -AddItem ROM 34 zx81.tap -AddItem ROM 36 ManicMiner.tap -AddItem ROM 37 JetSetWilly.tap -AddItem ROM 38 JetPac.tap -AddItem ROM 39 Cookie.tap -AddItem ROM 40 TranzAm.tap -AddItem ROM 41 Planetoids.tap -AddItem ROM 42 SpaceRaiders.tap -AddItem ROM 43 MisĀ­coJones.tap -del *.tap +@echo off +set /a i=0 +call :AddROM xdnlh17 "ZX Spectrum 48K" roms\48.rom +call :AddROM xtdnh1 "ZX Spectrum 128K EN" roms\128en.rom +call :AddROM xt "ZX Spectrum +2A EN" roms\plus3en41.rom +call :AddROM xdlh "48K Cargando Leches" roms\leches.rom +call :AddROM xdnlh17 "Inves Spectrum+" roms\inves.rom +call :AddROM xdnlh17 "Microdigital TK95" roms\tk95.rom +call :AddROM xdnlh17 "Looking Glass 1.07" roms\lg18v07.rom +call :AddROM xdnmlh17 "Timex Computer 2048" roms\tc2048.rom +call :AddROM xmh1 "Timex Computer 2068" roms\tc2068.rom +call :AddROM xpch1 "Pentagon 128" roms\pentagon.rom +call :AddROM xdlh17 "Pokemon" roms\pokemon48.rom +call :AddROM xdnlh17 "Gosh Wonderful v1.33" roms\gw03v33.rom +call :AddROM xdh1 "SE Basic IV 4.0 Anya" roms\se.rom +call :AddROM xtdnh1 "Derby+" roms\derbyp.rom +call :AddROM xt "DivMMC +3e ES 1.43" roms\plus3es143.rom +call :AddROM xt "Next +3e 1.53" roms\next.rom +call :AddROM xth1ru "BBC Micro" roms\BBCBasic.rom +call :AddROM xth1ru "Jupiter Ace" roms\jupace.rom +call :AddROM xth1ru "ZX81" roms\zx81.rom +call :AddROM xlh17ru "Manic Miner (1983)" roms\ManicMiner.rom +call :AddROM xlh17ru "Jet Set Willy (1984)" roms\JetSetWilly.rom +call :AddROM xlh17ru "Jet Pac (1983)" roms\JetPac.rom +call :AddROM xlh17ru "Cookie (1983)" roms\Cookie.rom +call :AddROM xlh17ru "Tranz Am (1983)" roms\TranzAm.rom +call :AddROM xlh17ru "Planetoids (1983)" roms\Planetoids.rom +call :AddROM xlh17ru "Space Raiders (1983)" roms\SpaceRaiders.rom +call :AddROM xlh17ru "Misco Jones (2013)" roms\MiscoJones.rom +exit /b + +:AddROM +set /a i1=i+(%~z3)/16384-1 +echo Adding ROM in slots %i%-%i1%: %2 (%3)... +GenRom %1 %2 %3 %~n3.tap +if not %ERRORLEVEL% == 0 goto Error +AddItem ROM %i% %~n3.tap +if not %ERRORLEVEL% == 0 goto Error +del %~n3.tap +set /a i=i1+1 +exit /b + +:Error +echo ERROR: Exit status %ERRORLEVEL%. Stopped. +exit %ERRORLEVEL% /b