diff options
author | Ole Loots <ole@monochrom.net> | 2011-03-01 19:27:34 +0000 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2011-03-01 19:27:34 +0000 |
commit | a80af90142526d5b026a89fdbac205e93e19d25a (patch) | |
tree | c51ed2c58d1c61b79e7e097b5b966d4977243a7c /atari/osspec.c | |
parent | 46915c6b7b6d67675cb365776a972fde32a24596 (diff) | |
download | netsurf-a80af90142526d5b026a89fdbac205e93e19d25a.tar.gz netsurf-a80af90142526d5b026a89fdbac205e93e19d25a.tar.bz2 |
Implemented OS detection routines provided by GS
svn path=/trunk/netsurf/; revision=11873
Diffstat (limited to 'atari/osspec.c')
-rw-r--r-- | atari/osspec.c | 60 |
1 files changed, 56 insertions, 4 deletions
diff --git a/atari/osspec.c b/atari/osspec.c index 97b518757..498b12678 100644 --- a/atari/osspec.c +++ b/atari/osspec.c @@ -13,11 +13,52 @@ NS_ATARI_SYSINFO atari_sysinfo;
+unsigned short _systype_v;
+unsigned short _systype (void)
+{
+_systype_v = (_systype_v & ~0xF) | SYS_MINT | SYS_XAAES;
+ return _systype_v;
+
+ int32_t * cptr = NULL;
+ _systype_v = SYS_TOS;
+
+ cptr = Setexc(0x0168, -1L);
+ if (cptr == NULL ) {
+ return _systype_v; /* stone old TOS without any cookie support */
+ }
+ while (*cptr) {
+ if (*cptr == C_MgMc || *cptr == C_MgMx ) {
+ _systype_v = (_systype_v & ~0xF) | SYS_MAGIC;
+ } else if (*cptr == C_MiNT ) {
+ _systype_v = (_systype_v & ~0xF) | SYS_MINT;
+ } else if (*cptr == C_Gnva/*Gnva*/) {
+ _systype_v |= SYS_GENEVA;
+ } else if (*cptr == C_nAES/*nAES*/) {
+ _systype_v |= SYS_NAES;
+ }
+ cptr += 2;
+ }
+ if (_systype_v & SYS_MINT) { /* check for XaAES */
+ short out = 0, u;
+ if (wind_get (0, (((short)'X') <<8)|'A', &out, &u,&u,&u) && out) {
+ _systype_v |= SYS_XAAES;
+ }
+ }
+ return _systype_v;
+}
void init_os_info(void)
{
int16_t out[4];
- atari_sysinfo.gdosversion = Sversion();
+ unsigned long cookie_FSMC = 0;
+
+ atari_sysinfo.gemdos_version = Sversion();
+
+ if( tos_getcookie (C_FSMC, &cookie_FSMC ) == C_FOUND ) {
+ atari_sysinfo.gdos_FSMC = 1;
+ } else {
+ atari_sysinfo.gdos_FSMC = 0;
+ }
atari_sysinfo.large_sfont_pxh = 13;
atari_sysinfo.medium_sfont_pxh = 6;
atari_sysinfo.small_sfont_pxh = 4;
@@ -28,6 +69,15 @@ void init_os_info(void) }
if( appl_xgetinfo(AES_SMALLFONT, &out[0], &out[1], &out[2], &out[3] ) > 0 ){
atari_sysinfo.small_sfont_pxh = out[0];
+ }
+ atari_sysinfo.aes_max_win_title_len = 79;
+ if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) {
+ if (sys_NAES()) {
+ atari_sysinfo.aes_max_win_title_len = 127;
+ }
+ if (sys_XAAES()) {
+ atari_sysinfo.aes_max_win_title_len = 200;
+ }
}
}
@@ -36,7 +86,7 @@ int tos_getcookie(long tag, long * value) COOKIE * cptr;
long oldsp;
- if( atari_sysinfo.gdosversion > TOS4VER ){
+ if( atari_sysinfo.gemdos_version > TOS4VER ){
return( Getcookie(tag, value) );
}
@@ -45,7 +95,9 @@ int tos_getcookie(long tag, long * value) do {
if( cptr->c == tag ){
if(cptr->v != 0 ){
- *value = cptr->v;
+ if( value != NULL ){
+ *value = cptr->v;
+ }
return( C_FOUND );
}
}
@@ -86,7 +138,7 @@ char * gdos_realpath(const char * path, char * rpath) if( rpath == NULL ){
return( NULL );
}
- if( atari_sysinfo.gdosversion > TOS4VER ){
+ if( sys_type() & SYS_MINT ){
return( realpath(path, rpath) );
}
|