From 3e11d7122cffa5069e21f6011f4d88b3dbe3b94b Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Wed, 5 Sep 2018 15:20:44 +0100 Subject: [PATCH] Add apple2 target to loadngo.sh, apple2 example program. --- eg/apple2/print.60p | 20 ++++++++++++++++++++ loadngo.sh | 17 ++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 eg/apple2/print.60p diff --git a/eg/apple2/print.60p b/eg/apple2/print.60p new file mode 100644 index 0000000..aa72441 --- /dev/null +++ b/eg/apple2/print.60p @@ -0,0 +1,20 @@ +// Write ">AB>" to "standard output" + +routine cout + inputs a + trashes a + @ $FDED + +routine main + inputs a + trashes a, z, n +{ + ld a, 62 + call cout + ld a, 65 + call cout + ld a, 66 + call cout + ld a, 62 + call cout +} diff --git a/loadngo.sh b/loadngo.sh index e196167..79df088 100755 --- a/loadngo.sh +++ b/loadngo.sh @@ -1,6 +1,6 @@ #!/bin/sh -usage="Usage: loadngo.sh (c64|vic20|atari2600) [--dry-run] " +usage="Usage: loadngo.sh (c64|vic20|atari2600|apple2) [--dry-run] " arch="$1" shift 1 @@ -21,6 +21,21 @@ elif [ "X$arch" = "Xvic20" ]; then elif [ "X$arch" = "Xatari2600" ]; then output_format='atari2600-cart' emu='stella' +elif [ "X$arch" = "Xapple2" ]; then + src="$1" + out=/tmp/a-out.bin + bin/sixtypical --traceback --origin=0x2000 --output-format=raw $src > $out + ls -la $out + cp ~/scratchpad/linapple/res/Master.dsk sixtypical.dsk + # TODO: replace HELLO with something that does like + # BLOAD "PROG" + # CALL 8192 + # (not BRUN because it does not always return to BASIC afterwards not sure why) + a2rm sixtypical.dsk PROG + a2in B sixtypical.dsk PROG $out + linapple -d1 sixtypical.dsk -autoboot + rm -f $out sixtypical.dsk + exit 0 else echo $usage && exit 1 fi