diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-07-13 15:24:22 +0300 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-07-13 15:24:22 +0300 |
| commit | 09602b00af1c426074c8886b3f3bc93e31f334bd (patch) | |
| tree | b15570ce9c36de98b995256c9e1f13606e23471f /src/color.c | |
| parent | 4ef3f4e351b81b706ce6013ae84b17d013e4ca5a (diff) | |
Putting some nonmatch functions from site
Diffstat (limited to 'src/color.c')
| -rw-r--r-- | src/color.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/color.c b/src/color.c index 20c2d321..28a16e93 100644 --- a/src/color.c +++ b/src/color.c @@ -152,7 +152,31 @@ u32 FindFreeObjPalette(u32 a1) { return 0xffffffff; } -ASM_FUNC("asm/non_matching/color/SetEntityObjPalette.inc", void SetEntityObjPalette(Entity* entity, u32 palette)); +NONMATCH("asm/non_matching/color/SetEntityObjPalette.inc", void SetEntityObjPalette(Entity* entity, u32 palette)) { + u32 uVar1; + Palette* pPVar1; + + if (palette < 0) { + palette = 0; + } + if (0x7e < (u8)(entity->spriteAnimation[2] - 1)) { + entity->spriteAnimation[1] = palette; + } + entity->palette.b.b0 = palette; + entity->palette.b.b4 = palette; + pPVar1 = &gPaletteList[palette]; + if ((s8)pPVar1->_0_0 != 4) { + pPVar1->_1++; + uVar1 = pPVar1->_0_4; + pPVar1->_0_0 = 3; + while (uVar1 = uVar1 - 1, uVar1 != 0) { + pPVar1 = pPVar1 + 1; + pPVar1->_0_4 = uVar1; + pPVar1->_0_0 = 2; + } + } +} +END_NONMATCH void UnloadOBJPalette(Entity* entity) { u8* p = &entity->spriteAnimation[1]; |
