From 57d561cd8ffa3b4898220142f96e32586177f3e5 Mon Sep 17 00:00:00 2001 From: jiangzhengwenjz Date: Tue, 28 Apr 2020 05:33:49 +0800 Subject: [PATCH] CopyTileMapEntry --- src/bg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bg.c b/src/bg.c index 598f402aff..5db6903327 100644 --- a/src/bg.c +++ b/src/bg.c @@ -1,3 +1,4 @@ +#include #include "global.h" #include "bg.h" #include "dma3.h" @@ -1136,20 +1137,19 @@ void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s { u16 var; - if (palette1 == 16) - goto CASE_16; switch (palette1) { - case 0 ... 16: + case 0 ... 15: var = ((*src + tileOffset) & 0xFFF) + ((palette1 + palette2) << 12); break; - CASE_16: + case 16: var = *dest; var &= 0xFC00; var += palette2 << 12; var |= (*src + tileOffset) & 0x3FF; break; default: + case 17 ... INT_MAX: var = *src + tileOffset + (palette2 << 12); break; }