moved pulse probilng to raster interrupt routine

This commit is contained in:
FeralChild64 committed 2020-06-03 19:12:09 +02:00
1 parent 753603e563
commit 023a21c3ef
3 files changed
+140 -29

No files matched your search

+9 -4
View File
@@ -15,6 +15,7 @@ tape_head_align_get_pulse:
// This routine differs from the one used to read pulse during tape reading:
// - it is not as precise
// - it terminates when timer reaches $FF
// - ir returns value in .Y
lda #$10
!:
@@ -27,14 +28,18 @@ tape_head_align_get_pulse:
cpy #$FF
bne !-
!:
// FALLTROUGH
tape_head_align_get_pulse_start_timer:
// Start timer again, force latch reload, count timer A underflows
ldx #%01010001
stx CIA2_CRB // $DD0F
lda #%01010001
sta CIA2_CRB // $DD0F
// Return with time elapsed
// Return with time elapsed in .Y
tya
rts
#endif // CONFIG_TAPE_HEAD_ALIGN