Repository navigation
Add Pocket Emu handheld emulator app - #161
Draft
octobooth-13 wants to merge 2 commits into
Draft
octobooth-13 wants to merge 2 commits into
octobooth-13 wants to merge 2 commits into
Conversation
Adds badge/apps/game_boy, which runs original Game Boy ROMs that the owner copies onto the badge. The emulator core is Peanut-GB (MIT), wrapped as a MicroPython native module (gbcore.mpy) built from tools/gameboy for the RP2350 (armv7emsp, .mpy v6.3). No ROMs are included; roms/ is git-ignored. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Renames badge/apps/game_boy to badge/apps/pocket_emu and tools/gameboy to tools/pocket_emu, replaces the handheld-likeness icon with a generic one, and removes trademarked product and game names from the UI, READMEs and comments, as the repository's IP policy requires. Behaviour and the compiled core are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Hi maintainers! 👋 This PR is ready for review, but my account can only open draft pull requests here: marking it ready, or reopening it as a non-draft, fails with a permissions error. Could someone please mark it Ready for review, approve the CI workflow run for this fork, and take a look? Quick summary for reviewers:
Whether this repo should host an emulator is your call, and I'm happy to make any changes you'd like. Thanks! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds Pocket Emu (
badge/apps/pocket_emu), an app that plays classic 8-bit handheld games on the Universe 2026 badge. It runs.gbROM files that the owner dumps from their own cartridges and copies toapps/pocket_emu/roms/in USB Disk Mode. No ROMs are included, androms/is git-ignored.Python is far too slow for emulation, so the emulator is Peanut-GB (MIT), wrapped as a MicroPython native module:
tools/pocket_emu/gbcore.cholds the wrapper,peanut_gb.his vendored at commitd0bcca7, andbuild.pybuildsbadge/apps/pocket_emu/gbcore.mpywithout needingmake.armv7emsp,.mpyv6.3, which matches stock firmware (sys.implementation._mpy == 7942,pimoroni/micropythonbw-1.29.0-gc). No firmware change is needed.How the app behaves:
/state/pocket_emu/<rom>.sav. A 32 KB write stalls the badge for about 0.5 s, so the core reports which 8 KB RAM banks changed. Changes outside bank 0 (real save data) are written about 1 s after the game stops writing. Bank-0-only changes, which some games use as scratch space for sprites, are written at most once a minute, and always when HOME or quit is pressed. A.savplaced next to a ROM is imported on first launch.rogueandinput_testdo, so a game is never closed with unsaved progress.Type of change
badge25/) maintenanceBadge app checklist
badge/apps/<name>/with__init__.pyand a 24x24icon.png(it is 48x48, whichbadge/AGENTS.mdrecommends for a sharper tile)README.mdstarts with a one-sentence description, followed by usage and any hardware or network requirementsbadge,screen,image, ...) and logical buttons such asBUTTON_SELECTbadge.ticks_delta)assets/, are PNG where possible, and are as small as practicalbadge/secrets.pystays empty)Screenshots
The game names in the screenshot are placeholders. Gameplay screenshots are left out because they would show third-party game artwork.
How to use it
Copy
.gbfiles intoapps/pocket_emu/roms/on theBADGERdrive, then open Pocket Emu. With one ROM it starts straight away; with several, pick one from the list.Monochrome-era and dual-mode cartridges work. Colour-only games do not.
Licensing and intellectual property
This is an open source repository released under the MIT License. Everything merged here is distributed under the terms of that license.
We can't accept contributions that use someone else's intellectual property (for example, characters, artwork, logos, trademarks, game names, music, fonts, or code) unless that person or company has agreed to its release under the project license. This includes recognizable likenesses of existing games or brands that could be confusing.
Additional notes
peanut_gb.h, whose MIT licence header and docs describe the hardware it emulates.gbcore.mpyis a compiled binary, reproducible withtools/pocket_emu/build.py; rebuilding after the rename produced a byte-identical file. It only loads on firmware with a matching.mpyABI. Elsewhere, including the Badge Simulator, the app shows an "emulator core did not load" screen instead of crashing.Validation
python .github/scripts/validate_app_readmes.py badge/apps: passed ("All app READMEs have a valid description.")python .github/skills/hyb26-skill/scripts/validate_app.py badge/apps/pocket_emu: passed (0 warnings)check_app: passed, with one warning thaticon.pngis 48x48. The picker renders in the simulator, which cannot run native.mpycode.