2 ; Maciej 'YTM/Elysium' Witkowiak
6 ; Plus4, Gateway, MP3 and GEOS 1.1 detection by
7 ; Marco van den Heuvel, 2018-02-07
10 ; unsigned char get_ostype (void);
11 ; unsigned char get_tv (void);
18 .include "geossym.inc"
19 .include "geossym2.inc"
29 cmp #$13 ; either 1.3 or 1.5
37 lda c128Flag ; we're on at least 2.0
72 bpl only40 ; C64 with 40 columns only
74 bpl only40 ; C128 but currently on 40 columns
77 only40: ldx #0 ; COLUMNS40
78 tvmode: ; PAL/NTSC check here, result in A
80 sei ; disable interrupts
81 lda CPU_DATA ; this is for C64
83 lda #IO_IN ; enable access to I/O
86 bpl tvmode ; wait for rasterline 127<x<256
87 lda #24 ; (rasterline now >=256!)
89 cmp rasreg ; wait for rasterline = 24 (or 280 on PAL)
91 lda grcntrl1 ; 24 or 280 ?
104 sta CPU_DATA ; restore memory config
105 plp ; restore interrupt state
110 bit $FF07 ; Test bit 6