Prev: FF4E Up: Map Next: FF70
FF52: Get tape signal
Used by the routines at FEAB and FF4E.
Input
B On input, timing constant. On output, holds the time taken to find an edge change. If found before the timing constant value, a '0' bit was found, otherwise it was a '1' bit.
C Border colour and previous EAR signal bit
This is similar to the ROM routine LD_EDGE_1 at 05E7.
FF52 LD A,$0B Wait the required length before sampling a bit
FF54 DEC A
FF55 JR NZ,$FF54
FF57 AND A Clear carry flag
FF58 INC B Increment pass counter
FF59 RET Z Return if a signal wasn't found quickly enough
FF5A LD A,$7F Read the tape signal
FF5C IN A,($FE)
FF5E RRA Shift right
FF5F NOP The ROM routine returns here; this custom loader does nothing
FF60 XOR C Mask against expected edge type
FF61 AND $20 Test for the edge
FF63 JR Z,$FF58 Jump back if it wasn't found
At this point, an edge has been found
FF65 LD A,C Flip border colour
FF66 CPL
FF67 LD C,A
FF68 AND $07 Turn off non-border bits
FF6A OR $08 Turn off MIC input
FF6C OUT ($FE),A Set the border
FF6E SCF Set carry flag to denote success
FF6F RET All done
Prev: FF4E Up: Map Next: FF70