From 702bde56d94e9d33710df2ed159b5cf94290ec27 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 17 Jul 2024 11:14:20 -0400 Subject: [PATCH] riven: got hd loading working will forever be hard keeping block (512 byte) and sector (256 byte) sizes separate --- games/riven_hgr/NOTES | 8 +++++++- games/riven_hgr/qload_hd.s | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/games/riven_hgr/NOTES b/games/riven_hgr/NOTES index 36f489f7..d9ac9fc5 100644 --- a/games/riven_hgr/NOTES +++ b/games/riven_hgr/NOTES @@ -84,8 +84,14 @@ final movie roto procedure: scale to 80x48 save +;================================ +; NOTE: for hard-disk image we use 512-byte blocks (not 256-byte sectors) +; so be careful using odd-numbered block lengths! +; This is mostly an issue for the $7F long almost-32k files +; and the 1-block level info files, otherwise we mostly are even + Disk00 Map (disk has 35 tracks, each 4k in size) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$~~~~~~~ T 0 = Qboot T 0.5 = TITLE 1618 bytes 8S = 0T8S (2048) 400B free T 1 = QLOAD 2346 bytes 16S = 1T00S (4096) 2k free diff --git a/games/riven_hgr/qload_hd.s b/games/riven_hgr/qload_hd.s index 76bd0db2..f6c231b7 100644 --- a/games/riven_hgr/qload_hd.s +++ b/games/riven_hgr/qload_hd.s @@ -90,6 +90,11 @@ load_file: lda LENGTH_ARRAY,X + clc + adc #1 + lsr ; important! blocks=sectors/2 + ; need to round up if it was odd + ; careful: this could over-write if not careful sta COUNT jsr seekread