Skip to content

GB_set_boot_rom_load_callback

Lior Halphon edited this page Nov 30, 2024 · 3 revisions

Definition

typedef enum {
    GB_BOOT_ROM_DMG_0,
    GB_BOOT_ROM_DMG,
    GB_BOOT_ROM_MGB,
    GB_BOOT_ROM_SGB,
    GB_BOOT_ROM_SGB2,
    GB_BOOT_ROM_CGB_0,
    GB_BOOT_ROM_CGB,
    GB_BOOT_ROM_CGB_E,
    GB_BOOT_ROM_AGB_0,
    GB_BOOT_ROM_AGB,
} GB_boot_rom_t;

typedef void (*GB_boot_rom_load_callback_t)(GB_gameboy_t *gb, GB_boot_rom_t type);

void GB_set_boot_rom_load_callback(GB_gameboy_t *gb, GB_boot_rom_load_callback_t callback);

In gb.h

Description

Sets an optional but recommended callback that lets the emulator instance request a specific boot ROM. This callback is required to allow the GB_BORDER_ALWAYS border mode to use Super Game Boy borders while emulating a non-Super Game Boy model. When the callback is called, the callee must call either GB_load_boot_rom or GB_load_boot_rom_from_buffer to load a suitable boot ROM before returning.

The possible values for GB_boot_rom_t are:

  • GB_BOOT_ROM_DMG_0: A boot ROM for the original DMG revision, usually saved as dmg0_boot.bin
  • GB_BOOT_ROM_DMG: A boot ROM for all other DMG revisions, usually saved as dmg_boot.bin
  • GB_BOOT_ROM_MGB: A boot ROM for the MGB, usually saved as mgb_boot.bin
  • GB_BOOT_ROM_SGB: A boot ROM for the SGB, usually saved as sgb_boot.bin
  • GB_BOOT_ROM_SGB2: A boot ROM for the SGB2, usually saved as sgb2_boot.bin
  • GB_BOOT_ROM_CGB_0: A boot ROM for the original CGB revision, usually saved as cgb0_boot.bin
  • GB_BOOT_ROM_CGB: A boot ROM for the CGB revisions A to D, usually saved as cgb_boot.bin
  • GB_BOOT_ROM_CGB_E: A boot ROM for CGB revision E, usually saved as cgbE_boot.bin
    • If this boot ROM revision is not available, the callback can safely fall back to treating this value as GB_BOOT_ROM_CGB.
  • GB_BOOT_ROM_AGB_0: A boot ROM for the original AGB revision, usually saved as agb0_boot.bin
    • If this boot ROM revision is not available, the callback can safely fall back to treating this value as GB_BOOT_ROM_AGB.
  • GB_BOOT_ROM_AGB: A boot ROM for all other AGB revisions, usually saved as agb_boot.bin

Thread Safety

GB_set_boot_rom_load_callback is thread-safe and can be called from any thread and context.

See Also

Clone this wiki locally