]> git.sur5r.net Git - cc65/commitdiff
Added HGR and DHGR slide show programs.
authorOliver Schmidt <ol.sc@web.de>
Thu, 29 Mar 2018 22:07:56 +0000 (00:07 +0200)
committerOliver Schmidt <ol.sc@web.de>
Thu, 29 Mar 2018 22:08:26 +0000 (00:08 +0200)
The DHGR program is sort of a hack as it first switches to double (aka 80 col) text mode to prepare for double graphics mode. Therefore only one additional soft switch access is necessary after using TGI to generally switch to hires.

18 files changed:
testcode/lib/apple2/Makefile
testcode/lib/apple2/astronaut.hgr [new file with mode: 0644]
testcode/lib/apple2/catface.dhgr [new file with mode: 0644]
testcode/lib/apple2/chips.hgr [new file with mode: 0644]
testcode/lib/apple2/dhgrshow.c [new file with mode: 0644]
testcode/lib/apple2/gatsby.dhgr [new file with mode: 0644]
testcode/lib/apple2/girl.dhgr [new file with mode: 0644]
testcode/lib/apple2/hgrshow.c [new file with mode: 0644]
testcode/lib/apple2/macrometer.hgr [new file with mode: 0644]
testcode/lib/apple2/mariner.hgr [new file with mode: 0644]
testcode/lib/apple2/monarch.dhgr [new file with mode: 0644]
testcode/lib/apple2/rose.hgr [new file with mode: 0644]
testcode/lib/apple2/superman.dhgr [new file with mode: 0644]
testcode/lib/apple2/venice.dhgr [new file with mode: 0644]
testcode/lib/apple2/werner.hgr [new file with mode: 0644]
testcode/lib/apple2/werner.pic [deleted file]
testcode/lib/apple2/werner.s
testcode/lib/apple2/winston.hgr [new file with mode: 0644]

index 87dadcbe741e8fd11e61d3e3c802e139da7484dd..9d551aa622b4d20f5f1baa081f00c4524049e2bb 100644 (file)
@@ -1,12 +1,37 @@
 # For this one see https://applecommander.github.io/
 AC ?= ac.jar
 
-CL      = cl65
-CLFLAGS = -t apple2 -C apple2-hgr.cfg -Oirs
+CL ?= cl65
 
-hgrtest.dsk: hgrtest
+all: hgr.dsk dhgr.dsk
+
+hgr.dsk: hgrshow hgrtest
        cp prodos.dsk $@
-       java -jar $(AC) -cc65 $@ hgrtest bin <hgrtest
+       java -jar $(AC) -as $@ hgrshow <hgrshow
+       java -jar $(AC) -as $@ hgrtest <hgrtest
+       java -jar $(AC) -p  $@ astronaut.hgr  bin 0x2000 <astronaut.hgr
+       java -jar $(AC) -p  $@ chips.hgr      bin 0x2000 <chips.hgr
+       java -jar $(AC) -p  $@ macrometer.hgr bin 0x2000 <macrometer.hgr
+       java -jar $(AC) -p  $@ mariner.hgr    bin 0x2000 <mariner.hgr
+       java -jar $(AC) -p  $@ rose.hgr       bin 0x2000 <rose.hgr
+       java -jar $(AC) -p  $@ werner.hgr     bin 0x2000 <werner.hgr
+       java -jar $(AC) -p  $@ winston.hgr    bin 0x2000 <winston.hgr
+
+hgrshow: hgrshow.c
+       $(CL) -Oirs -t apple2 --start-addr 0x4000 -m hgrshow.map $^
 
 hgrtest: hgrtest.c werner.s
