From 723a7772fa6b52e652006fcd30f0b09eab105b2e Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 13 Jan 2020 18:31:13 +0100 Subject: [PATCH] fixed IOINIT, adapted tape routines to fixed CHROUT --- STATUS.md | 4 ++-- c64/kernal/init/fda3.ioinit.s | 9 +++++---- c64/kernal/tape/tape_common.s | 7 ------- c64/kernal/tape/tape_common_screen.s | 9 +++++++++ 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/STATUS.md b/STATUS.md index efc98db2..a4cfd1c7 100644 --- a/STATUS.md +++ b/STATUS.md @@ -179,7 +179,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | :-------: | :--------: | :---------- | :------: | :--------------------------------------------------: | | `($028F)` | | `KEYLOG` | DONE | | | `$FF81` | `$FF5B` | `CINT` | DONE | | -| `$FF84` | `$FDA3` | `IOINIT` | PARTIAL | CIA initialization incomplete | +| `$FF84` | `$FDA3` | `IOINIT` | DONE | | | `$FF87` | `$FD50` | `RAMTAS` | DONE | | | `$FF8A` | `$FD15` | `RESTOR` | DONE | | | `$FF8D` | `$FD1A` | `VECTOR` | DONE | | @@ -220,7 +220,7 @@ 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 | see IOINIT status | +| `($FFFC)` | `$FCE2` | RESET vec | DONE | | | `($FFFE)` | | IRQ/BRK vec | DONE | |
diff --git a/c64/kernal/init/fda3.ioinit.s b/c64/kernal/init/fda3.ioinit.s index 0c08a714..758b2dab 100644 --- a/c64/kernal/init/fda3.ioinit.s +++ b/c64/kernal/init/fda3.ioinit.s @@ -111,10 +111,11 @@ IOINIT: lda #$3F sta CIA2_DDRA // $DD02 - // XXX how to initialize these timers??? - // stx CIA1_CRB // $DC0F - // stx CIA2_CRA // $DD0E - // stx CIA2_CRB // $DD0F + // Checked using VICE that original ROM initializes timers this way + ldx #$08 + stx CIA1_CRB // $DC0F + stx CIA2_CRA // $DD0E + stx CIA2_CRB // $DD0F // Set VIC-II bank - at least the 'Operacja Proboszcz' game needs this within IOINIT // Checked on original ROMs, that it sets bit #2 (RS-232 output) high diff --git a/c64/kernal/tape/tape_common.s b/c64/kernal/tape/tape_common.s index 90651acd..4f99c6e8 100644 --- a/c64/kernal/tape/tape_common.s +++ b/c64/kernal/tape/tape_common.s @@ -27,8 +27,6 @@ tape_break_error: tape_ask_play: - sei // timing is critical for tape loading - #if !CONFIG_TAPE_NO_KEY_SENSE // First check whether the button is already pressed @@ -50,7 +48,6 @@ tape_ask_play: tape_wait_play_loop: - jsr udtim_keyboard jsr STOP bcs tape_break_error @@ -299,15 +296,11 @@ tape_load_success: jsr tape_screen_on_motor_off jsr lvs_display_done - - cli jmp lvs_return_last_address tape_load_error: jsr tape_screen_on_motor_off - - cli jmp lvs_load_verify_error diff --git a/c64/kernal/tape/tape_common_screen.s b/c64/kernal/tape/tape_common_screen.s index 737888f3..61f25877 100644 --- a/c64/kernal/tape/tape_common_screen.s +++ b/c64/kernal/tape/tape_common_screen.s @@ -19,6 +19,15 @@ tape_screen_on_motor_off: jmp screen_on tape_screen_off_motor_on: + + // We do not want interrupts and CHROUT reenables them + sei + + // Clear keyboard buffer + lda #$00 + sta NDX + + // Set screen color lda VIC_EXTCOL sta COLSTORE