2000-07-10 23:38:14 +00:00
|
|
|
;
|
2004-06-03 19:43:11 +00:00
|
|
|
; Christian Groessler, June 2004
|
2000-07-10 23:38:14 +00:00
|
|
|
; from Freddy Offenga's rominfo.c
|
|
|
|
;
|
2004-06-03 19:43:11 +00:00
|
|
|
; unsigned char _get_ostype(void)
|
2000-07-10 23:38:14 +00:00
|
|
|
;
|
2000-12-04 20:22:23 +00:00
|
|
|
; x x x x x x x x - 8 bit flag
|
|
|
|
; | | | | | | | |
|
|
|
|
; | | | | | +-+-+-- main OS rev.
|
|
|
|
; | | +-+-+-------- minor OS rev.
|
|
|
|
; +-+-------------- unused
|
2000-07-10 23:38:14 +00:00
|
|
|
;
|
|
|
|
; main OS rev.:
|
|
|
|
; 000 - unknown
|
|
|
|
; 001 - 400/800 ROM
|
|
|
|
; 010 - 1200XL ROM
|
|
|
|
; 011 - XL/XE ROM
|
|
|
|
; 1xx - unassigned
|
|
|
|
; minor OS rev.: (depending on main OS rev.);
|
|
|
|
; 400/800:
|
|
|
|
; 000 - unknown
|
2000-12-04 20:22:23 +00:00
|
|
|
; 001 - Rev. A PAL
|
|
|
|
; 010 - Rev. B PAL
|
|
|
|
; 011 - Rev. A NTSC
|
|
|
|
; 100 - Rev. B NTSC
|
|
|
|
; 101 - unassigned (up to 111)
|
2000-07-10 23:38:14 +00:00
|
|
|
; 1200XL:
|
|
|
|
; 000 - unknown
|
|
|
|
; 001 - Rev. 10
|
|
|
|
; 010 - Rev. 11
|
|
|
|
; 011 - unassigned (up to 111)
|
|
|
|
; XL/XE:
|
|
|
|
; 000 - unknown
|
|
|
|
; 001 - Rev. 1
|
|
|
|
; 010 - Rev. 2
|
|
|
|
; 011 - Rev. 3
|
|
|
|
; 100 - Rev. 4
|
|
|
|
; 101 - unassigned (up to 111)
|
|
|
|
;
|
|
|
|
|
2004-06-03 19:43:11 +00:00
|
|
|
.export __get_ostype
|
2000-07-10 23:38:14 +00:00
|
|
|
|
2004-06-03 19:43:11 +00:00
|
|
|
.proc __get_ostype
|
2000-07-10 23:38:14 +00:00
|
|
|
|
|
|
|
lda $fcd8
|
|
|
|
cmp #$a2
|
|
|
|
beq _400800
|
|
|
|
lda $fff1
|
|
|
|
cmp #1
|
|
|
|
beq _1200xl
|
|
|
|
lda $fff7
|
|
|
|
cmp #1
|
|
|
|
bcc _unknown
|
|
|
|
cmp #5
|
|
|
|
bcs _unknown
|
|
|
|
|
|
|
|
;XL/XE ROM
|
|
|
|
|
|
|
|
sec
|
|
|
|
asl a
|
|
|
|
asl a
|
|
|
|
asl a
|
2000-12-04 20:22:23 +00:00
|
|
|
and #%00111000
|
2000-07-10 23:38:14 +00:00
|
|
|
ora #%11
|
|
|
|
_fin: ldx #0
|
|
|
|
rts
|
|
|
|
|
|
|
|
; unknown ROM
|
|
|
|
|
|
|
|
_unknown:
|
|
|
|
lda #0
|
|
|
|
tax
|
|
|
|
rts
|
|
|
|
|
|
|
|
; 1200XL ROM
|
|
|
|
|
|
|
|
_1200xl:
|
|
|
|
lda $fff7 ; revision #
|
|
|
|
cmp #10
|
|
|
|
beq _1200_10
|
|
|
|
cmp #11
|
|
|
|
beq _1200_11
|
|
|
|
lda #0 ; for unknown
|
|
|
|
beq _1200_fin
|
|
|
|
|
|
|
|
_1200_10:
|
2000-12-04 20:22:23 +00:00
|
|
|
lda #%00001000
|
2000-07-10 23:38:14 +00:00
|
|
|
bne _1200_fin
|
|
|
|
|
|
|
|
_1200_11:
|
2000-12-04 20:22:23 +00:00
|
|
|
lda #%00010000
|
2000-07-10 23:38:14 +00:00
|
|
|
|
|
|
|
_1200_fin:
|
|
|
|
ora #%010
|
2000-12-04 20:22:23 +00:00
|
|
|
bne _fin
|
2000-07-10 23:38:14 +00:00
|
|
|
|
|
|
|
; 400/800 ROM
|
|
|
|
|
|
|
|
_400800:
|
|
|
|
lda $fff8
|
|
|
|
ldx $fff9
|
|
|
|
cmp #$dd
|
|
|
|
bne _400800_1
|
|
|
|
cpx #$57
|
|
|
|
bne _400800_unknown
|
|
|
|
|
|
|
|
; 400/800 NTSC Rev. A
|
|
|
|
|
2000-12-04 20:22:23 +00:00
|
|
|
lda #%00011001
|
2000-07-10 23:38:14 +00:00
|
|
|
bne _400800_done
|
|
|
|
|
2000-07-17 00:30:01 +00:00
|
|
|
; 400/800 unknown
|
2000-07-10 23:38:14 +00:00
|
|
|
|
|
|
|
_400800_unknown:
|
|
|
|
lda #%00000001
|
|
|
|
bne _400800_done
|
|
|
|
|
|
|
|
_400800_1:
|
|
|
|
cmp #$d6
|
|
|
|
bne _400800_2
|
|
|
|
cpx #$57
|
|
|
|
bne _400800_unknown
|
|
|
|
|
|
|
|
; 400/800 PAL Rev. A
|
|
|
|
|
2000-12-04 20:22:23 +00:00
|
|
|
lda #%00001001
|
2000-07-10 23:38:14 +00:00
|
|
|
bne _400800_done
|
|
|
|
|
|
|
|
_400800_2:
|
|
|
|
cmp #$f3
|
|
|
|
bne _400800_3
|
|
|
|
cpx #$e6
|
|
|
|
bne _400800_unknown
|
|
|
|
|
|
|
|
; 400/800 NTSC Rev. B
|
|
|
|
|
2000-12-04 20:22:23 +00:00
|
|
|
lda #%00100001
|
2000-07-10 23:38:14 +00:00
|
|
|
bne _400800_done
|
|
|
|
|
|
|
|
_400800_3:
|
|
|
|
|
|
|
|
cmp #$22
|
|
|
|
bne _400800_unknown
|
|
|
|
cpx #$58
|
|
|
|
bne _400800_unknown
|
|
|
|
|
|
|
|
; 400/800 PAL Rev. B
|
|
|
|
|
2000-12-04 20:22:23 +00:00
|
|
|
lda #%00010001
|
2000-07-10 23:38:14 +00:00
|
|
|
|
|
|
|
_400800_done:
|
|
|
|
bne _fin
|
|
|
|
|
|
|
|
.endproc
|