-       $(CL) $(CLFLAGS) -m hgrtest.map $^
+       $(CL) -Oirs -t apple2 -C apple2-hgr.cfg -m hgrtest.map $^
+
+dhgr.dsk: dhgrshow
+       cp prodos.dsk $@
+       java -jar $(AC) -as $@ dhgrshow <dhgrshow
+       java -jar $(AC) -p  $@ catface.dhgr  bin 0x2000 <catface.dhgr
+       java -jar $(AC) -p  $@ gatsby.dhgr   bin 0x2000 <gatsby.dhgr
+       java -jar $(AC) -p  $@ girl.dhgr     bin 0x2000 <girl.dhgr
+       java -jar $(AC) -p  $@ monarch.dhgr  bin 0x2000 <monarch.dhgr
+       java -jar $(AC) -p  $@ superman.dhgr bin 0x2000 <superman.dhgr
+       java -jar $(AC) -p  $@ venice.dhgr   bin 0x2000 <venice.dhgr
+
+dhgrshow: dhgrshow.c
+       $(CL) -Oirs -t apple2enh --start-addr 0x4000 -m dhgrshow.map $^
diff --git a/testcode/lib/apple2/astronaut.hgr b/testcode/lib/apple2/astronaut.hgr
new file mode 100644 (file)
index 0000000..f19f009
Binary files /dev/null and b/testcode/lib/apple2/astronaut.hgr differ
diff --git a/testcode/lib/apple2/catface.dhgr b/testcode/lib/apple2/catface.dhgr
new file mode 100644 (file)
index 0000000..1f373d9
Binary files /dev/null and b/testcode/lib/apple2/catface.dhgr differ
diff --git a/testcode/lib/apple2/chips.hgr b/testcode/lib/apple2/chips.hgr
new file mode 100644 (file)
index 0000000..c8302db
Binary files /dev/null and b/testcode/lib/apple2/chips.hgr differ
diff --git a/testcode/lib/apple2/dhgrshow.c b/testcode/lib/apple2/dhgrshow.c
new file mode 100644 (file)
index 0000000..147ee01
--- /dev/null
@@ -0,0 +1,45 @@
+// cl65 -t apple2enh --start-addr 0x4000 dhgrshow.c
+
+#include <tgi.h>
+#include <conio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <peekpoke.h>
+
+void main (void)
+{
+    unsigned old;
+    DIR *dir;
+    struct dirent *ent;
+
+    old = videomode (VIDEOMODE_80x24);
+    tgi_install (a2e_hi_tgi);
+    tgi_init ();
+    POKE (0xC05E, 0);
+
+    dir = opendir (".");
+    while (ent = readdir (dir)) {
+        char *ext;
+        int hgr;
+
+        ext = strrchr (ent->d_name, '.');
+        if (!ext || strcasecmp (ext, ".dhgr"))
+            continue;
+
+        hgr = open(ent->d_name, O_RDONLY);
+        POKE (0xC055, 0);
+        read(hgr, (void*)0x2000, 0x2000);
+        POKE (0xC054, 0);
+        read(hgr, (void*)0x2000, 0x2000);
+        close(hgr);
+
+        if (cgetc () == '\r')
+            break;
+    }
+    closedir (dir);
+
+    tgi_uninstall ();
+    videomode (old);
+}
diff --git a/testcode/lib/apple2/gatsby.dhgr b/testcode/lib/apple2/gatsby.dhgr
new file mode 100644 (file)
index 0000000..dc3750e
Binary files /dev/null and b/testcode/lib/apple2/gatsby.dhgr differ
diff --git a/testcode/lib/apple2/girl.dhgr b/testcode/lib/apple2/girl.dhgr
new file mode 100644 (file)
index 0000000..af332ed
Binary files /dev/null and b/testcode/lib/apple2/girl.dhgr differ
diff --git a/testcode/lib/apple2/hgrshow.c b/testcode/lib/apple2/hgrshow.c
new file mode 100644 (file)
index 0000000..5d839b5
--- /dev/null
@@ -0,0 +1,37 @@
+// cl65 -t apple2 --start-addr 0x4000 hgrshow.c
+
+#include <tgi.h>
+#include <conio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <dirent.h>
+
+void main (void)
+{
+    DIR *dir;
+    struct dirent *ent;
+
+    tgi_install (a2_hi_tgi);
+    tgi_init ();
+
+    dir = opendir (".");
+    while (ent = readdir (dir)) {
+        char *ext;
+        int hgr;
+
+        ext = strrchr (ent->d_name, '.');
+        if (!ext || strcasecmp (ext, ".hgr"))
+            continue;
+
+        hgr = open(ent->d_name, O_RDONLY);
+        read(hgr, (void*)0x2000, 0x2000);
+        close(hgr);
+
+        if (cgetc () == '\r')
+            break;
+    }
+    closedir (dir);
+
+    tgi_uninstall ();
+}
diff --git a/testcode/lib/apple2/macrometer.hgr b/testcode/lib/apple2/macrometer.hgr
new file mode 100644 (file)
index 0000000..925df6e
Binary files /dev/null and b/testcode/lib/apple2/macrometer.hgr differ
diff --git a/testcode/lib/apple2/mariner.hgr b/testcode/lib/apple2/mariner.hgr
new file mode 100644 (file)
index 0000000..2024a75
Binary files /dev/null and b/testcode/lib/apple2/mariner.hgr differ
diff --git a/testcode/lib/apple2/monarch.dhgr b/testcode/lib/apple2/monarch.dhgr
new file mode 100644 (file)
index 0000000..8812c4b
Binary files /dev/null and b/testcode/lib/apple2/monarch.dhgr differ
diff --git a/testcode/lib/apple2/rose.hgr b/testcode/lib/apple2/rose.hgr
new file mode 100644 (file)
index 0000000..d18fd83
Binary files /dev/null and b/testcode/lib/apple2/rose.hgr differ
diff --git a/testcode/lib/apple2/superman.dhgr b/testcode/lib/apple2/superman.dhgr
new file mode 100644 (file)
index 0000000..4886227
Binary files /dev/null and b/testcode/lib/apple2/superman.dhgr differ
diff --git a/testcode/lib/apple2/venice.dhgr b/testcode/lib/apple2/venice.dhgr
new file mode 100644 (file)
index 0000000..9d3cb4c
Binary files /dev/null and b/testcode/lib/apple2/venice.dhgr differ
diff --git a/testcode/lib/apple2/werner.hgr b/testcode/lib/apple2/werner.hgr
new file mode 100644 (file)
index 0000000..2405e24
Binary files /dev/null and b/testcode/lib/apple2/werner.hgr differ
diff --git a/testcode/lib/apple2/werner.pic b/testcode/lib/apple2/werner.pic
deleted file mode 100644 (file)
index 2405e24..0000000
Binary files a/testcode/lib/apple2/werner.pic and /dev/null differ
index 6456ade137437bcabc1b95f9396bef36c494d4bd..f9200f69496e3ef5d19a9f4c6089eca513d6df47 100644 (file)
@@ -1,2 +1,2 @@
 .segment "HGR"
-.incbin "werner.pic"
+.incbin "werner.hgr"
diff --git a/testcode/lib/apple2/winston.hgr b/testcode/lib/apple2/winston.hgr
new file mode 100644 (file)
index 0000000..074ff17
Binary files /dev/null and b/testcode/lib/apple2/winston.hgr differ