From e2ba8458a5cfdfacfaf103e7ba97d610afa6c970 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 29 Aug 2022 16:11:13 -0400 Subject: initial commit --- asmwrapper.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 asmwrapper.sh (limited to 'asmwrapper.sh') diff --git a/asmwrapper.sh b/asmwrapper.sh new file mode 100644 index 0000000..56c8d9a --- /dev/null +++ b/asmwrapper.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +# Execute either the real dasm, or dasm2atasm + atasm. +# If we have dasm on the PATH, use it, otherwise fake it. +# dasm2atasm is NOT perfect! It does however work OK for +# fenders.dasm, fendersdbl.dasm, and loadscreen.dasm. + +# The .syms file format is totally different for dasm and atasm, but +# fenders_offsets.pl can handle either one (adapt for your purposes). + +# If you have dasm, but want to force atasm, pass any non-empty string +# as the second argument to this script. + +# Could also use "dasm2atasm -c" and ca65/ld65 to assemble, but I can't +# seem to get ca65 or ld65 to emit a symbol file or listing (the -l +# option doesn't work; the -m option doesn't do what I expect), so +# I don't know any way to extract the OFFSET_* labels from ca65's output. + +if [ -z "$1" ]; then + echo "$0: missing argument" + exit 1 +fi + +if [ -n "`which dasm 2>/dev/null`" -a -z "$2" ] ; then + exec dasm $1.dasm -f3 -s$1.syms -o$1.bin +elif [ -n "`which atasm 2>/dev/null`" ]; then + ln -sf equates.inc equates.m65 + perl dasm2atasm $1.dasm $1.atasm + exec atasm -r -s -o$1.bin $1.atasm > $1.syms +else + echo "$0: you need either dasm or atasm on your PATH" + exit 1 +fi + +exit 0 -- cgit v1.2.3