summaryrefslogtreecommitdiffstats
path: root/games/clksignal-roms/clksignal-roms.SlackBuild
blob: 1e17c3188b08f3fe281f43623b5198414de98dba (plain)
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
#!/bin/bash

# Slackware build script for clksignal-roms

# Written by B. Watson (urchlay@slackware.uk)

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.

# I don't host any of the DOWNLOAD files (except the oric color
# palette). ROM sites tend to come and go, so at some point the
# download links will likely break. Let me know if this happens.

# To clean up the directory:
# rm -f *.rom *.ROM *.img *.zip *.chr basic chargen kernal dos154*

# 20230716 bkw:
# - clksignal 20230515's clksignal-qt now looks in a different dir for ROMS;
#   include a symlink in the package.

# 20230114 bkw:
# - add apple2gs.chr
# - add tos104uk.img
# - update STATUS.txt

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=clksignal-roms
VERSION=${VERSION:-20230716}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

ARCH=noarch

if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  exit 0
fi

TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION

install_rom() {
  install -m0644 -oroot -groot "$1" "$2"
}

ROMBASE=$PKG/usr/share/CLK
set_dest() {
  DEST="$ROMBASE/$1"
  mkdir -p "$DEST"
}

###### Apple II series ROMs, including the Disk II and IIgs.
set_dest AppleII

# wheels within wheels, plans within plans, zipfiles within zipfiles...
unzip $CWD/apple2_roms.zip apple.rom apple2o.rom 13-sector-disk-ii-roms.zip \
  apple_iie_rom.zip apple_2e_unenhanced_rom.zip ROMS.ZIP
unzip apple_iie_rom.zip APPLE2E.ROM
unzip apple_2e_unenhanced_rom.zip
unzip ROMS.ZIP 3410036.BIN 3420028A.BIN 3410027A.BIN

install_rom apple.rom $DEST/apple2.rom
install_rom apple2o.rom $DEST/apple2o.rom
install_rom APPLE2E.ROM $DEST/apple2e.rom
install_rom apple2eu.rom $DEST/apple2eu.rom
install_rom 3410036.BIN $DEST/apple2-character.rom

unzip $CWD/apple2ee.zip
install_rom 3420265a.chr $DEST/apple2e-character.rom

# CRC doesn't match, but the machine starts and seems to work
# correctly.
unzip $CWD/apple2e.zip 3420133a.chr
install_rom 3420133a.chr $DEST/apple2eu-character.rom

set_dest DiskII
install_rom 3410027A.BIN $DEST/boot-16.rom
install_rom 3420028A.BIN $DEST/state-machine-16.rom

unzip 13-sector-disk-ii-roms.zip '*.bin'
install_rom 13-sector-disk-ii-boot-rom.bin $DEST/boot-13.rom
install_rom 13-sector-disk-ii-state-machine-rom.bin $DEST/state-machine-13.rom

set_dest AppleIIgs
Z="$CWD/MESS 0.151 ROMs%2Fapple2gs.zip"
[ -e "$Z" ] || Z="$CWD/MESS%200.151%20ROMs%2Fapple2gs.zip"
[ -e "$Z" ] || Z="$CWD/apple2gs.zip"
unzip "$Z"

# Only include the ROM03 firmware.
# According to the CRC, this is an 'alternate' (or anyway, it's the 2nd
# of two known CRCs).
# Doesn't really matter: clksignal segfaults on trying to start up
# with --new=appleiigs.
cat 341-0737 341-0748 > rom03
install_rom rom03 $DEST/apple2gs.rom2
install_rom 341s0632-2.bin $DEST/341s0632-2
install_rom apple2gs.chr $DEST/apple2gs.chr

###### Commodore VIC-20 and 1540/1541 ROMs
# only English and PAL for now.
set_dest Vic20
install_rom $CWD/basic $DEST/basic.bin
install_rom $CWD/kernal $DEST/kernel-pal.bin
install_rom $CWD/chargen $DEST/characters-english.bin

# the 1541 isn't yet emulated by clksignal...
set_dest Commodore1540
install_rom $CWD/dos1540 $DEST/1540.bin
install_rom $CWD/dos1541 $DEST/1541.bin

###### Atari ST
set_dest AtariST
unzip $CWD/tos100uk.zip
install_rom tos100uk.img $DEST/tos100.img
unzip $CWD/tos104uk.zip
install_rom tos104uk.img $DEST/tos104.img

