tape code cleanup, added impulse detection for normal mode

This commit is contained in:
FeralChild64 committed 2019-12-18 17:45:20 +01:00
1 parent d5d3a1c3b2
commit f1e5a4cb3e
6 files changed
+219 -91

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
//
// Tape (turbo) helper routine - synchronization handling
//
// Based on routine by enthusi/Onslaught, found here:
// - https://codebase64.pokefinder.org/doku.php?id=base:turbotape_loader_source
#if CONFIG_TAPE_TURBO
tape_turbo_sync_common:
jsr tape_turbo_get_bit
rol ROPRTY
lda ROPRTY
cmp #$02
bne tape_turbo_sync_common
rts
tape_turbo_sync_header:
ldx #$FF
!:
ldy #$03
!:
jsr tape_turbo_sync_common
dey
bne !-
dex
bne !--
// FALLTROUGH
tape_turbo_sync_payload:
jsr tape_turbo_sync_common
!:
ldx #$09 // 9,8,... is real turboTape
!: // I sometimes used 8,7,6... to avoid it being listed in vice :)
jsr tape_turbo_get_byte
cmp #$02
beq !-
ldy #$00
!:
cpx ROPRTY
bne tape_turbo_sync_payload
jsr tape_turbo_get_byte
dex
bne !-
rts
#endif // CONFIG_TAPE_TURBO