From 98d254fb4ffebf6a523acc62fc0d1c862bbb402f Mon Sep 17 00:00:00 2001 From: shashclp Date: Sun, 4 Mar 2007 18:05:15 +0000 Subject: [PATCH] - Fixed a memory corruption when double sized sprites were used at screen borders --- desmume/src/GPU.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/desmume/src/GPU.c b/desmume/src/GPU.c index aaa2fe2dd..97db5440e 100644 --- a/desmume/src/GPU.c +++ b/desmume/src/GPU.c @@ -1123,7 +1123,7 @@ void sprite1D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab) if(sprX<0) { // If sprite is not in the window - if(sprX+sprSize.x<=0) + if(sprX + fieldX <= 0) continue; // Otherwise, is partially visible @@ -1134,7 +1134,7 @@ void sprite1D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab) } else { - if(sprX+sprSize.x>256) + if(sprX+fieldX>256) lg = 255 - sprX; } @@ -1238,7 +1238,7 @@ void sprite1D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab) // is performed realX += dx; realY += dy; - } + } continue; } @@ -1365,7 +1365,7 @@ void sprite2D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab) if(sprX<0) { // If sprite is not in the window - if(sprX+sprSize.x<=0) + if(sprX + fieldX <= 0) continue; // Otherwise, is partially visible @@ -1376,7 +1376,7 @@ void sprite2D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab) } else { - if(sprX+sprSize.x>256) + if(sprX+fieldX>256) lg = 255 - sprX; }