From 3f043c5d925966823c36d893a1e689407dc8c627 Mon Sep 17 00:00:00 2001 From: cpg Date: Mon, 17 Jul 2000 00:35:12 +0000 Subject: [PATCH] test program for get_ostype() function git-svn-id: svn://svn.cc65.org/cc65/trunk@163 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- testcode/lib/atari/ostype.c | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 testcode/lib/atari/ostype.c diff --git a/testcode/lib/atari/ostype.c b/testcode/lib/atari/ostype.c new file mode 100644 index 000000000..33f23f0f0 --- /dev/null +++ b/testcode/lib/atari/ostype.c @@ -0,0 +1,44 @@ +/* + * testprogram for get_ostype() function + * + * 17-Jul-2000, cpg@aladdin.de + */ + +#include +#include + +int main(void) +{ + unsigned int t; + unsigned char palntsc; + unsigned char *rev; + unsigned char minor; + unsigned char c; + + t = get_ostype(); /* get computer type */ + + palntsc = (t & AT_OS_PALNTSC) >> 3; + minor = (t & AT_OS_TYPE_MINOR) >> 5; + if (palntsc != AT_OS_PAL) palntsc = 0; /* 1 - PAL; 0 - NTSC */ + switch(t & AT_OS_TYPE_MAIN) { + case AT_OS_UNKNOWN: + default: + printf("unknown system type !!\n"); + break; + case AT_OS_400800: + if (minor == 1) rev = "A"; + else rev = "B"; + printf("it's a 400/800, %s, Rev. %s\n",palntsc ? "PAL" : "NTSC",rev); + break; + case AT_OS_1200XL: + if (minor == 1) rev = "10"; + else rev = "11"; + printf("it's a 1200XL, %s, Rev. %s\n",palntsc ? "PAL" : "NTSC",rev); + break; + case AT_OS_XLXE: + printf("is'a a XL/XE, %s, Rev. %d\n",palntsc ? "PAL" : "NTSC",minor); + break; + } + printf("hit to continure...\n"); + c = getchar(); +} -- 2.39.5