more work on filename/command reception in CBDOS
This commit is contained in:
1 parent
3e9581cb89
commit
f7ea553ff8
15 files changed
+186
-14
No files matched your search
@@ -28,10 +28,15 @@
|
|||||||
|
|
||||||
; Free space: $800C-$8069
|
; Free space: $800C-$8069
|
||||||
|
|
||||||
!addr XX_CHANNEL = $806A ; current channel
|
!addr XX_CHANNEL = $8067 ; current channel
|
||||||
!addr SD_CHANNEL = $806A ; - SD card
|
!addr SD_CHANNEL = $8067 ; - SD card
|
||||||
!addr FD_CHANNEL = $806B ; - floppy
|
!addr FD_CHANNEL = $8068 ; - floppy
|
||||||
!addr RD_CHANNEL = $806C ; - ram disk
|
!addr RD_CHANNEL = $8069 ; - ram disk
|
||||||
|
|
||||||
|
!addr XX_CMDFN_IDX = $806A ; index byte for storing file name/command
|
||||||
|
!addr SD_CMDFN_IDX = $806A ; - SD card
|
||||||
|
!addr FD_CMDFN_IDX = $806B ; - floppy
|
||||||
|
!addr RD_CMDFN_IDX = $806C ; - ram disk
|
||||||
|
|
||||||
!addr XX_STATUS_IDX = $806D ; index byte for reading status
|
!addr XX_STATUS_IDX = $806D ; index byte for reading status
|
||||||
!addr SD_STATUS_IDX = $806D ; - SD card
|
!addr SD_STATUS_IDX = $806D ; - SD card
|
||||||
@@ -42,3 +47,7 @@
|
|||||||
!addr SD_STATUS_STR = $8070 ; status string for SD card, terminated by 0
|
!addr SD_STATUS_STR = $8070 ; status string for SD card, terminated by 0
|
||||||
!addr FD_STATUS_STR = $80A0 ; status string for floppy drive, terminated by 0
|
!addr FD_STATUS_STR = $80A0 ; status string for floppy drive, terminated by 0
|
||||||
!addr RD_STATUS_STR = $80D0 ; status string for ram disk, terminated by 0
|
!addr RD_STATUS_STR = $80D0 ; status string for ram disk, terminated by 0
|
||||||
|
|
||||||
|
!addr SD_CMDFN_BUF = $8100 ; buffer for command and/or file name, 128 bytes, SD card
|
||||||
|
!addr FD_CMDFN_BUF = $8180 ; buffer for command and/or file name, 128 bytes, floppy
|
||||||
|
!addr RD_CMDFN_BUF = $8200 ; buffer for command and/or file name, 128 bytes, ram disk
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
;
|
||||||
|
; Close currently opened file
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
dev_fd_cmd_CLOSE:
|
||||||
|
|
||||||
|
; XXX provide implementation
|
||||||
|
|
||||||
|
sec
|
||||||
|
jmp dos_SECOND_done
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
;
|
||||||
|
; Open file for reading
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
dev_fd_cmd_OPEN:
|
||||||
|
|
||||||
|
; XXX provide implementation
|
||||||
|
|
||||||
|
sec
|
||||||
|
jmp dos_SECOND_done
|
||||||
@@ -10,6 +10,7 @@ dev_fd_init:
|
|||||||
|
|
||||||
ldx #$00
|
ldx #$00
|
||||||
stx FD_STATUS_IDX
|
stx FD_STATUS_IDX
|
||||||
|
stx FD_CMDFN_IDX
|
||||||
dex
|
dex
|
||||||
@1:
|
@1:
|
||||||
inx
|
inx
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
;
|
||||||
|
; Close currently opened file
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
dev_rd_cmd_CLOSE:
|
||||||
|
|
||||||
|
; XXX provide implementation
|
||||||
|
|
||||||
|
sec
|
||||||
|
jmp dos_SECOND_done
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
;
|
||||||
|
; Open file for reading
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
dev_rd_cmd_OPEN:
|
||||||
|
|
||||||
|
; XXX provide implementation
|
||||||
|
|
||||||
|
sec
|
||||||
|
jmp dos_SECOND_done
|
||||||
@@ -10,6 +10,7 @@ dev_rd_init:
|
|||||||
|
|
||||||
ldx #$00
|
ldx #$00
|
||||||
stx RD_STATUS_IDX
|
stx RD_STATUS_IDX
|
||||||
|
stx RD_CMDFN_IDX
|
||||||
dex
|
dex
|
||||||
@1:
|
@1:
|
||||||
inx
|
inx
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
;
|
||||||
|
; Close currently opened file
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
dev_sd_cmd_CLOSE:
|
||||||
|
|
||||||
|
; XXX provide implementation
|
||||||
|
|
||||||
|
sec
|
||||||
|
jmp dos_SECOND_done
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
;
|
||||||
|
; Open file for reading
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
dev_sd_cmd_OPEN:
|
||||||
|
|
||||||
|
; XXX provide implementation
|
||||||
|
|
||||||
|
sec
|
||||||
|
jmp dos_SECOND_done
|
||||||
@@ -10,6 +10,7 @@ dev_sd_init:
|
|||||||
|
|
||||||
ldx #$00
|
ldx #$00
|
||||||
stx SD_STATUS_IDX
|
stx SD_STATUS_IDX
|
||||||
|
stx SD_CMDFN_IDX
|
||||||
dex
|
dex
|
||||||
@1:
|
@1:
|
||||||
inx
|
inx
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ dos_ACPTR_eoi:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
; Retrieving bytes from the status string
|
; Sending bytes from the status string
|
||||||
|
|
||||||
dos_ACPTR_getsts_SD: ; get next byte of status - SD card
|
dos_ACPTR_getsts_SD: ; get next byte of status - SD card
|
||||||
|
|
||||||
|
|||||||
+61
-2
@@ -6,7 +6,66 @@
|
|||||||
|
|
||||||
dos_CIOUT:
|
dos_CIOUT:
|
||||||
|
|
||||||
; XXX provide implementation
|
pha
|
||||||
|
phx
|
||||||
|
|
||||||
sec
|
; XXX handle cases of transferring data
|
||||||
|
|
||||||
|
; Receive command/file name byte
|
||||||
|
|
||||||
|
ldx IDX2_TALKER
|
||||||
|
jsr (dos_CIOUT_putcmdfn_table, X)
|
||||||
|
|
||||||
|
plx
|
||||||
|
pla
|
||||||
|
|
||||||
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; Receiving command/file name
|
||||||
|
|
||||||
|
dos_CIOUT_putcmdfn_SD: ; get next byte of status - SD card
|
||||||
|
|
||||||
|
ldx SD_CMDFN_IDX
|
||||||
|
sta SD_CMDFN_IDX,x
|
||||||
|
inx
|
||||||
|
bpl @1
|
||||||
|
ldx #$7F
|
||||||
|
@1:
|
||||||
|
lda #$00
|
||||||
|
sta SD_CMDFN_IDX,x
|
||||||
|
rts
|
||||||
|
|
||||||
|
dos_CIOUT_putcmdfn_FD: ; get next byte of status - floppy
|
||||||
|
|
||||||
|
ldx FD_CMDFN_IDX
|
||||||
|
sta FD_CMDFN_IDX,x
|
||||||
|
inx
|
||||||
|
bpl @1
|
||||||
|
ldx #$7F
|
||||||
|
@1:
|
||||||
|
lda #$00
|
||||||
|
sta FD_CMDFN_IDX,x
|
||||||
|
rts
|
||||||
|
|
||||||
|
dos_CIOUT_putcmdfn_RD: ; get next byte of status - ram disk
|
||||||
|
|
||||||
|
ldx RD_CMDFN_IDX
|
||||||
|
sta RD_CMDFN_IDX,x
|
||||||
|
inx
|
||||||
|
bpl @1
|
||||||
|
ldx #$7F
|
||||||
|
@1:
|
||||||
|
lda #$00
|
||||||
|
sta RD_CMDFN_IDX,x
|
||||||
|
rts
|
||||||
|
|
||||||
|
dos_CIOUT_putcmdfn_table:
|
||||||
|
|
||||||
|
!word dos_CIOUT_putcmdfn_SD
|
||||||
|
!word dos_CIOUT_putcmdfn_FD
|
||||||
|
!word dos_CIOUT_putcmdfn_RD
|
||||||
@@ -38,6 +38,8 @@ dos_LISTEN_success:
|
|||||||
asl
|
asl
|
||||||
sta IDX2_LISTENER
|
sta IDX2_LISTENER
|
||||||
|
|
||||||
|
; XXX should we reset XX_CMDFN_IDX ?
|
||||||
|
|
||||||
bra dos_common_LSN_TALK_UN
|
bra dos_common_LSN_TALK_UN
|
||||||
|
|
||||||
; TALK
|
; TALK
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ dos_SECOND:
|
|||||||
tay
|
tay
|
||||||
and #$0F ; support channels 0-15, like 1541 drive
|
and #$0F ; support channels 0-15, like 1541 drive
|
||||||
|
|
||||||
ldx IDX1_LISTENER ; store channel
|
ldx IDX1_LISTENER
|
||||||
bmi dos_SECOND_done ; do nothing if no listener
|
bmi dos_SECOND_done ; do nothing if no listener
|
||||||
sta XX_CHANNEL, x
|
sta XX_CHANNEL, x ; store channel
|
||||||
|
|
||||||
; Determine command type
|
; Determine command type
|
||||||
|
|
||||||
@@ -32,10 +32,17 @@ dos_SECOND:
|
|||||||
|
|
||||||
; XXX provide implementation
|
; XXX provide implementation
|
||||||
|
|
||||||
dos_SECOND_OPEN: ; XXX provide implementaation
|
bra dos_SECOND_done
|
||||||
dos_SECOND_CLOSE: ; XXX provide implementaation
|
|
||||||
|
|
||||||
; finish
|
dos_SECOND_OPEN:
|
||||||
|
|
||||||
|
ldx IDX2_LISTENER
|
||||||
|
jmp (dos_cmd_OPEN_vectable, x)
|
||||||
|
|
||||||
|
dos_SECOND_CLOSE:
|
||||||
|
|
||||||
|
ldx IDX2_LISTENER
|
||||||
|
jmp (dos_cmd_CLOSE_vectable, x)
|
||||||
|
|
||||||
dos_SECOND_done:
|
dos_SECOND_done:
|
||||||
|
|
||||||
@@ -50,9 +57,11 @@ dos_TKSA:
|
|||||||
|
|
||||||
and #$0F ; support channels 0-15, like 1541 drive
|
and #$0F ; support channels 0-15, like 1541 drive
|
||||||
|
|
||||||
ldx IDX1_TALKER ; store channel
|
ldx IDX1_TALKER
|
||||||
bmi dos_TKSA_done ; do nothing if no taalker
|
bmi dos_TKSA_done ; do nothing if no taalker
|
||||||
sta XX_CHANNEL, x
|
sta XX_CHANNEL, x ; store channel
|
||||||
|
|
||||||
|
; FALLTROUGH
|
||||||
|
|
||||||
dos_TKSA_done:
|
dos_TKSA_done:
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
;
|
||||||
|
; Vector tables to device-specific routines
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
dos_cmd_OPEN_vectable:
|
||||||
|
|
||||||
|
!word dev_sd_cmd_OPEN
|
||||||
|
!word dev_fd_cmd_OPEN
|
||||||
|
!word dev_rd_cmd_OPEN
|
||||||
|
|
||||||
|
|
||||||
|
dos_cmd_CLOSE_vectable:
|
||||||
|
|
||||||
|
!word dev_sd_cmd_CLOSE
|
||||||
|
!word dev_fd_cmd_CLOSE
|
||||||
|
!word dev_rd_cmd_CLOSE
|
||||||
Reference in new issue
Block a user