2023-04-30 19:08:53 +02:00
#!/usr/bin/env sh
2023-04-30 18:50:24 +02:00
2024-08-29 11:04:01 +02:00
cd " $( dirname " $0 " ) " ; CWD = $( pwd )
CONFIG_HOME = ${ XDG_CONFIG_HOME :- $HOME /.config }
DOTX48NG = ${ DOTX48NG :- $CONFIG_HOME /x48ng }
2024-08-11 13:51:35 +02:00
CONFIG_FILE = " ${ DOTX48NG } " /config.lua
2024-08-11 13:40:32 +02:00
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
2024-08-11 13:40:32 +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-29 11:04:01 +02:00
cp -r ./ROMs/ " ${ DOTX48NG } " /
2023-10-01 12:47:42 +02:00
2024-08-11 13:51:35 +02:00
cd " ${ DOTX48NG } " /ROMs/ || exit 1
2024-08-11 14:00:46 +02:00
echo "The next step will download all available HP 48 ROMs from https://hpcalc.org where \"HP graciously began allowing this to be downloaded in mid-2000.\""
echo "You can hit Ctrl-C now if you do not wish to download them."
read -r
2024-08-11 13:40:32 +02:00
make get-roms
2024-08-11 13:51:35 +02:00
cd " ${ DOTX48NG } " || exit 1
2024-08-11 13:40:32 +02:00
[ -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
2024-08-29 11:04:01 +02:00
PORT1_SIZE = 128
PORT2_SIZE = 4096
2023-04-30 18:50:24 +02:00
2024-08-29 11:04:01 +02:00
if echo " $ROM " | grep -q "^sx" ; then
PORT2_SIZE = 128
2023-05-14 16:20:09 +02:00
fi
2024-08-11 13:40:32 +02:00
[ -e port1 ] && mv port1 port1.orig
2024-08-29 11:04:01 +02:00
dd if = /dev/zero of = " $DOTX48NG " /port1 bs = 1k count = $PORT1_SIZE
2024-08-11 13:40:32 +02:00
[ -e port2 ] && mv port2 port2.orig
2024-08-29 11:04:01 +02:00
dd if = /dev/zero of = " $DOTX48NG " /port2 bs = 1k count = $PORT2_SIZE