mirror of https://github.com/zeldaret/tmc.git
Move top three functions of D30 to CD4 and rename
This commit is contained in:
parent
d20ff87948
commit
4a01f2f7d7
|
|
@ -428,7 +428,7 @@ SECTIONS {
|
|||
src/enemy/enemy66.o(.text);
|
||||
/* END enemies */
|
||||
src/code_08049CD4.o(.text); /* enemyUtils.c */
|
||||
src/code_08049D30.o(.text);
|
||||
src/code_08049DF4.o(.text);
|
||||
src/enemyUtils.o(.text);
|
||||
src/createEnemy.o(.text);
|
||||
src/enterPortalSubtask.o(.text);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
|
||||
extern void MemFill32(u32, void*, u32);
|
||||
|
||||
void sub_08049DCC(RoomMemory*);
|
||||
RoomMemory* sub_08049D88(void);
|
||||
|
||||
void ClearRoomMemory(void) {
|
||||
MemFill32(0xFFFFFFFF, gRoomMemory, 0x40);
|
||||
gUnk_020354B0 = gRoomMemory;
|
||||
|
|
@ -23,3 +26,53 @@ u32 sub_08049D1C(u32 arg0) {
|
|||
output &= ~bitmask;
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
void UpdateRoomTracker(void) {
|
||||
gUnk_020354B0 = gRoomMemory;
|
||||
|
||||
do {
|
||||
if (gUnk_020354B0->area == gRoomControls.area && gUnk_020354B0->room == gRoomControls.room) {
|
||||
sub_08049DCC(gUnk_020354B0);
|
||||
return;
|
||||
}
|
||||
gUnk_020354B0++;
|
||||
|
||||
} while (gUnk_020354B0 < gRoomMemory + 8);
|
||||
gUnk_020354B0 = sub_08049D88();
|
||||
}
|
||||
|
||||
RoomMemory* sub_08049D88(void) {
|
||||
RoomMemory* r4 = gRoomMemory;
|
||||
RoomMemory* r1 = r4 + 1;
|
||||
|
||||
do {
|
||||
if (r1->unk_02 > r4->unk_02) {
|
||||
r4 = r1;
|
||||
}
|
||||
r1++;
|
||||
} while (r1 < gRoomMemory + 8);
|
||||
|
||||
r4->area = gRoomControls.area;
|
||||
r4->room = gRoomControls.room;
|
||||
|
||||
r4->unk_02 = 0xFFFF;
|
||||
r4->unk_04 = 0;
|
||||
|
||||
sub_08049DCC(r4);
|
||||
|
||||
return r4;
|
||||
}
|
||||
|
||||
void sub_08049DCC(RoomMemory* rm) {
|
||||
RoomMemory* r1 = gRoomMemory;
|
||||
|
||||
do {
|
||||
if (r1->unk_02 < rm->unk_02) {
|
||||
r1->unk_02++;
|
||||
}
|
||||
r1++;
|
||||
} while (r1 < gRoomMemory + 8);
|
||||
|
||||
rm->unk_02 = 0;
|
||||
}
|
||||
|
|
@ -10,58 +10,6 @@ extern Entity* (*const gUnk_080D3BE8[])(void);
|
|||
|
||||
extern void ReplaceMonitoredEntity(Entity*, Entity*);
|
||||
|
||||
void sub_08049DCC(RoomMemory*);
|
||||
RoomMemory* sub_08049D88(void);
|
||||
|
||||
void UpdateRoomTracker(void) {
|
||||
gUnk_020354B0 = gRoomMemory;
|
||||
|
||||
do {
|
||||
if (gUnk_020354B0->area == gRoomControls.area && gUnk_020354B0->room == gRoomControls.room) {
|
||||
sub_08049DCC(gUnk_020354B0);
|
||||
return;
|
||||
}
|
||||
gUnk_020354B0++;
|
||||
|
||||
} while (gUnk_020354B0 < gRoomMemory + 8);
|
||||
gUnk_020354B0 = sub_08049D88();
|
||||
}
|
||||
|
||||
RoomMemory* sub_08049D88(void) {
|
||||
RoomMemory* r4 = gRoomMemory;
|
||||
RoomMemory* r1 = r4 + 1;
|
||||
|
||||
do {
|
||||
if (r1->unk_02 > r4->unk_02) {
|
||||
r4 = r1;
|
||||
}
|
||||
r1++;
|
||||
} while (r1 < gRoomMemory + 8);
|
||||
|
||||
r4->area = gRoomControls.area;
|
||||
r4->room = gRoomControls.room;
|
||||
|
||||
r4->unk_02 = 0xFFFF;
|
||||
r4->unk_04 = 0;
|
||||
|
||||
sub_08049DCC(r4);
|
||||
|
||||
return r4;
|
||||
}
|
||||
|
||||
void sub_08049DCC(RoomMemory* rm) {
|
||||
RoomMemory* r1 = gRoomMemory;
|
||||
|
||||
do {
|
||||
if (r1->unk_02 < rm->unk_02) {
|
||||
r1->unk_02++;
|
||||
}
|
||||
r1++;
|
||||
} while (r1 < gRoomMemory + 8);
|
||||
|
||||
rm->unk_02 = 0;
|
||||
}
|
||||
|
||||
Entity* sub_08049DF4(u32 arg0) {
|
||||
if (gUnk_020000B0 != NULL) {
|
||||
return gUnk_020000B0;
|
||||
Loading…
Reference in New Issue