<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>glimmerptr</title><link href="https://glimmerptr.codeberg.page/" rel="alternate"/><link href="https://glimmerptr.codeberg.page/feeds/all-en.atom.xml" rel="self"/><id>https://glimmerptr.codeberg.page/</id><updated>2026-08-30T00:00:00+02:00</updated><entry><title>Porting a raylib game for the andbernic with muos</title><link href="https://glimmerptr.codeberg.page/port-game-raylib-westonpack-en.html" rel="alternate"/><published>2026-08-30T00:00:00+02:00</published><updated>2026-08-30T00:00:00+02:00</updated><author><name>Oscar (glimmerptr) Triano</name></author><id>tag:glimmerptr.codeberg.page,2026-08-30:/port-game-raylib-westonpack-en.html</id><summary type="html">&lt;h1&gt;Porting a raylib game for the andbernic with muos&lt;/h1&gt;
&lt;p&gt;I have anbernic with muos as system. I've thinked why not use this these machines for something more than emulation, like making games for these kind of machines with portmaster.
All this it's done on an Arch, Endeavour OS, on a …&lt;/p&gt;</summary><content type="html">&lt;h1&gt;Porting a raylib game for the andbernic with muos&lt;/h1&gt;
&lt;p&gt;I have anbernic with muos as system. I've thinked why not use this these machines for something more than emulation, like making games for these kind of machines with portmaster.
All this it's done on an Arch, Endeavour OS, on a x86_64, so you'll have to adapt these step to the system you have.&lt;/p&gt;
&lt;h2&gt;Portmaster&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://portmaster.games"&gt;Portmaster&lt;/a&gt; is a plataform that provides the instalation of games from other platforms, either with and runtime environment or offering native versions of these games.&lt;/p&gt;
&lt;p&gt;For this case I use westonpack, more than anything becuse it seems muos uses the framebuffer /dev/fb0 to draw on screen instead of DRM/KMS as raylib uses.
&lt;a href="https://github.com/binarycounter/Westonpack/wiki"&gt;Westonpack&lt;/a&gt;  is a runtime environment that emulates the graphics stack that is found tipically on a Linux desktop and not on a Linux for embedded.&lt;/p&gt;
&lt;h2&gt;Building environment preparation&lt;/h2&gt;
&lt;p&gt;Reading this &lt;a href="https://portmaster.games/porting.html"&gt;https://portmaster.games/porting.html&lt;/a&gt; you can have your environment for porting games with raylib. In this section I'm going to describe how I've mounted mine.&lt;/p&gt;
&lt;p&gt;You need to have installed in your system &lt;strong&gt;debootstrap&lt;/strong&gt; and &lt;strong&gt;qemu-user-static-binfmt&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;We adapt the steps we need from &lt;a href="https://wiki.debian.org/Debootstrap"&gt;https://wiki.debian.org/Debootstrap&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;gt; mkdir debian-arm64
&amp;gt; sudo debootstrap --arch=arm64 stable debian-arm64 http://deb.debian.org/debian/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Once finished we do chroot there&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;gt; sudo chroot debian-arm64/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If qemu-user-static-binfmt is well installed on the host, on chroot when doing the following&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;gt; uname -m&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;should display&lt;/p&gt;
&lt;p&gt;&lt;code&gt;aarch64&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;Installation and package configuration&lt;/h3&gt;
&lt;p&gt;Do this on yor terminal, inside chroot&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;gt; apt install cmake-curses-gui build-essential libsdl2-dev&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Download the source code of the actual version of raylib (for this date) &lt;a href="https://github.com/raysan5/raylib/archive/refs/tags/6.0.tar.gz"&gt;https://github.com/raysan5/raylib/archive/refs/tags/6.0.tar.gz&lt;/a&gt; in root, 
or another part of your chroot environment&lt;/p&gt;
&lt;p&gt;Personally for working comfortably in chroot root from host I give it all permissions from my user and group to the &lt;em&gt;root of chroot&lt;/em&gt; (&lt;strong&gt;no&lt;/strong&gt; /root from the host).
Extract zip and enter in the dir.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;gt; tar -xzf raylib-6.0.tar.gz
&amp;gt; cd raylib-6.0
&amp;gt; ccmake .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Press C key (Configure)&lt;/p&gt;
&lt;p&gt;Once finished the initial configuration&lt;/p&gt;
&lt;p&gt;We edit these fields until the look like this, we &lt;strong&gt;don't&lt;/strong&gt; delete fields.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;BUILD_EXAMPLES    OFF&lt;/li&gt;
&lt;li&gt;OPENGL_VERSION    2.1&lt;/li&gt;
&lt;li&gt;PLATFORM                  SDL&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt="The edited fields must show up as the list from above" src="https://glimmerptr.codeberg.page/pgrw-1.png"&gt;&lt;/p&gt;
&lt;p&gt;Again, configure, until Generate appears (key G), and press G to generate. Exit and do&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;gt; make
&amp;gt; make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Una vez listo, copia tu juego en una carpeta dentro del chroot y cuando lo compiles añades estas bibliotecas mas las que tengas
Once done, copy your game into a dir inside chroot and when you compile add these libraries&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-ldrm -lgbm -lEGL -lGL&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;Westonpack&lt;/h3&gt;
&lt;p&gt;Follow the instructions from &lt;a href="https://github.com/binarycounter/Westonpack/wiki/SDL2-on-X11-Example#running-sdl2-games-that-require-x11"&gt;https://github.com/binarycounter/Westonpack/wiki/SDL2-on-X11-Example#running-sdl2-games-that-require-x11&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And copy and adapt this script &lt;a href="https://github.com/binarycounter/Westonpack/wiki/SDL2-on-X11-Example#running-sdl2-games-that-require-x11"&gt;https://github.com/binarycounter/Westonpack/wiki/SDL2-on-X11-Example#example-script-opengl-2&lt;/a&gt; for your port.&lt;/p&gt;
&lt;p&gt;At least changing the names is enough. Rename the script to the name of your port.&lt;/p&gt;
&lt;h2&gt;Packaging for testing&lt;/h2&gt;
&lt;p&gt;The port structure would be&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;port&lt;/span&gt;
├──&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;game&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;name&lt;/span&gt;
│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;assets&lt;/span&gt;
│&lt;span class="w"&gt;   &lt;/span&gt;│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;whatever&lt;/span&gt;
│&lt;span class="w"&gt;   &lt;/span&gt;│
│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;libs&lt;/span&gt;.&lt;span class="nv"&gt;aarch64&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;Put&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;all&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;your&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;libraries&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;you&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;game&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;uses&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;here&lt;/span&gt;
│&lt;span class="w"&gt;   &lt;/span&gt;│&lt;span class="w"&gt;   &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;libraylib&lt;/span&gt;.&lt;span class="nv"&gt;so&lt;/span&gt;.&lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;This&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;you&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;has&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;compiled&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;raydlib&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;dynamic&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;lib&lt;/span&gt;
│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;game&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;name&lt;/span&gt;.&lt;span class="nv"&gt;aarch64&lt;/span&gt;
│&lt;span class="w"&gt;   &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x11sdllib&lt;/span&gt;
│&lt;span class="w"&gt;       &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;libSDL2&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;.&lt;span class="mi"&gt;0&lt;/span&gt;.&lt;span class="nv"&gt;so&lt;/span&gt;.&lt;span class="mi"&gt;0&lt;/span&gt;
└──&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;game&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;name&lt;/span&gt;.&lt;span class="nv"&gt;sh&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Uploading to your little machine&lt;/h3&gt;
&lt;p&gt;Use scp or sftp to upload the port to your machine for testing&lt;/p&gt;
&lt;p&gt;Copy &lt;em&gt;/port/nombre-juego&lt;/em&gt; to &lt;em&gt;ports/nombre-juego&lt;/em&gt;
Copy &lt;em&gt;/port/nombre-juego.sh&lt;/em&gt; to &lt;em&gt;ROMS/Ports/nombre-juego.sh&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Portmaster &lt;a href="https://portmaster.games/porting.html#how-do-we-compile-our-games-for-portmaster"&gt;here&lt;/a&gt; tells about to kill the UI to test the game from terminal,
with the last steps we can keep the user interface and test the game as if it were downloaded from Portmaster.&lt;/p&gt;
&lt;p&gt;This structure is for &lt;strong&gt;testing&lt;/strong&gt; purposes only, for packaging for portmaster &lt;strong&gt;&lt;a href="https://portmaster.games/packaging.html"&gt;is necessary metadata files&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This is all for the moment, for any aclaration or details please contact me.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://glimmerptr.codeberg.page"&gt;glimmerptr&lt;/a&gt; © 2026 by &lt;a href="https://glimmerptr.codeberg.page"&gt;Oscar Triano (glimmerptr)&lt;/a&gt; is licensed under &lt;a href="https://creativecommons.org/licenses/by-sa/4.0/"&gt;CC BY-SA 4.0&lt;/a&gt;&lt;img src="https://mirrors.creativecommons.org/presskit/icons/cc.svg" alt="" style="max-width: 1em;max-height:1em;margin-left: .2em;"&gt;&lt;img src="https://mirrors.creativecommons.org/presskit/icons/by.svg" alt="" style="max-width: 1em;max-height:1em;margin-left: .2em;"&gt;&lt;img src="https://mirrors.creativecommons.org/presskit/icons/sa.svg" alt="" style="max-width: 1em;max-height:1em;margin-left: .2em;"&gt;&lt;/p&gt;</content><category term="Tecnología"/><category term="programación"/><category term="empotrado"/></entry></feed>