More CGB fixes
This commit is contained in:
parent
2f1e21dc2d
commit
269bac4626
@ -499,12 +499,14 @@ void GB_display_run(GB_gameboy_t *gb, uint8_t cycles)
|
|||||||
|
|
||||||
/* The OAM STAT interrupt occurs 1 T-cycle before STAT actually changes, except on line 0.
|
/* The OAM STAT interrupt occurs 1 T-cycle before STAT actually changes, except on line 0.
|
||||||
PPU glitch? (Todo: and in double speed mode?) */
|
PPU glitch? (Todo: and in double speed mode?) */
|
||||||
if (gb->current_line != 0 && gb->cgb_double_speed) {
|
if (gb->current_line != 0 && !gb->cgb_double_speed) {
|
||||||
gb->io_registers[GB_IO_STAT] &= ~3;
|
gb->io_registers[GB_IO_STAT] &= ~3;
|
||||||
gb->io_registers[GB_IO_STAT] |= 2;
|
gb->io_registers[GB_IO_STAT] |= 2;
|
||||||
}
|
}
|
||||||
GB_STAT_update(gb);
|
GB_STAT_update(gb);
|
||||||
|
if (gb->current_line != 0) {
|
||||||
gb->io_registers[GB_IO_STAT] &= ~3;
|
gb->io_registers[GB_IO_STAT] &= ~3;
|
||||||
|
}
|
||||||
|
|
||||||
GB_SLEEP(gb, display, 7, 1);
|
GB_SLEEP(gb, display, 7, 1);
|
||||||
|
|
||||||
@ -538,7 +540,7 @@ void GB_display_run(GB_gameboy_t *gb, uint8_t cycles)
|
|||||||
{
|
{
|
||||||
uint8_t rendering_delay = 5;
|
uint8_t rendering_delay = 5;
|
||||||
if (gb->is_cgb) {
|
if (gb->is_cgb) {
|
||||||
rendering_delay = gb->current_line == 0? 2 : 6;
|
rendering_delay = 6;
|
||||||
}
|
}
|
||||||
gb->cycles_for_line += rendering_delay;
|
gb->cycles_for_line += rendering_delay;
|
||||||
GB_SLEEP(gb, display, 10, rendering_delay);
|
GB_SLEEP(gb, display, 10, rendering_delay);
|
||||||
@ -768,8 +770,6 @@ void GB_display_run(GB_gameboy_t *gb, uint8_t cycles)
|
|||||||
GB_STAT_update(gb);
|
GB_STAT_update(gb);
|
||||||
GB_SLEEP(gb, display, 17, LINE_LENGTH - 12);
|
GB_SLEEP(gb, display, 17, LINE_LENGTH - 12);
|
||||||
|
|
||||||
gb->io_registers[GB_IO_STAT] &= ~3;
|
|
||||||
|
|
||||||
/* Reset window rendering state */
|
/* Reset window rendering state */
|
||||||
gb->wy_diff = 0;
|
gb->wy_diff = 0;
|
||||||
gb->window_disabled_while_active = false;
|
gb->window_disabled_while_active = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user