;
; 10.09.2001
;
-; Plus4 and GEOS 1.1 detection by
-; Marco van den Heuvel, 2010-02-02
+; Plus4, Gateway, MP3 and GEOS 1.1 detection by
+; Marco van den Heuvel, 2018-02-07
;
; unsigned char get_ostype (void);
and #%11110000
cmp #$10
beq geos10
+ lda gatewayFlag
+ cmp #$41
+ beq gateway
+ lda mp3Flag
+ cmp #$4d
+ beq megapatch3
lda c128Flag ; we're on at least 2.0
cmp #$18
beq geos_on_plus4
geos_on_plus4:
lda #$04
rts
+gateway:
+ lda #$08
+ ora c128Flag
+ rts
+megapatch3:
+ lda #$03
+ ora c128Flag
+ rts
_get_tv:
jsr _get_ostype
--- /dev/null
+#include <geos.h>
+#include <conio.h>
+
+// Let's define the window we're operating
+struct window wholeScreen = {0, SC_PIX_HEIGHT-1, 0, SC_PIX_WIDTH-1};
+
+
+void main (void)
+{
+ unsigned char os = get_ostype();
+ unsigned char *machine = NULL;
+ unsigned char *version = NULL;
+ unsigned char good = 1;
+
+ SetPattern(0);
+ InitDrawWindow(&wholeScreen);
+ Rectangle();
+ gotoxy(0, 4);
+ if (os == GEOS4) {
+ machine = "plus4";
+ version = "GeOS v3.5";
+ } else {
+ if ((os & GEOS128) == GEOS128) {
+ machine = "c128";
+ } else {
+ machine = "c64";
+ }
+ os &= 0x7f;
+ if (os == GEOS_V10) {
+ version = "GeOS v1.0";
+ } else if (os == GEOS_V11) {
+ version = "GeOS v1.1";
+ } else if (os == GEOS_V12) {
+ version = "GeOS v1.2";
+ } else if (os == GEOS_V20) {
+ version = "GeOS v2.0";
+ } else if (os == MEGAPATCH3) {
+ version = "MegaPatch 3";
+ } else if (os == GATEWAY) {
+ version = "GateWay";
+ } else if ((os & WHEELS) == WHEELS) {
+ version = "Wheels";
+ } else {
+ version = "Unknown GeOS version";
+ good = 0;
+ }
+ }
+
+ if (good) {
+ cprintf("%s (%s)", version, machine);
+ } else {
+ cprintf("%s (%s) (%d)", version, machine, os);
+ }
+
+ Sleep(10*50);
+
+ return;
+}
--- /dev/null
+
+; this is the resource file for geosver.c, a GEOS application example
+
+HEADER APPLICATION "geosver" "GeOSver" "V1.0" {
+dostype USR
+author "Marco van den Heuvel"
+info "This is a C prog compiled with cc65 and GEOSLib."
+}