Skip to content

Commit 0a84236

Browse files
Skipping dynmem loading if already supplied by exomizer (optional)
1 parent a4ee6b8 commit 0a84236

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ d64.strictz5:
5959
$(C1541) -attach strictz5.d64 -write ozmoo ozmoo
6060

6161
d64.minform:
62-
acme -DTRACE=1 -DZ5=1 $(DEBUGFLAGS) $(VMFLAGS) --cpu 6510 --format cbm -l acme_labels.txt --outfile ozmoo ozmoo.asm
63-
#exomizer/src/exomizer sfx basic oz -o ozmoo
62+
acme -DDYNMEM_ALREADY_LOADED=1 -DZ5=1 $(DEBUGFLAGS) $(VMFLAGS) --cpu 6510 --format cbm -l acme_labels.txt --outfile ozmoo ozmoo.asm
63+
exomizer/src/exomizer sfx basic ozmoo minform/minform.dynmem,14336 -o ozmoo_zip
6464
cp minform/minform.d64 minform.d64
65-
$(C1541) -attach minform.d64 -write ozmoo ozmoo
65+
$(C1541) -attach minform.d64 -write ozmoo_zip ozmoo
6666

6767
d64.minizork:
6868
acme -DZ3=1 $(DEBUGFLAGS) $(VMFLAGS) --cpu 6510 --format cbm -l acme_labels.txt --outfile ozmoo ozmoo.asm

create_d64.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,22 @@ def create_d64(story_filename, d64_filename, dynmem_filename)
163163
# check header.high_mem_start (size of dynmem + statmem)
164164
# minform: $1768 = 5992 (23, 104)
165165
story_file.read(4) # skip version and flags1
166-
high_mem_start = story_file.read(2).unpack("n")
166+
high_mem_start = story_file.read(2).unpack("n")[0]
167167

168168
# check header.static_mem_start (size of dynmem)
169169
story_file.read(8) # skip until this entry
170170
static_mem_start = story_file.read(2).unpack("n")[0]
171171

172172
# get dynmem size (in 1kb blocks)
173-
dynmem_size = 1024 * ((static_mem_start + 512)/1024)
173+
#dynmem_size = 1024 * ((static_mem_start + 512)/1024)
174+
dynmem_size = 1024 * ((high_mem_start + 512)/1024)
174175

175176
# save dynmem as separate file
176177
story_file.rewind
177178
dynmem = story_file.read(dynmem_size)
178179
if !dynmem_filename.nil? then
180+
# Assume memory starts at $3800
181+
dynmem_file.write([0x00,0x38].pack("CC"))
179182
dynmem_file.write(dynmem)
180183
dynmem_file.close
181184
end

minform/minform.dynmem

3 KB
Binary file not shown.

ozmoo.asm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ w1 cmp $d012
9191
; Default banks during execution: Like standard except Basic ROM is replaced by RAM.
9292
+set_memory_no_basic
9393

94-
94+
!ifdef DYNMEM_ALREADY_LOADED {
95+
jsr parse_header
96+
} else {
9597
jsr load_dynamic_memory
98+
}
9699
jsr prepare_static_high_memory
97100
jsr parse_dictionary
98101
jsr parse_object_table
@@ -116,7 +119,9 @@ load_header
116119
sty readblocks_numblocks
117120
sta readblocks_mempos + 1
118121
jsr readblocks
122+
;jmp parse_header
119123

124+
parse_header ; must follow load_header
120125
; check z machine version
121126
lda story_start + header_version
122127
!ifdef Z3 {

vmem.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
; virtual memory
33
TRACE_VM = 1
44
;TRACE_VM_PC = 1
5-
PRELOAD_UNTIL = header_static_mem ; dynmem only
5+
;PRELOAD_UNTIL = header_static_mem ; dynmem only
66
;PRELOAD_UNTIL = header_dictionary ; dynmen + grammar tables
7-
;PRELOAD_UNTIL = header_high_mem ; dynmem + statmem
7+
PRELOAD_UNTIL = header_high_mem ; dynmem + statmem
88

99
; virtual memory address space
1010
; Z1-Z3: 128 kB (0 - $1ffff)

0 commit comments

Comments
 (0)