MEGA65 glue code for DOS finished

This commit is contained in:
FeralChild64 committed 2020-08-23 10:55:35 +02:00
1 parent 379eb746fe
commit ece9dc8f6f
20 files changed
+277 -24

No files matched your search

+28 -14
View File
@@ -8,44 +8,58 @@
.label VDOS_INIT = $4000 + 0 * 2
.label VDOS_CHKUNIT = $4000 + 1 * 2
.label VDOS_ACPTR = $4000 + 2 * 2
.label VDOS_CIOUT = $4000 + 3 * 2
.label VDOS_LISTEN = $4000 + 4 * 2
.label VDOS_SECOND = $4000 + 5 * 2
.label VDOS_TALK = $4000 + 6 * 2
.label VDOS_TKSA = $4000 + 7 * 2
.label VDOS_UNTLK = $4000 + 8 * 2
.label VDOS_UNLSN = $4000 + 9 * 2
// XXX connect this to core IEC implementation
.label VDOS_SETUNIT = $4000 + 2 * 2
.label VDOS_ACPTR = $4000 + 3 * 2
.label VDOS_CIOUT = $4000 + 4 * 2
.label VDOS_LISTEN = $4000 + 5 * 2
.label VDOS_SECOND = $4000 + 6 * 2
.label VDOS_TALK = $4000 + 7 * 2
.label VDOS_TKSA = $4000 + 8 * 2
.label VDOS_UNTLK = $4000 + 9 * 2
.label VDOS_UNLSN = $4000 + 10 * 2
m65dos_init:
// Initializes the DOS internal variables
jsr map_DOS_1
jsr_ind VDOS_INIT
jmp_8 !+
m65dos_chkunit:
m65dos_chkunit: // XXX expose to BASIC
// Checks is the unit number is supported by the internal DOS
// Input: .A - unit number to check
// Output: Carry set if not supported, otherwise .A contains unit type (0 = SD card, 1 = internal floppy, 2 = RAM disk)
jsr map_DOS_1
jsr_ind VDOS_CHKUNIT
jmp_8 !+
m65dos_setunit: // XXX expose to BASIC
// Set the unit number
// Input: .A - unit number, .X - unit type (as in m65dos_chkunit)
// Output: Carry set means error
jsr map_DOS_1
jsr_ind VDOS_SETUNIT
jmp_8 !+
m65dos_acptr:
jsr map_DOS_1
jsr_ind VDOS_ACPTR
!:
jmp map_NORMAL_from_DOS_1 // try to make ACPTR slightly faster
jmp map_NORMAL_from_DOS_1 // ACPTR is slightly faster
m65dos_ciout:
jsr map_DOS_1
jsr_ind VDOS_CIOUT
!:
jmp map_NORMAL_from_DOS_1 // try to make CIOUT slightly faster
jmp map_NORMAL_from_DOS_1 // CIOUT is slightly faster
m65dos_listen:
+22
View File
@@ -0,0 +1,22 @@
// #LAYOUT# M65 KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// MEGA65 pseudo-IEC internal DOS support - check if the current device is already handled by internal DOS
//
m65dos_check:
pha
lda IECPROTO
cmp #IEC_ROMDOS
beq !+
pla
sec
rts
!:
pla
clc
rts
+22
View File
@@ -0,0 +1,22 @@
// #LAYOUT# M65 KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// MEGA65 pseudo-IEC internal DOS support - detect if a drive should be handled by internal DOS
//
m65dos_detect:
// Checks if drive is supported by internal DOS
// Output: Carry set if not supported, if supported IECPROTO isset to IEC_ROMDOS
pha
jsr m65dos_chkunit
bcs !+
lda #IEC_ROMDOS
sta IECPROTO
!:
pla
rts