]> git.sur5r.net Git - cc65/blob - samples/geos/geosver.c
673b7e1f712caf2d08956379759edba564e62252
[cc65] / samples / geos / geosver.c
1 #include <geos.h>
2 #include <conio.h>
3
4 // Let's define the window we're operating
5 struct window wholeScreen = {0, SC_PIX_HEIGHT-1, 0, SC_PIX_WIDTH-1};
6
7
8 void main (void)
9 {
10     unsigned char os = get_ostype();
11     unsigned char *machine = NULL;
12     unsigned char *version = NULL;
13     unsigned char good = 1;
14
15     SetPattern(0);
16     InitDrawWindow(&wholeScreen);
17     Rectangle();
18     gotoxy(0, 4);
19     if (os == GEOS4) {
20         machine = "plus4";
21         version = "GeOS v3.5";
22     } else {
23         if ((os & GEOS128) == GEOS128) {
24             machine = "c128";
25         } else {
26             machine = "c64";
27         }
28         os &= 0x7f;
29         if (os == GEOS_V10) {
30             version = "GeOS v1.0";
31         } else if (os == GEOS_V11) {
32             version = "GeOS v1.1";
33         } else if (os == GEOS_V12) {
34             version = "GeOS v1.2";
35         } else if (os == GEOS_V20) {
36             version = "GeOS v2.0";
37         } else if (os == MEGAPATCH3) {
38             version = "MegaPatch 3";
39         } else if (os == GATEWAY) {
40             version = "GateWay";
41         } else if ((os & WHEELS) == WHEELS) {
42             version = "Wheels";
43         } else {
44             version = "Unknown GeOS version";
45             good = 0;
46         }
47     }
48
49     if (good) {
50         cprintf("%s (%s)", version, machine);
51     } else {
52         cprintf("%s (%s) (%d)", version, machine, os);
53     }
54
55     Sleep(10*50);
56              
57     return;
58 }