Vegz78 / McAirpos

MakeCode Arcade games in RetroPie, Recalbox 7/8 and Batocera, running natively as ELF executables on Raspberry Pi OS/Linux ARM with 1-2 gamepads

Home Page:https://Vegz78.github.io/McAirpos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game exit on start(game_files.elf must be executable and game folder writable)

Tech-munk opened this issue · comments

Hi!
I'm super new to raspberry pie and coding.
I gave my students an assignment to make games in make.code arcade and they did. I was able to convert the game files to ELF files. and transfer them into retropie. Using the McAirpos. But only three of the games started up. Any idea why this happened?
I also have some issues with my DIY-joystick. It does not work with all the three working games...

Hi @Tech-munk,

Thanks for trying out McAirpos and for your feedback!

Would it be possible for you(maybe with consent from your students) to upload here 3 game .elf files for me to test?:
-One that launches and works with your controller
-One that launches, but does not work with your controller
-One that does not launch

Also: Did they all work in the web simulator in the makecode arcade editor before you downloaded them as .elf?
(Just downloaded 3 random new games from arcade.makecode.com, and they worked ok.)

Hi Vegz78 and sorry for my late reply.
Yes! All the games on this list work good enough on google browser.
-This game works with controller (but not my DIY-joystick)
arcade-welcome-2-hell.zip

-This game won't export as an ELF
arcade-GAME-CUBE - Hussain (1).zip

-This game won't start up
arcade-2Trump.zip

Thanks for the all the help and hard work you're doing! And greetings from Norway!

Hi Vegz78 and sorry for my late reply.

Ikke noe problem, og vær hilset!

-This game won't export as an ELF
arcade-GAME-CUBE - Hussain (1).zip

This is a compilation problem inside Microsoft's domain. Please search or post a help request or issue at https://forum.makecode.com/c/share-your-arcade-projects-here/help/ or https://github.com/microsoft/pxt-arcade/issues.
Make sure to include the:

I suspect it has something to do with one or more of the extensions your student has used in this project, which for some reason is not present/found on their online compilation servers or loaded locally. For some reason, it worked when compiling to other hardware, but not the RPi....

-This game won't start up
arcade-2Trump.zip

It compiled and started up fine here. Are you sure all your .elf game files are executable?(chmod +x *.elf)

-This game works with controller (but not my DIY-joystick)
arcade-welcome-2-hell.zip

Controller issues requires a little tinkering if they do not work out of the box. launCharc autodetects many gamepads and uses uinput-mapper with an auto-calibration function in the config files .../uinput-mapper/configs/arcadeX.py.

I don't have much experience with DIY arcade controllers, because I don't have any myself. Are they connected via a USB interface OR GPIO? I would like broaden the support for these controllers, since many have arcade cabinet setups.

You could maybe either attempt to:

  • Use the launCharc nomap option and attemp to set up your controller as GPIO inputs OR EV_KEY scan code inputs directly in /sd/arcade.cfg. @Kay-Wolfe described his attempts here and there are examples and descriptions of configurations for MakeCode Arcade here: https://github.com/microsoft/uf2-linux/tree/master/cfg
  • Tinker with the mappings in the .../uinput-mapper/configs/arcadeX.py files.(Check first in the log file /tmp/McAirpos.log, whether your controller is detected or not by launCharc.)
  • If stuck after some attempts, show me what you have done/attach copies of your config files, and maybe we could find a working solution together.

For bullet points 2 and 3, we will need this information, and highlight in bold with comments each joystick input line with the desired/intended functions(button A, directions etc.).

Good luck!
-and impressive games by the students, by the way!

Takk for hjelpen!
the DIY-controller is a usb interface.
I'll get to it this weekend and see what comes of it.

I'll let you know ;)

This game won't export as an ELF
arcade-GAME-CUBE - Hussain (1).zip

Got so curious about this one, so posted an issue at the pxt-arcade repo, that the great guys on the MakeCode team have already replied to with a solution and updated game code that compiles for the RPi!:
microsoft/pxt-arcade#3045 (comment)

I'll get to it this weekend and see what comes of it.

I'll let you know ;)

Any success with this and your DIY controller?

Hi! I have the same problem. I'm new also, in Retropie and in Makecode. I have installed Retropie in a PI Zero w, Mame games work and I want to use your software so my kids could play their own games. Installation was correct. I've moved your jumpy-platformer example and other game from Makecode web to the roms/makecode folder, both appears in menu and both returns to main screen without launch when I try. I've tested a xbox gamepad and a homemade gamepad that works with the other mame games. Do you have any idea? Could I send you any log or something?

