Prev: 60078 Up: Map Next: 60272
60236: Sample Edge
Used by the routine at Sample_Tape.
Local edge-sampling helpers used by Sample_Tape. Sample_Edge waits for two edges, and Sample_Edge_Wait waits for one. Patch_Timing patches the delay operand at 60241.
Wait for a second edge after the first succeeds.
Sample_Edge 60236 CALL Sample_Edge_Wait Call Sample_Edge_Wait and return if the carry flag is reset.
60239 RET NC
This entry point is used by the routine at Sample_Tape.
Wait for one EAR transition. Patch_Timing patches the delay operand at 60241.
Sample_Edge_Wait 60240 LD A,22 Set the delay counter in A.
Burn the patched delay before sampling.
Sample_Edge_Delay 60242 DEC A Decrease A and jump back to Sample_Edge_Delay until it is zero.
60243 JR NZ,Sample_Edge_Delay
60245 AND A Clear the carry flag.
Poll the EAR bit until it changes.
Sample_Edge_Scan 60246 INC B Increase B and return if it wraps to zero.
60247 RET Z
60248 LD A,255 Read from the keyboard;
Port Number Bit
0 1 2 3 4
255 SPACE SYMBOL SHIFT M N B
60250 IN A,(254)
60252 RRA Return if BREAK is pressed.
60253 RET NC
60254 XOR C Match the new EAR state against C.
60255 AND %00100000 Keep only the EAR bit.
60257 JR Z,Sample_Edge_Scan Jump back to Sample_Edge_Scan if the EAR bit is unchanged.
60259 LD A,C Invert the stored EAR/border state in C.
60260 CPL
60261 LD C,A
60262 LD A,0 Clear A ready for the border update.
60264 AND %00000111 Keep only the border colour bits.
60266 OR %00001000 Force the MIC bit off so the border shows.
60268 OUT (254),A Update the border from A.
60270 SCF Set the carry flag.
60271 RET Return.
Prev: 60078 Up: Map Next: 60272