mirror of https://github.com/mgba-emu/mgba.git
Fix scanline rendering when parameters change mid-scanline
This commit is contained in:
parent
79301a365f
commit
c6cd179101
|
@ -38,7 +38,7 @@ void GBAVideoReset(struct GBAVideo* video) {
|
|||
video->vcounterIRQ = 0;
|
||||
video->vcountSetting = 0;
|
||||
|
||||
video->vcount = -1;
|
||||
video->vcount = 0;
|
||||
|
||||
video->lastHblank = 0;
|
||||
video->nextHblank = VIDEO_HDRAW_LENGTH;
|
||||
|
@ -124,10 +124,6 @@ int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles) {
|
|||
GBARaiseIRQ(video->p, IRQ_VCOUNTER);
|
||||
video->nextVcounterIRQ += VIDEO_TOTAL_LENGTH;
|
||||
}
|
||||
|
||||
if (video->vcount < VIDEO_VERTICAL_PIXELS && GBASyncDrawingFrame(video->p->sync)) {
|
||||
video->renderer->drawScanline(video->renderer, video->vcount);
|
||||
}
|
||||
} else {
|
||||
// Begin Hblank
|
||||
video->inHblank = 1;
|
||||
|
@ -136,6 +132,10 @@ int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles) {
|
|||
video->nextHblank = video->nextEvent + VIDEO_HDRAW_LENGTH;
|
||||
video->nextHblankIRQ = video->nextHblank;
|
||||
|
||||
if (video->vcount < VIDEO_VERTICAL_PIXELS && GBASyncDrawingFrame(video->p->sync)) {
|
||||
video->renderer->drawScanline(video->renderer, video->vcount);
|
||||
}
|
||||
|
||||
if (video->vcount < VIDEO_VERTICAL_PIXELS) {
|
||||
GBAMemoryRunHblankDMAs(video->p, lastEvent);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue