Skip to content

Commit

Permalink
Merge pull request pret#335 from jiangzhengwenjz/bg
Browse files Browse the repository at this point in the history
real match CopyTileMapEntry
  • Loading branch information
PikalaxALT authored Apr 27, 2020
2 parents dcc9306 + 57d561c commit b9a5646
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bg.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <limits.h>
#include "global.h"
#include "bg.h"
#include "dma3.h"
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b9a5646

Please sign in to comment.