diff --git a/.github/workflows/ci-all.yml b/.github/workflows/ci-all.yml index 12e69f7..e9b6a6a 100644 --- a/.github/workflows/ci-all.yml +++ b/.github/workflows/ci-all.yml @@ -76,6 +76,10 @@ jobs: needs_chromedriver: false needs_audio: true extra_requirements: '' + - emulator: DocBoy + needs_chromedriver: false + needs_audio: true + extra_requirements: '' uses: ./.github/workflows/emulator-runner.yml with: emulator: ${{ matrix.emulator }} diff --git a/.github/workflows/ci-docboy.yml b/.github/workflows/ci-docboy.yml new file mode 100644 index 0000000..70a3b1b --- /dev/null +++ b/.github/workflows/ci-docboy.yml @@ -0,0 +1,18 @@ +name: CI - DocBoy + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + run: + uses: ./.github/workflows/emulator-runner.yml + with: + emulator: DocBoy + needs_audio: true + + deploy-pages: + needs: run + uses: ./.github/workflows/deploy-pages.yml diff --git a/emulators/docboy.ini b/emulators/docboy.ini new file mode 100644 index 0000000..26dac09 --- /dev/null +++ b/emulators/docboy.ini @@ -0,0 +1 @@ +dmg_palette=FFFF,AD55,52AA,0000,FFFF diff --git a/emulators/docboy.py b/emulators/docboy.py new file mode 100644 index 0000000..80f69b2 --- /dev/null +++ b/emulators/docboy.py @@ -0,0 +1,24 @@ +from util import * +from emulator import Emulator +from test import * +import os +import shutil + + +class DocBoy(Emulator): + def __init__(self): + super().__init__("DocBoy", "https://github.com/Docheinstein/docboy", startup_time=1, features=(PCM,)) + + def setup(self): + for model in ["dmg", "cgb"]: + downloadGithubRelease(f"Docheinstein/docboy", f"downloads/docboy-{model}.zip", filter=lambda n: model in n and "win" in n) + extract(f"downloads/docboy-{model}.zip", f"emu/docboy-{model}") + setDPIScaling(f"emu/docboy-{model}/docboy-sdl.exe") + shutil.copyfile(os.path.join(os.path.dirname(__file__), "docboy.ini"), f"emu/docboy-{model}/docboy.ini") + + def startProcess(self, rom, *, model, required_features): + model = {DMG: "dmg", CGB: "cgb"}.get(model) + if model is None: + return None + return subprocess.Popen([f"emu/docboy-{model}/docboy-sdl.exe", os.path.abspath(rom), "-c", "docboy.ini", "-z", "1"], + cwd=f"emu/docboy-{model}") diff --git a/main.py b/main.py index 2b06ab7..5a71b10 100644 --- a/main.py +++ b/main.py @@ -150,6 +150,12 @@ def _new_instance(module_name, class_name): 'name': "gameroy", 'url': "https://github.com/Rodrigodd/gameroy", }, + { + 'factory': lambda: _new_instance("emulators.docboy", "DocBoy"), + 'keywords': ["DocBoy", "docboy"], + 'name': "docboy", + 'url': "https://github.com/Docheinstein/docboy", + }, ]