mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Fix rare crash in modes 3-5
This commit is contained in:
parent
2d2aaaf3a0
commit
c759fbf65c
1
CHANGES
1
CHANGES
|
@ -3,6 +3,7 @@ Emulation fixes:
|
||||||
- GB Serialize: Fix loading MBC1 states that affect bank 0 (fixes mgba.io/i/2402)
|
- GB Serialize: Fix loading MBC1 states that affect bank 0 (fixes mgba.io/i/2402)
|
||||||
- GBA I/O: Disable open bus behavior on invalid register 06A
|
- GBA I/O: Disable open bus behavior on invalid register 06A
|
||||||
- GBA Video: Ignore horizontally off-screen sprite timing (fixes mgba.io/i/2391)
|
- GBA Video: Ignore horizontally off-screen sprite timing (fixes mgba.io/i/2391)
|
||||||
|
- GBA Video: Fix rare crash in modes 3-5
|
||||||
Other fixes:
|
Other fixes:
|
||||||
- FFmpeg: Fix crash when encoding audio with some containers
|
- FFmpeg: Fix crash when encoding audio with some containers
|
||||||
- FFmpeg: Fix GIF recording (fixes mgba.io/i/2393)
|
- FFmpeg: Fix GIF recording (fixes mgba.io/i/2393)
|
||||||
|
|
|
@ -158,7 +158,7 @@ void GBAVideoSoftwareRendererDrawBackgroundMode3(struct GBAVideoSoftwareRenderer
|
||||||
BACKGROUND_BITMAP_INIT;
|
BACKGROUND_BITMAP_INIT;
|
||||||
|
|
||||||
uint32_t color = renderer->normalPalette[0];
|
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);
|
LOAD_16(color, ((localX >> 8) + (localY >> 8) * GBA_VIDEO_HORIZONTAL_PIXELS) << 1, renderer->d.vram);
|
||||||
color = mColorFrom555(color);
|
color = mColorFrom555(color);
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ void GBAVideoSoftwareRendererDrawBackgroundMode4(struct GBAVideoSoftwareRenderer
|
||||||
if (GBARegisterDISPCNTIsFrameSelect(renderer->dispcnt)) {
|
if (GBARegisterDISPCNTIsFrameSelect(renderer->dispcnt)) {
|
||||||
offset = 0xA000;
|
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];
|
color = ((uint8_t*)renderer->d.vram)[offset + (localX >> 8) + (localY >> 8) * GBA_VIDEO_HORIZONTAL_PIXELS];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ void GBAVideoSoftwareRendererDrawBackgroundMode5(struct GBAVideoSoftwareRenderer
|
||||||
if (GBARegisterDISPCNTIsFrameSelect(renderer->dispcnt)) {
|
if (GBARegisterDISPCNTIsFrameSelect(renderer->dispcnt)) {
|
||||||
offset = 0xA000;
|
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);
|
LOAD_16(color, offset + (localX >> 8) * 2 + (localY >> 8) * 320, renderer->d.vram);
|
||||||
color = mColorFrom555(color);
|
color = mColorFrom555(color);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue