# unit misc

### Miscellaneous procedures for detect additional hardware

author: Tomasz Biela, Konrad Kokoszkiewicz, Guillermo Fuenzalida, Sebastian Igielski

## Register Variables:

name: | address: | type: | description:
--- | --- | --- | ---
banks | __PORTB_BANKS | array [0..63] of byte | array with code of banks PORTB
DetectOS | $fff7 | byte |

## Interface:

name: | description:
--- | ---
DetectANTIC | #### function DetectANTIC: Boolean; assembler; Detect ANTIC PAL/NTSC ##### returns: TRUE = PAL FALSE = NTSC
DetectHighMem | #### function DetectHighMem: word; Detect 65816 linear memory http://atariki.krap.pl/index.php/Obliczenie_rozmiaru_pami%C4%99ci_liniowej ##### returns: amount of memory in KB
DetectVBXE | #### function DetectVBXE(var p: word): Boolean; assembler; register; Detect VBXE card ##### parameters: word variable ##### returns: TRUE present, FALSE otherwise bit 0..6 variable: VBXE CORE bit 7 variable: =1 RAMBO bit 8..15 variable: VBXE PAGE
DetectEvie | #### function DetectEvie: Boolean; assembler; Detect EVIE card ##### returns: TRUE present, FALSE otherwise
DetectStereo | #### function DetectStereo: Boolean; assembler; Second POKEY detect routine http://atariki.krap.pl/index.php/Programowanie:_Detekcja_stereo author: Seban/SLIGHT (c) 1995,96 ##### returns: TRUE present, FALSE otherwise
DetectStereo | #### function DetectStereo: Boolean; assembler; Second POKEY detect routine http://atariki.krap.pl/index.php/Programowanie:_Detekcja_stereo author: KMK ##### returns: X = 0 mono X = 1 stereo
DetectCPU | #### function DetectCPU: byte; assembler; How to detect on which CPU the assembler code is running (This information is from Konrad Kokoszkiewicz (drac030), the author of SYSINFO 2.0) You can test on plain 6502-Code if there is a 65c816 CPU, the 16-Bit processor avaible in some XLs as a turbo-board, avaible. Draco told me how to do this: First we make sure, whether we are running on NMOS-CPU (6502) or CMOS (65c02,65c816). I will just show the "official" way which doesn`t uses "illegal opcodes": ##### returns: $00 - 6502 $01 - 65c02 $80 - 65816
DetectCPUSpeed | #### function DetectCPUSpeed: real; Detect CPU speed in megahertz author: Konrad Kokoszkiewicz ##### returns: speed (REAL Q24.8)
DetectMem | #### function DetectMem: byte; assembler; Detect amount additional memory PORTB ##### returns: amount of banks (0..255) banks code PORTB = BANKS[0..63] at address $0101
DetectMapRam | #### function DetectMapRam: Boolean; assembler; Detect MapRAM http://xxl.atari.pl/mapram/ ##### returns: TRUE present, FALSE otherwise
DetectBASIC | #### function DetectBASIC: byte; assembler; Detect BASIC ##### returns: 162 = 'Atari Basic Rev.A' 96 = 'Atari Basic Rev.B' 234 = 'Atari Basic Rev.C'