Skip to content

Commit 6213a3e

Browse files
Added MODE_ZIP for X16
1 parent 8a99c16 commit 6213a3e

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
all: x16
22

33
x16:
4-
ruby make.rb -s examples/dragontroll.z5 -t:x16 -v
4+
ruby make.rb examples/dragontroll.z5 -t:x16 -v
55
#acme --cpu 65c02 -o testx16.bin --format cbm -l temp/acme_labels.txt testx16.asm
66
# Need F12 to enter the debugger
77
#grep testscreen temp/acme_labels.txt

make.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
MODE_71 = 6
7676
MODE_71D = 7
7777
MODE_81 = 8
78+
MODE_ZIP = 9
7879

7980
DISKNAME_BOOT = 128
8081
DISKNAME_STORY = 129
@@ -2080,6 +2081,23 @@ def build_81(storyname, diskimage_filename, config_data, vmem_data, vmem_content
20802081
nil # Signal success
20812082
end
20822083

2084+
def build_zip(storyname, diskimage_filename, config_data, vmem_data,
2085+
vmem_contents, preload_max_vmem_blocks)
2086+
# create folder if needed, and clear old contents, if any
2087+
foldername = "#{$target}_#{storyname}"
2088+
FileUtils.rm_rf(foldername)
2089+
FileUtils.mkdir_p(foldername)
2090+
2091+
# Add terp and story file
2092+
FileUtils.cp($good_zip_file, foldername+"/"+storyname+".prg")
2093+
FileUtils.cp($story_file, foldername+"/"+storyname+".dat")
2094+
2095+
# Add bootfile + terp + preloaded vmem blocks file to disk
2096+
# if add_boot_file(diskfilename, diskimage_filename) != true
2097+
puts "Successfully built game as #{foldername}"
2098+
nil # Signal success
2099+
end
2100+
20832101
def print_usage_and_exit
20842102
print_usage
20852103
exit 1
@@ -2487,6 +2505,8 @@ def print_usage
24872505
unless mode
24882506
if $target == 'c128'
24892507
mode = MODE_71
2508+
elsif $target == 'x16'
2509+
mode = MODE_ZIP
24902510
elsif $target == 'mega65'
24912511
mode = MODE_81
24922512
else
@@ -2513,6 +2533,11 @@ def print_usage
25132533
exit 1
25142534
end
25152535

2536+
if mode != MODE_ZIP and $target == 'x16'
2537+
puts "ERROR: Only build mode ZIP is supported on this target platform."
2538+
exit 1
2539+
end
2540+
25162541
# if mode == MODE_71 and $target != 'c128'
25172542
# puts "ERROR: Build mode 71 is not supported on this target platform."
25182543
# exit 1
@@ -3146,6 +3171,9 @@ def print_usage
31463171
when MODE_81
31473172
diskimage_filename = File.join($TEMPDIR, "temp1.d81")
31483173
error = build_81(storyname, diskimage_filename, config_data.dup, vmem_data.dup, vmem_contents, preload_max_vmem_blocks)
3174+
when MODE_ZIP
3175+
diskimage_filename = File.join($TEMPDIR, "temp1.zip")
3176+
error = build_zip(storyname, diskimage_filename, config_data.dup, vmem_data.dup, vmem_contents, preload_max_vmem_blocks)
31493177
else
31503178
puts "Unsupported build mode."
31513179
exit 1

0 commit comments

Comments
 (0)