forked from c64scene-ar/64k-ought-to-be-enough
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
140 lines (113 loc) · 4.99 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.PHONY: res runme part2 part2a part1 part1a part3 part3a
TARGET_NAME_DETECT = detect.com
TARGET_DETECT = bin/${TARGET_NAME_DETECT}
ASM = nasm
ASMFLAGS = -fobj -Wall -Ox
LD = alink
LDFLAGS = -oCOM -m
all: res test_boot
detect: $(TARGET_DETECT)
SRCFILES_DETECT = detect/detect.asm common/pztimer.asm
OBJECTS_DETECT = $(patsubst %.asm, %.o, $(SRCFILES_DETECT))
%.o: %.asm
$(ASM) $(ASMFLAGS) $< -o $@
.PRECIOUS: $(TARGET_P1) $(OBJECTS_P1) $(TARGET_DETECT) $(OBJECTS_DETECT)
$(TARGET_DETECT): $(OBJECTS_DETECT)
echo "Linking..."
$(LD) $(OBJECTS_DETECT) $(LDFLAGS) -o $@
clean:
@echo "Cleaning..."
-rm -f */*.o
-rm -f bin/*.map
part1:
@echo "Generating part1.com"
nasm -Ox -Wall part1/part1.asm -fbin -o bin/part1.com
part1a: part1
@python3 tools/append_gfx_to_com.py part1/image_320_200.raw -c bin/part1.com -o bin/part1gfx.com -s 48
test_part1: part1a
@echo "Running..."
dosbox-x -conf conf/dosbox-x_pcjr.conf -c "mount c bin/ && dir" -c "c:" -c part1gfx.com
part2:
@echo "Generating part2.com"
nasm -Ox -Wall part2/part2.asm -fbin -o bin/part2.com
part2a: part2
@python3 tools/append_gfx_to_com.py part2/alakran-cara.raw -c bin/part2.com -o bin/part2gfx.com -s 32
@echo "Done."
test_part2: part2a
@echo "Running..."
dosbox-x -conf conf/dosbox-x_pcjr.conf -c "mount c bin/ && dir" -c "c:" -c part2gfx.com
part3:
@echo "Generating part3.com"
nasm -Ox -Wall part3/part3.asm -fbin -o bin/part3.com
part3a: part3
@python3 tools/append_gfx_to_com.py part3/image_zero.raw -c bin/part3.com -o bin/part3gfx.com -s 56
test_part3: part3a
@echo "Running..."
dosbox-x -conf conf/dosbox-x_pcjr.conf -c "mount c bin/ && dir" -c "c:" -c part3gfx.com
runme:
@echo "Generating runme.com"
nasm -Ox -Wall runme/runme.asm -fbin -o bin/runme.com
test_runme: runme
@echo "Running..."
dosbox-x -conf conf/dosbox-x_pcjr.conf -c "mount c bin/ && dir" -c "c:" -c runme.com
test_detect: detect
dosbox-x -conf conf/dosbox-x_pcjr.conf -c "mount c bin/" -c "c:" -c dir
fat_image: runme detect part1a part2a part3a
@echo "Generating FAT image with needed files"
-rm -f boot_loader/fat_image.360
sudo mkfs.msdos -n PVM_BOOT -C boot_loader/fat_image.360 360
-sudo mkdir /media/floppy
sudo mount -o loop boot_loader/fat_image.360 /media/floppy
sudo cp bin/runme.com /media/floppy/
sudo cp bin/detect.com /media/floppy/
sudo cp bin/part1gfx.com /media/floppy/part1.com
sudo cp bin/part2gfx.com /media/floppy/part2.com
sudo cp bin/part3gfx.com /media/floppy/part3.com
sudo umount /media/floppy
sudo rmdir /media/floppy
dd if=boot_loader/fat_image.360 of=boot_loader/fat_without_boot.bin bs=512 skip=1 count=719
boot: fat_image
nasm -Ox -Wall boot_loader/boot_loader.asm -fbin -o boot_loader/boot.bin
cat boot_loader/boot.bin boot_loader/fat_without_boot.bin > bin/demo_pvm.360
test_boot: boot
dosbox-x -conf conf/dosbox-x_pcjr.conf
dist: boot
@echo "Generating distribution .zip"
-rm bin/64kought.zip
-rm 64kought/64kought.360
cp bin/demo_pvm.360 64kought/64kought.360
zip bin/64kought.zip -r 64kought
res:
@echo "Generating resources..."
@echo "Compressing music..."
python3 tools/convert_vgm_to_pvm.py res/cumparchiptune.vgm
python3 tools/convert_vgm_to_pvm.py res/libertango.vgm
python3 tools/convert_vgm_to_pvm.py res/zamba_de_mi_esperanza.vgm
mv res/cumparchiptune.pvm part1/uctumi-cumparsita.pvm
mv res/libertango.pvm part2/uctumi-libertango.pvm
mv res/zamba_de_mi_esperanza.pvm part3/uctumi-zamba.pvm
@echo "Converting graphics..."
python3 tools/parse_55_segment_data.py res/55-segment.png -o part1/segment55_data.asm
python3 tools/parse_55_segment_font.py -o part1/segment55_table.asm
python3 tools/parse_ibm_charset.py -m 4 res/tandy_1000_hx_charset-charset.bin -o part1/charset_0x20_0x60.bin
python3 tools/convert_gfx_to_bios_format.py -g 9 -o part2/alakran-cara.raw "res/alakran-cara.png"
python3 tools/convert_gfx_to_bios_format.py -g 88 -o part3/image_pampa.raw "res/part3_pampa.png"
python3 tools/convert_gfx_to_bios_format.py -g 10 -o res/image_moon.raw "res/part3_moon.png"
python3 tools/convert_gfx_to_bios_format.py -g 6 -o res/image_still_there.raw "res/part3_still_there.png"
python3 tools/convert_gfx_to_bios_format.py -g 8 -o part1/image_320_200.raw res/part1_image.png
python3 tools/parse_big_charset.py -o part2/charset_bigfont.bin res/part2_font_arleka-4colors.png
python3 tools/generate_elipse.py -o part3/elipse_table.asm -v 64
python3 tools/vector_editor.py -o part3/svg_font.asm
python3 tools/generate_fadeout_table.py -o common/fadeout16.asm
@echo "Splitting graphic..."
@dd if=res/image_moon.raw of=res/image_moon_half_a.raw count=1 bs=16384
@dd if=res/image_moon.raw of=res/image_moon_half_b.raw count=1 skip=1 bs=16384
@echo "Compressing graphics..."
@lz4 -9 -f res/image_moon_half_a.raw part3/image_moon_half_a.raw.lz4
@lz4 -9 -f res/image_moon_half_b.raw part3/image_moon_half_b.raw.lz4
@lz4 -9 -f res/image_still_there.raw part3/image_still_there.raw.lz4
@lz4 -9 -f part3/image_pampa.raw part3/image_pampa.raw.lz4
@echo "Done"
dis:
@echo "Dissassembling..."
ndisasm -b 16 -o 100h bin/part1.com | gvim -