From: Oliver Schmidt
Date: Thu, 29 Mar 2018 22:07:56 +0000 (+0200)
Subject: Added HGR and DHGR slide show programs.
X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a2a486882585b0e2c3c4ecbc5ea19afda015289f;p=cc65
Added HGR and DHGR slide show programs.
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.
---
diff --git a/testcode/lib/apple2/Makefile b/testcode/lib/apple2/Makefile
index 87dadcbe7..9d551aa62 100644
--- a/testcode/lib/apple2/Makefile
+++ b/testcode/lib/apple2/Makefile
@@ -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
+#include
+#include
+#include
+#include
+#include
+#include
+
+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
index 000000000..dc3750e66
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
index 000000000..af332edbe
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
index 000000000..5d839b5fa
--- /dev/null
+++ b/testcode/lib/apple2/hgrshow.c
@@ -0,0 +1,37 @@
+// cl65 -t apple2 --start-addr 0x4000 hgrshow.c
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+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
index 000000000..925df6e41
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
index 000000000..2024a7596
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
index 000000000..8812c4b2d
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
index 000000000..d18fd83f0
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
index 000000000..4886227c2
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
index 000000000..9d3cb4c85
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
index 000000000..2405e2409
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
index 2405e2409..000000000
Binary files a/testcode/lib/apple2/werner.pic and /dev/null differ
diff --git a/testcode/lib/apple2/werner.s b/testcode/lib/apple2/werner.s
index 6456ade13..f9200f694 100644
--- a/testcode/lib/apple2/werner.s
+++ b/testcode/lib/apple2/werner.s
@@ -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
index 000000000..074ff178d
Binary files /dev/null and b/testcode/lib/apple2/winston.hgr differ