diff options
Diffstat (limited to 'src/pokedex.c')
-rw-r--r-- | src/pokedex.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/pokedex.c b/src/pokedex.c index 606642221..6146bcc05 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -5238,22 +5238,20 @@ static void Task_ExitSearchWaitForFade(u8 taskId) void SetSearchRectHighlight(u8 flags, u8 x, u8 y, u8 width) { - u16 i; + u16 i, temp; //This would have been better as a pointer but here we are u32 ptr = (u32)GetBgTilemapBuffer(3); //this should be a pointer, but this only matches as a u32. - u16 temp; //This would have been better as a pointer but here we are for (i = 0; i < width; i++) { - temp = *(u16 *)(ptr + y * 64 + (x + i) * 2); - - temp &= 0xFFF; - temp |= (flags << 12); - *(u16 *)(ptr + (y*64 + (x + i)*2)) = temp; - - temp = *(u16 *)(ptr + (y + 1)*64 + (x + i)*2); - temp &= 0xFFF; - temp |= (flags << 12); - *(u16 *)(ptr + (y + 1)*64 + (x + i)*2)) = temp; + temp = *(u16 *)(ptr + (y+0)*64 + (x+i)*2); + temp &= 0x0fff; + temp |= (flags << 12); + *(u16 *)(ptr + (y+0)*64 + (x+i)*2) = temp; + + temp = *(u16 *)(ptr + (y+1)*64 + (x+i)*2); + temp &= 0x0fff; + temp |= (flags << 12); + *(u16 *)(ptr + (y+1)*64 + (x+i)*2) = temp; } } |