mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Fix rare crash in modes 3-5
This commit is contained in:
parent
cdc7535167
commit
73efec2a02
1
CHANGES
1
CHANGES
|
@ -27,6 +27,7 @@ Emulation fixes:
|
|||
- GBA Video: Fix OpenGL rendering on M1 Macs
|
||||
- GBA Video: Ignore horizontally off-screen sprite timing (fixes mgba.io/i/2391)
|
||||
- GBA Video: Fix Hblank timing (fixes mgba.io/i/2131, mgba.io/i/2310)
|
||||
- GBA Video: Fix rare crash in modes 3-5
|
||||
Other fixes:
|
||||
- Core: Don't attempt to restore rewind diffs past start of rewind
|
||||
- FFmpeg: Fix crash when encoding audio with some containers
|
||||
|
|
|
@ -108,7 +108,7 @@ void GBAVideoSoftwareRendererDrawBackgroundMode3(struct GBAVideoSoftwareRenderer
|
|||
BACKGROUND_BITMAP_INIT;
|
||||
|
||||
uint32_t color = renderer->normalPalette[0];
|
||||
if (mosaicWait && localX >= 0 && localY >= 0) {
|
||||
if (mosaicWait && localX >= 0 && localY >= 0 && (localX >> 8) < GBA_VIDEO_HORIZONTAL_PIXELS && (localY >> 8) < GBA_VIDEO_VERTICAL_PIXELS) {
|
||||
LOAD_16(color, ((localX >> 8) + (localY >> 8) * GBA_VIDEO_HORIZONTAL_PIXELS) << 1, renderer->d.vram);
|
||||
color = mColorFrom555(color);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ void GBAVideoSoftwareRendererDrawBackgroundMode4(struct GBAVideoSoftwareRenderer
|
|||
if (GBARegisterDISPCNTIsFrameSelect(renderer->dispcnt)) {
|
||||
offset = 0xA000;
|
||||
}
|
||||
if (mosaicWait && localX >= 0 && localY >= 0) {
|
||||
if (mosaicWait && localX >= 0 && localY >= 0 && (localX >> 8) < GBA_VIDEO_HORIZONTAL_PIXELS && (localY >> 8) < GBA_VIDEO_VERTICAL_PIXELS) {
|
||||
color = ((uint8_t*)renderer->d.vram)[offset + (localX >> 8) + (localY >> 8) * GBA_VIDEO_HORIZONTAL_PIXELS];
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ void GBAVideoSoftwareRendererDrawBackgroundMode5(struct GBAVideoSoftwareRenderer
|
|||
if (GBARegisterDISPCNTIsFrameSelect(renderer->dispcnt)) {
|
||||
offset = 0xA000;
|
||||
}
|
||||
if (mosaicWait && localX >= 0 && localY >= 0) {
|
||||
if (mosaicWait && localX >= 0 && localY >= 0 && (localX >> 8) < 160 && (localY >> 8) < 128) {
|
||||
LOAD_16(color, offset + (localX >> 8) * 2 + (localY >> 8) * 320, renderer->d.vram);
|
||||
color = mColorFrom555(color);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue