mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-28 11:44:30 -05:00
decomp sub_80A579C
This commit is contained in:
@@ -5,103 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80A579C
|
||||
sub_80A579C:
|
||||
push {r4-r7,lr}
|
||||
adds r6, r0, 0
|
||||
adds r5, r1, 0
|
||||
ldr r0, _080A5838
|
||||
ldr r3, [r0]
|
||||
cmp r3, 0
|
||||
beq _080A5854
|
||||
ldr r0, _080A583C
|
||||
ldr r0, [r0]
|
||||
adds r2, r0, 0
|
||||
adds r2, 0xE4
|
||||
movs r0, 0
|
||||
ldrsh r1, [r2, r0]
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
cmp r1, r0
|
||||
beq _080A5854
|
||||
adds r0, r1, 0
|
||||
lsls r4, r0, 1
|
||||
adds r4, r0
|
||||
lsls r4, 2
|
||||
ldr r0, _080A5840
|
||||
adds r4, r0
|
||||
adds r0, r3, 0
|
||||
adds r1, r6, 0
|
||||
adds r2, r5, 0
|
||||
bl GetDungeonBounds
|
||||
ldr r2, [r6]
|
||||
mov r12, r2
|
||||
movs r0, 0xF0
|
||||
lsls r0, 7
|
||||
add r0, r12
|
||||
str r0, [r6]
|
||||
ldr r3, [r6, 0x4]
|
||||
movs r7, 0xA0
|
||||
lsls r7, 7
|
||||
adds r0, r3, r7
|
||||
str r0, [r6, 0x4]
|
||||
ldr r2, [r5]
|
||||
ldr r1, _080A5844
|
||||
adds r0, r2, r1
|
||||
str r0, [r5]
|
||||
ldr r1, [r5, 0x4]
|
||||
ldr r7, _080A5848
|
||||
adds r0, r1, r7
|
||||
str r0, [r5, 0x4]
|
||||
movs r7, 0
|
||||
ldrsh r0, [r4, r7]
|
||||
cmp r0, 0xA
|
||||
bne _080A581E
|
||||
movs r0, 0x90
|
||||
lsls r0, 8
|
||||
add r0, r12
|
||||
str r0, [r6]
|
||||
movs r4, 0xD0
|
||||
lsls r4, 7
|
||||
adds r0, r3, r4
|
||||
str r0, [r6, 0x4]
|
||||
ldr r7, _080A584C
|
||||
adds r0, r2, r7
|
||||
str r0, [r5]
|
||||
ldr r2, _080A5850
|
||||
adds r0, r1, r2
|
||||
str r0, [r5, 0x4]
|
||||
_080A581E:
|
||||
ldr r1, [r6]
|
||||
ldr r0, [r5]
|
||||
cmp r1, r0
|
||||
ble _080A5828
|
||||
str r1, [r5]
|
||||
_080A5828:
|
||||
ldr r1, [r6, 0x4]
|
||||
ldr r0, [r5, 0x4]
|
||||
cmp r1, r0
|
||||
ble _080A5832
|
||||
str r1, [r5, 0x4]
|
||||
_080A5832:
|
||||
movs r0, 0x1
|
||||
b _080A5856
|
||||
.align 2, 0
|
||||
_080A5838: .4byte gGroundMapDungeon_3001B70
|
||||
_080A583C: .4byte gGroundMapAction
|
||||
_080A5840: .4byte gGroundMapConversionTable
|
||||
_080A5844: .4byte 0xffff8800
|
||||
_080A5848: .4byte 0xffffb000
|
||||
_080A584C: .4byte 0xffff7000
|
||||
_080A5850: .4byte 0xffff9800
|
||||
_080A5854:
|
||||
movs r0, 0
|
||||
_080A5856:
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80A579C
|
||||
|
||||
thumb_func_start CheckMapCollision_80A585C
|
||||
CheckMapCollision_80A585C:
|
||||
push {r4-r7,lr}
|
||||
|
||||
@@ -1113,3 +1113,38 @@ bool8 GetCurrentDungeonBounds(PixelPos *pos1, PixelPos *pos2)
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_80A579C(PixelPos *pos1, PixelPos *pos2)
|
||||
{
|
||||
const GroundConversionStruct *convTable;
|
||||
|
||||
if(gGroundMapDungeon_3001B70 != NULL)
|
||||
{
|
||||
if(gGroundMapAction->groundMapId != -1)
|
||||
{
|
||||
convTable = &gGroundMapConversionTable[gGroundMapAction->groundMapId];
|
||||
GetDungeonBounds(gGroundMapDungeon_3001B70, pos1, pos2);
|
||||
|
||||
pos1->x += 0x7800;
|
||||
pos1->y += 0x5000;
|
||||
pos2->x -= 0x7800;
|
||||
pos2->y -= 0x5000;
|
||||
|
||||
if(convTable->unk0 == 0xA)
|
||||
{
|
||||
pos1->x += 0x1800;
|
||||
pos1->y += 0x1800;
|
||||
pos2->x -= 0x1800;
|
||||
pos2->y -= 0x1800;
|
||||
}
|
||||
|
||||
if (pos1->x > pos2->x) {
|
||||
pos2->x = pos1->x;
|
||||
}
|
||||
if (pos1->y > pos2->y) {
|
||||
pos2->y = pos1->y;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user