From 924d87d271a650f0a64a543045a59c40d46105c6 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 17 Jun 2021 21:50:24 +0200 Subject: [PATCH] further RAM disk and floppy code integration --- src/dos_m65/dos_vectab_unit.s | 4 ++-- src/dos_m65/pseudoiec/msg_ciout.s | 15 +++++++------- src/dos_m65/unit_disk/unit_fd_cmd_open.s | 23 ++++++++++++++++----- src/dos_m65/unit_ramdisk/unit_rd_cmd_open.s | 6 ------ 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/dos_m65/dos_vectab_unit.s b/src/dos_m65/dos_vectab_unit.s index ee5bce48..c64e805d 100644 --- a/src/dos_m65/dos_vectab_unit.s +++ b/src/dos_m65/dos_vectab_unit.s @@ -7,8 +7,8 @@ dos_cmd_OPEN_vectab: !word unit_sd_cmd_OPEN - !word unit_fd_cmd_OPEN - !word unit_rd_cmd_OPEN + !word unit_disk_cmd_OPEN + !word unit_disk_cmd_OPEN dos_cmd_CLOSE_vectab: diff --git a/src/dos_m65/pseudoiec/msg_ciout.s b/src/dos_m65/pseudoiec/msg_ciout.s index 29ce9597..ac8fa48e 100644 --- a/src/dos_m65/pseudoiec/msg_ciout.s +++ b/src/dos_m65/pseudoiec/msg_ciout.s @@ -72,9 +72,7 @@ msg_CIOUT_cmdfn_F0: ; get next byte of status - floppy stx F0_CMDFN_IDX lda #$A0 sta F0_CMDFN_BUF,x - plp - +bcs unit_fd_cmd_OPEN_EOI ; if EOI - execute command - jmp dos_EXIT_CLC + bra msg_CIOUT_cmdfn_FX msg_CIOUT_cmdfn_F1: ; get next byte of status - floppy @@ -87,9 +85,7 @@ msg_CIOUT_cmdfn_F1: ; get next byte of status - floppy stx F1_CMDFN_IDX lda #$A0 sta F1_CMDFN_BUF,x - plp - +bcs unit_fd_cmd_OPEN_EOI ; if EOI - execute command - jmp dos_EXIT_CLC + bra msg_CIOUT_cmdfn_FX msg_CIOUT_cmdfn_RD: ; get next byte of status - ram disk @@ -102,8 +98,13 @@ msg_CIOUT_cmdfn_RD: ; get next byte of status - ram disk stx RD_CMDFN_IDX lda #$A0 sta RD_CMDFN_BUF,x + + ; FALLTROUGH + +msg_CIOUT_cmdfn_FX: ; common pard for floppy and RAM disk + plp - +bcs unit_rd_cmd_OPEN_EOI ; if EOI - execute command + +bcs unit_disk_cmd_OPEN_EOI ; if EOI - execute command jmp dos_EXIT_CLC msg_CIOUT_cmdfn_vectab: diff --git a/src/dos_m65/unit_disk/unit_fd_cmd_open.s b/src/dos_m65/unit_disk/unit_fd_cmd_open.s index f03c8457..b5c0dca1 100644 --- a/src/dos_m65/unit_disk/unit_fd_cmd_open.s +++ b/src/dos_m65/unit_disk/unit_fd_cmd_open.s @@ -6,14 +6,15 @@ ; XXX add support for both floppies -unit_fd_cmd_OPEN: +unit_disk_cmd_OPEN: lda #$01 ; mode: receive command or file name - sta F0_MODE + ldx PAR_FSINSTANCE + sta XX_MODE, x jmp dos_EXIT_CLC -unit_fd_cmd_OPEN_EOI: +unit_disk_cmd_OPEN_EOI: ; XXX this dispatcher is temporary @@ -26,16 +27,28 @@ unit_fd_cmd_OPEN_EOI: dey bpl @lp1 - ; XXX add support for second floppy + ldx PAR_FSINSTANCE + cmp #$02 + beq @f1 + bcs @rd lda F0_CMDFN_BUF + +skip_2_bytes_trash_nvz +@f1: + lda F1_CMDFN_BUF + +skip_2_bytes_trash_nvz +@rd: + lda RD_CMDFN_BUF + cmp #'$' - beq unit_fd_cmd_OPEN_dir + beq unit_fd_cmd_OPEN_dir ; XXX add support for second floppy and RAM disk ; FALLTROUGH unit_fd_cmd_OPEN_file: + ; XXX add support for second floppy and RAM disk + ; Copy the filter from command XXX this should be moved to common part and deduplicated with directory opening ldy #$00 diff --git a/src/dos_m65/unit_ramdisk/unit_rd_cmd_open.s b/src/dos_m65/unit_ramdisk/unit_rd_cmd_open.s index 0eab1ee8..ca151259 100644 --- a/src/dos_m65/unit_ramdisk/unit_rd_cmd_open.s +++ b/src/dos_m65/unit_ramdisk/unit_rd_cmd_open.s @@ -6,12 +6,6 @@ ; XXX to be unified with floppy code -unit_rd_cmd_OPEN: - - ; XXX provide implementation - - jmp dos_EXIT_SEC - unit_rd_cmd_OPEN_EOI: ; XXX provide implementation