The Game Boy gets its own static recompilation tool, though it's still a work in progress

gameboy.jpg

If you've heard of static recompilation, it's likely from the efforts on the N64 back in 2024. Allowing you to recompile a given binary into more portable and modern C code. GB Recompiled does exactly this for Game Boy titles, allowing you to natively run them on modern platforms without a traditional emulator. It should be noted that this tool does not output an executable, with you having to compile the C code yourself using CMake, Ninja, SDL2, and a C compiler.

Though this tool can successfully recompile a reported 98.9% ofd the tested ROM library (1592/1609 titles), most games are not fully playable. There is still work to be done, though what has already been achieved marks a fantastic step forwards. You can find a full list of features below:

Features said:
  • High Compatibility: Successfully recompiles 98.9% of the tested ROM library (1592/1609 ROMs) MOST OF THE GAMES ARE NOT FULLY PLAYABLE YET
  • Native Performance: Generated C code compiles to native machine code
  • Accurate Runtime:
    • Cycle-accurate instruction emulation (including HALT bug)
    • Precise OAM DMA and interrupt timing
    • Accurate PPU (graphics) emulation with scanline rendering
    • Audio subsystem (APU) with all 4 channels
  • Memory Bank Controllers: Full support for MBC1 (including Mode 1), MBC2, MBC3 (with RTC), and MBC5
  • SDL2 Platform Layer: Ready-to-run with keyboard/controller input and window display
  • Debugging Tools: Trace logging, instruction limits, and screenshot capture
  • Cross-Platform: Works on macOS, Linux, and Windows (via CMake + Ninja)

:arrow: GitHub Repo
 
>claims high compatibility with 98.9% accuracy
>almost nothing is playable

Well… which one is it lmao
I haven't had a chance to use it myself, but I read it as 98% of games will decompile into a working project that will compile into a platform-native binary, but they'll have some kind of bugs that means they're not perfect?

It's weirdly worded I do agree, but that's from their own GitHub readme lol
 
I'm not entirely sure how useful this is either..? Guess we'll find out soon enough.

translates Z80 assembly directly into portable, modern C code
Lots of things used the Z80 – the ColecoVision, ZX Spectrum, SMS/Game Gear, and MSX. Does it work just as well for those..?
 
It also says it's cycle accurate. How then, can it still have errors?
It says the runtime is cycle-accurate. But the stuff that gets spat out likely doesn't work yet.
So like: They got the Gameboy part of this thing worked out, but the game part still needs work.
 
Not to sound negative, but I fail to see the significance in comparison to N64.

Most Gameboy Emulators have "100% accuracy" score for every game and doesn't need modern hardware performance to work at intended framerates. Which is a far cry from nintendo 64 emulators that still struggle to come closer to accuracy or performance. I think the benefits of N64 or even other 3D consoles benefit much more than 2D 8/16 bit ones.

Perhaps not being limited to the small screen is nice and some actual frame blending & ghosting effects. again, not trying to be negative. Just kinda want to understand why this is a huge deal. :ninja:
 
Not to sound negative, but I fail to see the significance in comparison to N64.

Most Gameboy Emulators have "100% accuracy" score for every game and doesn't need modern hardware performance to work at intended framerates. Which is a far cry from nintendo 64 emulators that still struggle to come closer to accuracy or performance. I think the benefits of N64 or even other 3D consoles benefit much more than 2D 8/16 bit ones.

Perhaps not being limited to the small screen is nice and some actual frame blending & ghosting effects. again, not trying to be negative. Just kinda want to understand why this is a huge deal. :ninja:
As with N64, I think the significance is ease of moddability. But unlike N64 I don't think that Game Boy games require mods to look and play their best on modern hardware. They already run at a perfect 60 FPS and their simplicity means that QoL mods are less necessary. So while there can be some benefits I don't think they are as significant.
 
Just tried to build it in Windows, and the instructions to set it up (in README.md) are hilariously and frustratingly inaccurate despite being updated yesterday.

EDIT: Tried to run the prebuilt Windoze executable and got an "Entry Point Not Found" error lmao
 
  • Like
Reactions: MarkDarkness
Not to sound negative, but I fail to see the significance in comparison to N64.

Most Gameboy Emulators have "100% accuracy" score for every game and doesn't need modern hardware performance to work at intended framerates. Which is a far cry from nintendo 64 emulators that still struggle to come closer to accuracy or performance. I think the benefits of N64 or even other 3D consoles benefit much more than 2D 8/16 bit ones.

Perhaps not being limited to the small screen is nice and some actual frame blending & ghosting effects. again, not trying to be negative. Just kinda want to understand why this is a huge deal. :ninja:

For me, one of the biggest reasons is to bring these games into the modern age with widescreen support and colorization. I always think of that video showing a 16:9 version of Pokémon Red/Blue, which unfortunately was never actually made - even though those games have been fully decompiled.


Projects like that could introduce a whole new audience to some of the best titles on the system, especially people who struggle to enjoy the original graphics today.


There are a lot of games that I think could reach a much larger audience if they received the same kind of widescreen and colorization treatment.
 
Last edited by mattyxarope,
  • Like
Reactions: MeowthBlep
As with N64, I think the significance is ease of moddability. But unlike N64 I don't think that Game Boy games require mods to look and play their best on modern hardware. They already run at a perfect 60 FPS and their simplicity means that QoL mods are less necessary. So while there can be some benefits I don't think they are as significant.
Yeah, that's what I thought. I'm not knocking this project, just wondering how much significance it has. N64 emulators still haven't reach the accuracy of real consoles. That's why decompilation/static recompilation seems more significantly impactful when emulation still needs work on N64.

Gameboy accuracy is more reliable in comparison, and rom hacks or mods, cheats & other emulator features to supplement quality of life features. It also saves more space with compressing roms inside of archive files instead of one game & exe + other files that takes up more space.

Well, for me, at least, one of the biggest reasons is to bring these into the modern age with widescreen ports and colorations. I think of this video of 16:9 Pokemon Blue/Red which unfortunately never got made, despite there being a full decomp of those games. I think it could pull in a whole new audience to some of the gems from the system who cannot really stand the older graphics.
Yeah I bet. Though, gameboy colorizations have been done officially & unofficially. Rom hacks had turned non gameboy color games into new color ones with the performance boost. Link's awakening & wario land 2 were colorized. Even trip world DX on nintendo switch eshop has a colorized edition.

I may not have seen any widescreen attempts on gameboy, but Bsnes HD did for snes, and just about other 32 bit console emulators have it like N64, duckstation & pcsx2. I also haven't forgotten there been "Texture" packs for some of them. Mesen lets you replace graphics & music in games. Snes had the msu-1 & sega genesis flash carts has similar msu-1 music feature.

I'm very hopeful that this recompilation project will be at least have more momentum than N64 considering how slow a game gets ports. I just want better idea of what to expect.
 
GB (and even GBA) games frequently suffer from the limited screen area and audio quality.

Funny enough, that HD port of Link's Awakening gets in on the joke by letting you zoom the world view up close...or ABSURDLY far.
 
Hopefully Super Mario Bros Deluxe gets a mod to zoom out. I want to play with those extra features, but actually be able to see shit.
 
Hopefully Super Mario Bros Deluxe gets a mod to zoom out. I want to play with those extra features, but actually be able to see shit.
Then play Super Mario Bros. Remastered.

But yeah, I'm with you. :)

Got another question though:
3D N64 games can run in higher framerates and that's fine but GB games are developed with the exact cycle accuracy of the GB hardware in mind. Wouldn't a natively compiled port run inaccurate or something?
 
Just tried to build it in Windows, and the instructions to set it up (in README.md) are hilariously and frustratingly inaccurate despite being updated yesterday.

EDIT: Tried to run the prebuilt Windoze executable and got an "Entry Point Not Found" error lmao
It’s screaming AI to me
 
  • Like
Reactions: bailli and impeeza
Has anyone tried recompiling any GB Studio games?
Using commit 98d468f0ee58d64a7ccbff7b39f2ab30edd7a356 on WSL2 Ubuntu, the two GB Studio games I tried were completely broken.

Deadleus - Blank screen with a bunch of F spamming the console.
Sushi Gun - Quickly shows the intro logo then goes to a blank screen.
 
Hopefully Super Mario Bros Deluxe gets a mod to zoom out. I want to play with those extra features, but actually be able to see shit.
That kinda already exists, a homebrew remake done with GB-Studio engine:

Its vision area is even bigger than with the original NES game... but at the cost of using small low-res sprites and tiles.
 

Site & Scene News

Popular threads in this forum