# TikTok mGBA Emulator

This project is an implementation for controlling a GameBoy Emulator with the TikTok Chat. Users can control the game by sending commands to the chat. The commands are parsed and sent to the mGBA Emulator via HTTP-API.

## Requirements

- .NET Runtime
- .NET ASP Core Framework
- NodeJS with `npm` or `pnpm`
- Runnable on Windows, Linux and macOS

## Instructions

For running the project, you need to start the following both services:

1. NodeJS Server
2. mGBA with HTTP-API

### NodeJS Server

1. Install NodeJS
2. Install the dependencies with `npm install` or `pnpm install`
3. Run the server with `npm start` or `pnpm start`

### mGBA with HTTP-API

1. Download mGBA
2. Download mGBA-http (exe & lua)
3. Run mGBA-HTTP Server from `http/server/mGBA-http-server.exe`
4. Run mGBA and press "Scripting..."
5. Load the LUA file from `http/script/mGBA-socket-server.lua`
6. Load a rom into mGBA and start the game

## Documentation

When mGBA-http is running, it provides an user interface for Swagger. Though it provides
a JSON for implementing the API by using a code generator.

- <http://localhost:5000/index.html>
- <http://localhost:5000/swagger/v1/swagger.json>

## Resources

- <https://github.com/mgba-emu/mgba>
- <https://github.com/nikouu/mGBA-http>
