From 274a3c070a0c4f937ce6cabbfba5995735ff54fd Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sat, 22 Aug 2020 21:48:36 +0200 Subject: [PATCH] fixed DOS memory mapping --- src/dos_m65/4000.dos_vectable.s | 29 +---------------------- src/dos_m65/stubs.s | 26 ++++++++++++++++++++ src/kernal/board_m65/mega65_map_helpers.s | 9 ++++--- src/kernal/iec_fast/m65dos_bridge.s | 26 ++++++++++---------- 4 files changed, 44 insertions(+), 46 deletions(-) create mode 100644 src/dos_m65/stubs.s diff --git a/src/dos_m65/4000.dos_vectable.s b/src/dos_m65/4000.dos_vectable.s index 00d700f1..365f1761 100644 --- a/src/dos_m65/4000.dos_vectable.s +++ b/src/dos_m65/4000.dos_vectable.s @@ -2,7 +2,7 @@ // A vector table to integrate DOS with the MEGA65 Kernal .word dos_INIT -.word dos_HASUNIT +.word dos_CHKUNIT .word dos_ACPTR .word dos_CIOUT .word dos_LISTEN @@ -11,30 +11,3 @@ .word dos_TKSA .word dos_UNTLK .word dos_UNLSN - - -// Dummy implementations - XXX to be replaced with real ones - -dos_INIT: - nop -dos_HASUNIT: - nop -dos_ACPTR: - nop -dos_CIOUT: - nop -dos_LISTEN: - nop -dos_SECOND: - nop -dos_TALK: - nop -dos_TKSA: - nop -dos_UNTLK: - nop -dos_UNLSN: - nop - - sec - rts diff --git a/src/dos_m65/stubs.s b/src/dos_m65/stubs.s new file mode 100644 index 00000000..56a37771 --- /dev/null +++ b/src/dos_m65/stubs.s @@ -0,0 +1,26 @@ + +// Dummy implementations - XXX to be replaced with real ones + +dos_INIT: + nop +dos_CHKUNIT: + nop +dos_ACPTR: + nop +dos_CIOUT: + nop +dos_LISTEN: + nop +dos_SECOND: + nop +dos_TALK: + nop +dos_TKSA: + nop +dos_UNTLK: + nop +dos_UNLSN: + nop + + sec + rts diff --git a/src/kernal/board_m65/mega65_map_helpers.s b/src/kernal/board_m65/mega65_map_helpers.s index cf2d69cc..1453ef6c 100644 --- a/src/kernal/board_m65/mega65_map_helpers.s +++ b/src/kernal/board_m65/mega65_map_helpers.s @@ -77,13 +77,12 @@ map_DOS_1: lda #$C0 tab // from now on, zeropage starts from $C000 - ldy #$00 - lda #$41 + ldy #$40 + lda #$40 taz // $C000 <- map 8KB from $10000 - // XXX what should be the value here?? - lda #$A0 - ldx #$C2 // $4000 <- map 16KB from ????? + lda #$C0 + ldx #$C1 // $4000 <- map 16KB from $20000 map jmp_8 map_end_no_eom // no EOM, we do not want interrupts within DOS! diff --git a/src/kernal/iec_fast/m65dos_bridge.s b/src/kernal/iec_fast/m65dos_bridge.s index be0a2754..11208afe 100644 --- a/src/kernal/iec_fast/m65dos_bridge.s +++ b/src/kernal/iec_fast/m65dos_bridge.s @@ -6,16 +6,16 @@ // -.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 +.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 @@ -24,13 +24,13 @@ m65dos_init: jsr map_DOS_1 - // XXX do after memory mapping is correct: jsr_ind VDOS_INIT + jsr_ind VDOS_INIT jmp_8 !+ -m65dos_hasunit: +m65dos_chkunit: jsr map_DOS_1 - jsr_ind VDOS_HASUNIT + jsr_ind VDOS_CHKUNIT jmp_8 !+ m65dos_acptr: