sub_808EB08
This commit is contained in:
@@ -5,85 +5,6 @@
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
thumb_func_start sub_808EB08
|
|
||||||
sub_808EB08: @ 808EB08
|
|
||||||
push {r4-r7,lr}
|
|
||||||
mov r7, r8
|
|
||||||
push {r7}
|
|
||||||
adds r6, r0, 0
|
|
||||||
adds r4, r1, 0
|
|
||||||
adds r5, r2, 0
|
|
||||||
lsls r4, 16
|
|
||||||
lsrs r4, 16
|
|
||||||
lsls r5, 16
|
|
||||||
lsrs r5, 16
|
|
||||||
ldrb r1, [r6, 0x4]
|
|
||||||
lsls r0, r1, 4
|
|
||||||
adds r0, r1
|
|
||||||
lsls r0, 2
|
|
||||||
ldr r1, =gSprites
|
|
||||||
adds r7, r0, r1
|
|
||||||
ldrb r0, [r6, 0x5]
|
|
||||||
bl GetFieldObjectGraphicsInfo
|
|
||||||
mov r8, r0
|
|
||||||
lsls r4, 16
|
|
||||||
asrs r4, 16
|
|
||||||
lsls r5, 16
|
|
||||||
asrs r5, 16
|
|
||||||
adds r0, r6, 0
|
|
||||||
adds r1, r4, 0
|
|
||||||
adds r2, r5, 0
|
|
||||||
bl npc_coords_set
|
|
||||||
movs r1, 0x10
|
|
||||||
ldrsh r0, [r6, r1]
|
|
||||||
movs r2, 0x12
|
|
||||||
ldrsh r1, [r6, r2]
|
|
||||||
adds r2, r7, 0
|
|
||||||
adds r2, 0x20
|
|
||||||
adds r3, r7, 0
|
|
||||||
adds r3, 0x22
|
|
||||||
bl sub_8093038
|
|
||||||
mov r1, r8
|
|
||||||
ldrh r0, [r1, 0x8]
|
|
||||||
lsls r0, 16
|
|
||||||
asrs r0, 17
|
|
||||||
negs r0, r0
|
|
||||||
adds r1, r7, 0
|
|
||||||
adds r1, 0x28
|
|
||||||
strb r0, [r1]
|
|
||||||
mov r2, r8
|
|
||||||
ldrh r0, [r2, 0xA]
|
|
||||||
lsls r0, 16
|
|
||||||
asrs r0, 17
|
|
||||||
negs r0, r0
|
|
||||||
adds r2, r7, 0
|
|
||||||
adds r2, 0x29
|
|
||||||
strb r0, [r2]
|
|
||||||
ldrh r0, [r7, 0x20]
|
|
||||||
adds r0, 0x8
|
|
||||||
strh r0, [r7, 0x20]
|
|
||||||
ldrh r1, [r7, 0x22]
|
|
||||||
adds r1, 0x10
|
|
||||||
movs r0, 0
|
|
||||||
ldrsb r0, [r2, r0]
|
|
||||||
adds r0, r1
|
|
||||||
strh r0, [r7, 0x22]
|
|
||||||
adds r0, r6, 0
|
|
||||||
bl sub_808E38C
|
|
||||||
ldrb r0, [r6, 0x1]
|
|
||||||
lsrs r0, 7
|
|
||||||
cmp r0, 0
|
|
||||||
beq _0808EB9A
|
|
||||||
bl CameraObjectReset1
|
|
||||||
_0808EB9A:
|
|
||||||
pop {r3}
|
|
||||||
mov r8, r3
|
|
||||||
pop {r4-r7}
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
.pool
|
|
||||||
thumb_func_end sub_808EB08
|
|
||||||
|
|
||||||
thumb_func_start sub_808EBA8
|
thumb_func_start sub_808EBA8
|
||||||
sub_808EBA8: @ 808EBA8
|
sub_808EBA8: @ 808EBA8
|
||||||
push {r4,r5,lr}
|
push {r4,r5,lr}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ void sub_808E78C(u8, u8, u8, u8);
|
|||||||
void sub_808E75C(s16, s16);
|
void sub_808E75C(s16, s16);
|
||||||
void FieldObjectGetLocalIdAndMap(struct MapObject *, u8 *, u8 *, u8 *);
|
void FieldObjectGetLocalIdAndMap(struct MapObject *, u8 *, u8 *, u8 *);
|
||||||
void npc_coords_shift(struct MapObject *, s16, s16);
|
void npc_coords_shift(struct MapObject *, s16, s16);
|
||||||
|
void sub_808EB08(struct MapObject *, s16, s16);
|
||||||
|
|
||||||
// Exported data declarations
|
// Exported data declarations
|
||||||
|
|
||||||
|
|||||||
@@ -1242,3 +1242,23 @@ void npc_coords_shift(struct MapObject *mapObject, s16 x, s16 y)
|
|||||||
mapObject->coords2.y = y;
|
mapObject->coords2.y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sub_808EB08(struct MapObject *mapObject, s16 x, s16 y)
|
||||||
|
{
|
||||||
|
struct Sprite *sprite;
|
||||||
|
const struct MapObjectGraphicsInfo *graphicsInfo;
|
||||||
|
|
||||||
|
sprite = &gSprites[mapObject->spriteId];
|
||||||
|
graphicsInfo = GetFieldObjectGraphicsInfo(mapObject->graphicsId);
|
||||||
|
npc_coords_set(mapObject, x, y);
|
||||||
|
sub_8093038(mapObject->coords2.x, mapObject->coords2.y, &sprite->pos1.x, &sprite->pos1.y);
|
||||||
|
sprite->centerToCornerVecX = -(graphicsInfo->width >> 1);
|
||||||
|
sprite->centerToCornerVecY = -(graphicsInfo->height >> 1);
|
||||||
|
sprite->pos1.x += 8;
|
||||||
|
sprite->pos1.y += 16 + sprite->centerToCornerVecY;
|
||||||
|
sub_808E38C(mapObject);
|
||||||
|
if (mapObject->mapobj_bit_15)
|
||||||
|
{
|
||||||
|
CameraObjectReset1();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user