This commit is contained in:
antoniovillena 2021-04-11 22:50:46 +02:00
commit 112d1e97e3
31 changed files with 588 additions and 147 deletions

3
.gitignore vendored
View File

@ -53,3 +53,6 @@ cores/Oric/source/_impact.cmd
cores/Oric/source/_impact.log
cores/Oric/build/oric.v4_my.bit
sdk/bin/sjasmplus
sdk/src/sjasmplus

View File

@ -1,5 +1,6 @@
@call ..\sdk\setvars.bat
sjasmplus firmware.asm
zx7b firmware_strings.rom firmware.rom.zx7b
sjasmplus bootloader.asm
bin2hex bootloader.rom
copy /y bootloader.hex ..\cores\Spectrum\bootloader_hex.txt
copy /y bootloader.hex ..\cores\Spectrum\bootloader_hex.txt

View File

@ -1,3 +1,4 @@
@call ..\sdk\setvars.bat
echo define version 1 > version.asm
sjasmplus firmware.asm
fcut firmware_strings.rom 7e00 -7e00 strings.bin

View File

@ -1,3 +1,4 @@
@call ..\..\sdk\setvars.bat
FuenteABin
Png2Rcs fondo.png fondo.rcs -a fondo.atr
sjasmplus scroll.asm

View File

@ -1,3 +1,4 @@
@call ..\..\..\sdk\setvars.bat
rem 51F0-A4FF ep 6e3f
rem b900-bf7f
fcut Manic.sna 52F0 4a30 Manic.bin

View File

@ -1,3 +1,4 @@
@call ..\..\..\sdk\setvars.bat
genMenu
rcs screen.scr screen.rcs
fcut screen.rcs 0 1800 screen.cut

View File

@ -1,3 +1,4 @@
@call ..\..\..\sdk\setvars.bat
genMenu 1
rcs screen.scr screen.rcs
fcut screen.rcs 0 1000 screen.cut

View File

@ -1,3 +1,4 @@
@call ..\..\..\sdk\setvars.bat
genMenu 0
rcs screen.scr screen.rcs
fcut screen.rcs 0 1000 screen.cut

41
modflash/Makefile Normal file
View File

@ -0,0 +1,41 @@
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# 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 roms.txt cores.txt
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)
# Nothing to do
else
rm -f $(GENROM) $(ADDITEM)
endif
.PHONY: dist-clean
dist-clean: clean
rm -f FLASH.ZX1

43
modflash/README.md Normal file
View File