I have copied this log:
cat McAirpos.log
launCharc starting /home/pi/RetroPie/roms/makecode/arcade-Chicken-Run-v10.elf with automatic gamepad mappings...

Highest found input event number: 6
Gamepad search hits:
/home/pi/McAirpos/McAirpos/uinput-mapper/input-read -vp /dev/input/event4 2>&1 | grep -e BTN_START -e BTN_SOUTH -e BTN_PINKIE, Output: BTN_START → ([0, EV_KEY], BTN_START)
/home/pi/McAirpos/McAirpos/uinput-mapper/input-read -vp /dev/input/event5 2>&1 | grep -e BTN_START -e BTN_SOUTH -e BTN_PINKIE, Output: BTN_START → ([0, EV_KEY], BTN_START)
Keyboard search hit:
cat /proc/bus/input/devices | grep -B 5 -A 5 Handlers=sysrq | grep -B 7 -A 3 -e EV=12001 -e EV=10001 | grep -B 2 -A 8 -E 'Phys=(usb\S+/input1:1|usb\S+/input0|[a-zA-Z0-9]{2}(:[a-zA-Z0-9]{2}){5}.*)' | tr ' ' '\n' | grep event | head -1 | tr -d [:cntrl:], Output:event0

Found 2 gamepads to configure on:
/dev/input/event4, and
/dev/input/event5

Starting UInput-Mapper with command:
(/home/pi/McAirpos/McAirpos/uinput-mapper/input-read -C -D /dev/input/event4 /dev/input/event4 /dev/input/event5 /dev/input/event5 | sudo /home/pi/McAirpos/McAirpos/uinput-mapper/input-create -C -S /home/pi/McAirpos/McAirpos/uinput-mapper/configs/arcade2.py &)
Setting up UInputMapper in MakeCode Arcade game's /sd/arcade.cfg with:
SCAN_CODES=/dev/input/event6

launCharc starting /home/pi/RetroPie/roms/makecode/arcade-Chicken-Run-v10.elf with automatic gamepad mappings...

Highest found input event number: 6
Gamepad search hits:
/home/pi/McAirpos/McAirpos/uinput-mapper/input-read -vp /dev/input/event4 2>&1 | grep -e BTN_START -e BTN_SOUTH -e BTN_PINKIE, Output: BTN_START → ([0, EV_KEY], BTN_START)
/home/pi/McAirpos/McAirpos/uinput-mapper/input-read -vp /dev/input/event5 2>&1 | grep -e BTN_START -e BTN_SOUTH -e BTN_PINKIE, Output: BTN_START → ([0, EV_KEY], BTN_START)
Keyboard search hit:
cat /proc/bus/input/devices | grep -B 5 -A 5 Handlers=sysrq | grep -B 7 -A 3 -e EV=12001 -e EV=10001 | grep -B 2 -A 8 -E 'Phys=(usb\S+/input1:1|usb\S+/input0|[a-zA-Z0-9]{2}(:[a-zA-Z0-9]{2}){5}.*)' | tr ' ' '\n' | grep event | head -1 | tr -d [:cntrl:], Output:event0

Found 2 gamepads to configure on:
/dev/input/event4, and
/dev/input/event5

Starting UInput-Mapper with command:
(/home/pi/McAirpos/McAirpos/uinput-mapper/input-read -C -D /dev/input/event4 /dev/input/event4 /dev/input/event5 /dev/input/event5 | sudo /home/pi/McAirpos/McAirpos/uinput-mapper/input-create -C -S /home/pi/McAirpos/McAirpos/uinput-mapper/configs/arcade2.py &)
Setting up UInputMapper in MakeCode Arcade game's /sd/arcade.cfg with:
SCAN_CODES=/dev/input/event6

Did not find the file /tmp/pxt-pid...

Timed out trying to find game's process ID...
If stuck, please read or open a related issue at https://github.com/Vegz78/McAirpos.

Did not find the file /tmp/pxt-pid...

Hi @claricerogue,

It’s hard to remote diagnose, but the above error might indicate that the game did not execute(assuming it’s not a missing /tmp folder since you found the log file in a working /tmp folder with correct permissions).

Have you checked that you have execute permissions on all your game_file.elf files?:
chmod +x *.elf

The game files must also be allowed to write game_file.elf.data folders in the same directory, so if the above chmod doesn’t work, maybe you could try a chmod +w for the parent makecode games folder.

Please write back if this works or not.

Br, Vegard
PS: What happens if you exit RetroPie to the Linux Console and try to execute only the game file by itself from inside its folder?:
./game_file.elf

Did it work eventually, @claricerogue and @Tech-munk?

Problem with execute games is solved with your indications thanks. Now I have a problem with the gamepads. I'll open new issue.

👍