mirror of https://github.com/mgba-emu/mgba.git
GB Video: Fix initialization
This commit is contained in:
parent
302d4860f3
commit
746f2b8e6a
|
@ -547,6 +547,8 @@ void GBSkipBIOS(struct GB* gb) {
|
|||
mTimingDeschedule(&gb->timing, &gb->timer.event);
|
||||
mTimingSchedule(&gb->timing, &gb->timer.event, 0);
|
||||
|
||||
GBIOWrite(gb, REG_LCDC, 0x91);
|
||||
|
||||
if (gb->biosVf) {
|
||||
GBUnmapBIOS(gb);
|
||||
}
|
||||
|
|
|
@ -182,7 +182,11 @@ void GBIOReset(struct GB* gb) {
|
|||
GBIOWrite(gb, REG_NR43, 0x00);
|
||||
GBIOWrite(gb, REG_NR50, 0x77);
|
||||
GBIOWrite(gb, REG_NR51, 0xF3);
|
||||
GBIOWrite(gb, REG_LCDC, 0x91);
|
||||
if (!gb->biosVf) {
|
||||
GBIOWrite(gb, REG_LCDC, 0x91);
|
||||
} else {
|
||||
GBIOWrite(gb, REG_LCDC, 0x00);
|
||||
}
|
||||
GBIOWrite(gb, REG_SCY, 0x00);
|
||||
GBIOWrite(gb, REG_SCX, 0x00);
|
||||
GBIOWrite(gb, REG_LYC, 0x00);
|
||||
|
|
|
@ -419,6 +419,7 @@ void GBVideoWriteLCDC(struct GBVideo* video, GBRegisterLCDC value) {
|
|||
video->mode = 2;
|
||||
video->modeEvent.callback = _endMode2;
|
||||
int32_t next = GB_VIDEO_MODE_2_LENGTH - 5; // TODO: Why is this fudge factor needed? Might be related to T-cycles for load/store differing
|
||||
mTimingDeschedule(&video->p->timing, &video->modeEvent);
|
||||
mTimingSchedule(&video->p->timing, &video->modeEvent, next << video->p->doubleSpeed);
|
||||
|
||||
video->ly = 0;
|
||||
|
@ -445,6 +446,7 @@ void GBVideoWriteLCDC(struct GBVideo* video, GBRegisterLCDC value) {
|
|||
video->renderer->writePalette(video->renderer, 0, video->dmgPalette[0]);
|
||||
|
||||
mTimingDeschedule(&video->p->timing, &video->modeEvent);
|
||||
mTimingDeschedule(&video->p->timing, &video->frameEvent);
|
||||
mTimingSchedule(&video->p->timing, &video->frameEvent, GB_VIDEO_TOTAL_LENGTH);
|
||||
}
|
||||
video->p->memory.io[REG_STAT] = video->stat;
|
||||
|
|
Loading…
Reference in New Issue