mGBA-afa6fb

#### Supplemental Linux® From Scratch - Version 13.0

### Chapter 21. Video Game Emulators

- Prev

  Introduction to Game Boy Advance Emulation

- Next

  Introduction to Nintendo GameCube/Wii Emulation

- Up
- Home

# mGBA-afa6fb

## Introduction to mGBA

The mGBA package provides a GBA emulator. It can also be used with other emulators.

- Download: https://github.com/mgba-emu/mgba/archive/afa6fbd72a90e8c5fabd1842d28784a1ce8ae704/mgba-afa6fbd72a90e8c5fabd1842d28784a1ce8ae704.tar.gz

### mgba Dependencies

#### Required

CMake, libepoxy, libpng, and libzip-1.11.4

#### Recommended

desktop-file-utils, FFmpeg, Lua, Qt-6 and/or sdl2-compat (for the frontends), and SQLite

#### Optional

editline

## Installation of mGBA

Install mGBA by running the following commands:

    mkdir build &&
    cd    build &&

    cmake -D CMAKE_INSTALL_PREFIX=/usr        \
          -D CMAKE_BUILD_TYPE=Release         \
          -D CMAKE_SKIP_INSTALL_RPATH=ON      \
          -D SKIP_GIT=ON                      \
          -G Ninja .. &&

    ninja

Now, as the `root` user:

    ninja install &&
    mv -v /usr/share/doc/mGBA{,-afa6fb}

## Using mGBA

This version of mGBA has a problem with OpenGL and the Qt GUI. On Wayland, mGBA will complain that it can't create an appropriate display device. This is because it fails to create an OpenGL display. When running the Qt GUI, you must run it with QT_QPA_PLATFORM=xcb mgba-qt, forcing XCB windowing for Qt. This will make OpenGL work as expected. This quirk is shared with other emulators like Dolphin, and each application solves the issue in their own way. Dolphin forces XCB in the application itself.

## Command Explanations

`-D CMAKE_SKIP_INSTALL_RPATH=ON`: This switch makes cmake remove hardcoded library search paths (rpath) when installing a binary executable file or a shared library. This package does not need rpath once it's installed into the standard location, and rpath may sometimes cause unwanted effects or even security issues.

`-D SKIP_GIT=ON`: This both skips the dependency on Git and prevents a configuration failure as the extracted directory is not a Git repository.

mv -v /usr/share/doc/mGBA{,-afa6fb}: This command ensures the doc folder for this package is consistent with the other packages.

## Contents

Installed Programs: mgba and mgba-qt
Installed Libraries: libmgba
Installed Directories: /usr/include/mgba{,-util} and /usr/share/doc/mgba-afa6fb

### Short Descriptions

mgba | is the SDL2 frontend for mGBA
mgba-qt | is the Qt-6 frontend for mGBA
`libmgba` | contains the mGBA core which can be used by frontends and other emulators

- Prev

  Introduction to Game Boy Advance Emulation

- Next

  Introduction to Nintendo GameCube/Wii Emulation

- Up
- Home