1
0
Clone
6
Serial Version
mosskoi edited this page 2025-10-20 04:00:09 +01:00

Introduction

  • This version of the project doesn't need WiFi
  • The user is content with using a cable between their computer and the microcontroller.
  • Sunlight must be within reach of the microcontroller.

Parts

This project is divided in 4 parts.

Patching your Boktai ROM: As mGBA has already an in-emualtor UV sensor, we'll need the patch to disable that and by-pass a "sensor broken" screen. Microcontroller code: To capture UV light and send information over to the server. Python Client: The user will have to run a python3 client, for windows users there is a .exe available. Lua Server: mGBA's script that runs a server and converts UV signal to in-game sun level.

You'll need

  • 1 microcontroller of your choice.
  • Jumper wires.
  • 1 UV light sensor.
  • 1 USB cable between the computer and the microcontroller to flash the software.
  • Arduino IDE.
  • mGBA.
  • python3 if you're on linux, if you're on windows I provide a .exe for you.
  • ROM dump of Boktai.

Don't know which microcontroller to get? I'd recommend either an arduino nano or an esp32.

The jumper wires will be male-to-male, male-to-female or female-to-female depending on your needs, make sure you get ones that will suit you.

Don't know which UV light sensor to get? I used a GUVA-S12SD, it works fine.

The total price for all these together shouldn't go over 5$.

Step 1: Patch the ROM

  1. Download boktai's patch here: https://github.com/Prof9/Boktai-Solar-Sensor-Patches
  2. Apply patch, you can do that here: https://www.romhacking.net/patch/

Step 2: Microcontroller

  1. Download the source code here
  2. Have the microcontroller, jumper wires and UV sensor at hand.
  3. Connect them with jumper wires, GND to GND, VCC to power supply, and SIG to your GPIO with analog read of choice.
  4. Connect it to your PC via a USB cable.
  5. Open Arduino IDE.
  6. Open the Source code.
  7. Under "Tools" make sure your Board and Serial port are correct, if you your board is not there you'll need to download them on "Board Manager".
  8. Check for your pinout and change the value of UV_SIGNAL_READ to that GPIO number.
  9. Flash the code to the microcontroller.

Step 3: Lua server

  1. Download the source code here
  2. Open mGBA
  3. Start emulating the patched rom.
  4. Under "tools" go to "scripting...".
  5. File and load script.
  6. Select the lua script.

Step 4: Python client

Download the source code here

This one might differ a bit if you're on linux or windows

Windows:

  1. Download the .exe.
  2. double click it.
  3. Select the COM port the microcontroller is connected to.

Linux:

  1. Install requirements on requirements.txt.
  2. run python3 main.py.
  3. select the TTY port the microcontroller is connected to.

Step 5: Enjoy the game

:)