Skip to content

Instantly share code, notes, and snippets.

@dillera
Created April 15, 2025 12:54
Show Gist options
  • Save dillera/0cfa961056fc5819709e9a21dfc8073c to your computer and use it in GitHub Desktop.
Save dillera/0cfa961056fc5819709e9a21dfc8073c to your computer and use it in GitHub Desktop.
Boot FujinetPC on Macintosh
Copy and paste in the terminal to create the run-fujinet-suite.sh script.
Set up the root path for your username.
Unzip Altirra, copy the fujinet-pc you build from src, and copy the fujinet-bridge from it's repo into one folder, I'm calling it emulation.
Install wine with brew. Install stable or dev version.
Here is the scipt:
----------------------------------------------
cat <<'EOF' > run-fujinet-suite.sh
#!/bin/bash
# Root path for all emulation components
ROOT="/Users/happyMacBoi/emulation"
# Define full command paths
FUJINET_RUN="$ROOT/fujinet-firmware/run-fujinet"
FUJINET_BRIDGE="$ROOT/fujinet-emulator-bridge/fujinet-bridge"
ALTIRRA_EXE="$ROOT/Altirra-4.21/Altirra64.exe"
# PID tracking
PIDS=()
# Launch function (no quote nesting — everything passed safely)
launch() {
DESC="$1"
shift
echo "Launching $DESC..."
(
"$@" &
PID=$!
echo "✅ $DESC started with PID $PID"
PIDS+=("$PID")
)
}
# --- Start run-fujinet ---
if [ -x "$FUJINET_RUN" ]; then
launch "run-fujinet" bash -c "cd $ROOT/fujinet-firmware && ./run-fujinet"
else
echo "❌ Error: $FUJINET_RUN not found or not executable"
fi
# --- Start netsiohub ---
if [ -d "$FUJINET_BRIDGE" ]; then
echo "[WARN] Ensuring port 9997 is free..."
lsof -ti :9997 | xargs -r kill -9
launch "netsiohub" bash -c "cd $FUJINET_BRIDGE && python -m netsiohub"
else
echo "❌ Error: $FUJINET_BRIDGE not found"
fi
# --- Start Altirra ---
if [ -f "$ALTIRRA_EXE" ]; then
launch "Altirra" bash -c "cd $ROOT && wine $ALTIRRA_EXE /gdi"
else
echo "❌ Error: $ALTIRRA_EXE not found"
fi
echo "=== All processes started ==="
echo "🧠 PIDs: ${PIDS[*]}"
echo "🔚 Press [ENTER] to shut down everything..."
read -r
# --- Shutdown ---
echo "🔻 Shutting down..."
for PID in "${PIDS[@]}"; do
if kill -0 "$PID" 2>/dev/null; then
echo "Killing PID $PID..."
kill "$PID"
else
echo "PID $PID is already dead"
fi
done
echo "Finished"
EOF
-------------------------------------------------------
Row, run with this:
chmod +x run-fujinet-suite.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment