more work on tape support

This commit is contained in:
FeralChild64 committed 2019-10-31 22:42:44 +01:00
1 parent 46aacc4ef0
commit c32fbadc7c
6 files changed
+147 -38

No files matched your search

+6 -36
View File
@@ -10,53 +10,23 @@
#if CONFIG_TAPE_TURBO
tape_ask_play:
sei // timing is critical for tape loading
lda #$1D
sta CPU_R6510 // motor on XXX make it more system friendly
ror VIC_SCROLY // screen blanked to VIC_EXTCOL color XXX make it more system friendly
// XXX finish the implementation
rts
tape_load_success:
rol VIC_SCROLY // screen back on
lda #$37 // default setting
sta CPU_R6510
// XXX finish this routine
rts
tape_load_error:
// XXX finish this routine
rts
load_tape_turbo:
// XXX if VERIFY asked - error
jsr tape_ditch_verify // only LOAD is supported, no VERIFY
ldy #$00
sty PRTY // initial checksum value
jsr tape_ask_play
sty CIA2_TIMAHI // .Y still 0
sty CIA2_TIMAHI
lda #$FE // timer threshold for TurboTape
sta CIA2_TIMALO
jsr tape_ask_play
// Read file header
ldy #$00
jsr tape_turbo_sync // .X gets set to 0
stx STAL+0 // instead of a later lda, sta
+86
View File
@@ -0,0 +1,86 @@
//
// Common routines for tape support
//
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
tape_ditch_verify:
lda VERCKK
bne !+
rts
!:
pla
pla
jmp lvs_device_not_found_error
tape_motor_off:
lda CPU_R6510
ora #$20
sta CPU_R6510
rts
tape_motor_on:
lda CPU_R6510
and #($FF - $20)
sta CPU_R6510
rts
tape_ask_play:
sei // timing is critical for tape loading
jsr tape_motor_off
ldx #__MSG_KERNAL_PRESS_PLAY
jsr print_kernal_message
tape_wait_button_loop:
jsr udtim_keyboard
jsr STOP
bcc !+
// Stop key pressed
pla
pla
cli
jmp kernalerror_ROUTINE_TERMINATED
!:
lda CPU_R6510
and #$10 // check for pressed button
bne tape_wait_button_loop
jsr screen_blank
jsr tape_motor_on
rts
tape_load_success:
jsr screen_show
jsr tape_motor_off
jmp lvs_success_end
tape_load_error:
jsr screen_show
jsr tape_motor_off
jmp lvs_load_verify_error
#endif