]> git.sur5r.net Git - cc65/blob - libsrc/c64/get_ostype.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / c64 / get_ostype.s
1 ;
2 ; Stefan Haubenthal, Jul 10 2003
3 ;
4 ; C64DTV detection by
5 ; Marco van den Heuvel, 2010-01-28
6 ;
7 ; unsigned char get_ostype(void)
8 ;
9 ; $AA US
10 ; $64 PET-64
11 ; $43 SX-64
12 ; $03 EU_NEW
13 ; $00 EU_OLD
14 ; $FF C64DTV
15 ;
16
17         .export         _get_ostype
18
19 .proc   _get_ostype
20
21         ldx     #0            ; Clear high byte
22
23         ldy     #1
24         sty     $d03f
25         ldy     $d040
26         cpy     $d000
27         bne     @c64dtv
28         inc     $d000
29         cpy     $d040
30         beq     @c64dtv
31
32 ; Normal C64
33
34         lda     $ff80
35         rts
36
37 ; C64 DTV
38
39 @c64dtv:
40         stx     $d03f
41         lda     #$ff
42         rts
43 .endproc