Fix scanline rendering when parameters change mid-scanline

This commit is contained in:
Jeffrey Pfau 2014-07-19 15:59:27 -07:00
parent 79301a365f
commit c6cd179101
1 changed files with 5 additions and 5 deletions

View File

@ -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);
}