IEC cleanups and size optimization

This commit is contained in:
FeralChild64 committed 2019-08-30 19:12:56 +02:00
1 parent ee499b6b21
commit e3314f8b8f
6 files changed
+74 -100

No files matched your search

+4 -17
View File
@@ -20,8 +20,9 @@ iec_tx_command:
jsr iec_pull_atn_clk_release_data
;; Give devices time to respond (response is mandatory!) by pulling DATA
jsr iec_wait1ms_for_data
bmi iec_tx_command_dev_not_found
jsr iec_wait1ms
lda CIA2_PRA ; pulled DATA = highest bit 0 = 'plus'
bmi iec_return_DEVICE_NOT_FOUND
;; At least one device responded, but they are still allowed to stall
;; (can be busy processing something), we have to wait till they are all
@@ -34,19 +35,5 @@ iec_tx_command:
;; and transmits a byte
clc ; Carry flag set is used for EOI mark
jsr iec_tx_common
jmp iec_tx_common
;; According to https://www.pagetable.com/?p=1135 there is some complicated and dangerous
;; flow here, but http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf (page 6)
;; advices to just wait 1ms and check the DATA status
jsr iec_wait1ms_for_data
bmi iec_tx_command_dev_not_found
;; Done
jmp iec_return_success
iec_tx_command_dev_not_found:
jmp iec_return_DEVICE_NOT_FOUND