@ -0,0 +1,43 @@
# Authors
2021 Ivan Tatarinov <ivan-tat@ya.ru>
# Contributors
No one yet.
# License
This document is under [GNU FDL-1.3 or later](http://www.gnu.org/licenses/fdl-1.3.html) license.
# Target
File `FLASH.ZX1`.
# Windows
## Build
```batch
make.bat
```
# GNU/Linux
## Build
```bash
make
```
## Clean
```bash
make clean
```
or even to remove `FLASH.ZX1` file:
```bash
make dist-clean
```

View File

@ -0,0 +1,5 @@
SPDX-FileType: TEXT
SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
SPDX-License-Identifier: GFDL-1.3-or-later

View File

@ -1,89 +0,0 @@
GenRom 0 "Apple 2" cores\Apple2.ZX1 Apple2.tap
GenRom 0 "Atari 2600" cores\Atari2600.ZX1 Atari2600.tap
GenRom 0 "Atari 800 XL" cores\Atari800XL.ZX1 Atari800XL.tap
GenRom 0 "Acorn Atom" cores\Atom.ZX1 Atom.tap
GenRom 0 "BBC Micro" cores\BBCMicro.ZX1 BBCMicro.tap
GenRom 0 "C16" cores\C16.ZX1 C16.tap
GenRom 0 "C64" cores\C64.ZX1 C64.tap
GenRom 0 "Test" cores\Test.ZX1 Test.tap
GenRom 0 "ColecoVision" cores\Coleco.ZX1 Coleco.tap
GenRom 0 "CPC464" cores\CPC464.ZX1 CPC464.tap
GenRom 0 "CPC6128" cores\CPC6128.ZX1 CPC6128.tap
GenRom 0 "Acorn Electron" cores\Electron.ZX1 Electron.tap
GenRom 0 "Galaksija" cores\Galaksija.zx1 Galaksija.tap
GenRom 0 "Jupiter Ace" cores\JupAce.ZX1 JupAce.tap
GenRom 0 "Spectrum Kyp" cores\Kyp.ZX1 Kyp.tap
GenRom 0 "MSX" cores\MSX.ZX1 MSX.tap
GenRom 0 "Nintendo NES" cores\NES.ZX1 NES.tap
GenRom 0 "Oric" cores\Oric.ZX1 Oric.tap
GenRom 0 "PC" cores\PC.ZX1 PC.tap
GenRom 0 "PC2M" cores\PC2M.ZX1 PC2M.tap
GenRom 0 "Sam Coupe" cores\SamCoupe.ZX1 SamCoupe.tap
GenRom 0 "Sega Master System" cores\SMS.ZX1 SMS.tap
GenRom 0 "TBBlue" cores\TBBlue.ZX1 TBBlue.tap
GenRom 0 "Vectrex" cores\Vectrex.ZX1 Vectrex.tap
GenRom 0 "VIC-20" cores\VIC20.ZX1 VIC20.tap
GenRom 0 "Arcade Pacman" cores\Arcades\pacman.ZX1 pacman.tap
GenRom 0 "Arcade Galaxian" cores\Arcades\galaxian.ZX1 galaxian.tap
GenRom 0 "Arcade Phoenix" cores\Arcades\phoenix.ZX1 phoenix.tap
GenRom 0 "Arcade The Glob" cores\Arcades\theblob.ZX1 theblob.tap
GenRom 0 "Arcade Scramble" cores\Arcades\scramble.ZX1 scramble.tap
GenRom 0 "Arcade Frogger" cores\Arcades\frogger.ZX1 frogger.tap
GenRom 0 "Arcade Moon Cresta" cores\Arcades\mooncresta.ZX1 mooncresta.tap
GenRom 0 "Arcade Jump Shot" cores\Arcades\jumpshot.ZX1 jumpshot.tap
GenRom 0 "Arcade Amidar" cores\Arcades\amidar.ZX1 amidar.tap
GenRom 0 "Arcade Black Hole" cores\Arcades\blackhole.ZX1 blackhole.tap
GenRom 0 "Arcade Crush Roller" cores\Arcades\crush2.ZX1 crush2.tap
GenRom 0 "Arcade Galaga" cores\Arcades\galaga.ZX1 galaga.tap
GenRom 0 "Arcade Gorkans" cores\Arcades\gorkans.ZX1 gorkans.tap
GenRom 0 "Arcade Lizard Wizard" cores\Arcades\lizwiz.ZX1 lizwiz.tap
GenRom 0 "Arcade Mr. Do" cores\Arcades\mrdo.ZX1 mrdo.tap
GenRom 0 "Arcade Ms. Pacman" cores\Arcades\mspacman.ZX1 mspacman.tap
GenRom 0 "Arcade Orbitron" cores\Arcades\orbitron.ZX1 orbitron.tap
GenRom 0 "Arcade Pac Miner" cores\Arcades\pacminer.ZX1 pacminer.tap
GenRom 0 "Arcade Pacman Plus" cores\Arcades\pacplus.ZX1 pacplus.tap
AddItem CORE2 Apple2.tap
AddItem CORE3 Atari2600.tap
AddItem CORE4 Atari800XL.tap
AddItem CORE5 Atom.tap
AddItem CORE6 BBCMicro.tap
AddItem CORE7 C16.tap
AddItem CORE8 C64.tap
AddItem CORE9 Test.tap
AddItem CORE10 Coleco.tap
AddItem CORE11 CPC464.tap
AddItem CORE12 CPC6128.tap
AddItem CORE13 Electron.tap
AddItem CORE14 Galaksija.tap
AddItem CORE15 JupAce.tap
AddItem CORE16 Kyp.tap
AddItem CORE17 MSX.tap
AddItem CORE18 NES.tap
AddItem CORE19 Oric.tap
AddItem CORE20 PC.tap
AddItem CORE21 PC2M.tap
AddItem CORE22 SamCoupe.tap
AddItem CORE23 SMS.tap
AddItem CORE24 TBBlue.tap
AddItem CORE25 Vectrex.tap
AddItem CORE26 VIC20.tap
AddItem CORE27 pacman.tap
AddItem CORE28 galaxian.tap
AddItem CORE29 phoenix.tap
AddItem CORE30 theblob.tap
AddItem CORE31 scramble.tap
AddItem CORE32 frogger.tap
AddItem CORE33 mooncresta.tap
AddItem CORE34 jumpshot.tap
AddItem CORE35 amidar.tap
AddItem CORE36 blackhole.tap
AddItem CORE37 crush2.tap
AddItem CORE38 galaga.tap
AddItem CORE39 gorkans.tap
AddItem CORE40 lizwiz.tap
AddItem CORE41 mrdo.tap
AddItem CORE42 mspacman.tap
AddItem CORE43 orbitron.tap
AddItem CORE44 pacminer.tap
AddItem CORE45 pacplus.tap
del *.tap

24
modflash/addcores.bat Normal file
View File

@ -0,0 +1,24 @@
@echo off
rem SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
rem
rem SPDX-FileNotice: Based on code by Antonio Villena <_@antoniovillena.es>
rem
rem SPDX-License-Identifier: GPL-3.0-or-later
set /a i=2
for /f "eol=# tokens=1,2,3 delims=;" %%a in (cores.txt) do call :AddCore %%a %%b %%c
exit /b
:AddCore
echo Adding core %i%: %2 (%3)...
GenRom %1 %2 %3 %~n3.tap
if not %ERRORLEVEL% == 0 goto Error
AddItem CORE%i% %~n3.tap
if not %ERRORLEVEL% == 0 goto Error
del %~n3.tap
set /a i+=1
exit /b
:Error
echo ERROR: Exit status %ERRORLEVEL%. Stopped.
exit /b %ERRORLEVEL%

33
modflash/addcores.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash -e
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
#
# SPDX-FileNotice: Based on code by Antonio Villena <_@antoniovillena.es>
#
# SPDX-License-Identifier: GPL-3.0-or-later
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
}
OnExit() {
rm -f addcores.tmp
}
trap OnExit EXIT
awk -F \; '/^[^#]+/{print "AddCore " $1 " " $2 " " gensub(/\\/, "/", "g", $3)}' cores.txt >addcores.tmp
. ./addcores.tmp

