mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Apply mask on DMEM address to avoid segmentation fault in Indiana Jones,
see #2628
This commit is contained in:
parent
6275140109
commit
e9a6f258af
|
@ -142,6 +142,7 @@ void F5INDI_DMA_Segmented(u32 _w0, u32 _w1)
|
||||||
static
|
static
|
||||||
void F5INDI_Lighting_Overlay1(u32 _w0, u32 _w1)
|
void F5INDI_Lighting_Overlay1(u32 _w0, u32 _w1)
|
||||||
{
|
{
|
||||||
|
static bool showErrorMessage = true;
|
||||||
const u32 S = ((_SHIFTR(_w1, 24, 7) << 2) + 4) & 0xFFF8;
|
const u32 S = ((_SHIFTR(_w1, 24, 7) << 2) + 4) & 0xFFF8;
|
||||||
memset(DMEM + 0xD40, 0, S);
|
memset(DMEM + 0xD40, 0, S);
|
||||||
|
|
||||||
|
@ -208,7 +209,12 @@ void F5INDI_Lighting_Overlay1(u32 _w0, u32 _w1)
|
||||||
++V;
|
++V;
|
||||||
s16 Z1 = (s16)_SHIFTR(*V, 16, 16);
|
s16 Z1 = (s16)_SHIFTR(*V, 16, 16);
|
||||||
|
|
||||||
V = CAST_DMEM(const u32*, 0x170 + offsetAddr[offsetAddrIdx^3]);
|
const u32 addr = 0x170 + offsetAddr[offsetAddrIdx ^ 3];
|
||||||
|
if (addr >= 0x1000 && showErrorMessage) {
|
||||||
|
dwnd().getDrawer().showMessage("Wrong data address detected!!! Please report to developers.\n", Milliseconds(5000));
|
||||||
|
showErrorMessage = false;
|
||||||
|
}
|
||||||
|
V = CAST_DMEM(const u32*, (addr&0x0FFC));
|
||||||
offsetAddrIdx++;
|
offsetAddrIdx++;
|
||||||
s16 X = (s16)_SHIFTR(*V, 16, 16);
|
s16 X = (s16)_SHIFTR(*V, 16, 16);
|
||||||
s16 Y = (s16)_SHIFTR(*V, 0, 16);
|
s16 Y = (s16)_SHIFTR(*V, 0, 16);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user