Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hi!

To be honest, the low level hardware detection is performed by the SDK i use: GBDK-2020 https://github.com/gbdk-2020/gbdk-2020

The test itself is made at startup: https://github.com/gbdk-2020/gbdk-2020/blob/develop/gbdk-lib/libc/targets/gbz80/... (see __cpu variable)

Basically, the boot rom is slightly different and leaves the values of some register in different states at startup, and that's how we can detect which GB model we are running on (for DMG / Pocket / Color / Advance detection). For the detection of SGB, it's different: we ask to enable some SGB only features (such as mutliplayer support). If the machine replies a with specific value, then it's running on a SGB, else it does nothing meaning it's not running on a SGB but on another Game Boy model.

(+1)

That's super interesting! I had no idea that was even possible! It'd be really cool if you added gba and gba sp functionality, although just gba as a whole would be awesome too!