MakeCode Arcade on Recalbox

Now also support for MakeCode Arcade games on Recalbox 7.1.1-Reloaded! for Raspberry Pi:

Still experimental, but both the installation script and McAirpos is working on my RPi4 4GB.

Appreciate feedbacks on GitHub!

6 Likes

2 Likes

Hello,
Many thanks for all your work regarding MakeCode Arcade integration in RecalBox.
I just have some try but for the moment without any success :frowning:
I am trying to follow the link below :

" Run this command from the terminal(F4 + ALT+F2, root/recalboxroot) on Recalbox 7.1.1-Reloaded!:
curl -sL https://raw.githubusercontent.com/Vegz78/McAirpos/master/install_recalbox.sh | bash -"

Is it possible to have more details please?

Regards.

Please also remember that McAirpos is a hack(or kludge) in every bad aspect of the word, both:
-From the perspective of @Microsoft and the @MakeCode team and product we all here love, since it(Raspberry Pi OS and EV_ABS controllers) is not officially supported(yet?), and it would be much better and elegant if they solved the problem of regaining access to the terminal and framebuffer on game exit and broadened the controller support as an official solution inside the MakeCode Arcade GitHub repository, and
-From the perspective of RetroPie and Recalbox, who much rather would like to have the official support(as in the above point) of MakeCode included inside their installers/supported systems list, with artwork and controller compatibility etc., instead of my hacky back door solution(even though they have confirmed that they can live ok with all initiatives which broadens the use of their products and helps the retro gaming community).

The first point(official MakeCode support for Raspberry Pi OS and controllers) could happen any time, since, one can reason, that all the Raspberry Pis sold is an interesting market for MakeCode and since anyone could contribute to achieving this in their open source code(and this even has been implied hypothetically).

It is therefore hard to invest too much more time on this hack past its initial goal, which was to get my son’s MakeCode Arcade game projects running on the big screen inside RetroPie on his Raspberry Pi with gamepad support, and for me to learn som programming with an interesting project.

Anyone is welcome to contribute to development, better instructions, feedbacks or prevention of code rot etc. of McAirpos, or - maybe better - contribute to the same RPi support in the official MakeCode Arcade GitHub project.

I hope McAirpos works for as many people as possible, for as long as possible, and will, within reasonable efforts, try to support as much as I can. In the meantime:

Happy hacking! :wink:

1 Like

Hi @Neslou,

It has been a while since I tried installing McAirpos on Recalbox 7.1.1-Reloaded!(only version I have tried with success), and I hope it still works. I am not exactly sure which details are missing for you, but I will make an attempt here:

In Recalbox, while connected to internet on your RPi:

  1. You have to exit the EmulationStation frontend and get into the the command line. This can either be done using ssh from another device or locally on the Recalbox RPI with the button sequence F4 and then ALT+F2, where you can then log in as root with the default username root and password recalboxroot.
    https://recalbox.gitbook.io/documentation/basic-manual/getting-started/troubleshooting#root-access
  2. From this command prompt you then type in this command(everything on the same line before hitting enter) to download and run the McAirpos installer script:
    curl -sL https://raw.githubusercontent.com/Vegz78/McAirpos/master/install_recalbox.sh | bash -
  3. Then, when finished installing(hopefully without errors), reboot Recalbox with the reboot command
  4. You also need some MakeCode Arcade games as .elf files in the games folder /recalbox/share/roms/makecode. Can either be copied from another remote device with scp or from within the Recalbox menu after reboot. To download games as .elf files, open your game in the MakeCode editor from here: https://vegz78.github.io/McAirpos/

I hope this may be of some help, I am sorry for the stub instructions on GitHub for Recalbox and if I forgot some details in the above write-up from memory.

If unsuccessful, please open an issue on GitHub.

Br, Vegard

1 Like

Hi,
Thank you for your prompt reply…
Actually, it works…
Some more precise context :frowning:
1°)
I am using the last version of Recalbox (download today) for Raspberry Pi Zero and my GpiCase.
Raspberry Pi Imager v1.6.1

2°) After establishing internet connexion, i connect with putty to start your script :frowning:
PuTTY

3°) I need to refresh the or change the theme to see my games :frowning:


There is a bug as we can’t change the level on this game when playing with the handheld (it is ok from the web interface)

4°) Unfortunately, each time i restart my system, i loose my modification.

Again, many thanks for your help (it is for my children :-))

Regards.

1 Like

Wow! That was an exciting project with MakeCode Arcade running inside Recalbox on a GPI case!!! -Nice! :wink:

If I understand you correct, you loose the whole installation of both McAirpos and your games every time you restart Recalbox?

I haven’t tried myself with the Pi imager or on the RPi0, I have only burned the official Recalbox7.1.1-Reloaded! image on an sd card from the Recalbox site and run on my RPi3&4s.

