Skip to content

Commit 82d3ffd

Browse files
committed
Don't try to borrow a border if no ROM is loaded
1 parent 71b485c commit 82d3ffd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Core/gb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ void GB_borrow_sgb_border(GB_gameboy_t *gb)
279279
if (gb->border_mode != GB_BORDER_ALWAYS) return;
280280
if (gb->tried_loading_sgb_border) return;
281281
gb->tried_loading_sgb_border = true;
282-
if (gb->rom && gb->rom[0x146] != 3) return; // Not an SGB game, nothing to borrow
282+
if (!gb->rom || gb->rom[0x146] != 3) return; // Not an SGB game, nothing to borrow
283283
if (!gb->boot_rom_load_callback) return; // Can't borrow a border without this callback
284284
GB_gameboy_t sgb;
285285
GB_init(&sgb, GB_MODEL_SGB);

0 commit comments

Comments
 (0)