through sub_81515FC

This commit is contained in:
PikalaxALT 2017-10-28 16:09:31 -04:00
parent f57776c74c
commit 8613e8a54d
2 changed files with 31 additions and 84 deletions

View File

@ -5,78 +5,6 @@
.text
thumb_func_start sub_81515B0
sub_81515B0: @ 81515B0
push {lr}
lsls r0, 16
lsrs r0, 16
lsls r1, 16
asrs r1, 16
cmp r1, 0
beq _081515CC
lsls r0, 16
asrs r0, 8
bl __divsi3
lsls r0, 16
asrs r0, 16
b _081515CE
_081515CC:
movs r0, 0
_081515CE:
pop {r1}
bx r1
thumb_func_end sub_81515B0
thumb_func_start sub_81515D4
sub_81515D4: @ 81515D4
push {lr}
lsls r0, 24
lsrs r3, r0, 24
lsls r1, 16
lsrs r0, r1, 16
lsls r2, 16
asrs r1, r2, 16
cmp r1, 0
beq _081515F6
lsls r0, 16
asrs r0, 16
lsls r0, r3
bl __divsi3
lsls r0, 16
asrs r0, 16
b _081515F8
_081515F6:
movs r0, 0
_081515F8:
pop {r1}
bx r1
thumb_func_end sub_81515D4
thumb_func_start sub_81515FC
sub_81515FC: @ 81515FC
push {r4-r6,lr}
adds r6, r1, 0
cmp r6, 0
beq _0815161C
adds r2, r0, 0
asrs r3, r0, 31
lsrs r5, r2, 24
lsls r4, r3, 8
adds r1, r5, 0
orrs r1, r4
lsls r0, r2, 8
adds r2, r6, 0
asrs r3, r6, 31
bl __divdi3
b _0815161E
_0815161C:
movs r0, 0
_0815161E:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_81515FC
thumb_func_start sub_8151624
sub_8151624: @ 8151624
push {lr}

View File

@ -1,17 +1,5 @@
// Includes
#include "global.h"
// Static type declarations
// Static RAM declarations
// Static ROM declarations
// .rodata
// .text
s16 sub_8151534(s16 x, s16 y)
{
s32 result;
@ -41,3 +29,34 @@ s32 sub_8151574(s32 x, s32 y)
result /= 256;
return result;
}
s16 sub_81515B0(s16 x, s16 y)
{
if (y == 0)
{
return 0;
}
return (x << 8) / y;
}
s16 sub_81515D4(u8 s, s16 x, s16 y)
{
if (y == 0)
{
return 0;
}
return (x << s) / y;
}
s32 sub_81515FC(s32 x, s32 y)
{
s64 _x;
if (y == 0)
{
return 0;
}
_x = x;
_x *= 256;
return _x / y;
}