Skip to content

armgba-lr: add armGBA libretro core for GB, GBC and GBA - #3517

Open
MagnominusGit wants to merge 1 commit into
ROCKNIX:nextfrom
MagnominusGit:armgba-lr-pr
Open

MagnominusGit wants to merge 1 commit into
ROCKNIX:nextfrom
MagnominusGit:armgba-lr-pr

Conversation

@MagnominusGit

@MagnominusGit MagnominusGit commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

What does this PR do?

Adds armGBA 1.2.1 (20061e2) as an optional libretro core for gb, gbc and gba. mGBA and Gambatte stay the defaults.

GBA games run on a recompiler with AArch64, ARMv7 and x86-64 backends; GB and GBC games run on Gambatte-Speedrun's core.

Speed vs mGBA (one core, unthrottled):

  • Retroid Pocket 5 (Cortex-A77): 3.1x on average over 20 test games, 3.0x on the five hardest (Payback, Duke Nukem Advance, Doom, Golden Sun: The Lost Age, Ultimate Card Games)
  • RG353M (Cortex-A55): 1.4-1.6x on the hardest games (Payback, Mario Kart, FFTA, Advance Wars, Golden Sun)
  • GKD Pixel 2: All of the hardest games tested ran full speed, 60 FPS single-threaded.
  • x86-64: 2.5x median across my ROMs

Features:

  • Threaded Video: draws on a second core; One Frame Late is faster still, at one frame of delay. Helps fast-forward and runahead on slower devices.
  • Game Boy models: Game Boy, Pocket / Light, Color and Game Boy Advance, or Auto. Boots through Nintendo's BIOS and boot ROMs if present, otherwise armGBA's own open-source ones (built in), or none.
  • GBA cartridge hardware: light sensor, gyro, tilt and rumble on the sticks; GBA Video, multi-game and Classic NES carts.
  • Unlicensed GB mappers: Sachen, TAMA5, MBC6, MBC7, Vast Fame and others.
  • Cheats and RetroAchievements on both consoles; saves compatible with mGBA, GB clock files with gambatte-libretro.
  • Link play (Link Mode):
    • Together: 2-4 consoles on one device, a controller each, or rollback netplay where every device runs all of them. Link Cable, GBA Wireless Adapter, or GB Four Player Adapter.
    • Separate: two devices over netplay, each running only its own console, game and save. Link Cable (GB, GBC, GBA) or GBA Wireless Adapter.
    • In netplay, each player changes their own screens with L2 and R2 (Screen Layout Control), and Show Player Numbers marks each player's screen.
  • Save backups: timestamped backups of each player's save; Load Save, Load Into and Back Up Save in the core options. In Separate, Send Save copies a save to the other player.
  • Game Boy screens: the first model's and the Pocket's measured from real ones, and the Light backlit in cyan; Grayscale stays the default.
  • LCD effects: ghosting, the LCD grid and the Game Boy's pixel shadow (with its distance), drawn by the core or by the shader presets this installs (armgba in the shader list).
  • Game Boy Contrast (the original wheel, also on the right stick), Left Stick as D-Pad and Safe Saves (on by default).

Testing & Verification

Test Steps

  1. Install the image, or put the .tar in /storage/.update.
  2. In ES, set the core of a GBA, GB or GBC game (or the whole system) to armgba and play.
  3. For netplay: in ES, long-press A on a game, then Start a Netplay Game to host or join.
  4. For link play: in RetroArch's core options, set Link Mode to Together or Separate, then restart the game.

Test Results & Evidence

  • Recompiler: matches the exact CPU frame by frame across my GBA ROMs (1500 frames, with and without input), on x86-64, AArch64 and ARMv7.
  • Compatibility: almost every GBA, GBC and GB ROM I tested boots to a picture; the few that don't fail on mGBA or Gambatte too.
  • Accuracy: compared with mGBA (GBA) and Gambatte and SameBoy (GB/GBC). Disputed GBA cases were rechecked with NanoBoyAdvance. Passes all 28 GBA hardware test ROMs (jsmolka, FuzzARM, NanoBoyAdvance) and 213 of 236 Game Boy test screens.
  • Save states and runahead (1 and 2 frames): frame-exact on x86-64 and AArch64, with Threaded Video on or off.
  • Link, Together: 4-player Kirby & The Amazing Mirror; a Payback 2-player deathmatch for 2 hours with no dropped link. Rollback netplay (with mispredicted input) gives the same frames as a local run.
  • Netplay from ES: a Retroid Pocket Classic hosted and joined Payback from ES's Start a Netplay Game menu, with an x86-64 PC as the other player.
  • Link, Separate: Pokemon Emerald Cable Club trade and Union Room trade and battle (Wireless Adapter) between a Retroid Pocket 5 and an x86-64 mini PC over Wi-Fi. 40 link test cases (timing, host order, lag, late join) pass in a netplay test harness.
  • Saves: backup, load, transfer and netplay save handling pass 7 end-to-end tests.
  • Regression: the boot check above, rerun after the link and save work, gives the same result for every ROM.
  • 1.0: ASan and UBSan runs, fuzzed patch files, and every ROM gives the same frames before and after the final fixes.

Additional Context & Reviewer Notes

  • armgba is listed after the default core on each system, with decoration, netplay, rewind, autosave, cheevos in es_features.cfg, as mGBA has.
  • GPLv2. Code or references from mGBA, Gambatte, Gambatte-Speedrun, SameBoy, NanoBoyAdvance, hhugboy, gambatte-libretro and gpSP (credited in the README); VBA-M, VBA Next and Gearboy used for comparison.

AI Assistance Disclosure

While ROCKNIX has no restrictions on using AI tools, transparency helps reviewers set the proper context during code review.

Did you use AI tools (e.g., ChatGPT, Copilot, Claude) to assist with this pull request?

  • No Written entirely without AI tools.
  • Partially AI was used for minor assistance (e.g., refactoring, writing tests, debugging, documentation).
  • Yes AI generated a major portion of the code or implementation.

@MagnominusGit

Copy link
Copy Markdown
Contributor Author

Bumped down to draft briefly, I am going to implement local and multi-handheld GB link netplay for GBA, GB, and GBC.

Wish me luck.

Hairo added a commit to spruceUI/twigUI-next that referenced this pull request Oct 17, 2026
@MagnominusGit
MagnominusGit marked this pull request as ready for review October 20, 2026 01:47
@MagnominusGit
MagnominusGit marked this pull request as draft October 20, 2026 13:22
@MagnominusGit
MagnominusGit marked this pull request as ready for review October 24, 2026 01:55
@MagnominusGit
MagnominusGit marked this pull request as draft October 24, 2026 05:49
@MagnominusGit
MagnominusGit force-pushed the armgba-lr-pr branch 2 times, most recently from febeb82 to 3ad7138 Compare October 24, 2026 22:15
@MagnominusGit
MagnominusGit marked this pull request as ready for review October 25, 2026 05:44
@MagnominusGit

Copy link
Copy Markdown
Contributor Author

@sunshineinabox I have basically validated this as much as humanly possible over the last few days.

I believe the emulator is quite polished now from all my tests across all my devices, and is ready to be integrated into the community firmwares.

@MagnominusGit
MagnominusGit force-pushed the armgba-lr-pr branch 6 times, most recently from 56396f9 to 50ed514 Compare October 29, 2026 19:45
armGBA 1.2.1 as an optional core for gb, gbc and gba, with its LCD
shader presets, and netplay allowed for it in EmulationStation.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant