Fixed: Loading states in DMG mode results in a black screen
This commit is contained in:
parent
19c382c9e0
commit
f0e772ca97
@ -279,7 +279,7 @@ uint32_t GB_convert_rgb15(GB_gameboy_t *gb, uint16_t color)
|
|||||||
|
|
||||||
void GB_palette_changed(GB_gameboy_t *gb, bool background_palette, uint8_t index)
|
void GB_palette_changed(GB_gameboy_t *gb, bool background_palette, uint8_t index)
|
||||||
{
|
{
|
||||||
if (!gb->rgb_encode_callback) return;
|
if (!gb->rgb_encode_callback || !gb->is_cgb) return;
|
||||||
uint8_t *palette_data = background_palette? gb->background_palettes_data : gb->sprite_palettes_data;
|
uint8_t *palette_data = background_palette? gb->background_palettes_data : gb->sprite_palettes_data;
|
||||||
uint16_t color = palette_data[index & ~1] | (palette_data[index | 1] << 8);
|
uint16_t color = palette_data[index & ~1] | (palette_data[index | 1] << 8);
|
||||||
|
|
||||||
|
@ -303,6 +303,11 @@ int GB_load_state_from_buffer(GB_gameboy_t *gb, const uint8_t *buffer, size_t le
|
|||||||
gb->rumble_callback(gb, gb->rumble_state);
|
gb->rumble_callback(gb, gb->rumble_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (unsigned i = 0; i < 32; i++) {
|
||||||
|
GB_palette_changed(gb, false, i * 2);
|
||||||
|
GB_palette_changed(gb, true, i * 2);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user