Skip to content

Commit

Permalink
libticalcs: switch all TI-Z80 DBUS ROM dumpers from spasm to pasmo, w…
Browse files Browse the repository at this point in the history
…hich has been packaged by Debian for a long time, so that more ROM dumpers can be integrated in Debian packages.

I tried to use other Z80 cross-assemblers packaged by Debian, but:
* z80asm, SDCC's sdasz80 and crasm do not support defining stuff through the CLI, which would require annoying workarounds;
* binutils-z80's z80-unknown-coff-as doesn't handle .org the same way as other assemblers, and the multiple section + ldscript workaround does not work either, because as forbids + or - between symbols from different sections (even if they're both ".text.X" sections)...
No cross-assembler packaged by Debian supports eZ80 instructions, so the TI-eZ80 ROM dumper shall remain built by spasm.

Signed-off-by: Lionel Debroux <[email protected]>
  • Loading branch information
debrouxl committed Mar 20, 2020
1 parent 53df032 commit 7cfc728
Show file tree
Hide file tree
Showing 19 changed files with 1,062 additions and 851 deletions.
24 changes: 21 additions & 3 deletions libticalcs/trunk/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,15 @@ AC_ARG_ENABLE([builtin-rom-dumpers],
[], [enable_builtin_rom_dumpers=yes])

AC_ARG_VAR([SPASM], [SPASM Z80 assembler])
AC_ARG_VAR([PASMO], [PASMO Z80 assembler])
AC_ARG_VAR([TIPACK], [Tool for creating TI variable files])
have_spasm=no
have_pasmo=no
have_tipack=no
have_tigcc=no
have_m68klinuxgnu=no
: ${SPASM=spasm}
: ${PASMO=pasmo}
: ${TIPACK=tipack}

if test "x$enable_builtin_rom_dumpers" != "xyes" ; then
Expand All @@ -226,7 +229,22 @@ EOF
fi
AC_MSG_RESULT([$have_spasm])

if test "x$have_spasm" = "xyes" ; then
AC_MSG_CHECKING([whether $PASMO works])
cat >conftest.asm <<EOF
macro B_CALL, arg
db 0EFh
dw arg
endm
org 9d95h
B_CALL 4972h
ret
EOF
if "$PASMO" conftest.asm conftest.bin >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
have_pasmo=yes
fi
AC_MSG_RESULT([$have_pasmo])

if test "x$have_spasm$have_pasmo" = "xyesyes" ; then
AC_MSG_CHECKING([whether $TIPACK works])
if "$TIPACK" conftest.bin -p -o conftest.8xp >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
have_tipack=yes
Expand Down Expand Up @@ -266,12 +284,12 @@ EOF
AC_MSG_RESULT([$have_m68klinuxgnu])
fi

if test "x$have_spasm$have_tipack" = "xyesyes" ; then
if test "x$have_spasm$have_pasmo$have_tipack" = "xyesyesyes" ; then
build_z80_rom_dumpers=yes
else
build_z80_rom_dumpers=no
if test "x$enable_builtin_rom_dumpers" = "xno" ; then
AC_MSG_FAILURE([spasm and/or tipack are not installed or are not usable.])
AC_MSG_FAILURE([spasm, pasmo and/or tipack are not installed or are not usable.])
fi
fi

Expand Down
13 changes: 8 additions & 5 deletions libticalcs/trunk/src/romdump_84p_usb/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
EXTRA_DIST = romdump.z80
CLEANFILES = *.bin *.lst *.8xp

SPASMFLAGS = -N -T
PASMOFLAGS =

rom_dumpers = dump84p.8xp dump84pcu.8xp
if BUILD_Z80_ROM_DUMPERS
all: dump84p.8xp dump84pcu.8xp
all: $(rom_dumpers)
endif

dump84p.bin: romdump.z80
$(SPASM) $(SPASMFLAGS) -A -DTI84P $(srcdir)/romdump.z80 dump84p.bin
$(PASMO) $(PASMOFLAGS) -E TI84P $(srcdir)/romdump.z80 dump84p.bin

dump84pcu.bin: romdump.z80
$(PASMO) $(PASMOFLAGS) -E TI84PC $(srcdir)/romdump.z80 dump84pcu.bin

dump84p.8xp: dump84p.bin
$(TIPACK) -n 'ROMDUMP' dump84p.bin -p -o dump84p.8xp

dump84pcu.bin: romdump.z80
$(SPASM) $(SPASMFLAGS) -A -DTI84PC $(srcdir)/romdump.z80 dump84pcu.bin
dump84pcu.8xp: dump84pcu.bin
$(TIPACK) -n 'ROMDUMP' dump84pcu.bin -p -o dump84pcu.8xp
Loading

0 comments on commit 7cfc728

Please sign in to comment.