Make loadngo.sh able to handle both C64 (x64) and VIC-20 (xvic).
Chris Pressey
4 years ago
6 | 6 |
many do assume the existence of a routine at 65490 which
|
7 | 7 |
outputs the value of the accumulator as an ASCII character,
|
8 | 8 |
simply for the purposes of producing some observable output.
|
|
9 |
(This is an address of a KERNAL routine which does this
|
|
10 |
on both the Commodore 64 and the Commodore VIC-20, so these
|
|
11 |
sources should be usable on these architectures.)
|
0 | |
#!/bin/sh
|
1 | |
|
2 | |
if [ "X$X64" = "X" ]; then
|
3 | |
X64=x64
|
4 | |
fi
|
5 | |
SRC=$1
|
6 | |
if [ "X$1" = "X" ]; then
|
7 | |
echo "Usage: ./loadngo-c64.sh <source.60p>"
|
8 | |
exit 1
|
9 | |
fi
|
10 | |
OUT=/tmp/a-out.prg
|
11 | |
bin/sixtypical --traceback --prelude=c64 $SRC > $OUT || exit 1
|
12 | |
ls -la $OUT
|
13 | |
if [ -e vicerc ]; then
|
14 | |
$X64 -config vicerc $OUT
|
15 | |
else
|
16 | |
$X64 $OUT
|
17 | |
fi
|
18 | |
rm -f $OUT
|
|
0 |
#!/bin/sh
|
|
1 |
|
|
2 |
usage="Usage: loadngo.sh (c64|vic20) [--dry-run] <source.60p>"
|
|
3 |
|
|
4 |
arch="$1"
|
|
5 |
shift 1
|
|
6 |
if [ "X$arch" = "Xc64" ]; then
|
|
7 |
prelude='c64'
|
|
8 |
if [ -e vicerc ]; then
|
|
9 |
emu="x64 -config vicerc"
|
|
10 |
else
|
|
11 |
emu="x64"
|
|
12 |
fi
|
|
13 |
elif [ "X$arch" = "Xvic20" ]; then
|
|
14 |
prelude='vic20'
|
|
15 |
if [ -e vicerc ]; then
|
|
16 |
emu="xvic -config vicerc"
|
|
17 |
else
|
|
18 |
emu="xvic"
|
|
19 |
fi
|
|
20 |
else
|
|
21 |
echo $usage && exit 1
|
|
22 |
fi
|
|
23 |
|
|
24 |
if [ "X$1" = "X--dry-run" ]; then
|
|
25 |
shift 1
|
|
26 |
emu='echo'
|
|
27 |
fi
|
|
28 |
|
|
29 |
src="$1"
|
|
30 |
if [ "X$src" = "X" ]; then
|
|
31 |
echo $usage && exit 1
|
|
32 |
fi
|
|
33 |
|
|
34 |
### do it ###
|
|
35 |
|
|
36 |
out=/tmp/a-out.prg
|
|
37 |
bin/sixtypical --traceback --prelude=$prelude $src > $out || exit 1
|
|
38 |
ls -la $out
|
|
39 |
$emu $out
|
|
40 |
rm -f $out
|