mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 09:24:19 +01:00
match sub_810EE14 in flying.c
This commit is contained in:
parent
1e7f4a80c7
commit
1758eb99df
130
src/flying.c
130
src/flying.c
@ -1496,11 +1496,8 @@ void sub_810EDD0(struct Sprite *sprite)
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
void sub_810EE14(struct Sprite *sprite)
|
||||
{
|
||||
// NONMATCHING - Functionally equivalent - slight register swap at end
|
||||
|
||||
u32 matrixNum;
|
||||
int t1, t2;
|
||||
|
||||
@ -1540,16 +1537,9 @@ void sub_810EE14(struct Sprite *sprite)
|
||||
|
||||
if (t2 > 128)
|
||||
t2 = 128;
|
||||
|
||||
|
||||
/* NONMATCHING
|
||||
* compiles to:
|
||||
* asr r0, r0, #0x1
|
||||
strh r0, [r5, #0x26]
|
||||
* needed:
|
||||
* asrs r1, r0, 1
|
||||
* strh r1, [r5, 0x26] */
|
||||
sprite->pos2.y = (64 - t2) / 2;
|
||||
t2 = (64 - t2) / 2;
|
||||
sprite->pos2.y = t2;
|
||||
|
||||
if (sprite->data[2] == 24)
|
||||
{
|
||||
@ -1559,122 +1549,6 @@ void sub_810EE14(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
NAKED
|
||||
void sub_810EE14(struct Sprite *sprite)
|
||||
{
|
||||
asm_unified("push {r4,r5,lr}\n\
|
||||
sub sp, 0x4\n\
|
||||
adds r5, r0, 0\n\
|
||||
movs r1, 0x2E\n\
|
||||
ldrsh r0, [r5, r1]\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0810EE28\n\
|
||||
cmp r0, 0x1\n\
|
||||
beq _0810EE80\n\
|
||||
b _0810EEEC\n\
|
||||
_0810EE28:\n\
|
||||
ldr r0, =gBattleAnimArgs\n\
|
||||
movs r2, 0\n\
|
||||
ldrsh r0, [r0, r2]\n\
|
||||
cmp r0, 0\n\
|
||||
bne _0810EE40\n\
|
||||
ldr r4, =gBattleAnimAttacker\n\
|
||||
b _0810EE42\n\
|
||||
.pool\n\
|
||||
_0810EE40:\n\
|
||||
ldr r4, =gBattleAnimTarget\n\
|
||||
_0810EE42:\n\
|
||||
ldrb r0, [r4]\n\
|
||||
movs r1, 0\n\
|
||||
bl GetBattlerSpriteCoord\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r0, 24\n\
|
||||
strh r0, [r5, 0x20]\n\
|
||||
ldrb r0, [r4]\n\
|
||||
movs r1, 0x1\n\
|
||||
bl GetBattlerSpriteCoord\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r0, 24\n\
|
||||
strh r0, [r5, 0x22]\n\
|
||||
movs r0, 0\n\
|
||||
movs r3, 0x80\n\
|
||||
lsls r3, 2\n\
|
||||
strh r3, [r5, 0x30]\n\
|
||||
movs r2, 0x80\n\
|
||||
lsls r2, 1\n\
|
||||
str r0, [sp]\n\
|
||||
adds r0, r5, 0\n\
|
||||
movs r1, 0\n\
|
||||
bl TrySetSpriteRotScale\n\
|
||||
ldrh r0, [r5, 0x2E]\n\
|
||||
adds r0, 0x1\n\
|
||||
strh r0, [r5, 0x2E]\n\
|
||||
b _0810EEEC\n\
|
||||
.pool\n\
|
||||
_0810EE80:\n\
|
||||
movs r1, 0x32\n\
|
||||
ldrsh r0, [r5, r1]\n\
|
||||
cmp r0, 0xB\n\
|
||||
bgt _0810EE8E\n\
|
||||
ldrh r0, [r5, 0x30]\n\
|
||||
subs r0, 0x28\n\
|
||||
b _0810EE92\n\
|
||||
_0810EE8E:\n\
|
||||
ldrh r0, [r5, 0x30]\n\
|
||||
adds r0, 0x28\n\
|
||||
_0810EE92:\n\
|
||||
strh r0, [r5, 0x30]\n\
|
||||
ldrh r0, [r5, 0x32]\n\
|
||||
adds r0, 0x1\n\
|
||||
movs r1, 0\n\
|
||||
strh r0, [r5, 0x32]\n\
|
||||
movs r2, 0x80\n\
|
||||
lsls r2, 1\n\
|
||||
movs r0, 0x30\n\
|
||||
ldrsh r3, [r5, r0]\n\
|
||||
str r1, [sp]\n\
|
||||
adds r0, r5, 0\n\
|
||||
bl TrySetSpriteRotScale\n\
|
||||
ldrb r1, [r5, 0x3]\n\
|
||||
lsls r1, 26\n\
|
||||
lsrs r1, 27\n\
|
||||
movs r0, 0xF4\n\
|
||||
lsls r0, 6\n\
|
||||
ldr r2, =gOamMatrices\n\
|
||||
lsls r1, 3\n\
|
||||
adds r1, r2\n\
|
||||
movs r2, 0x6\n\
|
||||
ldrsh r1, [r1, r2]\n\
|
||||
bl __divsi3\n\
|
||||
adds r1, r0, 0x1\n\
|
||||
cmp r1, 0x80\n\
|
||||
ble _0810EECC\n\
|
||||
movs r1, 0x80\n\
|
||||
_0810EECC:\n\
|
||||
movs r0, 0x40\n\
|
||||
subs r0, r1\n\
|
||||
lsrs r1, r0, 31\n\
|
||||
adds r0, r1\n\
|
||||
asrs r1, r0, 1\n\
|
||||
strh r1, [r5, 0x26]\n\
|
||||
movs r1, 0x32\n\
|
||||
ldrsh r0, [r5, r1]\n\
|
||||
cmp r0, 0x18\n\
|
||||
bne _0810EEEC\n\
|
||||
adds r0, r5, 0\n\
|
||||
bl sub_80A749C\n\
|
||||
adds r0, r5, 0\n\
|
||||
bl DestroyAnimSprite\n\
|
||||
_0810EEEC:\n\
|
||||
add sp, 0x4\n\
|
||||
pop {r4,r5}\n\
|
||||
pop {r0}\n\
|
||||
bx r0\n\
|
||||
.pool\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_810EEF8(struct Sprite *sprite)
|
||||
{
|
||||
int v1, v2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user