1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Atari: add support for BW-DOS. Initially contributed by Daniel Serpell.

This commit is contained in:
Christian Groessler 2018-09-27 17:37:59 +02:00
parent fe7845b5f0
commit 6dc7309e50
6 changed files with 38 additions and 12 deletions

View File

@ -1033,10 +1033,11 @@ diopp_size = 5 ; size of structure
SPARTADOS = 0 SPARTADOS = 0
REALDOS = 1 REALDOS = 1
OSADOS = 2 ; OS/A+ BWDOS = 2
XDOS = 3 OSADOS = 3 ; OS/A+
ATARIDOS = 4 XDOS = 4
MYDOS = 5 ATARIDOS = 5
MYDOS = 6
NODOS = 255 NODOS = 255
; The DOSes with dos_type below or equal MAX_DOS_WITH_CMDLINE do support ; The DOSes with dos_type below or equal MAX_DOS_WITH_CMDLINE do support
; command line arguments. ; command line arguments.

View File

@ -261,11 +261,12 @@ extern void atrx15p2_tgi[];
/* valid _dos_type values */ /* valid _dos_type values */
#define SPARTADOS 0 #define SPARTADOS 0
#define OSADOS 1 #define REALDOS 1
#define XDOS 2 #define BWDOS 2
#define REALDOS 3 #define OSADOS 3
#define ATARIDOS 4 #define XDOS 4
#define MYDOS 5 #define ATARIDOS 5
#define MYDOS 6
#define NODOS 255 #define NODOS 255
/* Define hardware */ /* Define hardware */

View File

@ -35,9 +35,20 @@ detect: lda DOS
cmp (DOSVEC),y cmp (DOSVEC),y
beq done beq done
lda #OSADOS lda #OSADOS
bne set
spdos: lda DOS+3 ; 'B' in BW-DOS
cmp #'B'
bne spdos_real
lda DOS+4 ; 'W' in BW-DOS
cmp #'W'
bne spdos_real
lda #BWDOS
.byte $2C ; BIT <abs> .byte $2C ; BIT <abs>
spdos: lda #SPARTADOS spdos_real:
lda #SPARTADOS
.byte $2C ; BIT <abs> .byte $2C ; BIT <abs>
mydos: lda #MYDOS mydos: lda #MYDOS
@ -47,7 +58,7 @@ rdos: lda #REALDOS
.byte $2C ; BIT <abs> .byte $2C ; BIT <abs>
xdos: lda #XDOS xdos: lda #XDOS
sta __dos_type set: sta __dos_type
done: rts done: rts
; ------------------------------------------------------------------------ ; ------------------------------------------------------------------------

View File

@ -195,6 +195,8 @@ chk_supp:
lda __dos_type lda __dos_type
cmp #SPARTADOS cmp #SPARTADOS
beq :+ beq :+
cmp #BWDOS
beq :+
cmp #REALDOS cmp #REALDOS
bne ns1 bne ns1
: txa : txa

View File

@ -67,6 +67,8 @@ ucok1:
beq :+ beq :+
cmp #REALDOS cmp #REALDOS
beq :+ beq :+
cmp #BWDOS
beq :+
lda #CHDIR_MYDOS lda #CHDIR_MYDOS
.byte $2C ; BIT <abs> .byte $2C ; BIT <abs>
: lda #CHDIR_SPDOS : lda #CHDIR_SPDOS

View File

@ -77,7 +77,16 @@ cont: ldx #0 ; channel 0
sdcheck:lda DOS sdcheck:lda DOS
cmp #'S' cmp #'S'
bne sdcrts0 ; not SpartaDOS, assume RAM is not used bne sdcrts0 ; not SpartaDOS, assume RAM is not used
lda DOS+1 ; SD version
; check for BW-DOS, which always reports itself as SpartaDOS, but doesn't use memory under the ROM
lda DOS+3 ; 'B' in BW-DOS
cmp #'B'
bne sdnobw
lda DOS+4 ; 'W' in BW-DOS
cmp #'W'
beq sdcrts0 ; BW-DOS does not use RAM below ROM
sdnobw: lda DOS+1 ; SD version
cmp #$40 ; SD-X has $40 or higher cmp #$40 ; SD-X has $40 or higher
bcc sdcrts1 ; older versions (except maybe 1.x) always use the RAM under the ROM bcc sdcrts1 ; older versions (except maybe 1.x) always use the RAM under the ROM
ldy #31 ; offset for OSRMFLG ldy #31 ; offset for OSRMFLG