]> git.sur5r.net Git - cc65/blob - samples/geos/geosver.c
Merge pull request #834 from jedeoric/master
[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_V13) {
36             version = "GEOS v1.3";
37         } else if (os == GEOS_V15) {
38             version = "GEOS v1.5";
39         } else if (os == GEOS_V20) {
40             version = "GEOS v2.0";
41         } else if (os == MEGAPATCH3) {
42             version = "MegaPatch 3";
43         } else if (os == GATEWAY) {
44             version = "GateWay";
45         } else if ((os & WHEELS) == WHEELS) {
46             version = "Wheels";
47         } else {
48             version = "Unknown GEOS version";
49             good = 0;
50         }
51     }
52
53     if (good) {
54         cprintf("%s (%s)", version, machine);
55     } else {
56         cprintf("%s (%s) (%d)", version, machine, os);
57     }
58
59     Sleep(10*50);
60              
61     return;
62 }