View File

@ -1,55 +0,0 @@
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

25
modflash/addroms.bat Normal file
View File

@ -0,0 +1,25 @@
@echo off
rem SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
rem
rem SPDX-FileNotice: Based on code by Antonio Villena <_@antoniovillena.es>
rem
rem SPDX-License-Identifier: GPL-3.0-or-later
set /a i=0
for /f "eol=# tokens=1,2,3 delims=;" %%a in (roms.txt) do call :AddROM %%a %%b %%c
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 /b %ERRORLEVEL%

35
modflash/addroms.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash -e
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
#
# SPDX-FileNotice: Based on code by Antonio Villena <_@antoniovillena.es>
#
# SPDX-License-Identifier: GPL-3.0-or-later
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
}
OnExit() {
rm -f addroms.tmp
}
trap OnExit EXIT
awk -F \; '/^[^#]+/{print "AddROM " $1 " " $2 " " gensub(/\\/, "/", "g", $3)}' roms.txt >addroms.tmp
. ./addroms.tmp

44
modflash/cores.txt Normal file
View File

@ -0,0 +1,44 @@
0; "Apple 2"; cores\Apple2.ZX1
0; "Atari 2600"; cores\Atari2600.ZX1
0; "Atari 800 XL"; cores\Atari800XL.ZX1
0; "Acorn Atom"; cores\Atom.ZX1
0; "BBC Micro"; cores\BBCMicro.ZX1
0; "C16"; cores\C16.ZX1
0; "C64"; cores\C64.ZX1
0; "Test"; cores\Test.ZX1
0; "ColecoVision"; cores\Coleco.ZX1
0; "CPC464"; cores\CPC464.ZX1
0; "CPC6128"; cores\CPC6128.ZX1
0; "Acorn Electron"; cores\Electron.ZX1
0; "Galaksija"; cores\Galaksija.zx1
0; "Jupiter Ace"; cores\JupAce.ZX1
0; "Spectrum Kyp"; cores\Kyp.ZX1
0; "MSX"; cores\MSX.ZX1
0; "Nintendo NES"; cores\NES.ZX1
0; "Oric"; cores\Oric.ZX1
0; "PC"; cores\PC.ZX1
0; "PC2M"; cores\PC2M.ZX1
0; "Sam Coupe"; cores\SamCoupe.ZX1
0; "Sega Master System"; cores\SMS.ZX1
0; "TBBlue"; cores\TBBlue.ZX1
0; "Vectrex"; cores\Vectrex.ZX1
0; "VIC-20"; cores\VIC20.ZX1
0; "Arcade Pacman"; cores\Arcades\pacman.ZX1
0; "Arcade Galaxian"; cores\Arcades\galaxian.ZX1
0; "Arcade Phoenix"; cores\Arcades\phoenix.ZX1
0; "Arcade The Glob"; cores\Arcades\theblob.ZX1
0; "Arcade Scramble"; cores\Arcades\scramble.ZX1
0; "Arcade Frogger"; cores\Arcades\frogger.ZX1
0; "Arcade Moon Cresta"; cores\Arcades\mooncresta.ZX1
0; "Arcade Jump Shot"; cores\Arcades\jumpshot.ZX1
0; "Arcade Amidar"; cores\Arcades\amidar.ZX1
0; "Arcade Black Hole"; cores\Arcades\blackhole.ZX1
0; "Arcade Crush Roller"; cores\Arcades\crush2.ZX1
0; "Arcade Galaga"; cores\Arcades\galaga.ZX1
0; "Arcade Gorkans"; cores\Arcades\gorkans.ZX1
0; "Arcade Lizard Wizard"; cores\Arcades\lizwiz.ZX1
0; "Arcade Mr. Do"; cores\Arcades\mrdo.ZX1
0; "Arcade Ms. Pacman"; cores\Arcades\mspacman.ZX1
0; "Arcade Orbitron"; cores\Arcades\orbitron.ZX1
0; "Arcade Pac Miner"; cores\Arcades\pacminer.ZX1
0; "Arcade Pacman Plus"; cores\Arcades\pacplus.ZX1

