Declare that --run replaces loadngo.sh, and remove the latter.
Chris Pressey
3 years ago
21 | 21 |
* Refactored internal data structures that represent
|
22 | 22 |
references and types to be immutable `namedtuple`s.
|
23 | 23 |
* Added `--dump-exit-contexts` option to `sixtypical`.
|
|
24 |
* Added a new `--run` option to `sixtypical`, which replaces
|
|
25 |
the old `loadngo.sh` script.
|
24 | 26 |
|
25 | 27 |
0.18
|
26 | 28 |
----
|
19 | 19 |
|
20 | 20 |
If you have the [VICE][] emulator installed, you can run
|
21 | 21 |
|
22 | |
./loadngo.sh c64 eg/c64/hearts.60p
|
|
22 |
sixtypical --output-format=c64-basic-prg --run eg/c64/hearts.60p
|
23 | 23 |
|
24 | 24 |
and it will compile the [hearts.60p source code](eg/c64/hearts.60p) and
|
25 | 25 |
automatically start it in the `x64` emulator, and you should see:
|
26 | 26 |
|
27 | 27 |

|
28 | 28 |
|
29 | |
You can try the `loadngo.sh` script on other sources in the `eg` directory
|
|
29 |
You can try `sixtypical --run` on other sources in the `eg` directory
|
30 | 30 |
tree, which contains more extensive examples, including an entire
|
31 | 31 |
game(-like program); see [eg/README.md](eg/README.md) for a listing.
|
32 | 32 |
|
|
0 |
This directory contains SixtyPical example programs
|
|
1 |
specifically for the Apple II series of computers.
|
|
2 |
|
|
3 |
See the [README in the parent directory](../README.md) for
|
|
4 |
more information on these example programs.
|
|
5 |
|
|
6 |
Note that `sixtypical` does not currently support "load
|
|
7 |
and go" execution of these programs, because constructing
|
|
8 |
an Apple II disk image file on the fly is not something
|
|
9 |
it can currently do. If you have the linapple sources
|
|
10 |
checked out, and the a2tools available, you could do
|
|
11 |
something like this:
|
|
12 |
|
|
13 |
bin/sixtypical --traceback --origin=0x2000 --output-format=raw eg/apple2/prog.60p --output prog.bin
|
|
14 |
cp /path/to/linapple/res/Master.dsk sixtypical.dsk
|
|
15 |
a2rm sixtypical.dsk PROG
|
|
16 |
a2in B sixtypical.dsk PROG prog.bin
|
|
17 |
linapple -d1 sixtypical.dsk -autoboot
|
|
18 |
|
|
19 |
and then enter
|
|
20 |
|
|
21 |
BLOAD PROG
|
|
22 |
CALL 8192
|
|
23 |
|
|
24 |
Ideally you could
|
|
25 |
|
|
26 |
BRUN PROG
|
|
27 |
|
|
28 |
But that does not always return to BASIC and I'm not sure why.
|
0 | |
#!/bin/sh
|
1 | |
|
2 | |
usage="Usage: loadngo.sh (c64|vic20|atari2600|apple2) [--dry-run] <source.60p>"
|
3 | |
|
4 | |
arch="$1"
|
5 | |
shift 1
|
6 | |
if [ "X$arch" = "Xc64" ]; then
|
7 | |
output_format='c64-basic-prg'
|
8 | |
emu="x64 -config vicerc"
|
9 | |
elif [ "X$arch" = "Xvic20" ]; then
|
10 | |
output_format='vic20-basic-prg'
|
11 | |
emu="xvic -config vicerc"
|
12 | |
elif [ "X$arch" = "Xatari2600" ]; then
|
13 | |
output_format='atari2600-cart'
|
14 | |
emu='stella'
|
15 | |
elif [ "X$arch" = "Xapple2" ]; then
|
16 | |
src="$1"
|
17 | |
out=/tmp/a-out.bin
|
18 | |
bin/sixtypical --traceback --origin=0x2000 --output-format=raw $src --output $out || exit 1
|
19 | |
ls -la $out
|
20 | |
cp ~/scratchpad/linapple/res/Master.dsk sixtypical.dsk
|
21 | |
# TODO: replace HELLO with something that does like
|
22 | |
# BLOAD "PROG"
|
23 | |
# CALL 8192
|
24 | |
# (not BRUN because it does not always return to BASIC afterwards not sure why)
|
25 | |
a2rm sixtypical.dsk PROG
|
26 | |
a2in B sixtypical.dsk PROG $out
|
27 | |
linapple -d1 sixtypical.dsk -autoboot
|
28 | |
rm -f $out sixtypical.dsk
|
29 | |
exit 0
|
30 | |
else
|
31 | |
echo $usage && exit 1
|
32 | |
fi
|
33 | |
|
34 | |
if [ "X$1" = "X--dry-run" ]; then
|
35 | |
shift 1
|
36 | |
emu='echo'
|
37 | |
fi
|
38 | |
|
39 | |
src="$1"
|
40 | |
if [ "X$src" = "X" ]; then
|
41 | |
echo $usage && exit 1
|
42 | |
fi
|
43 | |
|
44 | |
### do it ###
|
45 | |
|
46 | |
out=/tmp/a-out.prg
|
47 | |
bin/sixtypical --traceback --output-format=$output_format $src --output $out || exit 1
|
48 | |
ls -la $out
|
49 | |
$emu $out
|
50 | |
rm -f $out
|