1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-11-28 12:51:10 +00:00

Make loadngo.sh able to handle both C64 (x64) and VIC-20 (xvic).

This commit is contained in:
Chris Pressey 2018-03-07 13:27:57 +00:00
parent 72efecbb1a
commit 95fb2bb8f6
3 changed files with 44 additions and 19 deletions

View File

@ -7,3 +7,6 @@ They are not meant to be specific to any architecture, but
many do assume the existence of a routine at 65490 which many do assume the existence of a routine at 65490 which
outputs the value of the accumulator as an ASCII character, outputs the value of the accumulator as an ASCII character,
simply for the purposes of producing some observable output. simply for the purposes of producing some observable output.
(This is an address of a KERNAL routine which does this
on both the Commodore 64 and the Commodore VIC-20, so these
sources should be usable on these architectures.)

View File

@ -1,19 +0,0 @@
#!/bin/sh
if [ "X$X64" = "X" ]; then
X64=x64
fi
SRC=$1
if [ "X$1" = "X" ]; then
echo "Usage: ./loadngo-c64.sh <source.60p>"
exit 1
fi
OUT=/tmp/a-out.prg
bin/sixtypical --traceback --prelude=c64 $SRC > $OUT || exit 1
ls -la $OUT
if [ -e vicerc ]; then
$X64 -config vicerc $OUT
else
$X64 $OUT
fi
rm -f $OUT

41
loadngo.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/sh
usage="Usage: loadngo.sh (c64|vic20) [--dry-run] <source.60p>"
arch="$1"
shift 1
if [ "X$arch" = "Xc64" ]; then
prelude='c64'
if [ -e vicerc ]; then
emu="x64 -config vicerc"
else
emu="x64"
fi
elif [ "X$arch" = "Xvic20" ]; then
prelude='vic20'
if [ -e vicerc ]; then
emu="xvic -config vicerc"
else
emu="xvic"
fi
else
echo $usage && exit 1
fi
if [ "X$1" = "X--dry-run" ]; then
shift 1
emu='echo'
fi
src="$1"
if [ "X$src" = "X" ]; then
echo $usage && exit 1
fi
### do it ###
out=/tmp/a-out.prg
bin/sixtypical --traceback --prelude=$prelude $src > $out || exit 1
ls -la $out
$emu $out
rm -f $out