Match sub_080ADDD8

This commit is contained in:
Tal Hayon 2022-06-29 14:16:31 +03:00
parent 430bcd5493
commit eb2cf39bcf
2 changed files with 6 additions and 44 deletions

View File

@ -1,39 +0,0 @@
.syntax unified
push {lr}
adds r2, r1, #0
lsls r1, r0, #1
adds r1, r1, r0
lsls r1, r1, #2
ldr r0, _080ADDFC @ =gUnk_02024494
adds r3, r1, r0
ldr r0, _080ADE00 @ =0x00FFFFFC
ands r0, r2
ldr r1, _080ADE04 @ =gGlobalGfxAndPalettes
adds r0, r0, r1
str r0, [r3, #8]
movs r0, #1
ands r0, r2
cmp r0, #0
beq _080ADE0C
ldr r0, _080ADE08 @ =0x0000FFFF
b _080ADE14
.align 2, 0
_080ADDFC: .4byte gUnk_02024494
_080ADE00: .4byte 0x00FFFFFC
_080ADE04: .4byte gGlobalGfxAndPalettes
_080ADE08: .4byte 0x0000FFFF
_080ADE0C:
movs r0, #0xfe
lsls r0, r0, #0x17
ands r0, r2
lsrs r0, r0, #0x14
_080ADE14:
strh r0, [r3, #6]
ldrb r0, [r3]
movs r1, #0xf
ands r1, r0
movs r0, #0x30
orrs r1, r0
strb r1, [r3]
pop {pc}
.syntax divided

View File

@ -64,18 +64,19 @@ void sub_080ADD70(void) {
}
}
NONMATCH("asm/non_matching/vram/sub_080ADDD8.inc", void sub_080ADDD8(u32 index, u32 paletteIndex)) {
void sub_080ADDD8(u32 index, u32 paletteIndex) {
GfxSlot* slot = &gGFXSlots.slots[index];
u32 temp;
slot->palettePointer = gGlobalGfxAndPalettes + (paletteIndex & 0xfffffc);
if ((paletteIndex & 1) != 0) {
slot->paletteIndex = 0xffff;
temp = 0xffff;
} else {
// TODO some cast here?
slot->paletteIndex = ((paletteIndex)&0x7f00) >> 4;
// @ TODO probably a bitfield
temp = ((paletteIndex)&0x7f000000) >> 0x14;
}
slot->paletteIndex = temp;
slot->vramStatus = GFX_VRAM_3;
}
END_NONMATCH
void sub_080ADE24(void) {
u32 index;