various tape loading fixes

This commit is contained in:
FeralChild64 committed 2019-12-24 21:07:55 +01:00
1 parent c497e3b03c
commit 8c8e18bb80
15 files changed
+127 -131

No files matched your search

+53 -10
View File
@@ -3,27 +3,70 @@
// Tape (turbo) helper routine - handling the pilot
//
// Injest the pilot - series of short pulses. According to http://sidpreservation.6581.org/tape-format/
// it consist of the following number of pulses:
// - $6A00 for header
// - $1A00 for data and seq block header
// - $4F for repeated header/data
#if CONFIG_TAPE_NORMAL
tape_normal_pilot:
// Injest the pilot - series of short pulses. According to http://sidpreservation.6581.org/tape-format/
// it consist of the foollowing number of pulses:
// - $6A00 for header
// - $1A00 for data and seq block header
// - $4F for repeated header/data
tape_normal_pilot_short: // require 1x $40 pulses
lda #$01
// FALLTROUGH
tape_normal_pilot_common:
sta FSBLK
// FALLTROUGH
tape_normal_pilot_common_restart:
lda FSBLK
sta ROPRTY
// FALLTROUGH
tape_normal_pilot_common_loop_outer:
ldy #$40
// FALLTROUGH
tape_normal_pilot_common_loop_inner:
ldy #$05 // this should be enough
!:
jsr tape_normal_get_pulse
bcc tape_normal_pilot // not a pilot - try again
bcc tape_normal_pilot_common_restart // not a pilot - try again
dey
bne !-
bne tape_normal_pilot_common_loop_inner
dec ROPRTY
bne tape_normal_pilot_common_loop_outer
rts
tape_normal_pilot_data: // require 4x $40 pulses
lda #$04
skip_2_bytes_trash_nvz
// FALLTROUGH
tape_normal_pilot_header: // require 128x $40 pulses
lda #$80
jmp tape_normal_pilot_common // XXX calibrate tape speeed afterwards
#endif