mirror of https://github.com/mgba-emu/mgba.git
GB Software: More minor optimization
This commit is contained in:
parent
8257c85c95
commit
9a023168f4
|
@ -131,10 +131,7 @@ static void GBVideoSoftwareRendererDrawRange(struct GBVideoRenderer* renderer, i
|
||||||
GBVideoSoftwareRendererDrawBackground(softwareRenderer, maps, softwareRenderer->wx - 7, endX, y, 7 - softwareRenderer->wx, (softwareRenderer->currentWy - y) - softwareRenderer->wy);
|
GBVideoSoftwareRendererDrawBackground(softwareRenderer, maps, softwareRenderer->wx - 7, endX, y, 7 - softwareRenderer->wx, (softwareRenderer->currentWy - y) - softwareRenderer->wy);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int x;
|
memset(&softwareRenderer->row[startX], 0, endX - startX);
|
||||||
for (x = startX; x < endX; ++x) {
|
|
||||||
softwareRenderer->row[x] = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GBRegisterLCDCIsObjEnable(softwareRenderer->lcdc)) {
|
if (GBRegisterLCDCIsObjEnable(softwareRenderer->lcdc)) {
|
||||||
|
@ -143,11 +140,17 @@ static void GBVideoSoftwareRendererDrawRange(struct GBVideoRenderer* renderer, i
|
||||||
GBVideoSoftwareRendererDrawObj(softwareRenderer, obj[i], startX, endX, y);
|
GBVideoSoftwareRendererDrawObj(softwareRenderer, obj[i], startX, endX, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
color_t* row = &softwareRenderer->outputBuffer[softwareRenderer->outputBufferStride * y];
|
color_t* row = &softwareRenderer->outputBuffer[softwareRenderer->outputBufferStride * y];
|
||||||
int x;
|
int x;
|
||||||
for (x = startX; x < endX; ++x) {
|
for (x = startX; x < endX; x += 8) {
|
||||||
row[x] = softwareRenderer->palette[softwareRenderer->row[x]];
|
row[x] = softwareRenderer->palette[softwareRenderer->row[x]];
|
||||||
|
row[x + 1] = softwareRenderer->palette[softwareRenderer->row[x + 1]];
|
||||||
|
row[x + 2] = softwareRenderer->palette[softwareRenderer->row[x + 2]];
|
||||||
|
row[x + 3] = softwareRenderer->palette[softwareRenderer->row[x + 3]];
|
||||||
|
row[x + 4] = softwareRenderer->palette[softwareRenderer->row[x + 4]];
|
||||||
|
row[x + 5] = softwareRenderer->palette[softwareRenderer->row[x + 5]];
|
||||||
|
row[x + 6] = softwareRenderer->palette[softwareRenderer->row[x + 6]];
|
||||||
|
row[x + 7] = softwareRenderer->palette[softwareRenderer->row[x + 7]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue