Skip to content

Commit 79c458b

Browse files
authored
Build StepMania 5.1 from the 5_1-new branch. (#3)
* Updated StepMania to use the 5_1-new branch, instead of 'master' * Updated merge-config.sh to WARN and create target file, instead of failing, if target config doesn't exist. * Updated launcher to be able to apply default Preferences.ini preferences, & provided a reasonable set for the Pi. * Updated patch apply-then-remove logic so that we don't always built the tip of our branch, and instead build the commit the submodule was set to * Updated to remove existing .asoundrc (Alsamixer settings) during install. * Updated wallpaper to show version = 5.1 * Added "default-no-anim" NoteSkin - it's the default NoteSkin w/out animation * Fixed mistakenly calling it "raspian"
1 parent 5c81454 commit 79c458b

14 files changed

Lines changed: 395 additions & 31 deletions

File tree

Makefile

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ system-prep:
1717
chmod a+x ./merge-config.sh
1818
sudo ./merge-config.sh ./performance-tune/raspi-3b-tune.config /boot/config.txt
1919
sudo cp -fv ./system-prep/usb-audio-by-default.conf /etc/modprobe.d/.
20+
[ -e "$(HOME)/.asoundrc" ] && rm "$(HOME)/.asoundrc"
2021

2122
.PHONY: build-prep
2223
build-prep:
@@ -55,8 +56,8 @@ build-prep:
5556
yasm \
5657
zlib1g-dev
5758
sudo apt-get autoremove -y
58-
sudo mkdir -p /usr/local/stepmania-5.2
59-
sudo chmod a+rw /usr/local/stepmania-5.2
59+
sudo mkdir -p /usr/local/stepmania-5.1
60+
sudo chmod a+rw /usr/local/stepmania-5.1
6061

6162

6263
.PHONY: stepmania-prep
@@ -67,8 +68,6 @@ stepmania-prep:
6768
cd stepmania
6869
git submodule init
6970
git submodule update
70-
git fetch
71-
git merge origin/master
7271
git apply ../stepmania-build/raspi-3b-arm.patch && git commit --author="raspian-3b-stepmania-arcade <SpottyMatt@gmail.com>" -a -m "Patched to enable building on ARM processors with -DARM_CPU=XXX -DARM_FPU=XXX"
7372
cmake -G "Unix Makefiles" \
7473
-DWITH_CRASH_HANDLER=0 \
@@ -79,7 +78,7 @@ stepmania-prep:
7978
-DARM_CPU=cortex-a53 \
8079
-DARM_FPU=neon-fp-armv8
8180
cmake .
82-
git reset --hard origin/master
81+
git reset --hard HEAD^
8382

8483
.PHONY: stepmania-build
8584
stepmania-build:
@@ -88,16 +87,16 @@ stepmania-build:
8887
.PHONY: stepmania-install
8988
stepmania-install:
9089
$(MAKE) --dir stepmania install
91-
mkdir -p "$(HOME)/.stepmania-5.0/Save"
92-
touch "$(HOME)/.stepmania-5.0/Save/Preferences.ini"
93-
./merge-config.sh ./stepmania-install/Preferences.ini "$(HOME)/.stepmania-5.0/Save/Preferences.ini"
94-
cp -fv ./stepmania-install/launch.sh "$(HOME)/.stepmania-5.0/"
95-
chmod a+x "$(HOME)/.stepmania-5.0/launch.sh"
90+
mkdir -p "$(HOME)/.stepmania-5.1"
91+
cp -rfv ./stepmania-install/user-settings/. "$(HOME)/.stepmania-5.1/"
92+
chmod a+x "$(HOME)/.stepmania-5.1/Save/merge-ini.sh"
93+
chmod a+x "$(HOME)/.stepmania-5.1/launch.sh"
94+
cp -rfv ./stepmania-install/global-settings/. "/usr/local/stepmania-5.1/"
9695
mkdir -p "$(HOME)/.config/autostart"
9796
cat stepmania-install/stepmania.desktop | RUNUSER=$(shell whoami) envsubst > "$(HOME)/.config/autostart/stepmania.desktop"
9897
mkdir -p "$(HOME)/Pictures/"
99-
cp -rfv ./stepmania-install/stepmania_wallpaper/ "$(HOME)"/Pictures/.
100-
DISPLAY=:0 pcmanfm --set-wallpaper="$(HOME)/Pictures/stepmania_wallpaper/stepmania_yellow.png"
98+
cp -rfv ./stepmania-install/stepmania-wallpaper/ "$(HOME)"/Pictures/.
99+
DISPLAY=:0 pcmanfm --set-wallpaper="$(HOME)/Pictures/stepmania-wallpaper/yellow_5.1_16:9.png"
101100

102101
.PHONY: overclock-apply
103102
overclock-apply:

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
StepMania on Raspberry Pi
22
=========================
33

4-
Scripts & instructions to turn a Raspberry Pi 3B or 3B+ running Raspian into a [StepMania](https://github.com/stepmania/stepmania) arcade console.
4+
Scripts & instructions to turn a Raspberry Pi 3B or 3B+ running Raspbian into a [StepMania](https://github.com/stepmania/stepmania) arcade console.
55

6-
![StepMania on Raspbery Pi Title Card](stepmania-install/stepmania_wallpaper/stepmania_yellow.png)
6+
![StepMania on Raspbery Pi Title Card](stepmania-install/stepmania-wallpaper/yellow_5.1_16:9.png)
77

88
1. [Prerequisites](#prerequisites)
99
2. [Quick Start](#quick-start)
@@ -20,7 +20,7 @@ Prerequisites
2020
1. A supported [Raspberry Pi model](https://www.raspberrypi.org/products/)
2121
1. 3B
2222
2. 3B+
23-
2. An installed & working [Raspian](https://www.raspberrypi.org/downloads/raspbian/) operating system, Stretch (v9) or later.
23+
2. An installed & working [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) operating system, Stretch (v9) or later.
2424
3. A [USB sound card that works out-of-the-box with the Raspberry Pi](https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi?view=all)
2525

2626
Quick Start
@@ -128,7 +128,7 @@ Get USB Sound Working
128128

129129
Plug in your sound card. Use one or some combination of the following to try to activate it:
130130

131-
1. Raspian GUI
131+
1. Raspbian GUI
132132
2. `raspi-config`
133133
3. `alsamixer`
134134

@@ -377,6 +377,7 @@ Performance Benchmarks
377377
| ----------------- | ------------ | ------------ | --------- |
378378
| 1680 x 1050 | 512 | No | 32 |
379379
| 1680 x 1050 | 512 | Yes | 37 |
380+
| 1680 x 1050 | 1024 | Yes | 33 |
380381

381382
Building for Other Raspberry Pi Models
382383
-------------------------
@@ -394,3 +395,13 @@ In particular, it's got tables of the `ARM_CPU` and `ARM_FPU` values for other R
394395
Who knows, they might work! The regular 3B was just powerful enough to run StepMania acceptably; older models may struggle to perform.
395396

396397
Edit your `Makefile` and give it a try!
398+
399+
StepMania Source
400+
-------------------------
401+
402+
This uses a working commit from the [`5_1-new`](https://github.com/stepmania/stepmania/tree/5_1-new) branch of StepMania as the source code.
403+
404+
If you want to try building from a more recent commit, [update the `stepmania` submodule](https://stackoverflow.com/questions/5828324/update-git-submodule-to-latest-commit-on-origin/5828396#5828396) before building and installing.
405+
406+
Previously, this repository used the (unmaintained) StepMania 5.2 code from the tip of the `master` branch.
407+
If for some reason you want to set up _that_ StepMania, the old code has been preserved in the [`StepMania-5.2` branch](https://github.com/SpottyMatt/raspbian-3b-stepmania-arcade/tree/StepMania-5.2) of this repository.

merge-config.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ if ! [ -e "${SOURCE_CONFIG}" ]; then
2525
fi
2626

2727
if ! [ -e "${TARGET_CONFIG}" ]; then
28-
echo "ERROR: [${TARGET_CONFIG}] does not exist."
29-
exit 1
28+
echo "WARNING: [${TARGET_CONFIG}] does not exist."
29+
mkdir -p $(dirname "${TARGET_CONFIG}")
30+
touch "${TARGET_CONFIG}"
3031
fi
3132

3233
echo -e "Merging configuration:\n\tSource : ${SOURCE_CONFIG}\n\tTarget : ${TARGET_CONFIG}"

stepmania

Submodule stepmania updated 3859 files
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
local t = Def.ActorFrame {
2+
Def.Sprite {
3+
Texture="_arrow";
4+
Frame0000=0;
5+
Delay0000=1;
6+
};
7+
};
8+
return t;
102 KB
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Global]
2+
FallbackNoteSkin=default

stepmania-install/launch.sh

100644100755
Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
11
#!/usr/bin/env bash
22

3-
STEPMANIA_SETTINGS_DIR=~/.stepmania-5.0
3+
STEPMANIA_SETTINGS_DIR=~/.stepmania-5.1
4+
5+
####################
6+
# Default Preferences:
7+
# If there aren't user prefs (first-time startup),
8+
# do a fake startup & then overwrite generated preferences
9+
####################
10+
11+
SHOULD_APPLY_DEFAULTS="false"
12+
13+
if ! [ -e "${STEPMANIA_SETTINGS_DIR}/Save/Preferences.ini" ]; then
14+
SHOULD_APPLY_DEFAULTS="true"
15+
echo "First-ever launch; should apply defaults if present."
16+
fi
417

518
####################
619
# If there are named keymaps,
720
# try to map controllers properly & predictably
821
####################
922

10-
if [ -d ${STEPMANIA_SETTINGS_DIR}/Save/Keymaps ]; then
23+
SHOULD_LOAD_KEYMAPS="false"
24+
25+
if [ -d "${STEPMANIA_SETTINGS_DIR}/Save/Keymaps" ]; then
26+
SHOULD_LOAD_KEYMAPS="true"
27+
else
28+
echo "No named key mappings found in [${STEPMANIA_SETTINGS_DIR}/Save/Keymaps/]."
29+
fi
30+
31+
32+
if [ "${SHOULD_LOAD_KEYMAPS}" == "true" ] || [ "${SHOULD_APPLY_DEFAULTS}" == "true" ]; then
1133

1234
STARTUP_LOGS="/tmp/sm-launch.log"
1335
STARTED_UP_PATTERN="Display: "
@@ -17,15 +39,15 @@ if [ -d ${STEPMANIA_SETTINGS_DIR}/Save/Keymaps ]; then
1739
KILL_MAX=30
1840

1941
# "fake" launch to read SM logs to find out the actual ordering of controllers
20-
/usr/local/stepmania-5.2/stepmania --verbose --debug > ${STARTUP_LOGS} 2>&1 &
42+
/usr/local/stepmania-5.1/stepmania --verbose --debug > ${STARTUP_LOGS} 2>&1 &
2143
SM_DUMMY_PID=$!
2244

2345
STARTUP_WAIT=0
2446
KILL_WAIT=0
2547
while sleep 1; do
2648
STARTUP_WAIT=$((STARTUP_WAIT + 1))
2749
if [ $STARTUP_WAIT -gt $STARTUP_MAX ]; then
28-
echo "WARNING: StepMania took too long starting up. Will not be able to map controller input."
50+
echo "WARNING: StepMania took too long starting up."
2951
kill -9 ${SM_DUMMY_PID}
3052
sleep 5
3153
break
@@ -60,7 +82,7 @@ EOF
6082
while sleep 1; do
6183
KILL_WAIT=$((KILL_WAIT + 1))
6284
if [ $KILL_WAIT -gt $KILL_MAX ]; then
63-
echo "WARNING: StepMania took too long shutting down. Will not be able to map controller input."
85+
echo "WARNING: StepMania took too long shutting down."
6486
kill -9 ${SM_DUMMY_PID}
6587
sleep 5
6688
break 2
@@ -73,7 +95,13 @@ EOF
7395
fi
7496
done # with fake startup to get input device order
7597

76-
sleep 2
98+
fi
99+
100+
sleep 2
101+
102+
# Load Keymaps if necessary
103+
104+
if [ "${SHOULD_LOAD_KEYMAPS}" == "true" ]; then
77105

78106
rm -f ${GENERATED_KEYMAP}
79107
echo "[dance]" > ${GENERATED_KEYMAP}
@@ -172,12 +200,19 @@ EOF
172200
# at least one mapping was added
173201
cp -f ${GENERATED_KEYMAP} ${STEPMANIA_SETTINGS_DIR}/Save/Keymaps.ini
174202
fi
175-
else
176-
echo "No named key mappings found in [${STEPMANIA_SETTINGS_DIR}/Save/Keymaps/]."
177203
fi
178204

179205
sleep 1
180206

207+
####################
208+
# Apply Defaults
209+
####################
210+
211+
if [ "${SHOULD_APPLY_DEFAULTS}" == "true" ]; then
212+
cp ${STEPMANIA_SETTINGS_DIR}/Save/Preferences.ini ${STEPMANIA_SETTINGS_DIR}/Save/Preferences.ini.orig
213+
${STEPMANIA_SETTINGS_DIR}/Save/merge-ini.sh ${STEPMANIA_SETTINGS_DIR}/Save/Default-Preferences.ini ${STEPMANIA_SETTINGS_DIR}/Save/Preferences.ini Options
214+
fi
215+
181216
####################
182217
# Launch StepMania
183218
####################
@@ -186,7 +221,7 @@ sleep 1
186221
unclutter -display :0 -noevents -grab &
187222

188223
# start StepMania
189-
/usr/local/stepmania-5.2/stepmania
224+
/usr/local/stepmania-5.1/stepmania
190225

191226
# kill the thing that's hiding the cursor
192227
pkill unclutter
525 KB
Loading

stepmania-install/stepmania.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[Desktop Entry]
22
Name=Stepmania
33
Comment=Autolaunch Stepmania on Login
4-
Exec=/home/${RUNUSER}/.stepmania-5.0/launch.sh
4+
Exec=/home/${RUNUSER}/.stepmania-5.1/launch.sh
55
Terminal=false
66
Type=Application
77
NoDisplay=false

0 commit comments

Comments
 (0)