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
c41d1e18dc
commit
d1bc394ca3
1
CHANGES
1
CHANGES
|
@ -22,6 +22,7 @@ Emulation fixes:
|
|||
- GBA I/O: Disable open bus behavior on invalid register 06A
|
||||
- GBA Memory: Fix misaligned 32-bit I/O loads (fixes mgba.io/i/2307)
|
||||
- GBA Video: Fix OpenGL rendering on M1 Macs
|
||||
- GBA Video: Ignore horizontally off-screen sprite timing (fixes mgba.io/i/2391)
|
||||
Other fixes:
|
||||
- Core: Don't attempt to restore rewind diffs past start of rewind
|
||||
- FFmpeg: Fix crash when encoding audio with some containers
|
||||
|
|
|
@ -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