Move to config folder

This significantly makes it more manageable to add GB files inside a Docker container.
Bram van den Heuvel 3 months ago
parent 29f0a84cb7
commit ef765c4c87
  1. 46
  2. 6
  3. 3

@ -1,3 +1,45 @@
# pyboy-to-matrix
# Matrix-gameboy
Bridge between GameBoy emulator and Matrix, written in Python.
Matrix-gameboy is a GameBoy emulator that connects to a
[Matrix]( room and allows users to control the game from
within the room.
This repository supports the following:
- ✅ Emulate GameBoy games
- ✅ Send control commands to the emulator
- ✅ Get a screenshot posted in the room
- ❌ Emulate GameBoy Advance (GBA) games
## How to run
You can run
pip install -r requirements.txt && python
or using Docker, you can either build the repository yourself or run
docker run --rm --name "Matrix_Plays_GameBoy" \
-v $(pwd)/config:/usr/src/app/config \
## Why it was made
It was inspired by
[matrix-plays-pokemon](, which
is a JavaScript implementation that supports both GB and GBA using
Upon debugging, there were several problems that couldn't be solved, so I
decided to write up an equally short program doing the same thing, but in
In short, this implementation is a wrapper of the
[PyBoy]( and
[matrix-nio]( libraries.

@ -4,20 +4,20 @@ files:
# Filename of the game that you're going to load.
game_save: './'
# If running in a Docker container, you should use something like
# game_save: '/config/'
# game_save: '/usr/src/app/config/'
# Filename of the latest state. This is the game state when a user last gave
# an input. If the program unexpectedly closes, the game will continue from
# this state.
latest_state: './latest.state'
# If running in a Docker container, you should use something like
# latest_state: '/config/latest.state'
# latest_state: '/usr/src/app/config/latest.state'
# Location to temporarily store the screenshots that are sent to Matrix.
# The file permanently shows the last taken screenshot.
screenshot: './screenshot.png'
# If running in a Docker container, you should use something like
# screenshot: '/config/screenshot.png'
# screenshot: '/usr/src/app/config/screenshot.png'
# Config that connects the program to Matrix

@ -12,7 +12,7 @@ import yaml
# --------------------------
# Constant definitions
with open('config.yml', 'r', encoding='utf-8') as open_file:
with open('config/config.yml', 'r', encoding='utf-8') as open_file:
config = yaml.safe_load(open_file)
GAME_FILE_NAME = config['files']['game_save']
@ -219,6 +219,7 @@ async def message_callback(room : MatrixRoom, event : RoomMessageText) -> None:
async def setup_matrix_client():
client.add_event_callback(message_callback, RoomMessageText)
await client.join(GAME_ROOM)
await client.sync_forever(timeout=30000)
# --------------------------