2 ; Maciej 'YTM/Elysium' Witkowiak
6 ; Plus4 and GEOS 1.1 detection by
7 ; Marco van den Heuvel, 2010-02-02
10 ; unsigned char get_ostype (void);
11 ; unsigned char get_tv (void);
18 .include "geossym.inc"
19 .include "geossym2.inc"
29 lda c128Flag ; we're on at least 2.0
48 bpl only40 ; C64 with 40 columns only
50 bpl only40 ; C128 but currently on 40 columns
53 only40: ldx #0 ; COLUMNS40
54 tvmode: ; PAL/NTSC check here, result in A
56 sei ; disable interrupts
57 lda CPU_DATA ; this is for C64
59 lda #IO_IN ; enable access to I/O
62 bpl tvmode ; wait for rasterline 127<x<256
63 lda #24 ; (rasterline now >=256!)
65 cmp rasreg ; wait for rasterline = 24 (or 280 on PAL)
67 lda grcntrl1 ; 24 or 280 ?
80 sta CPU_DATA ; restore memory config
81 plp ; restore interrupt state
86 bit $FF07 ; Test bit 6