commit 2f27e29758da1f1ec965588c0712125051a6f71a Merge: ba722b1796b62fAuthor: FeralChild64 <you@example.com> Date: Tue Jan 28 17:34:53 2020 +0100 Merge branch 'master' into tape_redirect commit ba722b17e627af7dd067932688de0a3d86423e37 Author: FeralChild64 <you@example.com> Date: Tue Jan 28 17:28:19 2020 +0100 finished Mega65 variant of tape routines commit 47de685f2e08576504c5e00a5b7cb78498d22e72 Author: FeralChild64 <you@example.com> Date: Mon Jan 27 23:06:45 2020 +0100 compilation fix commit c3641acec049a7a6b53c35795b1f9e2df212cec2 Author: FeralChild64 <you@example.com> Date: Mon Jan 27 22:53:30 2020 +0100 dependencies fix commit dfad7a30bde043fa077005624dde1de4b72573b6 Merge: e4b0ec9e410bc0Author: FeralChild64 <you@example.com> Date: Mon Jan 27 21:25:49 2020 +0100 Merge branch 'master' into tape_redirect commit e4b0ec9c85861bde2ce52e0828d3bf895a681e17 Author: FeralChild64 <you@example.com> Date: Sat Jan 25 22:25:20 2020 +0100 initial attempt to move tape code to Mega65 extra ROM
94 lines
1.7 KiB
ArmAsm
94 lines
1.7 KiB
ArmAsm
// #LAYOUT# STD * #TAKE
|
|
// #LAYOUT# M65 KERNAL_1 #TAKE
|
|
// #LAYOUT# * * #IGNORE
|
|
|
|
//
|
|
// 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_get_pilot_header: // entry point, reset calibration, require 128x $40 pulses
|
|
|
|
// Reading the pilot header is the first action performed,
|
|
// thus start by setting default thresholds
|
|
|
|
lda #$91
|
|
sta __pulse_threshold
|
|
lda #$67
|
|
sta __pulse_threshold_ML
|
|
|
|
lda #$80
|
|
skip_2_bytes_trash_nvz
|
|
|
|
// FALLTROUGH
|
|
|
|
tape_normal_get_pilot_data: // entry point, require 4x $40 pulses
|
|
|
|
lda #$04
|
|
skip_2_bytes_trash_nvz
|
|
|
|
// FALLTROUGH
|
|
|
|
tape_normal_get_pilot_short: // entry point, require 1x $40 pulses
|
|
|
|
lda #$01
|
|
|
|
// FALLTROUGH
|
|
|
|
tape_normal_get_pilot_common:
|
|
|
|
sta FSBLK
|
|
|
|
lda #$0B
|
|
sta VIC_EXTCOL
|
|
|
|
// FALLTROUGH
|
|
|
|
tape_normal_get_pilot_common_restart:
|
|
|
|
lda FSBLK
|
|
sta ROPRTY
|
|
|
|
// FALLTROUGH
|
|
|
|
tape_normal_get_pilot_common_loop_outer:
|
|
|
|
ldy #$40
|
|
|
|
// FALLTROUGH
|
|
|
|
tape_normal_get_pilot_common_loop_inner:
|
|
|
|
jsr tape_common_get_pulse
|
|
bcc tape_normal_get_pilot_common_restart // not a pilot - try again
|
|
|
|
#if CONFIG_TAPE_AUTODETECT
|
|
// Try to distinguish turbo by cheecking for short signals
|
|
cmp #$B9 // see comment in tape_common_autodetect.s
|
|
bcs !+
|
|
#endif
|
|
|
|
jsr tape_normal_calibrate_during_pilot
|
|
|
|
dey
|
|
bne tape_normal_get_pilot_common_loop_inner
|
|
|
|
dec ROPRTY
|
|
bne tape_normal_get_pilot_common_loop_outer
|
|
|
|
clc
|
|
!:
|
|
rts
|
|
|
|
|
|
#endif
|