implemented TALK/LISTEN/UNTLK/UNLSN in the internal DOS

This commit is contained in:
FeralChild64 committed 2021-02-06 23:19:11 +01:00
1 parent 5f6a8eb7bf
commit 575833d763
5 files changed
+115 -14

No files matched your search

+6 -6
View File
@@ -7,19 +7,19 @@
; - additional 16KB RAM is reserved for DOS too ($14000-$17FFF), and can be banked-in if needed
;
; Page 0
; Page start+0
;
!addr MAGICSTR = $8000 ; magic string; if not matching, DOS considered non-functional
; General DOS configuration
!addr UNIT_SDCARD = $8005
!addr UNIT_FLOPPY = $8006
!addr UNIT_RAMDISK = $8007
!addr UNIT_SDCARD = $8005 ; unit number for device, 0 = none
!addr UNIT_FLOPPY = $8006 ; as above
!addr UNIT_RAMDISK = $8007 ; as above
; General DOS status
!addr UNIT_HANDLER = $8008
!addr IDX_LISTENER = $8008 ; listener idx * 2, >=$80 = none
!addr IDX_TALKER = $8009 ; talker idx * 2, >=$80 = none
+6
View File
@@ -31,4 +31,10 @@ dos_INIT:
lda #CONFIG_UNIT_RAMDISK
sta UNIT_RAMDISK
; Clear listener / talker
lda #$FF
sta IDX_LISTENER
sta IDX_TALKER
rts
+99
View File
@@ -0,0 +1,99 @@
;
; Implementation of LISTEN/UNLSN/TALK/UNTLK commands.
; For detailed description see 'm65dos_bridge.s' file.
;
; LISTEN
dos_LISTEN:
pha
and #$1F
beq dos_fail_TALK_LISTEN ; branch if device 0 (used to denote lack of device)
cmp UNIT_SDCARD
bne @1
lda #$00
bra dos_LISTEN_success
@1:
cmp UNIT_FLOPPY
bne @2
lda #$02
bra dos_LISTEN_success
@2:
cmp UNIT_RAMDISK
bne dos_fail_TALK_LISTEN
lda #$04
; FALLTROUGH
dos_LISTEN_success:
sta IDX_LISTENER
bra dos_common_LSN_TALK_UN
; TALK
dos_TALK:
pha
and #$1F
beq dos_fail_TALK_LISTEN ; branch if device 0 (used to denote lack of device)
cmp UNIT_SDCARD
bne @1
lda #$00
bra dos_TALK_success
@1:
cmp UNIT_FLOPPY
bne @2
lda #$02
bra dos_TALK_success
@2:
cmp UNIT_RAMDISK
bne dos_fail_TALK_LISTEN
lda #$04
; FALLTROUGH
dos_TALK_success:
sta IDX_TALKER
bra dos_common_LSN_TALK_UN
dos_fail_TALK_LISTEN:
pla
sec
rts
; UNLSN / UNTLK
dos_UNLSN:
pha
lda #$FF
sta IDX_LISTENER
bra dos_common_LSN_TALK_UN
dos_UNTLK:
pha
lda #$FF
sta IDX_TALKER
; FALLTROUGH
dos_common_LSN_TALK_UN:
pla
clc
rts
+2
View File
@@ -12,6 +12,8 @@ dos_UNITSET:
bcc @1
rts
@1:
; XXX do not allow illegal device numbers... above 30 or below 8 ?
; Check what kind of device was requested
cmp #$00
+2 -8
View File
@@ -5,18 +5,12 @@ 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