improved tape system autodetection

This commit is contained in:
FeralChild64 committed 2020-01-17 17:38:37 +01:00
1 parent 854f03ef84
commit 82347a8b17
11 files changed
+112 -30

No files matched your search

+30
View File
@@ -11,13 +11,43 @@
tape_turbo_sync_first:
#if CONFIG_TAPE_AUTODETECT
ldy #$00
!:
jsr tape_turbo_get_bit
rol INBIT
lda INBIT
cmp #$FF
bne !+
iny
bpl !-
bmi tape_turbo_sync_first_fail // suspiciously many $FF bytes, probably not a turbo tape
!:
cmp #$02
bne tape_turbo_sync_first
clc
rts
tape_turbo_sync_first_fail:
sec
rts
#else // no CONFIG_TAPE_AUTODETECT
jsr tape_turbo_get_bit
rol INBIT
lda INBIT
cmp #$02
bne tape_turbo_sync_first
rts
#endif
#endif