Linux games and apps

Mosaik can start native games built for the console (64-bit ARM Linux). Not all of them will work: it depends on how the game was prepared.

From the Store

From 0.9.58 the Linux games folder of the Store has ready games (Experimental). They install in Arcade/Linux, and their saves stay in Arcade/Saves (and in the backup) also when you remove them:

Game Folder Notes
Freedoom (Phase 1 and 2), with Crispy Doom Freedoom, Freedoom2 Free game data (freedoom.github.io). A fire, B use and open, X map, Y + direction strafe, L/R strafe, L2/R2 change weapon, Start menu, Select Enter. Saves in Saves/doom.
Mr.Boom MrBoom Bomb battles for up to 8 players with external controllers. It runs in the Mosaik game menu like a console game.
Diablo, with DevilutionX Diablo The game files are not included: copy DIABDAT.MPQ from your original game (CD or GOG), or spawn.mpq from the free shareware version, into Arcade/Linux/Diablo (for Hellfire also hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq). Without them a message says what to copy. Saves in Saves/diablo.

A game can also be a libretro core in its folder: "libretro": "core_libretro" in game.json (without .so) starts it in the Mosaik runner with no ROM, like Mr.Boom.

Adding a game

Create a folder in Arcade/Linux with the game and a launch.sh file that starts it:

Arcade/Linux/MyGame/
    launch.sh      required: starts the game
    game.json      optional: title and options
    cover.png      optional: cover

The game.json file

{
  "title": "My game",
  "year": "2024",
  "author": "Author",
  "env": { "VARIABLE_NAME": "value" },
  "keys": { "A": "SPACE", "START": "ENTER" }
}
Option Description
title, year, author Shown in Games and on the game's details page.
env Environment variables set before the game starts.
keys For games that don't read controllers: each console button presses the given keyboard key.
cpu Processor speed while the game runs: 1 = 816, 2 = 1200, 3 = 1608, 4 = 2000 MHz (from 0.9.104).
opaque true for a program that shows a black screen with sound only: Mosaik makes the display opaque while it runs (from 0.9.112). app.json has it too.
min_system The oldest Mosaik version the game needs, for example "0.9.58": on an older system it doesn't start and says so (from 0.9.62). Required for Store packages. app.json has it too.

Auto sleep

From 0.9.113 Linux games go to sleep by themselves, like the menus: after the minutes set in Auto sleep (Settings → System) without pressing anything, also when the game is paused, the console sleeps; it wakes up where you left it. Auto power off closes the game and turns the console off. A game that must stay awake, for example while downloading, creates /tmp/stay_awake (as on the stock firmware) and removes it when done.

Libraries a game can use

A game finds these on the console without bringing them: the C library (glibc 2.33), libstdc++ (GCC 10), libgcc_s, libm, libpthread, libdl, libz, SDL2 (2.30.8, with the PowerVR graphics chip and sound), libEGL and libGLESv2 (OpenGL ES 2.0), libasound, libudev. From 0.9.59 also SDL2_image, SDL2_mixer and SDL2_ttf (PNG, JPG, OGG, MP3, FLAC, WAV, TTF). Anything else goes inside the program or in a lib folder of the game, with export LD_LIBRARY_PATH="$PWD/lib:$LD_LIBRARY_PATH" in launch.sh.

During the game

Hold Menu for 1 second for the menu with resume, volume, brightness and exit. Sleep with the power button works here too.

Apps

Programs that aren't games (tools, players, viewers) go in Arcade/Apps, one folder per app, prepared like a Linux game:

Arcade/Apps/MyApp/
    launch.sh      required: starts the app
    app.json       optional: title, description, author, env, keys, min_system
    icon.png       optional: icon

When there is at least one app, the home screen gets an Apps entry with the apps in a grid, like the Store (from 0.9.112; before, a list). Apps start like Linux games (hold Menu to quit) and don't go into Games, recent games or play time. You can copy them with Transfer files. Apps you copied yourself go into the backup with the games, and Erase everything removes them; apps from the Store stay and are reinstalled after a restore. From 0.9.68 Erase everything also keeps the Linux games from the Store.

If something goes wrong

With the diagnostic log on, what the game prints goes to Arcade/Logs/linux-games.log.

This page comes from the wiki: Linux games