modflash: add Makefile and README.md for GNU/Linux and Windows NT hosts

This commit is contained in:
Ivan Tatarinov 2021-04-06 19:38:29 +03:00
parent 054a802f60
commit acbc5efebb
4 changed files with 168 additions and 0 deletions

33
modflash/Makefile Normal file
View File

@ -0,0 +1,33 @@
# Supported environments:
# * GNU/Linux
# * Windows NT (using MinGW/MSYS/Cygwin/WSL)
ifeq ($(OS),Windows_NT)
GENROM = GenRom.exe
ADDITEM = AddItem.exe
else
GENROM = GenRom
ADDITEM = AddItem
endif
.PHONY: all
all: | FLASHempty.ZX1 $(GENROM) $(ADDITEM) ./addroms.sh ./addcores.sh
cp FLASHempty.ZX1 FLASH.ZX1
./addroms.sh
./addcores.sh
ifneq ($(OS),Windows_NT)
$(GENROM): GenRom.c
$(CC) $(CFLAGS) $< -o $@
$(ADDITEM): AddItem.c
$(CC) $(CFLAGS) $< -o $@
endif
.PHONY: clean
clean:
ifeq ($(OS),Windows_NT)
rm -f FLASH.ZX1
else
rm -f $(GENROM) $(ADDITEM) FLASH.ZX1
endif

25
modflash/README.md Normal file
View File

@ -0,0 +1,25 @@
# Target
File `FLASH.ZX1` - .
# Windows
## Build
```batch
make.bat
```
# GNU/Linux
## Build
```bash
make
```
## Clean
```bash
make clean
```

63
modflash/addcores.sh Executable file
View File

@ -0,0 +1,63 @@
#!/bin/bash -e
GENROM=./GenRom
ADDITEM=./AddItem
i=2
Error() {
echo "ERROR: Exit status $1. Stopped." >&2
exit $1
}
AddCore() {
local f=${3%.*}.tap
echo "Adding core $i: \"$2\" ($3)..."
$GENROM $1 "$2" $3 $f || Error $?
$ADDITEM CORE$i $f || Error $?
rm -f $f
let i+=1
}
AddCore 0 "Apple 2" cores/Apple2.ZX1
AddCore 0 "Atari 2600" cores/Atari2600.ZX1
AddCore 0 "Atari 800 XL" cores/Atari800XL.ZX1
AddCore 0 "Acorn Atom" cores/Atom.ZX1
AddCore 0 "BBC Micro" cores/BBCMicro.ZX1
AddCore 0 "C16" cores/C16.ZX1
AddCore 0 "C64" cores/C64.ZX1
AddCore 0 "Test" cores/Test.ZX1
AddCore 0 "ColecoVision" cores/Coleco.ZX1
AddCore 0 "CPC464" cores/CPC464.ZX1
AddCore 0 "CPC6128" cores/CPC6128.ZX1
AddCore 0 "Acorn Electron" cores/Electron.ZX1
AddCore 0 "Galaksija" cores/Galaksija.zx1
AddCore 0 "Jupiter Ace" cores/JupAce.ZX1
AddCore 0 "Spectrum Kyp" cores/Kyp.ZX1
AddCore 0 "MSX" cores/MSX.ZX1
AddCore 0 "Nintendo NES" cores/NES.ZX1
AddCore 0 "Oric" cores/Oric.ZX1
AddCore 0 "PC" cores/PC.ZX1
AddCore 0 "PC2M" cores/PC2M.ZX1
AddCore 0 "Sam Coupe" cores/SamCoupe.ZX1
AddCore 0 "Sega Master System" cores/SMS.ZX1
AddCore 0 "TBBlue" cores/TBBlue.ZX1
AddCore 0 "Vectrex" cores/Vectrex.ZX1
AddCore 0 "VIC-20" cores/VIC20.ZX1
AddCore 0 "Arcade Pacman" cores/Arcades/pacman.ZX1
AddCore 0 "Arcade Galaxian" cores/Arcades/galaxian.ZX1
AddCore 0 "Arcade Phoenix" cores/Arcades/phoenix.ZX1
AddCore 0 "Arcade The Glob" cores/Arcades/theblob.ZX1
AddCore 0 "Arcade Scramble" cores/Arcades/scramble.ZX1
AddCore 0 "Arcade Frogger" cores/Arcades/frogger.ZX1
AddCore 0 "Arcade Moon Cresta" cores/Arcades/mooncresta.ZX1
AddCore 0 "Arcade Jump Shot" cores/Arcades/jumpshot.ZX1
AddCore 0 "Arcade Amidar" cores/Arcades/amidar.ZX1
AddCore 0 "Arcade Black Hole" cores/Arcades/blackhole.ZX1
AddCore 0 "Arcade Crush Roller" cores/Arcades/crush2.ZX1
AddCore 0 "Arcade Galaga" cores/Arcades/galaga.ZX1
AddCore 0 "Arcade Gorkans" cores/Arcades/gorkans.ZX1
AddCore 0 "Arcade Lizard Wizard" cores/Arcades/lizwiz.ZX1
AddCore 0 "Arcade Mr. Do" cores/Arcades/mrdo.ZX1
AddCore 0 "Arcade Ms. Pacman" cores/Arcades/mspacman.ZX1
AddCore 0 "Arcade Orbitron" cores/Arcades/orbitron.ZX1
AddCore 0 "Arcade Pac Miner" cores/Arcades/pacminer.ZX1
AddCore 0 "Arcade Pacman Plus" cores/Arcades/pacplus.ZX1

