aboutsummaryrefslogtreecommitdiff
path: root/GPU2D.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'GPU2D.cpp')
-rw-r--r--GPU2D.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/GPU2D.cpp b/GPU2D.cpp
index 81cc4fb..2b9d487 100644
--- a/GPU2D.cpp
+++ b/GPU2D.cpp
@@ -484,6 +484,7 @@ void GPU2D::DrawSprite_Rotscale(u16* attrib, u16* rotparams, u32 boundwidth, u32
tilenum <<= 5;
ytilefactor <<= 5;
u8* pixels = (Num ? GPU::VRAM_BOBJ : GPU::VRAM_AOBJ)[tilenum >> 14];
+ if (!pixels) return;
pixels += (tilenum & 0x3FFF);
u16* pal = (u16*)&GPU::Palette[Num ? 0x600 : 0x200];
@@ -553,6 +554,7 @@ void GPU2D::DrawSprite_Normal(u16* attrib, u32 width, s32 xpos, u32 ypos, u32* d
// 16-color
tilenum <<= 5;
u8* pixels = (Num ? GPU::VRAM_BOBJ : GPU::VRAM_AOBJ)[tilenum >> 14];
+ if (!pixels) return;
pixels += (tilenum & 0x3FFF);
pixels += ((ypos & 0x7) << 2);