mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Ignore horizontally off-screen sprite timing (fixes #2391)
This commit is contained in:
parent
b96d980a98
commit
745b1c76b5
1
CHANGES
1
CHANGES
|
@ -1,6 +1,7 @@
|
|||
0.9.4: (Future)
|
||||
Emulation fixes:
|
||||
- GBA I/O: Disable open bus behavior on invalid register 06A
|
||||
- GBA Video: Ignore horizontally off-screen sprite timing (fixes mgba.io/i/2391)
|
||||
Other fixes:
|
||||
- FFmpeg: Fix crash when encoding audio with some containers
|
||||
- FFmpeg: Fix GIF recording (fixes mgba.io/i/2393)
|
||||
|
|
|
@ -24,16 +24,20 @@ int GBAVideoRendererCleanOAM(struct GBAObj* oam, struct GBAVideoRendererSprite*
|
|||
width <<= GBAObjAttributesAGetDoubleSize(obj.a);
|
||||
cycles = 10 + width * 2;
|
||||
}
|
||||
if (GBAObjAttributesAGetY(obj.a) < GBA_VIDEO_VERTICAL_PIXELS || GBAObjAttributesAGetY(obj.a) + height >= VIDEO_VERTICAL_TOTAL_PIXELS) {
|
||||
int y = GBAObjAttributesAGetY(obj.a) + offsetY;
|
||||
sprites[oamMax].y = y;
|
||||
sprites[oamMax].endY = y + height;
|
||||
sprites[oamMax].cycles = cycles;
|
||||
sprites[oamMax].obj = obj;
|
||||
sprites[oamMax].index = i;
|
||||
++oamMax;
|
||||
if (GBAObjAttributesAGetY(obj.a) >= GBA_VIDEO_VERTICAL_PIXELS && GBAObjAttributesAGetY(obj.a) + height < VIDEO_VERTICAL_TOTAL_PIXELS) {
|
||||
continue;
|
||||
}
|
||||
if (GBAObjAttributesBGetX(obj.b) >= GBA_VIDEO_HORIZONTAL_PIXELS && GBAObjAttributesBGetX(obj.b) + width < 512) {
|
||||
continue;
|
||||
}
|
||||
int y = GBAObjAttributesAGetY(obj.a) + offsetY;
|
||||
sprites[oamMax].y = y;
|
||||
sprites[oamMax].endY = y + height;
|
||||
sprites[oamMax].cycles = cycles;
|
||||
sprites[oamMax].obj = obj;
|
||||
sprites[oamMax].index = i;
|
||||
++oamMax;
|
||||
}
|
||||
}
|
||||
return oamMax;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue