libx48ng/dist/setup-x48ng-home.sh

33 lines
688 B
Bash
Raw Normal View History

2023-04-30 19:08:53 +02:00
#!/usr/bin/env sh
2023-04-30 18:50:24 +02:00
2024-08-11 13:51:35 +02:00
DOTX48NG=${DOTX48NG:-~/.config/x48ng}
CONFIG_FILE="${DOTX48NG}"/config.lua
ROM=${ROM:-./ROMs/gxrom-r}
2023-04-30 18:50:24 +02:00
2024-08-11 13:51:35 +02:00
mkdir -p "${DOTX48NG}"
2023-04-30 19:08:53 +02:00
[ -e "${CONFIG_FILE}" ] && mv "${CONFIG_FILE}" "${CONFIG_FILE}".orig
x48ng --print-config > "${CONFIG_FILE}"
2023-04-30 19:08:53 +02:00
2024-08-11 13:51:35 +02:00
cp -r @PREFIX@/share/x48ng/ROMs/ "${DOTX48NG}"/
2024-08-11 13:51:35 +02:00
cd "${DOTX48NG}"/ROMs/ || exit 1
make get-roms
2024-08-11 13:51:35 +02:00
cd "${DOTX48NG}" || exit 1
[ -e rom ] && mv rom rom.orig
2024-08-11 13:49:17 +02:00
ln -s "$ROM" rom
2023-04-30 18:50:24 +02:00
2023-05-14 16:20:09 +02:00
PORT1_SIZE=128K
PORT2_SIZE=4M
2023-04-30 18:50:24 +02:00
if $(echo "$ROM" | grep -q "^sx"); then
2023-05-14 16:20:09 +02:00
PORT2_SIZE=128K
fi
[ -e port1 ] && mv port1 port1.orig
2023-05-14 16:20:09 +02:00
@PREFIX@/share/x48ng/mkcard $PORT1_SIZE port1
[ -e port2 ] && mv port2 port2.orig
2023-05-14 16:20:09 +02:00
@PREFIX@/share/x48ng/mkcard $PORT2_SIZE port2