View File

@ -1,3 +1,6 @@
@rem SPDX-FileCopyrightText: 2019 Antonio Villena <_@antoniovillena.es>
@rem
@rem SPDX-FileContributor: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
copy /Y FLASHempty.ZX1 FLASH.ZX1
call addrom
call addcore
call addroms.bat
call addcores.bat

27
modflash/roms.txt Normal file
View File

@ -0,0 +1,27 @@
xdnlh17; "ZX Spectrum 48K"; roms\48.rom
xtdnh1; "ZX Spectrum 128K EN"; roms\128en.rom
xt; "ZX Spectrum +2A EN"; roms\plus3en41.rom
xdlh; "48K Cargando Leches"; roms\leches.rom
xdnlh17; "Inves Spectrum+"; roms\inves.rom
xdnlh17; "Microdigital TK95"; roms\tk95.rom
xdnlh17; "Looking Glass 1.07"; roms\lg18v07.rom
xdnmlh17; "Timex Computer 2048"; roms\tc2048.rom
xmh1; "Timex Computer 2068"; roms\tc2068.rom
xpch1; "Pentagon 128"; roms\pentagon.rom
xdlh17; "Pokemon"; roms\pokemon48.rom
xdnlh17; "Gosh Wonderful v1.33"; roms\gw03v33.rom
xdh1; "SE Basic IV 4.0 Anya"; roms\se.rom
xtdnh1; "Derby+"; roms\derbyp.rom
xt; "DivMMC +3e ES 1.43"; roms\plus3es143.rom
xt; "Next +3e 1.53"; roms\next.rom
xth1ru; "BBC Micro"; roms\BBCBasic.rom
xth1ru; "Jupiter Ace"; roms\jupace.rom
xth1ru; "ZX81"; roms\zx81.rom
xlh17ru; "Manic Miner (1983)"; roms\ManicMiner.rom
xlh17ru; "Jet Set Willy (1984)"; roms\JetSetWilly.rom
xlh17ru; "Jet Pac (1983)"; roms\JetPac.rom
xlh17ru; "Cookie (1983)"; roms\Cookie.rom
xlh17ru; "Tranz Am (1983)"; roms\TranzAm.rom
xlh17ru; "Planetoids (1983)"; roms\Planetoids.rom
xlh17ru; "Space Raiders (1983)"; roms\SpaceRaiders.rom
xlh17ru; "Misco Jones (2013)"; roms\MiscoJones.rom

