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

+54
View File
@@ -0,0 +1,54 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# M65 KERNAL_1 #TAKE
// #LAYOUT# * * #IGNORE
//
// Tape head alignemnt tool - interrupt routine
//
#if CONFIG_TAPE_HEAD_ALIGN
tape_head_align_irq:
// inc $d020 // XXX for debug only
// Acknowledge interrupt
asl VIC_IRQ
// Clear table of pulses stored
lda #$FF
ldy #$0F
!:
sta __ha_pulses, y
dey
bpl !-
// Ignore 2 first pulses, they can be garbage
jsr tape_head_align_get_pulse
jsr tape_head_align_get_pulse
// Now, we can retrieve a pulse for real
ldx #$00
!:
jsr tape_head_align_get_pulse
tya
sta __ha_pulses, x
// XXX terminate ion case VIC_RASTER went too far
inx
cpx #$10
bne !-
// dec $d020 // XXX for debug only
jmp return_from_interrupt
#endif // CONFIG_TAPE_HEAD_ALIGN