There is an issue with an overlay file system on Recalbox, which write protects all system files and reverts to default on each reboot.

It requires using mount -o remount,rw to edit the system files, which I also use in the installation script, and my file changes have stuck between each reboot when I tested on my system.

However something could have changed with an update, be different when you install via ssh/Putty instead of locally as root or maybe be different on the RPi0 image. Maybe there is an error in my install script which I didn’t catch while I was doing this.

Do you see any errors while the script is running, or maybe you can try to follow the steps inside the script manually and see if there are any errors, especially with the above remount command?

If you or someone else don’t beat me to it, I will have a look again at the script, running on a new fresh install on my RPi4. But don’t have access to an RPi0 nor am I able to test on every possible combination, and it might take some time before I get the time(probably weeks).

Please report back if you or anyone else find a solution before me, so I can easily update on GitHub.

There is a bug as we can’t change the level on this game when playing with the handheld (it is ok from the web interface)

Have you tried running the elf file on regular Debian Raspberry Pi OS(Raspbian) on another Pi?
Have you tried other games?
Have you cleared your browser cache(remember to back up unsaved MakeCode game projects first)?

Everything worked well last time I compiled and downloaded game .elf files to my RPi a couple of months ago, but there might have been system updates/changes on makecode.com/game version affecting the compilation which are outside of my control.

Here, also please report back your findings if you beat me to it.

I hope we get this to work! Any help from anyone on this forum is greatly appreciated!

Br, Vegard

1 Like

Quick update:
I just redownloaded a new .elf compilation of the official Jumpy Platformer game from makecode.com. It worked fine on my RPi4 running a recently updated RPi OS and the latest version of McAirpos. So I don’t believe that there are any issues with either recent changes to MakeCode or the game source code. At least not on my side…

To rule out for sure, you can run this command from a Linux command line on your .elf game file: strings game_file.elf | grep eVER