28
sdk/Makefile Normal file
View File

@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Supported environments:
# * GNU/Linux
# * Windows NT (using MinGW/MSYS/Cygwin/WSL)
include common.mk
ifeq ($(OS),Windows_NT)
SJASMPLUS := sjasmplus.exe
else
SJASMPLUS := sjasmplus
endif
TOOLS:=\
bin/$(SJASMPLUS)
.PHONY: all
all: $(TOOLS)
$(TOOLS): | src/Makefile
$(MAKE) -w -C src ../bin/$(@F)
.PHONY: clean
clean: | src/Makefile
$(MAKE) -w -C src clean

137
sdk/README.md Normal file
View File

@ -0,0 +1,137 @@
# Authors
2021 Ivan Tatarinov <ivan-tat@ya.ru>
# Contributors
No one yet.
# License
This document is under [GNU FDL-1.3 or later](http://www.gnu.org/licenses/fdl-1.3.html) license.
# 1. General information
The source code of all tools is in `src` directory. All compiled binaries are placed in `bin` directory.
## 1.1. Copyright and licensing information for files
We try to follow [REUSE recommendations](https://reuse.software/tutorial/) on how to easely specify copyright and licensing information to our files.
So we added this information to each source file we used according to [SPDX specification](https://spdx.dev/specifications/).
Check it out by using this [reuse-tool](https://github.com/fsfe/reuse-tool).
# 2. Using SDK in GNU environment on Linux, FreeBSD etc.
## 2.1. Build tools
To build all tools type:
```bash
make
```
To build only **sjasmplus** type:
```bash
make bin/sjasmplus
```
## 2.2. Clean tools
To clean everything type:
```bash
make clean
```
## 2.3. Tools usage
These tools are supposed to be used mainly in Makefiles and Bash scripts invoked from Makefiles.
### 2.3.1. In Makefiles
To use these tools in a Makefile just include `common.mk` file at the beginning of one like this:
```make
include ../sdk/common.mk
```
Remember to specify correct relative path to it.
This will set "ZXUNOSDK" environment variable (on first inclusion only) and update your "PATH" environment variable to point to SDK's tools.
These changes are actual for current invocation of "make" utility and all child processes.
### 2.3.2. In Bash scripts
Bash scripts are supposed to be invoked from Makefiles where the correct environment is already prepared by "make" utility so nothing must be done for such scripts.
In other cases you must source `setvars.sh` file in a Bash script like this:
```bash
source ../sdk/setvars.sh
```
or
```bash
. ../sdk/setvars.sh
```
Remember to specify correct relative path to it.
This has the same behavior as the inclusion of `common.mk` file in a Makefile.
# 3. Using SDK in GNU environment on Windows
**NOTE**: compilation of the following tools:
* sjasmplus
on Windows platform is disabled right now because of presence of precompiled binaries of them in repository. They are not deleted when cleaning.
## 3.1. Build tools
To build all tools type:
```bash
make
```
To build only **sjasmplus** type:
```
make bin/sjasmplus.exe
```
## 3.2. Clean tools
To clean everything type:
```bash
make clean
```
## 3.3. Tools usage
### 3.3.1. In Makefiles
The usage is similar to one for GNU/Linux, FreeBSD etc. See [2.3.1](#231-in-makefiles).
### 3.3.2. In Bash scripts
The usage is similar to one for GNU/Linux, FreeBSD etc. See [2.3.2](#232-in-bash-scripts).
# 4. Using SDK on Windows without GNU environment
## 4.1. In batch scripts
To use these tools in a batch script just call `setvars.bat` file at the beginning of one like this:
```batch
call ..\sdk\setvars.bat
```
Remember to specify correct relative path to it.
This will set "ZXUNOSDK" environment variable (on first call only) and update your "PATH" environment variable to point to SDK's tools.
These changes are actual for current invocation of command shell and all child processes.

5
sdk/README.md.license Normal file
View File

@ -0,0 +1,5 @@
SPDX-FileType: TEXT
SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
SPDX-License-Identifier: GFDL-1.3-or-later

View File

@ -0,0 +1,17 @@
SPDX-FileName: sjasmplus.exe
SPDX-FileType: BINARY
SPDX-FileChecksum: SHA1: 0fea7c17d5e83c03466ab99141add32551f16714
SPDX-LicenseConcluded: Zlib
SPDX-LicenseComments: The concluded license is taken from external sources showed in program's banner after program was started.
SPDX-FileCopyrightText: Copyright 2004-2008 by Aprisobal / http://sjasmplus.sf.net / my@aprisobal.by /
SPDX-FileComment: SjASMPlus Z80 Cross-Assembler v1.08 (build 07-04-2016)
SPDX-FileNotice: based on code of SjASM by Sjoerd Mastijn / http://www.xl2s.tk /
SPDX-FileContributor: Modified 2016 AntonioVillena

19
sdk/common.mk Normal file
View File

@ -0,0 +1,19 @@
# Common declarations for Makefiles.
#
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Supported environments:
# * GNU/Linux
# * Windows NT (using MinGW/MSYS/Cygwin/WSL)
ifndef ZXUNOSDK
ZXUNOSDK := $(patsubst %/,%,$(abspath $(dir $(lastword $(MAKEFILE_LIST)))))
PATH := $(ZXUNOSDK)/bin:$(PATH)
export ZXUNOSDK
export PATH
endif

9
sdk/setvars.bat Normal file
View File

@ -0,0 +1,9 @@
@echo off
rem SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
rem
rem SPDX-License-Identifier: GPL-3.0-or-later
if not x%ZXUNOSDK% == x exit /b
set ZXUNOSDK=%~dp0
set ZXUNOSDK=%ZXUNOSDK:~0,-1%
set PATH=%ZXUNOSDK%\bin;%PATH%

10
sdk/setvars.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash -e
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
#
# SPDX-License-Identifier: GPL-3.0-or-later
if [[ "x$ZXUNOSDK" == x ]]; then
ZXUNOSDK=$(dirname $(realpath "$BASH_SOURCE"))
PATH=$ZXUNOSDK/bin:$PATH
export ZXUNOSDK
fi

39
sdk/src/Makefile Normal file
View File

@ -0,0 +1,39 @@
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Supported environments:
# * GNU/Linux
# * Windows NT (using MinGW/MSYS/Cygwin/WSL)
include ../common.mk
ifeq ($(OS),Windows_NT)
SJASMPLUS := sjasmplus.exe
else
SJASMPLUS := sjasmplus
endif
.PHONY: all
all: \
../bin/$(SJASMPLUS)
ifneq ($(OS),Windows_NT)
../bin/$(SJASMPLUS): sjasmplus/build/$(SJASMPLUS)
cp $< $@
sjasmplus/build/$(SJASMPLUS): | sjasmplus sjasmplus.mk
$(MAKE) -w -C sjasmplus -f ../sjasmplus.mk
sjasmplus:
git clone https://github.com/sjasmplus/sjasmplus.git $@
endif
.PHONY: clean
ifeq ($(OS),Windows_NT)
clean:;
else
clean: | sjasmplus sjasmplus.mk
$(MAKE) -w -C sjasmplus -f ../sjasmplus.mk clean
rm -f ../bin/$(SJASMPLUS)
endif

31
sdk/src/sjasmplus.mk Normal file
View File

@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Supported environments:
# * GNU/Linux
# * Windows NT (using MinGW/MSYS/Cygwin/WSL)
#
# Build:
# make -w -C sjasmplus -f ../sjasmplus.mk
# Clean:
# make -w -C sjasmplus -f ../sjasmplus.mk clean
ifeq ($(OS),Windows_NT)
SJASMPLUS := sjasmplus.exe
else
SJASMPLUS := sjasmplus
endif
build/$(SJASMPLUS): | build/Makefile
$(MAKE) -w -C build
build/Makefile: | build
cd build && cmake ..
build:
mkdir -p build
.PHONY: clean
clean: | build/Makefile
$(MAKE) -w -C build clean