4 Player GPIO + Raw Elf Export

@MakeCode I’d like to draw your eyes to the couple of PRs I made over the weekend to allow for 4 player GPIO inputs when using the .elf extension and combining with the McAirpos wrapper for use with emulation frontends.

My personal goal was to allow use of McAirpos directly launching .elf files in a Raspberry Pi 3B “Trixie” lite setup (no emulator frontend) to allow for single game launches in a physical arcade box and also allow for 4 player inputs via the GPIO as suggested by the current cardboard-arcade.zip.

PXT has a small update to the modal to describe it as an .elf file, this can probably go first as it’s backward compatible.

The second PR is against the pxt-arcade to present the new raw-elf option in hardware choices and updated the .cpp file to allow for the 4 player GPIO pins to be used.

Let me know if this would be possible and I know I don’t see the whole picture against other frontends but I think this will have a reasonable limit of impact but also encourage people to build games for their own emulator frontends.

Previous posts:

https://forums.adafruit.com/viewtopic.php?t=221907

2 Likes

Nice initiative, @Kikketer!

Hoping your PRs or a derivate of them will get merged for this functionality and looking forward to hearing more about this!
(…and maybe eventually how it worked out for your Gravis Gamepad Pro?)

While we are still waiting for your official CreationStationArcade thread on this forum, and since I do not want to hijack @UnsignedArduino’s thread about his amazing executable solution, where this discussion would be off topic, I guess this topic functions as the CreationStationArcade thread in the meantime.

Also adding more “push this button to absolutely kill the current game” safety checks and possibly drop McAirpos completely in an effort to track the PID myself.

Nothing would be better than getting rid of the the need for launchers for helping to get the .elf MakeCode Arcade game executables to run as they should on ARM Linux in the first place!

With your already proven record on making both an advanced arcade solution and navigating the rich pxt codebase to make targeted PRs, I am hoping you could please also chime in on the long ongoing efforts for getting there eventually?:

This would, together with your suggested simplified and improved compilation and downloading directly from arcade.makecode.com, be beneficial for both of us and everyone who wants to run their games natively. Especially if @MakeCode eventually would iron out the ever more regressing state of the .elf compiler in relation to the continued development of the rest of Arcade and of the Raspberry Pi OS and hardware, too, where more and more of the new and advanced stuff, the raycasting extension etc. is failing.

Nothing would be better than for McAirpos to focus just on gamepad support and integration into the retro game systems’ menus, instead of increasingly complex ways to get the .elfs to execute correctly in environments which have their own ways of juggling the ttys and ioctls around. This probably applies to CreationStationArcade and other applications as well.

As mildly funny side note, where we both have been struggling to wrestle the execution challenge of “…kill the current game safety checks and…to track the PID…”: Why reinvent the wheel? :wink:

Hehe sorry I didn’t see this reply right away. Yes I ran into the same situation with the .elf files and how to kill them. I didn’t yet dive into the intricacies of why this is the case for elf files, in fact right now I’m just trying to figure out/learn how these things are compiled in general (with the assistance of AI). It’s incredibly complicated from what I’ve been able to figure out so far… dependency management, plugin additions, etc etc.

So yes for now the CreationStationArcacde is at a solid spot and I will do a post very soon about it. What I started with was a simple re-creation of the core “manage the process” and did it in a bash script called “simpleLaunch”: https://github.com/Kikketer/CreationStationArcade/blob/main/simpleLaunch.sh

BUT I’ve since even taken the CreationStationArcade in the next step:

  1. The manu “game” shows screen saver and game selections
  2. When you pick a game in this menu-game it’ll run the standard control.runProgram (mostly undocumented thing that games can do!) of the selected game (which I believe also kills the menu game).
  3. Create a “reset” button that kills ANY .elf file which is a “kill” type script that runs in the background: https://github.com/Kikketer/CreationStationArcade/blob/main/monitor_kill.py#L153
  4. And combined with the next step in that kill to then re-launch the menu: https://github.com/Kikketer/CreationStationArcade/blob/main/monitor_kill.py#L167C46-L167C59

So basically you have a menu, push a button to launch a game, play the game… you then must push the reset button (it’s not makeCode arcade button it’s just hard-wired into the raspberry pi that then monitors those pins and hard-kills elf files when pressed and relaunches the menu).

This is a preview post of all the things for this “offline github based arcade machine” :slight_smile: And man writing it all down like that makes it sound complicated! More complete post to come soon.

1 Like