# 4 Player GPIO + Raw Elf Export

**URL:** <https://forum.makecode.com/t/4-player-gpio-raw-elf-export/41383>\
**Category:** Arcade\
**Created:** [January 5, 2026, 6:15pm UTC](https://forum.makecode.com/t/4-player-gpio-raw-elf-export/41383 "2026-01-05T18:15:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kikketer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kikketer/32/16551_2.png) [@Kikketer](https://forum.makecode.com/u/Kikketer)\
**Post date:** [January 5, 2026, 6:15pm UTC](https://forum.makecode.com/t/4-player-gpio-raw-elf-export/41383/1 "2026-01-05T18:15:44Z")

</div>

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

> <https://github.com/microsoft/pxt/pull/11027>
>
> This is the PXT half of the update I have created to allow for raw ELF exports f…rom Makecode Arcade and support 4 player via GPIO pins.
> 
> This simply does a check for the \`switch\` to display the proper extension in the dialog.
> 
> \<img width="1500" height="678" alt="image" src="https://github.com/user-attachments/assets/dec84f22-a5ff-4376-99d1-287a2ca5743e" /\>

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.

> <https://github.com/microsoft/pxt-arcade/pull/7280>
>
> This PR allows users to export the raw elf file via the hardware selection scree…n:
> 
> \<img width="833" height="551" alt="image" src="https://github.com/user-attachments/assets/1a112f2b-8af0-4f30-92c2-4bf5faa266de" /\>
> 
> The "learn more" leads to the McAirpos home page where people can discover the use/need for McAirpos to run these games on emulator frontends. For me it was to help with the use of the Arcade Cardboard when using McAirpos directly.
> 
> Files are exported as raw .elf files but another HUGE bonus as these .elf files also allow for the GPIO 4 player support! This was tested on my arcade cabinet with all 4 controllers wired to a Raspberry Pi 3B.
> 
> \<img width="750" height="339" alt="image" src="https://github.com/user-attachments/assets/3a66bd88-c02a-4a96-880c-57720c925009" /\>
> 
> Here's a video of the 4 player GPIO buttons in action running on a Raspberry Pi 3B using Trixie Lite and McAirpos to launch the game directly.
> 
> https://github.com/user-attachments/assets/75ed6809-b31f-4368-98e3-379eea60e16f

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:

> [@4 Player GPIO with Raspberry PI Zero?](https://forum.makecode.com/t/4-player-gpio-with-raspberry-pi-zero/41334):
>
> Sorry if this was asked already… Pulling the latest “cardboard” firmware: [https://learn.adafruit.com/makecode-arcade-with-raspberry-pi-zero/firmware#firmware-3-1](https://learn.adafruit.com/makecode-arcade-with-raspberry-pi-zero/firmware#firmware-3-1) shows inputs for 3rd and 4th controllers. However when I attach buttons and joysticks to those inputs (same I did for 1/2 players) they are not working. I’ve tested the same buttons and wiring across all players and only the 3rd and 4th players are broken. Even the arcade.cfg that’s part of that zip file has the pin…

[https://forums.adafruit.com/viewtopic.php?t=221907](https://forums.adafruit.com/viewtopic.php?t=221907)

---

<div class="post-metadata">

**Author:** ![Vegz78](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vegz78/32/1201_2.png) [@Vegz78](https://forum.makecode.com/u/Vegz78)\
**Post date:** [February 5, 2026, 11:07pm UTC](https://forum.makecode.com/t/4-player-gpio-raw-elf-export/41383/2 "2026-02-05T23:07:30Z")

</div>

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](https://github.com/Vegz78/McAirpos/issues/63)?)

---

<div class="post-metadata">

**Author:** ![Vegz78](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vegz78/32/1201_2.png) [@Vegz78](https://forum.makecode.com/u/Vegz78)\
**Post date:** [February 5, 2026, 11:19pm UTC](https://forum.makecode.com/t/4-player-gpio-raw-elf-export/41383/3 "2026-02-05T23:19:23Z")

</div>

While we are still waiting for your official [CreationStationArcade](https://github.com/Kikketer/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?:

> <https://github.com/microsoft/pxt-arcade/issues/2435>
>
> \*\*Describe the bug\*\*
> SHORT:
> When running MakeCode Arcade ELF executables on Ra…spberry Pi OS, the main process turns defunct/zombie and the game hangs on exit.
> 
> LONG: 
> 1. When running the game from the local console, tty1, in a bash shell, the game itself runs fine, with keyboard controls, reseting/restarting and everything, even though the game process turns zombie/defunct(first/main light weight process of 8 LWP, the other 7 seem normal).
> 
> 2. When exiting the same already running game in however way(in-game options or kill -9(kill -INT or -TERM does not work) command from ssh, or any keyboard shortcut) the game process dies and is reaped, but control/session is not handed back to the calling parent bash process at tty1, which:
> \-still has framebuffer filled with the last frozen image of the game,
> \-has no visible command prompt or response to remote commands to the console,
> \-local keyboard is unresponsive
> 
> 3. The only way I’ve found to regain control of the tty1 console is to issue a reboot or kill the running bash/parent process(requiring new login), or rebooting using CTRL+ALT+DEL, which for some reason works for rebooting on my systems…
> 
> \*\*To Reproduce\*\*
> Steps to reproduce the behavior:
> 1. Go to 'http://arcade.makecode.com/' and compile and download a game as ELF with '?hw=rpi&compile=rawELF' in the browser URL 
> 2. From the console/shell on a Raspberry Pi, make the game executable and run it with the command './anygame.elf'
> 3. Try to quit the game with 'CTRL-C' or from the in-game menu or shortcut keys
> 4. The console/shell and whole system hangs/freezes with a frozen image of the game and unresponsive inputs. Can only regain control of system by ssh and killing the calling console/shell process or rebooting the system.
> 
> \*\*Expected behavior\*\*
> The game process runs without turning zombie/defunct and exits gracefully by clearing the framebuffer and handing control back to the calling console/shell process. 
> 
> \*\*Screenshots\*\*
> Not relevant.
> 
> \*\*Desktop (please complete the following information):\*\*
> - OS/Browser: Any OS/Browser for compiling and downloading, running on Rasperry Pi OS(tested stretch and buster) on Raspberry Pi 3 or 4.
> \- Version: Many different versions of MakeCode Arcade and Raspberry Pi/RPi OS'es.
> 
> \*\*Additional context\*\*
> With reference to the latest posts in the forum thread https://forum.makecode.com/t/how-to-launch-makecode-arcade-uf2s-in-raspbian-retropie and of lately absent responses from @mmoskal and @pelikhan. As soon as this bug is fixed, MakeCode Arcade would run great natively on Raspberry Pis and open up a large platform for hobbyist arcade coders and gamers. I would be more than happy to help out testing changes/bugfixes, and to help writing a tutorial for compiling and running MakeCode Arcade games natively when this bug is fixed. Don't hesitate to contact me(here on GitHub, on the MakeCode forum or by mail, which @mmoskal has)!
> 
> Br,
> Vegard

This would, together with your suggested simplified and improved compilation and downloading directly from [arcade.makecode.com](http://arcade.makecode.com), be beneficial for both of us and [everyone who wants to run their games natively](https://forum.makecode.com/t/play-makecode-arcade-game-in-app/10787). 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](https://github.com/microsoft/pxt-arcade/issues/4847), 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?](https://github.com/Vegz78/McAirpos/tree/master/McAirpos/launCharc) 😉

---

<div class="post-metadata">

**Author:** ![Kikketer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kikketer/32/16551_2.png) [@Kikketer](https://forum.makecode.com/u/Kikketer)\
**Post date:** [February 9, 2026, 4:05am UTC](https://forum.makecode.com/t/4-player-gpio-raw-elf-export/41383/4 "2026-02-09T04:05:33Z")

</div>

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](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](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](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” 🙂 And man writing it all down like that makes it sound complicated! More complete post to come soon.
