npc_load_two_palettes__no_record

This commit is contained in:
scnorton 2017-09-08 17:58:41 -04:00
parent 5a020a47f3
commit dddb44e301
3 changed files with 25 additions and 53 deletions

View File

@ -5,59 +5,6 @@
.text
thumb_func_start npc_load_two_palettes__no_record
@ void npc_load_two_palettes__no_record(u16 tag, u8 slot)
npc_load_two_palettes__no_record: @ 808E9C8
push {r4-r6,lr}
lsls r0, 16
lsrs r4, r0, 16
lsls r1, 24
lsrs r5, r1, 24
adds r0, r4, 0
adds r1, r5, 0
bl pal_patch_for_npc
movs r3, 0
ldr r1, =gUnknown_0850BD00
ldrh r0, [r1]
ldr r2, =0x000011ff
cmp r0, r2
beq _0808EA30
ldr r0, =gUnknown_084975C4
adds r5, r0
adds r6, r2, 0
_0808E9EC:
lsls r2, r3, 3
adds r0, r2, r1
ldrh r0, [r0]
cmp r0, r4
bne _0808EA20
adds r1, 0x4
adds r1, r2, r1
ldr r0, =gUnknown_020375B4
ldrb r0, [r0]
ldr r1, [r1]
lsls r0, 1
adds r0, r1
ldrh r0, [r0]
ldrb r1, [r5]
bl pal_patch_for_npc
b _0808EA30
.pool
_0808EA20:
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
lsls r0, r3, 3
adds r0, r1
ldrh r0, [r0]
cmp r0, r6
bne _0808E9EC
_0808EA30:
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end npc_load_two_palettes__no_record
thumb_func_start npc_load_two_palettes__and_record
@ void npc_load_two_palettes__and_record(u16 tag, u8 slot)
npc_load_two_palettes__and_record: @ 808EA38

View File

@ -5,6 +5,13 @@
#ifndef POKEEMERALD_DATA3_H
#define POKEEMERALD_DATA3_H
struct PairedPalettes {
u16 tag;
const u16 *data;
};
extern const struct SpritePalette gUnknown_0850BBC8[];
extern const struct PairedPalettes gUnknown_0850BD00[15];
extern u8 gUnknown_084975C4[0x10];
#endif //POKEEMERALD_DATA3_H

View File

@ -23,6 +23,9 @@
// Static RAM declarations
extern u8 gUnknown_020375B4;
extern u16 gUnknown_020375B6;
// Static ROM declarations
static void sub_808D450(void);
@ -1177,3 +1180,18 @@ static u8 FindFieldObjectPaletteIndexByTag(u16 tag)
}
return 0xff;
}
void npc_load_two_palettes__no_record(u16 tag, u8 slot)
{
u8 i;
pal_patch_for_npc(tag, slot);
for (i = 0; gUnknown_0850BD00[i].tag != 0x11ff; i ++)
{
if (gUnknown_0850BD00[i].tag == tag)
{
pal_patch_for_npc(gUnknown_0850BD00[i].data[gUnknown_020375B4], gUnknown_084975C4[slot]);
return;
}
}
}