get to the point of being able to receive some bytes before locking up.
This commit is contained in:
1 parent
ea070f9bfe
commit
ee87f4a775
2 files changed
+13
-11
No files matched your search
+12
-10
@@ -58,32 +58,34 @@ iec_rx_clk_wait:
|
|||||||
|
|
||||||
iec_rx_bit_loop:
|
iec_rx_bit_loop:
|
||||||
|
|
||||||
inc $0634
|
|
||||||
|
|
||||||
;; Wait for CLK to release
|
;; Wait for CLK to release
|
||||||
jsr iec_wait_for_clock_release
|
jsr iec_wait_for_clock_release
|
||||||
|
|
||||||
inc $0635
|
|
||||||
|
|
||||||
;; DATA now has the next bit, but inverted.
|
;; DATA now has the next bit, but inverted.
|
||||||
;; DATA is in bit7, which is a bit annoying.
|
;; DATA is in bit7, which is a bit annoying.
|
||||||
;; But we can clock it out with a ROL instruction
|
;; But we can clock it out with a ROL instruction
|
||||||
;; so that it is in C. We can then ROL it into the
|
;; so that it is in C. We can then ROR it into the
|
||||||
;; partial data byte
|
;; partial data byte.
|
||||||
|
;; We use ROR so that we shift in from the top, so that
|
||||||
|
;; the first bit we shift in ends up in bit 0 after all
|
||||||
|
;; 8 bits have been read.
|
||||||
|
;; ODD: For some reason we don't need to invert the
|
||||||
|
;; received bits. This is weird, because we invert them
|
||||||
|
;; on the way out, and everything in the protocol seems
|
||||||
|
;; to indicate that we sould do so. But experimentation
|
||||||
|
;; has confirmed the bits don't need inversion on reception.
|
||||||
|
|
||||||
;; Move data bit into C flag
|
;; Move data bit into C flag
|
||||||
LDA $DD00
|
LDA $DD00
|
||||||
ROL
|
ROL
|
||||||
;; Pull it into the data byte
|
;; Pull it into the data byte
|
||||||
pla
|
pla
|
||||||
ROL
|
ROR
|
||||||
eor #$01 ; Invert the data bit
|
|
||||||
pha
|
pha
|
||||||
|
|
||||||
;; Wait for CLK to re-assert
|
;; Wait for CLK to re-assert
|
||||||
jsr iec_wait_for_clock_assert
|
jsr iec_wait_for_clock_assert
|
||||||
|
|
||||||
inc $0636
|
|
||||||
|
|
||||||
;; More bits?
|
;; More bits?
|
||||||
dex
|
dex
|
||||||
bpl iec_rx_bit_loop
|
bpl iec_rx_bit_loop
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ read_loop:
|
|||||||
;; Write read data to screen for now
|
;; Write read data to screen for now
|
||||||
inc $ff
|
inc $ff
|
||||||
ldx $ff
|
ldx $ff
|
||||||
sta $0400,x
|
sta $1000,x
|
||||||
plp
|
plp
|
||||||
bcs load_done
|
bcs load_done
|
||||||
bcc -
|
bcc -
|
||||||
|
|||||||
Reference in new issue
Block a user