47
modflash/addroms.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash -e
GENROM=./GenRom
ADDITEM=./AddItem
i=0
Error() {
echo "ERROR: Exit status $1. Stopped." >&2
exit $1
}
AddROM() {
local n=`stat --printf "%s" $3`
local i1=$((i+n/16384-1))
local f=${3%.*}.tap
echo "Adding ROM in slots $i-$i1: \"$2\" ($3)..."
$GENROM $1 "$2" $3 $f || Error $?
$ADDITEM ROM $i $f || Error $?
rm -f $f
let i=i1+1
}
AddROM xdnlh17 "ZX Spectrum 48K" roms/48.rom
AddROM xtdnh1 "ZX Spectrum 128K EN" roms/128en.rom
AddROM xt "ZX Spectrum +2A EN" roms/plus3en41.rom
AddROM xdlh "48K Cargando Leches" roms/leches.rom
AddROM xdnlh17 "Inves Spectrum+" roms/inves.rom
AddROM xdnlh17 "Microdigital TK95" roms/tk95.rom
AddROM xdnlh17 "Looking Glass 1.07" roms/lg18v07.rom
AddROM xdnmlh17 "Timex Computer 2048" roms/tc2048.rom
AddROM xmh1 "Timex Computer 2068" roms/tc2068.rom
AddROM xpch1 "Pentagon 128" roms/pentagon.rom
AddROM xdlh17 "Pokemon" roms/pokemon48.rom
AddROM xdnlh17 "Gosh Wonderful v1.33" roms/gw03v33.rom
AddROM xdh1 "SE Basic IV 4.0 Anya" roms/se.rom
AddROM xtdnh1 "Derby+" roms/derbyp.rom
AddROM xt "DivMMC +3e ES 1.43" roms/plus3es143.rom
AddROM xt "Next +3e 1.53" roms/next.rom
AddROM xth1ru "BBC Micro" roms/BBCBasic.rom
AddROM xth1ru "Jupiter Ace" roms/jupace.rom
AddROM xth1ru "ZX81" roms/zx81.rom
AddROM xlh17ru "Manic Miner (1983)" roms/ManicMiner.rom
AddROM xlh17ru "Jet Set Willy (1984)" roms/JetSetWilly.rom
AddROM xlh17ru "Jet Pac (1983)" roms/JetPac.rom
AddROM xlh17ru "Cookie (1983)" roms/Cookie.rom
AddROM xlh17ru "Tranz Am (1983)" roms/TranzAm.rom
AddROM xlh17ru "Planetoids (1983)" roms/Planetoids.rom
AddROM xlh17ru "Space Raiders (1983)" roms/SpaceRaiders.rom
AddROM xlh17ru "Misco Jones (2013)" roms/MiscoJones.rom