Skip to content

Commit

Permalink
Startup chimes & netinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
jaromaz committed Jul 12, 2022
1 parent e1612bd commit 1a8eb43
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 31 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The project consists of the following auto-compiling and installing bash scripts
* Commodore 64/128/PET emulator **[VICE](https://vice-emu.sourceforge.io)**.
* **[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.
* 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.
* 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.
* 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.
* **[SyncTERM](https://syncterm.bbsdev.net)** - an application for connecting with BBSs from the *Raspberry Pi OS*, compiled in combination with the *SDL library*.
* 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).

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

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.

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.

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.

### SyncTERM
Expand Down
75 changes: 63 additions & 12 deletions assets/func.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
# Author: Jaroslaw Mazurkiewicz / jaromaz
# www: https://jm.iq.pl e-mail: jm at iq.pl
# --------------------------------------------------------
# MacintoshPi functions
# MacintoshPi functions
# --------------------------------------------------------

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


function usercheck {
[ $USER != "pi" ] && echo 'Run this script as the "pi" user.' && exit
}
Expand All @@ -55,9 +57,29 @@ function installinfo {
echo " * INFO: The build and installation process will take approximately"
echo " two hours"
printf "\n "
for i in {10..0}; do printf "$i ... "; sleep 1; done
for i in {10..1}; do printf "$i ... "; sleep 1; done
echo
}


function net_error {
echo
echo "***********"
echo
echo "Error - can't download: $1"
echo "Check your Internet connection and try again later."
echo
echo "If you still feel its a bug, then please create an issue here:"
echo "https://github.com/jaromaz/MacintoshPi/issues/new"
echo
parent=$(cat /proc/$PPID/comm)
[ "$parent" == "build_all.sh" ] && killall -q build_all.sh
exit
}




function Base_dir {
[ -d ${BASE_DIR} ] || ( sudo mkdir -p ${BASE_DIR} && sudo chown pi:pi ${BASE_DIR} )
}
Expand Down Expand Up @@ -96,7 +118,9 @@ printf "\e[95m"; echo '

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

wget -O ${SRC_DIR}/master.zip ${SHEEPSHAVER_REPO} &&
wget -O ${SRC_DIR}/master.zip ${SHEEPSHAVER_REPO}
[ $? -ne 0 ] && net_error "SheepShaver sources"

unzip ${SRC_DIR}/master.zip -d ${SRC_DIR}
cd ${SRC_DIR}/macemu-*/SheepShaver
make links
Expand All @@ -110,7 +134,6 @@ NO_CONFIGURE=1 ./autogen.sh &&
--without-mon \
--without-esd \
--enable-addressing=direct,0x10000000
# --enable-sdl-framework-prefix=/Library/Frameworks

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

echo "no-sighandler" | sudo tee /etc/directfbrc
grep -q mmap_min_addr /etc/sysctl.conf || \
echo "vm.mmap_min_addr = 0" | sudo tee -a /etc/sysctl.conf
echo "vm.mmap_min_addr = 0" | sudo tee -a /etc/sysctl.conf

rm -rf ${SRC_DIR}

Expand All @@ -135,12 +158,14 @@ printf "\e[95m"; echo '
| _ \ / _` / __| | | / __| |/ / | | | |
| |_) | (_| \__ \ | | \__ \ < | | | |
|____/ \__,_|___/_|_|_|___/_|\_\ |___|___|
'; printf "\e[0m"; sleep 2

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

wget -O ${SRC_DIR}/master.zip ${BASILISK_REPO}
[ $? -ne 0 ] && net_error "Basilisk II sources"

unzip ${SRC_DIR}/master.zip -d /${SRC_DIR}
cd ${SRC_DIR}/macemu-*/BasiliskII/src/Unix/
NO_CONFIGURE=1 ./autogen.sh &&
Expand Down Expand Up @@ -173,11 +198,14 @@ sudo apt install -y automake gobjc libudev-dev xa65 build-essential byacc texi2h
libgtkglext1-dev libpulse-dev bison libnet1 libnet1-dev libpcap0.8 \
libpcap0.8-dev libvte-dev libasound2-dev raspberrypi-kernel-headers

[ $? -ne 0 ] && net_error "SDL2 apt packages"

Base_dir
mkdir -p ${SRC_DIR}


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

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

function Launcher {
if ! [ -d ${CONF_DIR} ]; then
mkdir -p ${SRC_DIR} 2>/dev/null
cd ../launcher
sudo mkdir /etc/macintoshpi
sudo cp -r config/* /etc/macintoshpi
sudo mkdir ${CONF_DIR}
sudo cp -r config/* ${CONF_DIR}
sudo cp mac /usr/bin
# Chimes wav files
wget -O ${SRC_DIR}/chimes.zip ${HDD_IMAGES}/chimes.zip
unzip -d ${SRC_DIR} ${SRC_DIR}/chimes.zip
[ $? -ne 0 ] && net_error "Chimes wav files"
sudo mkdir -p ${WAV_DIR}
for i in os7-342 os7-384 os7-480 os7-600 os8-480 \
os8-600 os9-480 os9-600 os9-768; do
sudo mkdir ${CONF_DIR}/${i}${WAV_DIR}
done
sudo cp ${SRC_DIR}/chimes/m1.wav ${CONF_DIR}/os7-342${WAV_DIR}/os7.wav
sudo cp ${SRC_DIR}/chimes/cc.wav ${CONF_DIR}/os7-384${WAV_DIR}/os7.wav
sudo cp ${SRC_DIR}/chimes/pe.wav ${CONF_DIR}/os7-480${WAV_DIR}/os7.wav
sudo cp ${SRC_DIR}/chimes/pe.wav ${CONF_DIR}/os7-600${WAV_DIR}/os7.wav
sudo cp ${SRC_DIR}/chimes/pe.wav ${CONF_DIR}/os8-480${WAV_DIR}/os8.wav
sudo cp ${SRC_DIR}/chimes/pm.wav ${CONF_DIR}/os8-600${WAV_DIR}/os8.wav
sudo cp ${SRC_DIR}/chimes/pm.wav ${CONF_DIR}/os9-480${WAV_DIR}/os9.wav
sudo cp ${SRC_DIR}/chimes/g3.wav ${CONF_DIR}/os9-600${WAV_DIR}/os9.wav
sudo cp ${SRC_DIR}/chimes/g3.wav ${CONF_DIR}/os9-768${WAV_DIR}/os9.wav
sudo cp ${SRC_DIR}/chimes/c2.wav ${WAV_DIR}/os7.wav
sudo cp ${SRC_DIR}/chimes/pm.wav ${WAV_DIR}/os8.wav
sudo cp ${SRC_DIR}/chimes/g3.wav ${WAV_DIR}/os9.wav
rm -rf ${SRC_DIR}
fi
}

Expand Down Expand Up @@ -236,13 +287,13 @@ function logo {
);

clear && echo
for i in {0..9}; do
for i in {0..9}; do
[ $(($i % 2)) -gt "0" ] && printf "\e[93m" || printf "\e[96m"
printf "${logotype[${i}]}"
done
echo
for i in {1..47}; do printf ' '; done
printf "\e[90m"
printf "\e[90m"
echo "v.${VERSION}"
printf "\e[0m\n"
}
Expand Down
8 changes: 6 additions & 2 deletions cdemu/cdemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,21 @@ printf "\e[92m"; echo '
\____|____/|_____|_| |_| |_|\__,_|
'; printf "\e[0m"; sleep 2

source ./assets/func.sh
updateinfo

# Software
sudo apt update && sudo apt upgrade -y
sudo apt-get install -y dpkg-dev dkms libao-dev intltool libsndfile1-dev libbz2-dev \
liblzma-dev gtk-doc-tools gobject-introspection libgirepository1.0-dev \
python3-matplotlib libsamplerate0-dev cmake raspberrypi-kernel-headers \
dh-systemd

[ $? -ne 0 ] && net_error "CDEmu apt packages"

# CDemu git repo
rm -rf ~/cdemusrc
git clone -b 'vhba-module-20210418' --single-branch --depth 1 https://github.com/cdemu/cdemu.git ~/cdemusrc

[ $? -ne 0 ] && net_error "CDEmu sources"

# vhba-module
cd ~/cdemusrc/vhba-module
Expand Down
31 changes: 20 additions & 11 deletions launcher/mac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# --------------------------------
# MacintoshPi Launcher / 2022
# MacintoshPi Launcher / v.1.2.5
# --------------------------------
# author: Jaroslaw Mazurkiewicz
# Jaromaz
Expand Down Expand Up @@ -46,13 +46,28 @@


function run_os {

clear
tput civis
if aplay -l 2>&1 | grep "no sound"; then SOUND=0; fi
log_check
sleep 2
if [ "$SOUND" -gt 0 ]; then
sudo killall pulseaudio &>/dev/null
sleep 1
sudo pulseaudio -D &>/dev/null
sleep 1
if [ -f $BASE_DIR/sounds/os${VER}.wav ]; then
sudo amixer -q sset Master playback 40%
sudo aplay -q $BASE_DIR/sounds/os${VER}.wav
sudo amixer -q sset Master playback 80%
sleep 1
sudo killall pulseaudio &>/dev/null
sleep 1
sudo pulseaudio -D &>/dev/null
sleep 1
fi

fi
[ -z "$SKA" ] || DISK="--disk $SKA"
[ "$VER" -eq 9 ] && command="sudo "
Expand All @@ -61,6 +76,7 @@
[ "$VER" -lt 9 ] && command="${command} BasiliskII"
${command} --config ${MACOS_CONFIG} ${DISK} &>>${LOG}
clear
tput cnorm
exit
}

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

# Autostart
# Autostart
if [ "$SKA" == "macpiautostart" ]; then
sleep 5
clear
SKA=""
echo "Waiting 5 sec for system start"
for i in {5..1}; do
sleep 1
printf "${i} ... "
done
echo "Running ... "
sleep 1
# Mac OS 7/8/9
if [ "$VER" -lt 10 ]; then
run_os
Expand All @@ -93,7 +102,7 @@
fi


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

# Copy config files
Expand All @@ -108,4 +117,4 @@
exit
fi

reboot
sudo reboot
6 changes: 6 additions & 0 deletions macos7/macos7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ sudo apt install -y automake gobjc libudev-dev xa65 build-essential byacc texi2h
libnet1-dev libpcap0.8 libpcap0.8-dev libvte-dev libasound2-dev \
raspberrypi-kernel-headers

[ $? -ne 0 ] && net_error "Mac OS 7 apt packages"

# Mac OS 7 config
echo "
#disk ${MACOS_DIR}/system70.dsk
Expand Down Expand Up @@ -69,7 +71,11 @@ screen win/640/480
# ROM & System
cd ${MACOS_DIR}
wget ${ROM}
[ $? -ne 0 ] && net_error "Mac OS 7 ROM file"

wget -O ${MACOS_DIR}/hdd.dsk.gz ${HDD_IMAGE}
[ $? -ne 0 ] && net_error "Mac OS 7 HDD image"

echo "* Decompressing the hard drive image - please wait"
gzip -d hdd.dsk.gz

Expand Down
4 changes: 4 additions & 0 deletions macos8/macos8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ sudo apt install -y automake gobjc libudev-dev xa65 build-essential byacc texi2h
libnet1-dev libpcap0.8 libpcap0.8-dev libvte-dev libasound2-dev \
raspberrypi-kernel-headers

[ $? -ne 0 ] && net_error "Mac OS 8 apt packages"

# Mac OS 8 config
echo "
rom ${MACOS_DIR}/QUAD650.ROM
Expand Down Expand Up @@ -65,8 +67,10 @@ screen win/640/480
# ROM & System
cd ${MACOS_DIR}
wget ${ROM}
[ $? -ne 0 ] && net_error "Mac OS 8 ROM file"
mv Quadra-650.ROM QUAD650.ROM 2>/dev/null
wget -O ${MACOS_DIR}/hdd.dsk.gz ${HDD_IMAGE}
[ $? -ne 0 ] && net_error "Mac OS 8 HDD image"
echo "* Decompressing the hard drive image - please wait"
gzip -d hdd.dsk.gz

Expand Down
4 changes: 4 additions & 0 deletions macos9/macos9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ sudo apt install -y libdirectfb-dev automake gobjc libudev-dev xa65 build-essent
libgtk2.0-dev x11proto-xf86dga-dev libesd0-dev libxxf86dga-dev \
libxxf86dga1 libsdl1.2-dev

[ $? -ne 0 ] && net_error "Mac OS 9 apt packages"

# Mac OS 9 config
echo "
rom ${MACOS_DIR}/newworld86.rom
Expand Down Expand Up @@ -63,8 +65,10 @@ screen win/800/600
# ROM & System
cd ${MACOS_DIR}
wget ${ROM}
[ $? -ne 0 ] && net_error "Mac OS 9 ROM file"
unzip newworld86.rom.zip 2>/dev/null
wget -O ${MACOS_DIR}/hdd.dsk.gz ${HDD_IMAGE}
[ $? -ne 0 ] && net_error "Mac OS 9 HDD image"
echo "* Decompressing the hard drive image - please wait"
gzip -d hdd.dsk.gz

Expand Down
8 changes: 7 additions & 1 deletion syncterm/syncterm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ printf "\e[92m"; echo '
|____/ \__, |_| |_|\___||_| |_____|_| \_\_| |_|
|___/
'; printf "\e[0m"; sleep 2
source ./assets/func.sh
updateinfo

BDIR=~/syncterm-build
mkdir $BDIR
sudo apt update && sudo apt -y upgrade

sudo apt install -y libncurses5-dev libsdl1.2-dev build-essential libsdl2-dev
[ $? -ne 0 ] && net_error "SyncTERM apt packages"

wget https://sourceforge.net/projects/syncterm/files/syncterm/syncterm-1.1/syncterm-1.1-src.tgz/download -O $BDIR/syncterm.tgz

[ $? -ne 0 ] && net_error "SyncTERM sources"

cd $BDIR

tar -xf syncterm.tgz
Expand Down
Loading

0 comments on commit 1a8eb43

Please sign in to comment.