Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,41 @@ Raspberry Pi based Netbooter for Sega Naomi/Chihiro/Triforce arcade boards
<p>Optional: an FTDI based RS485 to USB adaptor for OpenJVS (see <a href="https://github.com/OpenJVS/OpenJVS">https://github.com/OpenJVS/OpenJVS</a> for more information)</p>
<p>Optional: OpenJVS Pi HAT (see <a href="https://github.com/OpenJVS/OpenJVS">https://github.com/OpenJVS/OpenJVS</a> for more information)</p>
<p>Optional: ACS ACR122U NFC Card Reader</p>

sudo apt install --no-install-recommends xserver-xorg-core xserver-xorg-input-all xserver-xorg-video-fbdev
sudo apt install xinput-calibrator
sudo apt install dbus dbus-x11

Configure Systemd Auto-login:
```
sudo tee /etc/systemd/system/firefox-netbooter.service > /dev/null << 'EOF'
[Unit]
Description=Firefox Browser Kiosk
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStartPre=/bin/mkdir -p /tmp/firefox_temp
ExecStart=/usr/bin/startx /usr/bin/firefox --new-instance --profile /tmp/firefox_temp --kiosk 'http://127.0.0.1/index.html'

Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF
```

Enable and Start
```
sudo systemctl daemon-reload
sudo systemctl enable firefox-netbooter.service
sudo systemctl start firefox-netbooter.service
```

Check Status
```
sudo systemctl status firefox-netbooter.service
journalctl -u firefox-netbooter.service -f
```
1 change: 1 addition & 0 deletions boot/cmdline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fsck.repair=yes vt.global_cursor_default=0 fastboot noatime nodiratime noram
1 change: 1 addition & 0 deletions boot/cmdline.txt.7inportrait
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fsck.repair=yes vt.global_cursor_default=0 fastboot noatime nodiratime noram
1 change: 1 addition & 0 deletions boot/cmdline.txt.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11 consoleblank=1 logo.nologo quiet loglevel=0 plymouth.enable=0 vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fastboot noatime nodiratime noram
23 changes: 12 additions & 11 deletions boot/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
framebuffer_width=480
framebuffer_height=800

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
Expand All @@ -37,14 +37,14 @@
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2
#sdtv_mode=0

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=i2c_arm=on
dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
Expand All @@ -57,13 +57,14 @@ dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-fkms-v3d
#dtoverlay=vc4-fkms-v3d,nohdmi
#dtoverlay=vc4-kms-v3d,nohdmi
#dtoverlay=vc4-kms-dsi-7inch,nohdmi
#max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
hdmi_force_hotplug=1
dtparam=i2c_arm=on
dtparam=spi=on
display_rotate=1
lcd_rotate=1
enable_uart=1
#dtoverlay=tft35a:rotate=90,fps=60,speed=32000000
dtoverlay=uart3
dtoverlay=uart4
70 changes: 70 additions & 0 deletions boot/config.txt.7inportrait
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=480
framebuffer_height=800

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=0

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-fkms-v3d,nohdmi
#dtoverlay=vc4-kms-v3d,nohdmi
#dtoverlay=vc4-kms-dsi-7inch,nohdmi
#max_framebuffers=2

[all]
display_rotate=1
lcd_rotate=1
enable_uart=1
dtoverlay=uart3
dtoverlay=uart4
Binary file modified boot/config/images/mbaa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified boot/config/images/meltyb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified boot/config/images/meltyba.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified boot/config/images/mvsc2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions boot/config/romsinfo.csv
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ system,romname,image,video,description,lcd_description,manufacturer,year,genre,r
"Sega Naomi",n1-marvel_vs_capcom_2_all_unlocked-[841-0007].bin.gz,mvsc2.png,mvsc2.mp4,"Marvel vs. Capcom 2 UNLOCKED","Marvel vs. Capcom 2\nUnlocked",Capcom,2000,Fighter,"AAMA - Yellow (Animated Violence Mild)",Horizontal,"Digital (Stick)",Yes,No,generic,none,BBG1,n1-marvel_vs_capcom2_BBG0.bin.gz
"Sammy Atomiswave",aw-maximum_speed_AW09.bin.gz,maxspeed.png,maxspeed.mp4,"Maximum Speed","Maximum Speed",Sammy,2002,Driving,"AAMA - Green (Suitable For All Ages)",Horizontal,"Analog (Driving)",Yes,No,generic-driving,generic-driving,AW09,aw-maximum_speed_AW09.bin.gz
"Sega Naomi",n1-the_maze_of_the_kings-[GDS-0022].bin.gz,mok.png,mok.mp4,"Maze of the Kings, The","Maze of the Kings",Sega,2002,Gun,"AAMA - Yellow (Animated Violence Mild)",Horizontal,Lightgun,Yes,No,generic-shooting,none,BEP0,n1-the_maze_of_the_kings_BEP0.bin.gz
"Sega Naomi",n1-melty_blood_act_cadenza_rev_a-[GDL-0028C].bin.gz,meltyb.png,meltyba.mp4,"Melty Blood Act Cadenza","Melty Blood\nAct Cadenza","Ecole Software",2005,Fighter,"AAMA - Yellow (Animated Violence Mild)",Horizontal,"Digital (Stick)",Yes,No,generic,none,BJP0,n1-melty_blood_act_cadenza_BJP0.bin.gz
"Sega Naomi",n1-melty_blood_act_cadenza_rev.b-[GDL-0039].bin.gz,meltyba.png,meltyba.mp4,"Melty Blood Act Cadenza Rev B","Melty Blood\nAct Cadenza [B]","Ecole Software",2005,Fighter,"AAMA - Yellow (Animated Violence Mild)",Horizontal,"Digital (Stick)",Yes,No,generic,none,BJP0,n1-melty_blood_act_cadenza_BJP0.bin.gz
"Sega Naomi",n1-melty_blood_act_cadenza_rev_a-[GDL-0028C].bin.gz,mbaa.png,meltyba.mp4,"Melty Blood Act Cadenza","Melty Blood\nAct Cadenza","Ecole Software",2005,Fighter,"AAMA - Yellow (Animated Violence Mild)",Horizontal,"Digital (Stick)",Yes,No,generic,none,BJP0,n1-melty_blood_act_cadenza_BJP0.bin.gz
"Sega Naomi",n1-melty_blood_act_cadenza_rev.b-[GDL-0039].bin.gz,meltyb.png,meltyba.mp4,"Melty Blood Act Cadenza Rev B","Melty Blood\nAct Cadenza [B]","Ecole Software",2005,Fighter,"AAMA - Yellow (Animated Violence Mild)",Horizontal,"Digital (Stick)",Yes,No,generic,none,BJP0,n1-melty_blood_act_cadenza_BJP0.bin.gz
"Sega Naomi",n1-melty_blood_act_cadenza_rev.b2-[GDL-0039A].bin.gz,meltyba.png,meltyba.mp4,"Melty Blood Act Cadenza Rev B2","Melty Blood\nAct Cadenza [B2]","Ecole Software",2005,Fighter,"AAMA - Yellow (Animated Violence Mild)",Horizontal,"Digital (Stick)",Yes,No,generic,none,BJP0,n1-melty_blood_act_cadenza_BJP0.bin.gz
"Sega Naomi",n1-melty_blood_actress_again-[841-0061].bin.gz,mbaaa.png,mbaa.mp4,"Melty Blood Actress Again","Melty Blood\nActress Again",Type-Moon/Ecole,2008,Fighter,"AAMA - Yellow (Animated Violence Mild)",Horizontal,"Digital (Stick)",Yes,No,generic,none,BQT0,n1-melty_blood_actress_again_BQT0.bin.gz
"Sega Naomi",n1-melty_blood_actress_again_unlocked-[841-0061].bin.gz,mbaaa.png,mbaa.mp4,"Melty Blood Actress Again UNLOCKED","Melty Blood\nActress Again Unlocked",Type-Moon/Ecole,2008,Fighter,"AAMA - Yellow (Animated Violence Mild)",Horizontal,"Digital (Stick)",Yes,No,generic,none,BQT0,n1-melty_blood_actress_again_BQT0.bin.gz
Expand Down
54 changes: 54 additions & 0 deletions etc/X11/Xsession.d/xinput_calibrator_pointercal
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/sh

PATH="/usr/bin:$PATH"

BINARY="xinput_calibrator"
CALFILE="/etc/pointercal.xinput"
LOGFILE="/var/log/xinput_calibrator.pointercal.log"

PORTRAIT_MODE=false
PREAMBLE=""

BASE_INSERT_LINES='\tDriver\t\t\t"libinput"\n\tMatchIsTouchscreen\t"on"\n\tMatchDevicePath\t\t"/dev/input/event*"\n\tOption\t\t\t"DeviceName" "touchscreen"'
PORTRAIT_INSERT_LINES='\t# 90° clockwise: [ 0 1 0 ]\n\t# [ -1 0 1 ]\n\t# [ 0 0 1 ]\n\t#\n\t# In row-major order: "m11 m12 m13 m21 m22 m23 m31 m32 m33"\n\tOption\t\t\t"TransformationMatrix" "0 1 0 -1 0 1 0 0 1"'

for arg in "$@"; do
if [ "$arg" = "--portrait" ]; then
PORTRAIT_MODE=true
fi
done

if [ -e "$CALFILE" ]; then
if [ -s "$CALFILE" ]; then
# Calibration data found in $CALFILE, exit
exit 0
else
PREAMBLE="$CALFILE calibration file is empty, removing it...\n"
rm $CALFILE
fi
fi

echo "$PREAMBLE$CALFILE calibration data file not found. Starting calibration...\n" > $LOGFILE

$BINARY --verbose --output-type xorg.conf.d --output-filename $CALFILE >> $LOGFILE 2>&1

echo "Modifying configuration file..." >> $LOGFILE

# Use sed to insert each line above the line that begins with "EndSection"
# Loop through each line after interpreting \t and \n
printf "%b\n" "$BASE_INSERT_LINES" | while IFS= read -r line; do
sed -i "/^EndSection/i\\
$line" "$CALFILE"
done

if [ "$PORTRAIT_MODE" = true ]; then
echo "Portrait mode selected!" >> $LOGFILE
printf "%b\n" "$PORTRAIT_INSERT_LINES" | while IFS= read -r line; do
sed -i "/^EndSection/i\\
$line" "$CALFILE"
done
else
echo "Default mode selected." >> $LOGFILE
fi

echo "Calibration data stored in $CALFILE (log in $LOGFILE)" >> $LOGFILE
6 changes: 6 additions & 0 deletions etc/X11/xorg.conf.d/10-fbdev.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Section "Device"
Identifier "fbdev0"
driver "fbdev"
Option "fbdev" "/dev/fb0"
Option "ShadowFB" "off"
EndSection
14 changes: 14 additions & 0 deletions etc/X11/xorg.conf.d/50-display.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Section "Monitor"
Identifier "default"
EndSection

Section "Screen"
Identifier "screen0"
Device "fbdev0"
Monitor "default"
EndSection

Section "ServerLayout"
Identifier "default"
Screen 0 "screen0" 0 0
EndSection
50 changes: 19 additions & 31 deletions etc/X11/xorg.conf.d/99-calibration.conf
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "Calibration" "227 3936 268 3886"
Option "SwapAxes" "0"
EndSection

Section "Device"
# WaveShare SpotPear 3.5", framebuffer 1
Identifier "uga"
driver "fbdev"
Option "fbdev" "/dev/fb1"
Option "ShadowFB" "off"
EndSection

Section "Monitor"
# Primary monitor. WaveShare SpotPear 480x320
Identifier "WSSP"
EndSection

Section "Screen"
Identifier "primary"
Device "uga"
Monitor "WSSP"
SubSection "Display"
Modes "1920x1080"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "default"
Screen 0 "primary" 0 0
Identifier "calibration"
MatchProduct "raspberrypi-ts"
Driver "libinput"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Option "DeviceName" "touchscreen"
Option "MinX" "-466"
Option "MaxX" "64977"
Option "MinY" "116"
Option "MaxY" "65050"
Option "SwapXY" "0"
Option "InvertX" "0"
Option "InvertY" "0"
# 90° clockwise: [ 0 1 0 ]
# [ -1 0 1 ]
# [ 0 0 1 ]
#
# In row-major order: "m11 m12 m13 m21 m22 m23 m31 m32 m33"
Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
EndSection
3 changes: 3 additions & 0 deletions etc/xdg/openbox/autostart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ xset -dpms
# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp

# Calibrate touchpad, if needed
sudo /bin/sh /etc/X11/Xsession.d/xinput_calibrator_pointercal --portrait

# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences
Expand Down
Loading