]> git.sur5r.net Git - cc65/blob - libsrc/apple2/dosdetect.s
4fb6fcad642d4d9883fd9b96f4f0fc54544bbf51
[cc65] / libsrc / apple2 / dosdetect.s
1 ;
2 ; Oliver Schmidt, 08.03.2004
3 ;
4 ; Identify DOS version we're running on as one of these:
5 ;
6 ; AppleDOS 3.3   - $00
7 ; ProDOS 8 1.0.1 - $10
8 ; ProDOS 8 1.0.2 - $10
9 ; ProDOS 8 1.1.1 - $11
10 ; ProDOS 8 1.2   - $12
11 ; ProDOS 8 1.3   - $13
12 ; ProDOS 8 1.4   - $14
13 ; ProDOS 8 1.5   - $15
14 ; ProDOS 8 1.6   - $16
15 ; ProDOS 8 1.7   - $17
16 ; ProDOS 8 1.8   - $18
17 ; ProDOS 8 1.9   - $18
18 ; ProDOS 8 2.0.1 - $21
19 ; ProDOS 8 2.0.2 - $22
20 ; ProDOS 8 2.0.3 - $23
21 ;
22
23         .constructor    initdostype, 25
24         .export         __dos_type
25
26         .include        "mli.inc"
27
28 ; Identify DOS version according to:
29 ; - Beneath Apple ProDOS, chapter 6-63
30 ; - Apple II ProDOS 8 TechNote #23, ProDOS 8 Changes and Minutia
31 ; - ProDOS TechRefMan, chapter 5.2.4
32
33         .segment        "INIT"
34
35 initdostype:
36         lda     ENTRY
37         cmp     #$4C            ; Is MLI present? (JMP opcode)
38         bne     done
39         lda     KVERSION        ; ProDOS 8 kernel version
40         cmp     #$10
41         bcs     :+
42         ora     #$10            ; Make high nibble match major version
43 :       sta     __dos_type
44 done:   rts
45
46         .bss
47
48 __dos_type:     .res    1