From 434a17f1342772cbfbe1947d9c8ddd8059af1064 Mon Sep 17 00:00:00 2001 From: 4am Date: Sun, 16 Jan 2022 01:11:28 -0500 Subject: [PATCH] restore compact memory map --- src/constants.a | 21 ++++++++++----------- src/puzzle.a | 9 +++------ src/storage.a | 2 +- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/constants.a b/src/constants.a index a8b0f94..bb59bf3 100644 --- a/src/constants.a +++ b/src/constants.a @@ -14,11 +14,10 @@ ; 2000..3FFF - hi-res page ; 4000+ - program code (relocated to here at startup) ; ...unused... -; 7900..79FF - target words formatted array -; 7A00..7DFF - ProDOS file buffer for PROGRESS file -; 7E10..7F37 - progress of puzzles in current world -; 7F38..7FFF - address lookup table for puzzles within following world data -; 8000..BEB3 - world data (read from disk) +; 8A00..8DFF - ProDOS file buffer for PROGRESS file +; 8E10..8F37 - progress of puzzles in current world +; 8F38..8FFF - address lookup table for puzzles within following world data +; 9000..BEB3 - world data (read from disk) ; BEB4..BEFF - (de)acceleration function ;------------------------------------------------------------------------------ @@ -71,11 +70,11 @@ HGRHI = $1B00 ; 0x00C0 bytes WORLDFILEBUFFER = $1C00 ; 0x0400 bytes PREFSFILEBUFFER = $1C00 ; 0x0400 bytes (note: same as WORLDFILEBUFFER) -PROGRESSFILEBUFFER = $7A00; 0x0400 bytes -PACKEDPROGRESS = $7E10 ; 0x00C0 bytes -PROGRESS = $7ED0 ; 0x0068 bytes -PUZZLELO = $7F38 ; 0x0064 bytes -PUZZLEHI = $7F9C ; 0x0064 bytes -WORLDDATA = $8000 ; 0x3F00 bytes max +PROGRESSFILEBUFFER = $8A00; 0x0400 bytes +PACKEDPROGRESS = $8E10 ; 0x00C0 bytes +PROGRESS = $8ED0 ; 0x0068 bytes +PUZZLELO = $8F38 ; 0x0064 bytes +PUZZLEHI = $8F9C ; 0x0064 bytes +WORLDDATA = $9000 ; 0x3F00 bytes max DisableAccelerator = $BEB4 EnableAccelerator = DisableAccelerator+3 diff --git a/src/puzzle.a b/src/puzzle.a index 35dd53a..719b8eb 100644 --- a/src/puzzle.a +++ b/src/puzzle.a @@ -35,10 +35,10 @@ puzzle_data6 = $033A ; [0x08 bytes] puzzle_data7 = $0342 ; [0x08 bytes] puzzle_data8 = $034A ; [0x08 bytes] target_word_count = $0352 ; [0x01 byte ] number of records in -target_words = $7900 ; [0x100 bytes] +target_words = $0353 ; [0x80 bytes] ; each 8-byte record is a -length word, no prefix ; extra bytes in each record are guaranteed to be 0x00 - ; max 32 words per puzzle + ; max 16 words per puzzle ;------------------------------------------------------------------------------ ; InitPuzzleStorage @@ -52,14 +52,11 @@ target_words = $7900 ; [0x100 bytes] ;------------------------------------------------------------------------------ InitPuzzleStorage sta puzzle_logical_width - ldx #$52 + ldx #$CF lda #0 - sta puzzle_logical_width, x dex bne - -- sta target_words, x - inx - bne - rts ;------------------------------------------------------------------------------ diff --git a/src/storage.a b/src/storage.a index e99deb8..781dfd3 100644 --- a/src/storage.a +++ b/src/storage.a @@ -57,7 +57,7 @@ MaybeLoadWorldFromDisk jsr LoadFile1Shot !word @filename ; address of filename !word WORLDDATA ; load address - !word $3F00 ; maximum length + !word $2F00 ; maximum length !word WORLDFILEBUFFER ; address of ProDOS file buffer bcs @failure jsr PreParseWorldData