From 28de9a0aea5d0ddc46c852bc4374d395c4a723c8 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 25 Dec 2019 10:11:16 +0100 Subject: [PATCH] support for non-relocatable tape files --- CONFIG.md | 6 +++--- c64/kernal/tape/load_tape_normal.s | 4 ++-- c64/kernal/tape/load_tape_turbo.s | 9 +++++++++ c64/kernal/tape/tape_normal_pilot.s | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CONFIG.md b/CONFIG.md index 31c8437a..e0badbbf 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -119,17 +119,17 @@ Adds support for JiffyDOS fast protocol to the IEC bus. Needs about 430 bytes in KERNAL segment. If unsure - enable. -### `CONFIG_TAPE_LOAD` +### `CONFIG_TAPE_NORMAL` Adds a minimal normal (standard Commodore format) tape support - just LOAD command. -Needs some space in KERNAL segment. If unsure - enable. +Needs about 700 bytes in KERNAL segment (if both normal and turbo are enabled, about 900 bytes are needed, as they share some code). If unsure - enable. ### `CONFIG_TAPE_TURBO` Adds a minimal turbo tape support - just LOAD command (device 7, like on _Action Replay_ and _Final_ cartridges) -Needs about 400 bytes in KERNAL segment. If unsure - enable. +Needs about 600 bytes in KERNAL segment (if both normal and turbo are enabled, about 900 bytes are needed, as they share some code). If unsure - enable. ## Multiple SID support diff --git a/c64/kernal/tape/load_tape_normal.s b/c64/kernal/tape/load_tape_normal.s index f67ed8a4..d35d59ce 100644 --- a/c64/kernal/tape/load_tape_normal.s +++ b/c64/kernal/tape/load_tape_normal.s @@ -98,8 +98,8 @@ load_tape_normal_header: cmp #$03 bne load_tape_normal_header // header types 1 and 3 are loadable, see Mapping the C64, page 77 - // XXX handle non-relocatable program, header type 3 - + lda #$01 + sta SA // this file is non-relocatable; override secondary address with 1 !: // Handle the header diff --git a/c64/kernal/tape/load_tape_turbo.s b/c64/kernal/tape/load_tape_turbo.s index 643a0244..5bcc0677 100644 --- a/c64/kernal/tape/load_tape_turbo.s +++ b/c64/kernal/tape/load_tape_turbo.s @@ -63,6 +63,15 @@ load_tape_turbo_header_loop: cpy #$C0 // header is 192 bytes long in total bne load_tape_turbo_header_loop + // For non-relocatable files, override secondary address + ldy #$00 // XXX optimize out for 65C02 + lda (TAPE1), y + beq !+ + and #$01 + bne !+ + lda #$01 // XXX for 65C02 just set the bit with one instruction + sta SA +!: // Handle the header jsr tape_clean_sid diff --git a/c64/kernal/tape/tape_normal_pilot.s b/c64/kernal/tape/tape_normal_pilot.s index e2fb5823..a6f1e577 100644 --- a/c64/kernal/tape/tape_normal_pilot.s +++ b/c64/kernal/tape/tape_normal_pilot.s @@ -66,7 +66,7 @@ tape_normal_pilot_header: // require 128x $40 pulses lda #$80 - jmp tape_normal_pilot_common // XXX calibrate tape speeed afterwards + jmp tape_normal_pilot_common // XXX calibrate tape speed afterwards #endif