Skip to content

gb_set_bootrom()

Mr-PauI edited this page Dec 22, 2025 · 4 revisions

void gb_set_bootrom(struct gb_s *gb, uint8_t (*gb_bootrom_read)(struct gb_s*, const uint_fast16_t))

This optional function allows you to set a pointer to a gb_bootrom_read() function. This allows bootroms stored in memory to be used(ram,xip or psram).

A call to gb_reset() must be performed after calling gb_set_bootrom for these changes to take effect. This is because gb_init calls gb_reset, but gb_set_bootrom must be called after gb_init. The bootrom must be either a CGB, DMG or a MGB bootrom.

Switching from a CGB bootrom to a DMG can allow you to force a game to execute in DMG backwards compatible mode which may be desired for some titles for increased performance. This can be done within your gb_bootrom_read() function or by changing the bootrom function. Either method requires a call to gb_reset().

Clone this wiki locally