From 52632d20a1f1f5feaafa4544fd884a2d9e7f2712 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 27 May 2026 16:27:30 +0200 Subject: [PATCH] Add gb-cycle emulator --- .github/workflows/ci-all.yml | 6 +++++- .github/workflows/ci-gb-cycle.yml | 18 +++++++++++++++++ README.md | 1 + emulators/gbcycle.py | 33 +++++++++++++++++++++++++++++++ main.py | 6 ++++++ 5 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-gb-cycle.yml create mode 100644 emulators/gbcycle.py diff --git a/.github/workflows/ci-all.yml b/.github/workflows/ci-all.yml index e9b6a6a..9a3f691 100644 --- a/.github/workflows/ci-all.yml +++ b/.github/workflows/ci-all.yml @@ -80,6 +80,10 @@ jobs: needs_chromedriver: false needs_audio: true extra_requirements: '' + - emulator: gb-cycle + needs_chromedriver: false + needs_audio: false + extra_requirements: '' uses: ./.github/workflows/emulator-runner.yml with: emulator: ${{ matrix.emulator }} @@ -90,4 +94,4 @@ jobs: deploy-pages: if: ${{ always() }} needs: run-all - uses: ./.github/workflows/deploy-pages.yml \ No newline at end of file + uses: ./.github/workflows/deploy-pages.yml diff --git a/.github/workflows/ci-gb-cycle.yml b/.github/workflows/ci-gb-cycle.yml new file mode 100644 index 0000000..18e8d7f --- /dev/null +++ b/.github/workflows/ci-gb-cycle.yml @@ -0,0 +1,18 @@ +name: CI - gb-cycle + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + run: + uses: ./.github/workflows/emulator-runner.yml + with: + emulator: gb-cycle + needs_audio: false + + deploy-pages: + needs: run + uses: ./.github/workflows/deploy-pages.yml diff --git a/README.md b/README.md index 96b7d2b..3109ec2 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ If you'd like to contribute to the project, please read [CONTRIBUTING.md](CONTRI - [Emulicious](https://emulicious.net/) - [Gambatte-Speedrun](https://github.com/pokemon-speedrunning/gambatte-speedrun) - [GameRoy](https://github.com/Rodrigodd/gameroy) +- [gb-cycle](https://github.com/pakitovic/gb-cycle) - [Goomba Color](https://www.dwedit.org/gba/goombacolor.php) - [KiGB](http://kigb.emuunlim.com/) - [mGBA](https://mgba.io/) diff --git a/emulators/gbcycle.py b/emulators/gbcycle.py new file mode 100644 index 0000000..1cf3bdc --- /dev/null +++ b/emulators/gbcycle.py @@ -0,0 +1,33 @@ +from util import * +from emulator import Emulator +from test import * +import os + + +class GbCycle(Emulator): + def __init__(self): + super().__init__("gb-cycle", "https://github.com/pakitovic/gb-cycle", startup_time=10.0, features=(PCM,)) + self.title_check = lambda title: title.startswith("gb-desktop |") + + def setup(self): + downloadGithubRelease( + "pakitovic/gb-cycle", + "downloads/gb-cycle.zip", + filter=lambda name: name == "gb-cycle-windows-x86_64.zip", + require_asset=True, + ) + extract("downloads/gb-cycle.zip", "emu/gb-cycle") + self.executable = os.path.abspath("emu/gb-cycle/gb-desktop.exe") + setDPIScaling(self.executable) + + def startProcess(self, rom, *, model, required_features): + if model not in (DMG, CGB, SGB): + return None + + return subprocess.Popen([ + self.executable, + os.path.abspath(rom), + "--model", model, + "--startup", "skip-boot", + "--test-runner", + ], cwd=os.path.dirname(self.executable)) diff --git a/main.py b/main.py index fe32e31..a728fe2 100644 --- a/main.py +++ b/main.py @@ -156,6 +156,12 @@ def _new_instance(module_name, class_name): 'name': "docboy", 'url': "https://github.com/Docheinstein/docboy", }, + { + 'factory': lambda: _new_instance("emulators.gbcycle", "GbCycle"), + 'keywords': ["gb-cycle", "gbcycle"], + 'name': "gb-cycle", + 'url': "https://github.com/pakitovic/gb-cycle", + }, ]