diff --git a/STATUS.md b/STATUS.md index 36031357..bec0c131 100644 --- a/STATUS.md +++ b/STATUS.md @@ -151,8 +151,8 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | `$FFF0` | `$E50A` | `PLOT` | DONE | | | `$FFF3` | | `IOBASE` | DONE | | | `($FFFA)` | | NMI vec | PARTIAL | | -| `($FFFC)` | `$FCE2` | RESET vec | PARTIAL | | -| `($FFFE)` | | IRQ/BRK vec | PARTIAL | | +| `($FFFC)` | `$FCE2` | RESET vec | PARTIAL | see IOINIT status | +| `($FFFE)` | | IRQ/BRK vec | DONE | |
diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 4766472e..34f5c632 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -138,7 +138,7 @@ .label ROPRTY = $BD // tape / RS-232 temporary storage .label FSBLK = $BE // -- NOT IMPLEMENTED -- .label MYCH = $BF // -- NOT IMPLEMENTED -- - .label CAS1 = $C0 // -- NOT IMPLEMENTED -- + .label CAS1 = $C0 // tape motor interlock .label STAL = $C1 // $C1-$C2 LOAD/SAVE start address .label MEMUSS = $C3 // $C3-$C4 temporary address for tape LOAD/SAVE .label LSTX = $C5 // last keyy matrix position [!] our usage probably differs in details diff --git a/c64/kernal/interrupts/ea31.default_irq_handler.s b/c64/kernal/interrupts/ea31.default_irq_handler.s index 304fa343..472256b4 100644 --- a/c64/kernal/interrupts/ea31.default_irq_handler.s +++ b/c64/kernal/interrupts/ea31.default_irq_handler.s @@ -5,6 +5,27 @@ default_irq_handler: jsr JSCNKEY jsr JUDTIM // update jiffy clock +#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO + + // Turn tape motor on/off depending on the button state + // For CAS1 (tape motor interlock) variable description, see Mapping the C64, page 7 + + lda CPU_R6510 + and #$10 + beq !+ // branch if tape button pressed + + jsr tape_motor_off + lda #$00 + sta CAS1 + beq default_irq_handler_end_tape // branch always +!: + lda CAS1 + bne default_irq_handler_end_tape + jsr tape_motor_on + +default_irq_handler_end_tape: + +#endif + // Acknowledge CIA interrupt and return jmp clear_cia1_interrupt_flag_and_return_from_interrupt - diff --git a/c64/kernal/tape/tape_common.s b/c64/kernal/tape/tape_common.s index e6bb200e..bb6fa3af 100644 --- a/c64/kernal/tape/tape_common.s +++ b/c64/kernal/tape/tape_common.s @@ -84,6 +84,14 @@ tape_ask_play: sei // timing is critical for tape loading + // First check whether the button is already pressed + + lda CPU_R6510 + and #$10 + beq tape_wait_play_done + + // Turn off the motor, display message + jsr tape_motor_off ldx #__MSG_KERNAL_PRESS_PLAY @@ -110,6 +118,8 @@ tape_wait_play_loop: and #$10 // check for pressed button bne tape_wait_play_loop +tape_wait_play_done: + jsr print_return jmp tape_screen_hide_motor_on