npc_paltag_set_load
This commit is contained in:
parent
c6ef344262
commit
9286c93c8a
4 changed files with 51 additions and 100 deletions
|
@ -5,102 +5,6 @@
|
|||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_808F28C
|
||||
sub_808F28C: @ 808F28C
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
lsls r3, 24
|
||||
lsrs r4, r3, 24
|
||||
mov r3, sp
|
||||
bl TryGetFieldObjectIdByLocalIdAndMap
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _0808F2E8
|
||||
cmp r4, 0x6
|
||||
beq _0808F2B6
|
||||
cmp r4, 0x7
|
||||
beq _0808F2D4
|
||||
b _0808F2E8
|
||||
_0808F2B6:
|
||||
mov r0, sp
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =gMapObjects
|
||||
adds r0, r1
|
||||
ldr r1, =gUnknown_082766A2
|
||||
bl sub_808F228
|
||||
b _0808F2E8
|
||||
.pool
|
||||
_0808F2D4:
|
||||
mov r0, sp
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =gMapObjects
|
||||
adds r0, r1
|
||||
ldr r1, =gUnknown_082766A6
|
||||
bl sub_808F228
|
||||
_0808F2E8:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_808F28C
|
||||
|
||||
thumb_func_start npc_paltag_set_load
|
||||
npc_paltag_set_load: @ 808F2F8
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
bl gpu_pal_allocator_reset__manage_upper_four
|
||||
ldr r1, =gUnknown_020375B6
|
||||
ldr r2, =0x000011ff
|
||||
adds r0, r2, 0
|
||||
strh r0, [r1]
|
||||
ldr r2, =gUnknown_020375B4
|
||||
strb r4, [r2]
|
||||
cmp r4, 0x1
|
||||
bne _0808F344
|
||||
ldr r1, =gUnknown_0850BE38
|
||||
ldrb r0, [r2]
|
||||
lsls r0, 2
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
movs r1, 0
|
||||
movs r2, 0x6
|
||||
bl pal_patch_for_npc_range
|
||||
ldr r1, =gReservedSpritePaletteCount
|
||||
movs r0, 0x8
|
||||
strb r0, [r1]
|
||||
b _0808F356
|
||||
.pool
|
||||
_0808F344:
|
||||
ldr r0, =gUnknown_0850BE38
|
||||
ldrb r1, [r2]
|
||||
lsls r1, 2
|
||||
adds r1, r0
|
||||
ldr r0, [r1]
|
||||
movs r1, 0
|
||||
movs r2, 0xA
|
||||
bl pal_patch_for_npc_range
|
||||
_0808F356:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end npc_paltag_set_load
|
||||
|
||||
thumb_func_start npc_paltag_by_palslot
|
||||
npc_paltag_by_palslot: @ 808F360
|
||||
push {r4-r6,lr}
|
||||
|
|
7
include/data3.h
Normal file → Executable file
7
include/data3.h
Normal file → Executable file
|
@ -10,11 +10,12 @@ struct PairedPalettes {
|
|||
const u16 *data;
|
||||
};
|
||||
|
||||
extern const struct SpritePalette gUnknown_0850BBC8[];
|
||||
extern const struct PairedPalettes gUnknown_0850BD00[15];
|
||||
extern const struct PairedPalettes gUnknown_0850BD78[15];
|
||||
extern u8 gUnknown_084975C4[0x10];
|
||||
extern const struct SpriteTemplate gUnknown_084975D4;
|
||||
extern void (*const gUnknown_084975EC[3])(struct Sprite *);
|
||||
extern const struct SpritePalette gUnknown_0850BBC8[];
|
||||
extern const struct PairedPalettes gUnknown_0850BD00[15];
|
||||
extern const struct PairedPalettes gUnknown_0850BD78[15];
|
||||
extern const u16 *const gUnknown_0850BE38[2];
|
||||
|
||||
#endif //POKEEMERALD_DATA3_H
|
||||
|
|
11
include/event_scripts.h
Executable file
11
include/event_scripts.h
Executable file
|
@ -0,0 +1,11 @@
|
|||
//
|
||||
// Created by scott on 9/12/2017.
|
||||
//
|
||||
|
||||
#ifndef POKEEMERALD_EVENT_SCRIPTS_H
|
||||
#define POKEEMERALD_EVENT_SCRIPTS_H
|
||||
|
||||
extern const u8 gUnknown_082766A2[];
|
||||
extern const u8 gUnknown_082766A6[];
|
||||
|
||||
#endif //POKEEMERALD_EVENT_SCRIPTS_H
|
|
@ -5,6 +5,7 @@
|
|||
#include "sprite.h"
|
||||
#include "rom4.h"
|
||||
#include "data3.h"
|
||||
#include "event_scripts.h"
|
||||
#include "berry.h"
|
||||
#include "palette.h"
|
||||
#include "field_player_avatar.h"
|
||||
|
@ -1163,7 +1164,7 @@ void pal_patch_for_npc(u16 paletteTag, u8 paletteSlot)
|
|||
LoadPalette(gUnknown_0850BBC8[paletteIdx].data, 16 * paletteSlot + 256, 0x20);
|
||||
}
|
||||
|
||||
void pal_patch_for_npc_range(u16 *paletteTags, u8 minSlot, u8 maxSlot)
|
||||
void pal_patch_for_npc_range(const u16 *paletteTags, u8 minSlot, u8 maxSlot)
|
||||
{
|
||||
while (minSlot < maxSlot)
|
||||
{
|
||||
|
@ -1639,3 +1640,37 @@ void sub_808F254(u8 localId, u8 mapNum, u8 mapGroup)
|
|||
sub_808F208(&gMapObjects[mapObjectId]);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 action)
|
||||
{
|
||||
u8 mapObjectId;
|
||||
|
||||
if (!TryGetFieldObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &mapObjectId))
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case 6:
|
||||
sub_808F228(&gMapObjects[mapObjectId], gUnknown_082766A2);
|
||||
break;
|
||||
case 7:
|
||||
sub_808F228(&gMapObjects[mapObjectId], gUnknown_082766A6);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void npc_paltag_set_load(u8 a0)
|
||||
{
|
||||
gpu_pal_allocator_reset__manage_upper_four();
|
||||
gUnknown_020375B6 = 0x11ff;
|
||||
gUnknown_020375B4 = a0;
|
||||
if (a0 == 1)
|
||||
{
|
||||
pal_patch_for_npc_range(gUnknown_0850BE38[gUnknown_020375B4], 0, 6);
|
||||
gReservedSpritePaletteCount = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
pal_patch_for_npc_range(gUnknown_0850BE38[gUnknown_020375B4], 0, 10);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue