more work towards internal MEGA65 DOS

This commit is contained in:
FeralChild64 committed 2020-08-22 19:37:46 +02:00
1 parent fe00a07aeb
commit de7ce30e03
5 files changed
+133 -24

No files matched your search

+2 -2
View File
@@ -431,7 +431,7 @@ build/padding_64_KB:
$(TARGET_M65_x) $(TARGET_M65_x_PXL): $(SEG_LIST_M65) build/padding_64_KB build/chargen_openroms.rom build/chargen_openroms.patched build/chargen_pxlfont.rom build/chargen_pxlfont.patched
@echo
cat $(DIR_M65)/dos.seg_1 >> $(TARGET_M65_x)
cat $(DIR_M65)/dos.seg_1 > $(TARGET_M65_x)
cat $(DIR_M65)/kernal.seg_1 >> $(TARGET_M65_x)
cat $(DIR_M65)/basic.seg_1 >> $(TARGET_M65_x)
cat $(DIR_M65)/basic.seg_0 >> $(TARGET_M65_x)
@@ -440,7 +440,7 @@ $(TARGET_M65_x) $(TARGET_M65_x_PXL): $(SEG_LIST_M65) build/padding_64_KB build/c
cat $(DIR_M65)/kernal.seg_0 >> $(TARGET_M65_x)
cat build/padding_64_KB >> $(TARGET_M65_x)
@echo
cat $(DIR_M65)/dos.seg_1 >> $(TARGET_M65_x_PXL)
cat $(DIR_M65)/dos.seg_1 > $(TARGET_M65_x_PXL)
cat $(DIR_M65)/kernal.seg_1 >> $(TARGET_M65_x_PXL)
cat $(DIR_M65)/basic.seg_1 >> $(TARGET_M65_x_PXL)
cat $(DIR_M65)/basic.seg_0 >> $(TARGET_M65_x_PXL)
File renamed without changes.
+47 -3
View File
@@ -6,8 +6,10 @@
//
// Available memory maps:
// - NORMAL - nothing mapped in
// - KERNAL_1 - for calling KERNAL_1 segment code
// - NORMAL - nothing mapped in
// - KERNAL_1 - for calling KERNAL_1 segment code
// - DOS_1 - for swiching to DOS context
// - NORMAL_from_DOS_1 - for switching bact from DOS context
map_NORMAL:
@@ -19,6 +21,11 @@ map_NORMAL:
phz
lda #$00
// FALLTROUGH
map_NORMAL_common:
tax
tay
taz
@@ -30,6 +37,10 @@ map_end:
map
eom
// FALLTROUGH
map_end_no_eom:
plz
ply
plx
@@ -53,4 +64,37 @@ map_KERNAL_1:
ldx #$42 // 0x4000 <- map 8KB from 0x20000
bne map_end
jmp_8 map_end
map_DOS_1:
php
pha
phx
phy
phz
lda #$C0
tab // from now on, zeropage starts from $C000
ldy #$00
taz #$81 // 0xC000 <- map 8KB (4KB useable) from $10000
tya
ldx #$C2 // 0x4000 <- map 16KB from 0x20000
map
jmp_8 map_end_no_eom // no EOM, we do not want interrupts within DOS!
map_NORMAL_from_DOS_1:
php
pha
phx
phy
phz
lda #$00
tba
jmp_8 map_NORMAL_common
-19
View File
@@ -1,19 +0,0 @@
// #LAYOUT# M65 KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// MEGA65 pseudo-IEC internal DOS support
//
.label VDOS_INIT = $4000
.label VDOS_HASUNIT = $4002
.label VDOS_ACPTR = $4004
.label VDOS_CIOUT = $4006
.label VDOS_LISTEN = $4008
.label VDOS_SECOND = $400A
.label VDOS_TALK = $400C
.label VDOS_TKSA = $400E
.label VDOS_UNTLK = $4010
.label VDOS_UNLSN = $4012
// XXX implement support
+84
View File
@@ -0,0 +1,84 @@
// #LAYOUT# M65 KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// MEGA65 pseudo-IEC internal DOS support
//
.label VDOS_INIT = $4000
.label VDOS_HASUNIT = $4002
.label VDOS_ACPTR = $4004
.label VDOS_CIOUT = $4006
.label VDOS_LISTEN = $4008
.label VDOS_SECOND = $400A
.label VDOS_TALK = $400C
.label VDOS_TKSA = $400E
.label VDOS_UNTLK = $4010
.label VDOS_UNLSN = $4012
// XXX connect this to core IEC implementation
m65dos_init:
jsr map_DOS_1
jsr_ind VDOS_INIT
jmp_8 !+
m65dos_hasunit:
jsr map_DOS_1
jsr_ind VDOS_HASUNIT
jmp_8 !+
m65dos_acptr:
jsr map_DOS_1
jsr_ind VDOS_ACPTR
!:
jmp map_NORMAL_from_DOS_1 // try to make ACPTR slightly faster
m65dos_ciout:
jsr map_DOS_1
jsr_ind VDOS_CIOUT
!:
jmp map_NORMAL_from_DOS_1 // try to make CIOUT slightly faster
m65dos_listen:
jsr map_DOS_1
jsr_ind VDOS_LISTEN
jmp_8 !-
m65dos_second:
jsr map_DOS_1
jsr_ind VDOS_SECOND
jmp_8 !-
m65dos_talk:
jsr map_DOS_1
jsr_ind VDOS_TALK
jmp_8 !-
m65dos_tksa:
jsr map_DOS_1
jsr_ind VDOS_TKSA
jmp_8 !-
m65dos_untlk:
jsr map_DOS_1
jsr_ind VDOS_UNTLK
jmp_8 !-
m65dos_unlsn:
jsr map_DOS_1
jsr_ind VDOS_UNLSN
jmp_8 !-