Mine is version 1.4.40, with the full output like this:
{“compression”:“LZMA”,“headerSize”:296,“textSize”:217930,“name”:“jumpy platformer”,“eURL”:“https://arcade.makecode.com/”,“eVER”:“1.4.40”,“pxtTarget”:“arcade”}]

1 Like

Blockquote
Wow! That was an exciting project with MakeCode Arcade running inside Recalbox on a GPI case!!! -Nice!

Thank you for your encouragements… It is not so difficult, regarding making a microcontroller STM32 pcb with a DPI screen etc…and more appealing for my son.

I will continue my investigation anyway…i have another Pi Zero, a compute module 3 also etc…
I loose only the configuration of the Theme when i restart, my elf game remain on the share\roms\makecode folder.

Thank you also for all the advice you gave to me, it will allow me to continue tomorrow…if i don’t succeed with RecalBox, i will have a try with Retropie that seems to be more customizable apparently.

In all case, i will keep you update.

Regards.

1 Like

Quick update2:
The contents/commands of the Recalbox installations script is here:
https://github.com/Vegz78/McAirpos/blob/master/install_recalbox.sh

I Just do the same command as you:

Location :
/recalbox/share/roms/makecode

command:
strings arcade-jumpy-platformer.elf | grep eVER

Result:

strings arcade-jumpy-platformer.elf | grep eVER

{“compression”:“LZMA”,“headerSize”:296,“textSize”:217858,“name”:“jumpy platformer”,“eURL”:“https://arcade.makecode.com/",“eVER”:“1.4.40”,“pxtTarget”:"arcade”}]

To be even more specific; do you lose some of the configurations you do yourself to the theme(inside the Recalbox menu system or otherwise) or do you lose the whole newly installed MakeCode menu entry from the installer script between reboots?

For the former, the installations script might have made a change that interferes with the operation of the menu system or you might not be able to save(overlay file system) changes you are doing yourself to the system files. For the latter, the changes from the installation script itself might not have been saved correctly.

Could you after a reboot check which parts of the installation is saved between reboots?:
-Is /home/pi/McAirpos still there with files and subfolders(the main installation folder)?
-Is /sd/ with files still there(the MakeCode gamepad setup folder)?

The themes and menus are located under /etc/emulationstation:
-Is the file es_systems.cfg still there and still with a makecode meny entry inside?
-Are the subfolder with theme changes still there with makecode artwork?

I remember once that I made a change(deleted or renamed so that it no longer was referenced correctly by the overlay) to es_systems.cfg that did not stick, and I had to play with the upper and lower folders of the overlay file system to make the menu entries/correct es_systems.cfg stick. I don’t remember the exact location of these, maybe under /system or /share, or if upper or lower had priority, but I got it to work when i fixed the correct file. Alternatively, wipe the image and try reinstalling everything fresh again(if less work).

In all case, i will keep you update.

Perfect and good luck!

1 Like

Same result, so very probably not the game code or changes/differences with makecode.com(for the error that you can not get to the next level in the game, not the error with changes to theme not saved in Recalbox). Has to be something with the installation on Recalbox;
-Sometimes, very seldom, it can help to delete the game_file.elf.data" folder in your games folder(/recalbox/share/roms/makecode*) to “reset” the game.
-Do you have the correct ownership and rwx permissions to your game folder and all its files and subfolders?

1 Like

Hummm, i think this will be towards this direction…
I will do more tests tomorrow, it is late for me now :slight_smile:
But i remember loosing only the newly installed MakeCode menu entry between reboots. (Roms remains intact and also

from my memory…
I think loosing only the home/pi/xxxx
But i will confirm later.

I will also do the same thing with retropie but on another handheld (also based on Rpi Zero) but i better known the hardware because i made it from scratch, but i need to find it in the garage :frowning:

Regards.

Neslou

I use your page for opening my game project :frowning:
https://vegz78.github.io/McAirpos/index2

And then just compile the game for having my elf file :

Yeah, same as I did, which is basically just a link generator with or without a specific published game, to the official MakeCode Arcade site, with some added officially supported parameters for the compiling of .elf files appended to the URL like this:
https://arcade.makecode.com/?nolocalhost=1&compile=rawELF&hw=rpi

Another confirmation that the main issue is something with the installation of McAirpos inside your Recalbox installation, and not the game_file.elf.

Good night and hope you solve this puzzle!

1 Like

Hello,
Here is my test today :
1°) Starting the GPI Case just to have a picture of the situation.

  • No makecode Menu see on the Front End visually.
  • /recalbox/share/roms/makecode folder is present
    01
    *I don’t see any home directory or /sd/ folder
    02
  • /etc/emulationstation : => No makecode entry in the cfg and in the theme.xml file

I find a interesting ressource below :
https://github.com/gillg/recalbox-emulationstation/blob/master/THEMES.md

I will have a deeper look.

Regards.

Regards.

I just made some other tests on my old version of Retropie in my custom PSPi and it works (i mean i keep the modification after a reboot for the MakeCode Menu…)
I think Retropie is more customizable than recalbox ?
My last problem please is to help me to configure the button, because from the game i cannot press A button or even return to the menu :frowning:

Ok @Neslou,

To try to replicate your setup trouble and to double-check the McAirpos installation script for Recalbox, I used the Raspberry Pi Imager to freshly download and burn the latest Recalbox images for my RPi3 and RPi4. Unfortunately, I don’t have access to a RPi0/GPI and the latest Recalbox image was just today updated to version 7.2-Reloaded!, instead of the version 7.1.1-Reloaded! we used earlier. Our systems are therefore not identical.

On both my RPi3 and RPi4 I did the following:

  1. Downloaded and burned fresh corresponding images of Recalbox 7.2-Reloaded! on an SD card using the Raspberry Pi Imager
  2. Inserted the SD card and booted
  3. From another computer: ssh root@ip-address-of-Recalbox (password recalboxroot)
  4. Immediately in the ssh session:
    curl -sL https://raw.githubusercontent.com/Vegz78/McAirpos/master/install_recalbox.sh | bash -
    (everything above on one command line followed by enter)
  5. In the same ssh session as above: reboot followed by enter
  6. From another computer, copy a MakeCode Arcade game to the new Recalbox installation:
    scp /path/to/game_file.elf root@ip-address-of-Recalbox:/recalbox/share/roms/makecode (password recalboxroot)
  7. Reboot Recalbox a second time
  8. Play MakeCode Arcade game on Recalbox

On both my RPi3 and my RPi4, Recalbox 7.2-Reloaded! installed just fine on the first attempt using the McAirpos installation script, the installation was kept with themes and everything between multiple reboots, and the MakeCode game played fine with gamepad support.

The only thing that didn’t work now, but worked before on Recalbox 7.1.1-Reloaded!, was that the sound was missing in the MakeCode Arcade game on Recalbox 7.2-Reloaded!. I will attempt to address this issue later. Probably has something to do with the Alsa sound driver required by MakeCode Arcade games vs or together with Pulseaudio.

I am therefore totally at a loss to why this does not work for you. Maybe the Recalbox image for the RPi0/GPI is a bit different from the RPi3&4 images with regards to the squashfs/overlay protected file system introduced in version 7.0-Reloaded!, or maybe something else. It’s unfortunately hard for me to tell and investigate without access to a RPi0.

I hope that you find out what the error is, get your amazing planned setup for your kids to work and that we hear back from you here with a solution.

Good luck!
PS: Don’t hesitate to ask for other support, but please open an issue on the McAirpos GitHub repository; the long post approval delays on this forum are driving me nuts when trying to support. :wink:

Now Recalbox 8.0-Electron support!:

Quick installation scripts here: