added IEC support to CLOSE routine
This commit is contained in:
1 parent
5b70404563
commit
431e5384a2
3 files changed
+66
-46
No files matched your search
@@ -65,47 +65,47 @@ Note: only the jump table addresses are currently supported, real routine addres
|
||||
NOTE: Even the 'DONE' routines won't support features described as missing in one of the previous chapters!
|
||||
|
||||
|
||||
| Address | Name | Status | Remarks |
|
||||
| ------- | :----: | :------: | :-------------------------------------: |
|
||||
| $FF81 | CINT | PARTIAL | at least PAL/NTSC detection is missing |
|
||||
| $FF84 | IOINIT | PARTIAL | at least SID volume handling is missing |
|
||||
| $FF87 | RAMTAS | DONE | |
|
||||
| $FF8A | RESTOR | PARTIAL | CBINV, NMINV, and USRCMD missing |
|
||||
| $FF8D | VECTOR | DONE | |
|
||||
| $FF90 | SETMSG | DONE | |
|
||||
| $FF93 | SECOND | DONE | |
|
||||
| $FF96 | TKSA | PARTIAL | should it do a turnaround? |
|
||||
| $FF99 | MEMTOP | DONE | |
|
||||
| $FF9C | MEMBOT | DONE | |
|
||||
| $FF9F | SCNKEY | DONE | could be better integrated with ROM |
|
||||
| $FFA2 | SETTMO | NOT DONE | |
|
||||
| $FFA5 | ACPTR | PARTIAL | * work in progress |
|
||||
| $FFA8 | CIOUT | DONE | |
|
||||
| $FFAB | UNTLK | PARITAL | * work in progress |
|
||||
| $FFAE | UNLSN | DONE | |
|
||||
| $FFB1 | LISTEN | DONE | |
|
||||
| $FFB4 | TALK | PARTIAL | should it do a turnaround? |
|
||||
| $FFB7 | READST | DONE | |
|
||||
| $FFBA | SETFLS | DONE | |
|
||||
| $FFBD | SETNAM | DONE | |
|
||||
| $FFC0 | OPEN | PARTIAL | * work in progress |
|
||||
| $FFC3 | CLOSE | PARTIAL | * work in progress |
|
||||
| $FFC6 | CHKIN | PARTIAL | * work in progress |
|
||||
| $FFC9 | CHKOUT | PARTIAL | * work in progress |
|
||||
| $FFCC | CLRCHN | PARTIAL | * work in progress |
|
||||
| $FFCF | CHRIN | PARTIAL | |
|
||||
| $FFD2 | CHROUT | PARTIAL | |
|
||||
| $FFD5 | LOAD | PARTIAL | no VERIFY support yet |
|
||||
| $FFD8 | SAVE | NOT DONE | * work in progress |
|
||||
| $FFDB | SETTIM | NOT DONE | |
|
||||
| $FFDE | RDTIM | NOT DONE | |
|
||||
| $FFE1 | STOP | PARTIAL | no connection with UDTIM |
|
||||
| $FFE4 | GETIN | PARTIAL | * work in progress |
|
||||
| $FFE7 | CLALL | PARTIAL | * work in progress |
|
||||
| $FFEA | UDTIM | NOT DONE | |
|
||||
| $FFED | SCREEN | DONE | |
|
||||
| $FFF0 | PLOT | NOT DONE | |
|
||||
| $FFF3 | IOBASE | DONE | |
|
||||
| Address | Name | Status | Remarks |
|
||||
| ------- | :----: | :------: | :-------------------------------------------: |
|
||||
| $FF81 | CINT | PARTIAL | at least PAL/NTSC detection is missing |
|
||||
| $FF84 | IOINIT | PARTIAL | at least SID volume handling is missing |
|
||||
| $FF87 | RAMTAS | DONE | |
|
||||
| $FF8A | RESTOR | PARTIAL | CBINV, NMINV, and USRCMD missing |
|
||||
| $FF8D | VECTOR | DONE | |
|
||||
| $FF90 | SETMSG | DONE | |
|
||||
| $FF93 | SECOND | DONE | |
|
||||
| $FF96 | TKSA | DONE | |
|
||||
| $FF99 | MEMTOP | DONE | |
|
||||
| $FF9C | MEMBOT | DONE | |
|
||||
| $FF9F | SCNKEY | DONE | could be better integrated with ROM (aliases) |
|
||||
| $FFA2 | SETTMO | NOT DONE | |
|
||||
| $FFA5 | ACPTR | PARTIAL | * work in progress |
|
||||
| $FFA8 | CIOUT | DONE | |
|
||||
| $FFAB | UNTLK | DONE | |
|
||||
| $FFAE | UNLSN | DONE | |
|
||||
| $FFB1 | LISTEN | DONE | |
|
||||
| $FFB4 | TALK | DONE | |
|
||||
| $FFB7 | READST | DONE | |
|
||||
| $FFBA | SETFLS | DONE | |
|
||||
| $FFBD | SETNAM | DONE | |
|
||||
| $FFC0 | OPEN | PARTIAL | * work in progress |
|
||||
| $FFC3 | CLOSE | DONE | |
|
||||
| $FFC6 | CHKIN | PARTIAL | * work in progress |
|
||||
| $FFC9 | CHKOUT | PARTIAL | * work in progress |
|
||||
| $FFCC | CLRCHN | PARTIAL | * work in progress |
|
||||
| $FFCF | CHRIN | PARTIAL | |
|
||||
| $FFD2 | CHROUT | PARTIAL | |
|
||||
| $FFD5 | LOAD | PARTIAL | no VERIFY support yet |
|
||||
| $FFD8 | SAVE | NOT DONE | * work in progress |
|
||||
| $FFDB | SETTIM | NOT DONE | |
|
||||
| $FFDE | RDTIM | NOT DONE | |
|
||||
| $FFE1 | STOP | PARTIAL | no connection with UDTIM |
|
||||
| $FFE4 | GETIN | PARTIAL | * work in progress |
|
||||
| $FFE7 | CLALL | PARTIAL | * work in progress |
|
||||
| $FFEA | UDTIM | NOT DONE | |
|
||||
| $FFED | SCREEN | DONE | |
|
||||
| $FFF0 | PLOT | NOT DONE | |
|
||||
| $FFF3 | IOBASE | DONE | |
|
||||
|
||||
|
||||
### Unofficial Kernal locations
|
||||
|
||||
+24
-4
@@ -4,6 +4,7 @@
|
||||
;;
|
||||
;; - [RG64] C64 Programmer's Reference Guide - page 281/282
|
||||
;; - [CM64] Compute's Mapping the Commodore 64 - page 229/230
|
||||
;; - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc (IEC command)
|
||||
;;
|
||||
;; CPU registers that has to be preserved (see [RG64]): none
|
||||
;;
|
||||
@@ -17,11 +18,28 @@ close:
|
||||
jsr find_fls
|
||||
bcs close_error_not_found ;; XXX can we report error in IOSTATUS here?
|
||||
|
||||
;; We have the entry index in Y
|
||||
;; We have the entry index in Y - check whether this is IEC device
|
||||
lda FAT, y
|
||||
jsr iec_devnum_check
|
||||
bcs close_remove_from_table
|
||||
|
||||
;; XXX some devices (like IEC) needs special support here, to free their internal resources!
|
||||
;; Just make sure the Y register value is kept, or redo ldy DFTLN
|
||||
;; IEC device
|
||||
|
||||
;; First check whether we have something to be sent in the buffer
|
||||
lda C3PO
|
||||
beq +
|
||||
sec ; send it with EOI
|
||||
jsr iec_tx_byte ; send the command regardless of the status
|
||||
*
|
||||
lda SAT, y ; get secondary address
|
||||
ora $E0 ; CLOSE command
|
||||
sta BSOUR
|
||||
jsr iec_tx_command
|
||||
bcs close_remove_from_table
|
||||
jsr iec_tx_command_finalize
|
||||
|
||||
close_remove_from_table:
|
||||
;; Remove channel from the table
|
||||
iny
|
||||
cpy #$0A
|
||||
bpl +
|
||||
@@ -36,8 +54,10 @@ close:
|
||||
;; Decrement the list size variable
|
||||
dec LDTND
|
||||
|
||||
;; FALLTHROUGH - success
|
||||
clc ; report success - not sure if original CLOSE does this, but it's nevertheless a good practice
|
||||
rts
|
||||
|
||||
close_error_not_found:
|
||||
|
||||
sec ; report success - not sure if original CLOSE does this, but it's nevertheless a good practice
|
||||
rts
|
||||
+1
-1
@@ -18,7 +18,7 @@ unlsn:
|
||||
lda C3PO
|
||||
beq +
|
||||
sec ; send it with EOI
|
||||
jsr iec_tx_byte ; XXX what about the status of this operation?
|
||||
jsr iec_tx_byte ; send the command regardless of the status
|
||||
*
|
||||
;; Buffer empty, send the command
|
||||
lda #$3F
|
||||
|
||||
Reference in new issue
Block a user