diff --git a/c64/kernal/tape/tape_common.s b/c64/kernal/tape/tape_common.s index daf95cb0..1f133fd2 100644 --- a/c64/kernal/tape/tape_common.s +++ b/c64/kernal/tape/tape_common.s @@ -34,25 +34,6 @@ tape_break_error: jmp kernalerror_ROUTINE_TERMINATED -// -// Handle tape deck motor -// - -tape_motor_off: - - lda CPU_R6510 - ora #$20 - bne !+ // branch always - -tape_motor_on: - - lda CPU_R6510 - and #($FF - $20) -!: - sta CPU_R6510 - rts - - // // Handle screen (visible/blanked) + tape deck motor (on/off), // store/restore screen color diff --git a/c64/kernal/tape/tape_motor.s b/c64/kernal/tape/tape_motor.s new file mode 100644 index 00000000..800a25df --- /dev/null +++ b/c64/kernal/tape/tape_motor.s @@ -0,0 +1,25 @@ + +// +// Handle tape deck motor +// + + +#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO + + +tape_motor_off: + + lda CPU_R6510 + ora #$20 + bne !+ // branch always + +tape_motor_on: + + lda CPU_R6510 + and #($FF - $20) +!: + sta CPU_R6510 + rts + + +#endif diff --git a/c64/kernal/tape/tape_normal_get_byte.s b/c64/kernal/tape/tape_normal_get_byte.s index 5bb70c6a..3eb3de09 100644 --- a/c64/kernal/tape/tape_normal_get_byte.s +++ b/c64/kernal/tape/tape_normal_get_byte.s @@ -20,7 +20,7 @@ tape_normal_get_byte: // First we need a byte marker - (L,M) !: jsr tape_normal_get_pulse - cmp #($100 - $95 - $04) + cmp #($FF - $95 - $04) bcs !- // too short for a long pulse jsr tape_normal_get_pulse bcs !- // too short for a medium pulse diff --git a/c64/kernal/tape/tape_normal_get_pulse.s b/c64/kernal/tape/tape_normal_get_pulse.s index 8d08b380..156ebcbe 100644 --- a/c64/kernal/tape/tape_normal_get_pulse.s +++ b/c64/kernal/tape/tape_normal_get_pulse.s @@ -37,7 +37,7 @@ tape_normal_get_pulse: // this is total 17 cycles, or $4 periods of 4 ticks (timer A) each - we need to take it into account // every time we check the pulse length - cmp #($100 - $6C - $04) // short vs medium is the default check + cmp #($FF - $6C - $04) // short vs medium is the default check rts