mirror of https://github.com/mgba-emu/mgba.git
GB Video: Fix up timing after skipping BIOS
This commit is contained in:
parent
9ddf82bebc
commit
7b34a0a63c
|
@ -218,10 +218,16 @@ void GBVideoSkipBIOS(struct GBVideo* video) {
|
||||||
video->mode = 1;
|
video->mode = 1;
|
||||||
video->modeEvent.callback = _endMode1;
|
video->modeEvent.callback = _endMode1;
|
||||||
|
|
||||||
|
int32_t next;
|
||||||
if (video->p->model == GB_MODEL_CGB) {
|
if (video->p->model == GB_MODEL_CGB) {
|
||||||
video->ly = GB_VIDEO_VERTICAL_PIXELS;
|
video->ly = GB_VIDEO_VERTICAL_PIXELS;
|
||||||
video->p->memory.io[REG_LY] = video->ly;
|
video->p->memory.io[REG_LY] = video->ly;
|
||||||
video->stat = GBRegisterSTATClearLYC(video->stat);
|
video->stat = GBRegisterSTATClearLYC(video->stat);
|
||||||
|
next = 20;
|
||||||
|
} else {
|
||||||
|
video->ly = GB_VIDEO_VERTICAL_TOTAL_PIXELS;
|
||||||
|
video->p->memory.io[REG_LY] = 0;
|
||||||
|
next = 56;
|
||||||
}
|
}
|
||||||
video->stat = GBRegisterSTATSetMode(video->stat, video->mode);
|
video->stat = GBRegisterSTATSetMode(video->stat, video->mode);
|
||||||
|
|
||||||
|
@ -229,7 +235,7 @@ void GBVideoSkipBIOS(struct GBVideo* video) {
|
||||||
GBUpdateIRQs(video->p);
|
GBUpdateIRQs(video->p);
|
||||||
video->p->memory.io[REG_STAT] = video->stat;
|
video->p->memory.io[REG_STAT] = video->stat;
|
||||||
mTimingDeschedule(&video->p->timing, &video->modeEvent);
|
mTimingDeschedule(&video->p->timing, &video->modeEvent);
|
||||||
mTimingSchedule(&video->p->timing, &video->modeEvent, GB_VIDEO_HORIZONTAL_LENGTH << video->p->doubleSpeed);
|
mTimingSchedule(&video->p->timing, &video->modeEvent, next);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _endMode0(struct mTiming* timing, void* context, uint32_t cyclesLate) {
|
void _endMode0(struct mTiming* timing, void* context, uint32_t cyclesLate) {
|
||||||
|
|
Loading…
Reference in New Issue