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
https://Vegz78.github.io/McAirpos
MIT License
82 stars 10 forks source link

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

Closed Tech-munk closed 3 years ago

Tech-munk commented 3 years ago

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...

Vegz78 commented 3 years ago

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.)

Tech-munk commented 3 years ago

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!

Vegz78 commented 3 years ago

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:

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!

Tech-munk commented 3 years ago

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 ;)

Vegz78 commented 3 years ago

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!: https://github.com/microsoft/pxt-arcade/issues/3045#issuecomment-773822437

Vegz78 commented 3 years ago

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?

claricerogue commented 3 years ago

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?

claricerogue commented 3 years ago

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.

Vegz78 commented 3 years ago

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

Vegz78 commented 3 years ago

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

claricerogue commented 3 years ago

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

Vegz78 commented 3 years ago

👍