This is a fork of the Python bindings in the mGBA repository with some modifications to get it to build easily on my machine.
This provides Python bindings to libmgba, which is a library of functions that mGBA uses internally.
Thus, you can use it to create a 'headless' emulator instance and interact with its internal functions using Python.
It does not come with any GUI, i.e. you can't use it to just remote control an instance of the mGBA emulator.
Heads up: This will require a couple of GB of disk space.
- Have Visual Studio installed (the free Community Edition is enough.)
- Have Python installed.
(Also make sure you havesetuptools
installed. You might have to runpip install setuptools
for that.) - Have Git installed.
- Download this repository to somewhere on your hard drive (using
git clone
or by just downloading it as a ZIP file.) - Open the Start menu, look for the
Visual Studio 2022
directory, and run thex64 Native Tools Command Prompt
. - Navigate to wherever you have extracted this repository (e.g.
cd /D C:\Users\someone\Desktop\libmgba-py
.) - Run
build_win64.bat
Afterwards, distributable files should be available in the
build\win64\mgba
directory. You can copy that entire directory
into your Python project, or create a package from it.
These instructions only works for Ubuntu, specifically for versions that are supported by mGBA's Docker build containers. Available tags can be checked here: https://hub.docker.com/r/mgba/ubuntu/tags
- Have Docker installed
- Have Git installed (
apt install git
) - Download this repository to somewhere on your hard drive (using
git clone
or by just downloading it as a ZIP file.) - Open a shell and navigate to this directory.
- Run
build_ubuntu.sh
- Have Homebrew installed
- Have Xcode installed from the app store
- Download this repository to somewhere on your hard drive (using
git clone
or by just downloading it as a ZIP file.) - Open a shell and navigate to this directory.
- Run
./build_mac.sh
This code was taken from the offical mGBA repository and only modified a bit, so the original license terms apply:
mGBA is Copyright © 2013 – 2023 Jeffrey Pfau.
It is distributed under the Mozilla Public License version 2.0.
A copy of the license is available in the distributed LICENSE file.