further IO stack refactoring
This commit is contained in:
1 parent
6fa2c5b570
commit
e9140607bc
41 files changed
+131
-82
No files matched your search
@@ -0,0 +1,45 @@
|
||||
|
||||
//
|
||||
// Official Kernal routine, described in:
|
||||
//
|
||||
// - [RG64] C64 Programmer's Reference Guide - page 279/280
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 224
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): .X, .Y
|
||||
//
|
||||
|
||||
|
||||
CIOUT:
|
||||
|
||||
#if CONFIG_IEC
|
||||
|
||||
pha
|
||||
lda C3PO
|
||||
bne ciout_send_byte
|
||||
|
||||
// Nothing to send - set buffer as valid, store byte there
|
||||
inc C3PO
|
||||
|
||||
// Clear carry flag to indicate success
|
||||
clc
|
||||
|
||||
ciout_store_in_buffer:
|
||||
|
||||
// Store in the buffer data to be sent next, return
|
||||
pla
|
||||
sta BSOUR
|
||||
rts
|
||||
|
||||
ciout_send_byte:
|
||||
|
||||
clc // don't send with EOI
|
||||
jsr iec_tx_byte
|
||||
inc C3PO // iec_tx_byte sets it to 0, but we still have something to send
|
||||
jmp ciout_store_in_buffer
|
||||
|
||||
#else
|
||||
|
||||
sec // indicate failure
|
||||
rts
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
//
|
||||
// IEC part of the CLRCHN routine
|
||||
//
|
||||
|
||||
|
||||
#if CONFIG_IEC
|
||||
|
||||
|
||||
clrchn_iec:
|
||||
|
||||
// Check input device
|
||||
lda DFLTN
|
||||
jsr iec_check_devnum_oc
|
||||
bcs !+
|
||||
|
||||
// It was IEC device - send UNTALK first
|
||||
jsr UNTLK
|
||||
!:
|
||||
// Check output device
|
||||
lda DFLTO
|
||||
jsr iec_check_devnum_oc
|
||||
|
||||
// If it was IEC device - send UNLSN first
|
||||
bcc_far UNLSN
|
||||
|
||||
rts
|
||||
|
||||
|
||||
#endif // CONFIG_IEC
|
||||
Reference in new issue
Block a user