###### Colecovision
set_dest ColecoVision
unzip $CWD/coleco.zip
install_rom coleco.rom $DEST/coleco.rom

##### Amiga
# handle filename with spaces (wget) or hex escapes (curl -O, some browsers).
set_dest Amiga
Z="$CWD/Kickstart v1.3 rev 34.5 (1987)(Commodore)(A500-A1000-A2000-CDTV).rom"
if [ ! -e "$Z" ]; then
  Z="$CWD/Kickstart%20v1.3%20rev%2034.5%20%281987%29%28Commodore%29%28A500-A1000-A2000-CDTV%29.rom"
fi
install_rom "$Z" $DEST/Kickstart-v1.3-rev34.5-1987-Commodore-A500-A1000-A2000-CDTV.rom

##### Amstrad CPC
set_dest AmstradCPC

# firmware and BASIC are combined, split 'em apart with dd.
unzip $CWD/cpc464.zip
dd if=cpc464.rom of=$DEST/os464.rom bs=16k count=1
dd if=cpc464.rom of=$DEST/basic464.rom bs=16k count=1 skip=1
install_rom cpcados.rom $DEST/amsdos.rom

unzip $CWD/cpc664.zip
dd if=cpc664.rom of=$DEST/os664.rom bs=16k count=1
dd if=cpc664.rom of=$DEST/basic664.rom bs=16k count=1 skip=1

unzip $CWD/cpc6128.zip
dd if=cpc6128.rom of=$DEST/os6128.rom bs=16k count=1
dd if=cpc6128.rom of=$DEST/basic6128.rom bs=16k count=1 skip=1

##### Electron
set_dest Electron
unzip $CWD/electron.zip
install_rom basic.rom $DEST/basic.rom
install_rom os.rom $DEST/os.rom

##### Macintosh
set_dest Macintosh
unzip $CWD/mac128k.zip
unzip $CWD/mac512k.zip
unzip $CWD/macplus.zip
install_rom mac128k.rom $DEST/mac128k.rom
install_rom mac512k.rom $DEST/mac512k.rom
install_rom macplus.rom $DEST/macplus.rom

##### Sega Master System
set_dest MasterSystem
unzip $CWD/sms1pal.zip bios13fx.rom
unzip $CWD/smsj.zip jbios21.rom
install_rom bios13fx.rom $DEST/bios.sms
install_rom jbios21.rom $DEST/japanese-bios.sms

##### Enterprise
set_dest Enterprise
Z="$CWD/MESS 0.151 ROMs%2Fep64.zip"
[ ! -e "$Z" ] && Z="$CWD/MESS%200.151%20ROMs%2Fep64.zip"
[ ! -e "$Z" ] && Z="$CWD/ep64.zip"
unzip "$Z"
install_rom 9256ds-0038_enter05-23-a.u2 $DEST/exos20.bin

##### MSX. "any MSX BIOS", whatever that means.
set_dest MSX
install_rom $CWD/MSX.ROM $DEST/msx.rom
install_rom $CWD/DISK.ROM $DEST/disk.rom

##### Oric
# only have 2 of the 4 disk interfaces and 2 of the 3 BASIC ROMs.
# oric-pal-prom.zip originally came from
# https://forum.defence-force.org/viewtopic.php?f=8&t=2248&hilit=colour+rom&start=15
# ...and isn't copyrighted AFAIK.
set_dest Oric
unzip $CWD/oric1.zip
unzip $CWD/orica.zip
unzip $CWD/oric-pal-prom.zip
install_rom basic10.rom $DEST/basic10.rom
install_rom basic11b.rom $DEST/basic11.rom
install_rom jasmin.rom $DEST/jasmin.rom
install_rom microdis.rom $DEST/microdisc.rom
install_rom tbp24s10n.bin $DEST/colour.rom

##### ZX80/81
set_dest ZX8081
unzip $CWD/zx80.zip zx80.rom
unzip $CWD/zx81.zip zx81a.rom
install_rom zx80.rom $DEST/zx80.rom
install_rom zx81a.rom $DEST/zx81.rom

# 20230716 bkw: newer clksignal-qt requires this:
mkdir -p $PKG/usr/share/clksignal-qt
ln -s ../CLK $PKG/usr/share/clksignal-qt/ROMImages

# No docs, include our own.
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cat $CWD/README > $PKGDOC/README.txt
cat $CWD/STATUS.txt > $PKGDOC/STATUS.txt
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE