joeylib2/installer/components/x68kFirmware.sh

47 lines
1.8 KiB
Bash

# shellcheck shell=bash
# Part of JoeyLib, Copyright (c) 2026 Scott Duensing, under the MIT License.
# See LICENSE.md for license information.
# SPDX-License-Identifier: MIT
#
# Sharp X68000 firmware from Sharp's own free release (2000, published by
# the X68000 LIBRARY): the original IPL-ROM (all `-bios ipl10` needs) and
# the Human68k 3.02 system disk. The CG (font) ROM is not part of that
# release; it is the private component x68kCgrom.
compDescription="X68000 firmware: Sharp's free IPL-ROM + Human68k 3.02 system disk"
compGroups="emulator:x68000"
compRequires="host"
compHostDeps="lhasa"
compBase="http://retropc.net/x68000/software/sharp"
biosSha256="286564f316e1615c46a23b25536ebd403ab60979f6c4eee21d2287f005a3b309"
humanSha256="da68be5c5cbea871ecb5588010a4d3fe52f26c8c686401027cecc0d1a27dca1a"
compPin="$biosSha256 $humanSha256"
fwDir="$JOEY_FIRMWARE/x68000"
compInstall() {
local tmp
tmp="$(freshBuildDir "$compId")"
extractArchive "$(fetchFile "$compBase/x68bios/X68BIOSE.LZH" "$biosSha256")" "$tmp/bios"
extractArchive "$(fetchFile "$compBase/human302/HUMN302I.LZH" "$humanSha256")" "$tmp/human"
# Name case depends on the extractor (lhasa lowercases MS-DOS archives).
install -D -m 644 "$(find "$tmp/bios" -maxdepth 1 -iname iplrom.dat)" "$fwDir/roms/x68000/iplrom.dat"
install -D -m 644 "$(find "$tmp/human" -maxdepth 1 -iname human302.xdf)" "$fwDir/HUMAN302.XDF"
dropBuildDir "$compId"
}
compInstalled() {
[ -f "$fwDir/roms/x68000/iplrom.dat" ] && [ -f "$fwDir/HUMAN302.XDF" ]
}
compVerify() {
[ "$(sha1sum "$fwDir/roms/x68000/iplrom.dat" | cut -d' ' -f1)" = "0ed038ed2133b9f78c6e37256807424e0d927560" ] &&
[ "$(sha1sum "$fwDir/HUMAN302.XDF" | cut -d' ' -f1)" = "bdee51e80a9ef28d3c336d79ac80e9749f475608" ]
}
compEnv() {
envVar X68K_DIR "$fwDir"
}