-
Notifications
You must be signed in to change notification settings - Fork 11
/
makeheader
executable file
·56 lines (42 loc) · 911 Bytes
/
makeheader
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
#!/bin/bash
header()
{
FILE=$1
VAR=$2
/usr/bin/xxd -i ${FILE} | sed 's/'${FILE}'/'${VAR}'/'
}
cd asm
make clean
PATH=../cc65-2.13.3/bin:$PATH make
(
header autoload autoloadcode 4
header inflate inflatecode 8
header fastload9600 fastload9600 4
header fastload8000 fastload8000 4
header fastloadcd fastloadcd 4
header diskload9600 diskload9600 4
header diskload8000 diskload8000 4
header diskload2 diskloadcode2 8
header diskload3 diskloadcode3 8
) > ../c2t.h.1
cd ..
cat <<EOF >c2t.h.2
//DOS 3.3
unsigned char dosboot1[] = {
EOF
cat mon/dos33.boot1.mon | \
perl -p -e 's/ /,0x/g' | \
perl -p -e 's/$/,/' | \
perl -p -e 's/^....../\t/' >>c2t.h.2
cat <<EOF >>c2t.h.2
};
//DOS 3.3
unsigned char dosboot2[] = {
EOF
cat mon/dos33.boot2.mon | \
perl -p -e 's/ /,0x/g' | \
perl -p -e 's/$/,/' | \
perl -p -e 's/^....../\t/' >>c2t.h.2
echo "};" >>c2t.h.2
cat c2t.h.[012] > c2t.h
rm -f c2t.h.[12]