3 ; Maciej 'YTM/Elysium' Witkowiak
7 ; Plus4 and GEOS 1.1 detection by
8 ; Marco van den Heuvel, 2010-02-02
11 ; unsigned char get_ostype (void);
12 ; unsigned char get_tv (void);
18 .include "../inc/const.inc"
19 .include "../inc/geossym.inc"
20 .include "../inc/geossym2.inc"
30 lda c128Flag ; we're on at least 2.0
49 bpl only40 ; C64 with 40 columns only
51 bpl only40 ; C128 but currently on 40 columns
54 only40: ldx #0 ; COLUMNS40
55 tvmode: ; PAL/NTSC check here, result in A
57 sei ; disable interrupts
58 lda CPU_DATA ; this is for C64
60 lda #IO_IN ; enable access to I/O
63 bpl tvmode ; wait for rasterline 127<x<256
64 lda #24 ; (rasterline now >=256!)
66 cmp rasreg ; wait for rasterline = 24 (or 280 on PAL)
68 lda grcntrl1 ; 24 or 280 ?
81 sta CPU_DATA ; restore memory config
82 plp ; restore interrupt state
87 bit $FF07 ; Test bit 6