Skip to content

Commit 1a8eb43

Browse files
committed
Startup chimes & netinfo
1 parent e1612bd commit 1a8eb43

File tree

13 files changed

+122
-31
lines changed

13 files changed

+122
-31
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The project consists of the following auto-compiling and installing bash scripts
1818
* Commodore 64/128/PET emulator **[VICE](https://vice-emu.sourceforge.io)**.
1919
* **[MacintoshPi Virtual Modem](https://github.com/jaromaz/MacintoshPi#macintoshpi-virtual-modem)** using the **[tty0tty](https://github.com/freemed/tty0tty)** and **[tcpser](http://www.jbrain.com/pub/linux/serial/)** projects, running with the two aforementioned emulators for *Apple* and *Commodore* products, and on *Raspberry Pi OS* itself, as well as allowing any original terminal retro-software to connect with modern-day telnet BBSs.
2020
* CD-ROM, DVD-ROM emulator **[CDEmu](https://cdemu.sourceforge.io)** which allows mounting CD images (iso, toast, cue/bin, mds/mdf etc.) under *Raspberry Pi OS* - runs with *BasiliskII* and *SheepShaver* emulators, as well as on *Raspberry Pi OS*. The emulators are configured automatically to support that virtual CD-ROM drive.
21-
* A consistent **[MacintoshPi Launcher](https://github.com/jaromaz/MacintoshPi#macintoshpi-launcher)** that runs all of those systems at different resolutions (after reboot) and in different configurations.
21+
* A consistent **[MacintoshPi Launcher](https://github.com/jaromaz/MacintoshPi#macintoshpi-launcher)** that runs all of those systems at different resolutions (after reboot), in different configurations, with autostart support and with various startup chimes.
2222
* **[SyncTERM](https://syncterm.bbsdev.net)** - an application for connecting with BBSs from the *Raspberry Pi OS*, compiled in combination with the *SDL library*.
2323
* Information how to run *Raspberry Pi OS* in **dual-boot** with **[BMC64](https://accentual.com/bmc64/)**, the fastest *Commodore* emulator for *Raspberry Pi* (bare metal/low latency emulator).
2424

@@ -143,6 +143,8 @@ The launcher's task is to launch a given version of *Mac OS*, and if one is alre
143143

144144
The name of the directory with the data with which the system is to be overwritten is identical as the name of the parameter following the ```mac``` command, e.g. ```mac os8-480``` will restart *Raspberry Pi OS* in 640x480 resolution, and then launch ```Mac OS 8``` also in that resolution, but the ```mac os8``` command will simply launch *Mac OS 8* in the most recently selected resolution.
145145

146+
Various startup chimes are played at the launch of each system - depending on the selected resolution: Macintosh 128K, Macintosh Classic II, Macintosh Color Classic, Macintosh Performa 520, Power Macintosh 550, Power Macintosh G3 sounds.
147+
146148
The Launcher allows also ```.img``` or ```.dsk``` files to be added to *Mac OS* using e.g. ```mac os7 file.img``` - then the *Mac OS* concerned will be launched and the image content will appear on the desktop as an additional drive.
147149

148150
### SyncTERM

assets/func.sh

Lines changed: 63 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111
# Author: Jaroslaw Mazurkiewicz / jaromaz
1212
# www: https://jm.iq.pl e-mail: jm at iq.pl
1313
# --------------------------------------------------------
14-
# MacintoshPi functions
14+
# MacintoshPi functions
1515
# --------------------------------------------------------
1616

17-
VERSION="1.1.0"
17+
VERSION="1.2.5"
1818
BASE_DIR="/usr/share/macintoshpi"
1919
CONF_DIR="/etc/macintoshpi"
20+
WAV_DIR="${BASE_DIR}/sounds"
2021
SRC_DIR="${BASE_DIR}/src"
2122
BASILISK_REPO="https://github.com/kanjitalk755/macemu/archive/master.zip"
2223
SHEEPSHAVER_REPO=${BASILISK_REPO}
23-
SDL2_SOURCE="https://www.libsdl.org/release/SDL2-2.0.7.tar.gz"
24+
SDL2_SOURCE="https://www.libsdl.org/release/SDL2-2.0.7.tar.gz"
2425
VICE_SOURCE="https://downloads.sourceforge.net/project/vice-emu/releases/vice-3.4.tar.gz"
2526
BASILISK_FILE="/usr/local/bin/BasiliskII"
2627
SHEEPSHAVER_FILE="/usr/local/bin/SheepShaver"
@@ -30,6 +31,7 @@ ROM4OS[7]="https://github.com/macmade/Macintosh-ROMs/raw/18e1d0a9756f8ae3b9c005a
3031
ROM4OS[8]="https://github.com/macmade/Macintosh-ROMs/raw/main/Quadra-650.ROM"
3132
ROM4OS[9]="https://www.redundantrobot.com/sheepshaver_files/roms/newworld86.rom.zip"
3233

34+
3335
function usercheck {
3436
[ $USER != "pi" ] && echo 'Run this script as the "pi" user.' && exit
3537
}
@@ -55,9 +57,29 @@ function installinfo {
5557
echo " * INFO: The build and installation process will take approximately"
5658
echo " two hours"
5759
printf "\n "
58-
for i in {10..0}; do printf "$i ... "; sleep 1; done
60+
for i in {10..1}; do printf "$i ... "; sleep 1; done
61+
echo
62+
}
63+
64+
65+
function net_error {
66+
echo
67+
echo "***********"
68+
echo
69+
echo "Error - can't download: $1"
70+
echo "Check your Internet connection and try again later."
71+
echo
72+
echo "If you still feel its a bug, then please create an issue here:"
73+
echo "https://github.com/jaromaz/MacintoshPi/issues/new"
74+
echo
75+
parent=$(cat /proc/$PPID/comm)
76+
[ "$parent" == "build_all.sh" ] && killall -q build_all.sh
77+
exit
5978
}
6079

80+
81+
82+
6183
function Base_dir {
6284
[ -d ${BASE_DIR} ] || ( sudo mkdir -p ${BASE_DIR} && sudo chown pi:pi ${BASE_DIR} )
6385
}
@@ -96,7 +118,9 @@ printf "\e[95m"; echo '
96118

97119
mkdir -p ${SRC_DIR} 2>/dev/null
98120

99-
wget -O ${SRC_DIR}/master.zip ${SHEEPSHAVER_REPO} &&
121+
wget -O ${SRC_DIR}/master.zip ${SHEEPSHAVER_REPO}
122+
[ $? -ne 0 ] && net_error "SheepShaver sources"
123+
100124
unzip ${SRC_DIR}/master.zip -d ${SRC_DIR}
101125
cd ${SRC_DIR}/macemu-*/SheepShaver
102126
make links
@@ -110,7 +134,6 @@ NO_CONFIGURE=1 ./autogen.sh &&
110134
--without-mon \
111135
--without-esd \
112136
--enable-addressing=direct,0x10000000
113-
# --enable-sdl-framework-prefix=/Library/Frameworks
114137

115138
make -j3
116139
sudo make install
@@ -119,7 +142,7 @@ modprobe --show sheep_net 2>/dev/null || Build_NetDriver
119142

120143
echo "no-sighandler" | sudo tee /etc/directfbrc
121144
grep -q mmap_min_addr /etc/sysctl.conf || \
122-
echo "vm.mmap_min_addr = 0" | sudo tee -a /etc/sysctl.conf
145+
echo "vm.mmap_min_addr = 0" | sudo tee -a /etc/sysctl.conf
123146

124147
rm -rf ${SRC_DIR}
125148

@@ -135,12 +158,14 @@ printf "\e[95m"; echo '
135158
| _ \ / _` / __| | | / __| |/ / | | | |
136159
| |_) | (_| \__ \ | | \__ \ < | | | |
137160
|____/ \__,_|___/_|_|_|___/_|\_\ |___|___|
138-
161+
139162
'; printf "\e[0m"; sleep 2
140163

141164
mkdir -p ${SRC_DIR} 2>/dev/null
142165

143166
wget -O ${SRC_DIR}/master.zip ${BASILISK_REPO}
167+
[ $? -ne 0 ] && net_error "Basilisk II sources"
168+
144169
unzip ${SRC_DIR}/master.zip -d /${SRC_DIR}
145170
cd ${SRC_DIR}/macemu-*/BasiliskII/src/Unix/
146171
NO_CONFIGURE=1 ./autogen.sh &&
@@ -173,11 +198,14 @@ sudo apt install -y automake gobjc libudev-dev xa65 build-essential byacc texi2h
173198
libgtkglext1-dev libpulse-dev bison libnet1 libnet1-dev libpcap0.8 \
174199
libpcap0.8-dev libvte-dev libasound2-dev raspberrypi-kernel-headers
175200

201+
[ $? -ne 0 ] && net_error "SDL2 apt packages"
202+
176203
Base_dir
177204
mkdir -p ${SRC_DIR}
178205

179206

180207
wget ${SDL2_SOURCE} -O - | tar -xz -C ${SRC_DIR}
208+
[ $? -ne 0 ] && net_error "SDL2 sources"
181209

182210
cd ${SRC_DIR}/SDL2-2.0.7 &&
183211
./configure --host=arm-raspberry-linux-gnueabihf \
@@ -200,10 +228,33 @@ rm -rf ${SRC_DIR}
200228

201229
function Launcher {
202230
if ! [ -d ${CONF_DIR} ]; then
231+
mkdir -p ${SRC_DIR} 2>/dev/null
203232
cd ../launcher
204-
sudo mkdir /etc/macintoshpi
205-
sudo cp -r config/* /etc/macintoshpi
233+
sudo mkdir ${CONF_DIR}
234+
sudo cp -r config/* ${CONF_DIR}
206235
sudo cp mac /usr/bin
236+
# Chimes wav files
237+
wget -O ${SRC_DIR}/chimes.zip ${HDD_IMAGES}/chimes.zip
238+
unzip -d ${SRC_DIR} ${SRC_DIR}/chimes.zip
239+
[ $? -ne 0 ] && net_error "Chimes wav files"
240+
sudo mkdir -p ${WAV_DIR}
241+
for i in os7-342 os7-384 os7-480 os7-600 os8-480 \
242+
os8-600 os9-480 os9-600 os9-768; do
243+
sudo mkdir ${CONF_DIR}/${i}${WAV_DIR}
244+
done
245+
sudo cp ${SRC_DIR}/chimes/m1.wav ${CONF_DIR}/os7-342${WAV_DIR}/os7.wav
246+
sudo cp ${SRC_DIR}/chimes/cc.wav ${CONF_DIR}/os7-384${WAV_DIR}/os7.wav
247+
sudo cp ${SRC_DIR}/chimes/pe.wav ${CONF_DIR}/os7-480${WAV_DIR}/os7.wav
248+
sudo cp ${SRC_DIR}/chimes/pe.wav ${CONF_DIR}/os7-600${WAV_DIR}/os7.wav
249+
sudo cp ${SRC_DIR}/chimes/pe.wav ${CONF_DIR}/os8-480${WAV_DIR}/os8.wav
250+
sudo cp ${SRC_DIR}/chimes/pm.wav ${CONF_DIR}/os8-600${WAV_DIR}/os8.wav
251+
sudo cp ${SRC_DIR}/chimes/pm.wav ${CONF_DIR}/os9-480${WAV_DIR}/os9.wav
252+
sudo cp ${SRC_DIR}/chimes/g3.wav ${CONF_DIR}/os9-600${WAV_DIR}/os9.wav
253+
sudo cp ${SRC_DIR}/chimes/g3.wav ${CONF_DIR}/os9-768${WAV_DIR}/os9.wav
254+
sudo cp ${SRC_DIR}/chimes/c2.wav ${WAV_DIR}/os7.wav
255+
sudo cp ${SRC_DIR}/chimes/pm.wav ${WAV_DIR}/os8.wav
256+
sudo cp ${SRC_DIR}/chimes/g3.wav ${WAV_DIR}/os9.wav
257+
rm -rf ${SRC_DIR}
207258
fi
208259
}
209260

@@ -236,13 +287,13 @@ function logo {
236287
);
237288

238289
clear && echo
239-
for i in {0..9}; do
290+
for i in {0..9}; do
240291
[ $(($i % 2)) -gt "0" ] && printf "\e[93m" || printf "\e[96m"
241292
printf "${logotype[${i}]}"
242293
done
243294
echo
244295
for i in {1..47}; do printf ' '; done
245-
printf "\e[90m"
296+
printf "\e[90m"
246297
echo "v.${VERSION}"
247298
printf "\e[0m\n"
248299
}

cdemu/cdemu.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,21 @@ printf "\e[92m"; echo '
2222
\____|____/|_____|_| |_| |_|\__,_|
2323
'; printf "\e[0m"; sleep 2
2424

25+
source ./assets/func.sh
26+
updateinfo
27+
2528
# Software
26-
sudo apt update && sudo apt upgrade -y
2729
sudo apt-get install -y dpkg-dev dkms libao-dev intltool libsndfile1-dev libbz2-dev \
2830
liblzma-dev gtk-doc-tools gobject-introspection libgirepository1.0-dev \
2931
python3-matplotlib libsamplerate0-dev cmake raspberrypi-kernel-headers \
3032
dh-systemd
3133

34+
[ $? -ne 0 ] && net_error "CDEmu apt packages"
35+
3236
# CDemu git repo
3337
rm -rf ~/cdemusrc
3438
git clone -b 'vhba-module-20210418' --single-branch --depth 1 https://github.com/cdemu/cdemu.git ~/cdemusrc
35-
39+
[ $? -ne 0 ] && net_error "CDEmu sources"
3640

3741
# vhba-module
3842
cd ~/cdemusrc/vhba-module

launcher/config/os9-480/usr/share/macintoshpi/macos9.cfg renamed to launcher/config/os9-480/usr/share/macintoshpi/macos9/macos9.cfg

File renamed without changes.

launcher/config/os9-600/usr/share/macintoshpi/macos9.cfg renamed to launcher/config/os9-600/usr/share/macintoshpi/macos9/macos9.cfg

File renamed without changes.

launcher/config/os9-768/usr/share/macintoshpi/macos9.cfg renamed to launcher/config/os9-768/usr/share/macintoshpi/macos9/macos9.cfg

File renamed without changes.

launcher/mac

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# --------------------------------
3-
# MacintoshPi Launcher / 2022
3+
# MacintoshPi Launcher / v.1.2.5
44
# --------------------------------
55
# author: Jaroslaw Mazurkiewicz
66
# Jaromaz
@@ -46,13 +46,28 @@
4646

4747

4848
function run_os {
49+
50+
clear
51+
tput civis
4952
if aplay -l 2>&1 | grep "no sound"; then SOUND=0; fi
5053
log_check
54+
sleep 2
5155
if [ "$SOUND" -gt 0 ]; then
5256
sudo killall pulseaudio &>/dev/null
5357
sleep 1
5458
sudo pulseaudio -D &>/dev/null
5559
sleep 1
60+
if [ -f $BASE_DIR/sounds/os${VER}.wav ]; then
61+
sudo amixer -q sset Master playback 40%
62+
sudo aplay -q $BASE_DIR/sounds/os${VER}.wav
63+
sudo amixer -q sset Master playback 80%
64+
sleep 1
65+
sudo killall pulseaudio &>/dev/null
66+
sleep 1
67+
sudo pulseaudio -D &>/dev/null
68+
sleep 1
69+
fi
70+
5671
fi
5772
[ -z "$SKA" ] || DISK="--disk $SKA"
5873
[ "$VER" -eq 9 ] && command="sudo "
@@ -61,6 +76,7 @@
6176
[ "$VER" -lt 9 ] && command="${command} BasiliskII"
6277
${command} --config ${MACOS_CONFIG} ${DISK} &>>${LOG}
6378
clear
79+
tput cnorm
6480
exit
6581
}
6682

@@ -72,18 +88,11 @@
7288
MACOS_DIR=${BASE_DIR}/macos${VER}
7389
MACOS_CONFIG=${MACOS_DIR}/macos${VER}.cfg
7490

75-
# Autostart
91+
# Autostart
7692
if [ "$SKA" == "macpiautostart" ]; then
7793
sleep 5
7894
clear
7995
SKA=""
80-
echo "Waiting 5 sec for system start"
81-
for i in {5..1}; do
82-
sleep 1
83-
printf "${i} ... "
84-
done
85-
echo "Running ... "
86-
sleep 1
8796
# Mac OS 7/8/9
8897
if [ "$VER" -lt 10 ]; then
8998
run_os
@@ -93,7 +102,7 @@
93102
fi
94103

95104

96-
# help if not exists conf directory
105+
# Help info
97106
[ -d ${CONF_DIR}/${SYS} ] || hlp
98107

99108
# Copy config files
@@ -108,4 +117,4 @@
108117
exit
109118
fi
110119

111-
reboot
120+
sudo reboot

macos7/macos7.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ sudo apt install -y automake gobjc libudev-dev xa65 build-essential byacc texi2h
3333
libnet1-dev libpcap0.8 libpcap0.8-dev libvte-dev libasound2-dev \
3434
raspberrypi-kernel-headers
3535

36+
[ $? -ne 0 ] && net_error "Mac OS 7 apt packages"
37+
3638
# Mac OS 7 config
3739
echo "
3840
#disk ${MACOS_DIR}/system70.dsk
@@ -69,7 +71,11 @@ screen win/640/480
6971
# ROM & System
7072
cd ${MACOS_DIR}
7173
wget ${ROM}
74+
[ $? -ne 0 ] && net_error "Mac OS 7 ROM file"
75+
7276
wget -O ${MACOS_DIR}/hdd.dsk.gz ${HDD_IMAGE}
77+
[ $? -ne 0 ] && net_error "Mac OS 7 HDD image"
78+
7379
echo "* Decompressing the hard drive image - please wait"
7480
gzip -d hdd.dsk.gz
7581

macos8/macos8.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ sudo apt install -y automake gobjc libudev-dev xa65 build-essential byacc texi2h
3333
libnet1-dev libpcap0.8 libpcap0.8-dev libvte-dev libasound2-dev \
3434
raspberrypi-kernel-headers
3535

36+
[ $? -ne 0 ] && net_error "Mac OS 8 apt packages"
37+
3638
# Mac OS 8 config
3739
echo "
3840
rom ${MACOS_DIR}/QUAD650.ROM
@@ -65,8 +67,10 @@ screen win/640/480
6567
# ROM & System
6668
cd ${MACOS_DIR}
6769
wget ${ROM}
70+
[ $? -ne 0 ] && net_error "Mac OS 8 ROM file"
6871
mv Quadra-650.ROM QUAD650.ROM 2>/dev/null
6972
wget -O ${MACOS_DIR}/hdd.dsk.gz ${HDD_IMAGE}
73+
[ $? -ne 0 ] && net_error "Mac OS 8 HDD image"
7074
echo "* Decompressing the hard drive image - please wait"
7175
gzip -d hdd.dsk.gz
7276

macos9/macos9.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ sudo apt install -y libdirectfb-dev automake gobjc libudev-dev xa65 build-essent
3535
libgtk2.0-dev x11proto-xf86dga-dev libesd0-dev libxxf86dga-dev \
3636
libxxf86dga1 libsdl1.2-dev
3737

38+
[ $? -ne 0 ] && net_error "Mac OS 9 apt packages"
39+
3840
# Mac OS 9 config
3941
echo "
4042
rom ${MACOS_DIR}/newworld86.rom
@@ -63,8 +65,10 @@ screen win/800/600
6365
# ROM & System
6466
cd ${MACOS_DIR}
6567
wget ${ROM}
68+
[ $? -ne 0 ] && net_error "Mac OS 9 ROM file"
6669
unzip newworld86.rom.zip 2>/dev/null
6770
wget -O ${MACOS_DIR}/hdd.dsk.gz ${HDD_IMAGE}
71+
[ $? -ne 0 ] && net_error "Mac OS 9 HDD image"
6872
echo "* Decompressing the hard drive image - please wait"
6973
gzip -d hdd.dsk.gz
7074

0 commit comments

Comments
 (0)