mirror of https://github.com/mgba-emu/mgba.git
GB Video: Fix window underflow
This commit is contained in:
parent
2a7b268728
commit
52152a3a12
|
@ -175,6 +175,9 @@ static void GBVideoSoftwareRendererDrawBackground(struct GBVideoSoftwareRenderer
|
|||
}
|
||||
int topY = (((y + sy) >> 3) & 0x1F) * 0x20;
|
||||
int bottomY = (y + sy) & 7;
|
||||
if (startX < 0) {
|
||||
startX = 0;
|
||||
}
|
||||
int x;
|
||||
for (x = startX; x < endX; ++x) {
|
||||
int topX = ((x + sx) >> 3) & 0x1F;
|
||||
|
@ -204,6 +207,9 @@ static void GBVideoSoftwareRendererDrawObj(struct GBVideoSoftwareRenderer* rende
|
|||
if (obj->x - 8 > startX) {
|
||||
startX = obj->x - 8;
|
||||
}
|
||||
if (startX < 0) {
|
||||
startX = 0;
|
||||
}
|
||||
uint8_t* data = renderer->d.vram;
|
||||
int tileOffset = 0;
|
||||
int bottomY;
|
||||
|
|
Loading…
Reference in New Issue