How to Run a Game on a Raspberry pi 5 SD Card Directly!

there’s now a GetCurrentGame function

so things have gotten me confused so Im gonna document more this is for the key board

for this you have to plug it in first

the /sd/arcade.cfg

[Target]
Hardware=pc

[Input]
SCAN_CODES=/dev/input/event0
BTN_LEFT=105
BTN_RIGHT=106
BTN_UP=103
BTN_DOWN=108
BTN_A=57
BTN_B=29
BTN_MENU=41
BTN_RESET=14
kbd_mode=1

for the Reyann Zero Delay Arcade USB Encoder Pc to Joystick for Mame Jamma & Other Pc Fighting Games for American Style Arcade Joystick & HAPP Style Arcade Buttons I’m using

[Target]
Hardware=pc

[Input]
SCAN_CODES=/dev/input/by-id/usb-DragonRise_Inc._Generic_USB_Joystick-event-joystick
BTN_UP=290
BTN_DOWN=291
BTN_LEFT=292
BTN_RIGHT=293
BTN_A=288
BTN_B=289
BTN_RESET=294
BTN_MENU=295
kbd_mode=0

ok big update I hope I recommend you use the module and it should work but you might have to say press a twice if your game has a start like you run it it will restart and now it should work and it MIGHT freeze every now and then but it should restart to fix it self

Sick Logo!!! Upon Boot Up!!!

and fixed bugs

1 Like

Do you know how to do this in raspberry pi 0 v.1.3?

what do you mean like get it to run it on a pi 0 this could MAYBE still work because it sets a Hardware line to a pi 0s hardware I think but what do you mean

if you want colored text like that you can try this other tool I made https://pypi.org/project/TextColorDisplay/

I have installed an exceptionally lightweight yet highly efficient operating system on my Raspberry Pi. Specifically, I have integrated several drivers enabling network navigation via a dedicated browser, NetSurf, alongside Bluetooth connectivity. While such a setup might typically be sluggish, it performs admirably in my case. I am inquiring whether your concept could be adapted for the Raspberry Pi Zero v1.3. Though it may appear unfeasible, I believe it is achievable. Should I be mistaken, please do not hesitate to correct me.

well it might work but I think you can select to download a game for a pi 0 though because I made this because there was no option to download for a pi 5

ok, i understand

hey @richard you know why this is happening I don’t know why I didn’t ask you first but the module is kinda fine but I selected the audio driver to be alsa and it works but every time a sound plays some times it crashes but I made it where it restarts to fix it Gemini said it was something like a garbage collection error thing the elf file gc not collecting enough and I wasent sure if you knew if there was any file or setting that could be override to fix that because the video driver was fine but the audio one would sometimes cause a crash

i’m afraid i won’t be too helpful when it comes to linux stuff, not my area of expertise! unfortunately the person who implemented our linux support isn’t on the team anymore, so i’m not sure where to redirect your questions to

1 Like

this could be really useful for example have game packs with lots of games inside.

@richard well that’s unfortunate I guess forbidden sources Cough… AI Cough… will probably be my best bet right now but out of curiosity do you know if any of the fellow @moderators would know or maybe how I could maybe reach out to the person who did the Linux I don’t know those are the only two options I could think of but thanks any way

yeah I’m trying I am trying someting else to trick the audio to no make it crash but with this module now try not to use the car noise generator sounds

well just to show the code

#!/bin/bash
sudo mkdir /sd

echo "[Target]
Hardware=rpi

[Input]
SCAN_CODES=/dev/input/event0
BTN_LEFT=105
BTN_RIGHT=106
BTN_UP=103
BTN_DOWN=108
BTN_A=57
BTN_B=29
BTN_MENU=41
BTN_RESET=14
kbd_mode=1" | sudo tee /sd/arcade.cfg

# 2. Apply the Pi 5 signature spoofing trick
sudo umount -l /proc/cpuinfo 2>/dev/null
sudo rm -f /tmp/cpuinfo
cp /proc/cpuinfo /tmp/cpuinfo
sudo sh -c 'echo "Hardware : BCM2835" >> /tmp/cpuinfo'
sudo mount --bind /tmp/cpuinfo /proc/cpuinfo

# 1. Force terminal screen blanking off cleanly
sudo TERM=linux sh -c 'setterm -blank 0 -powerdown 0 > /dev/tty1' 2>/dev/null

# 2. Print your custom boot logo directly to the screen
python3 "$(dirname "$0")/PrintLogo.py"

# 3. Wait 2 seconds for the player to see your logo
sleep 2

# 4. The Crash-Proof Game Loop
while true; do
    echo "Starting Game Match..."
    
    # Bash automatically finds and targets any execution-ready game file using ./*.elf
    sudo chmod +x ./*.elf 2>/dev/null
    sudo SDL_VIDEODRIVER=kmsdrm SDL_AUDIODRIVER=alsa ./*.elf --hw rpi
    
    echo "Match concluded. Deep cleaning memory cache..."
    sync
    sleep 1.5
    echo "Ready for next match!"
done

I’ve also tried BCM2711 and BCM2712 they both also worked

2 Likes

ok some what big news I updated it so it uses a older sound thing OSS instead of ALSA to I think might help with older 32-bit is needed and now it might crash like 1-2 times every time you use game.reset() at the start of the new game but give it a second and you can press play and it should not not crash as much if not at all during a game maybe onece at the very start but after that you should be fine

1 Like

oh also press Ctrl + C to stop it not Ctrl + Z

@Vegz78 I’ve seen you do stuff like this do you know why or how to fix the crash clean out to not need crash at all

here’s the repo https://github.com/NeverStopTheCoder/RP5RS for more info

by that I mean there are mini clean out crashes and I did not seem to have a problem during the game with 2 plays I know not a lot but I got tired