Skip to content

Commit

Permalink
Decomped unk_02018380
Browse files Browse the repository at this point in the history
  • Loading branch information
AtSign8877 committed Dec 8, 2023
1 parent 15dad09 commit c62ffab
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 85 deletions.
8 changes: 0 additions & 8 deletions asm/include/unk_02018380.inc

This file was deleted.

75 changes: 0 additions & 75 deletions asm/unk_02018380.s

This file was deleted.

11 changes: 10 additions & 1 deletion include/unk_02018380.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@

#include "igt.h"

typedef struct UnkStruct_021D10E8 {
u32 unk0;
IGT *igt;
u64 unk8;
u32 unk10;
u32 unk14;
u64 unk18;
} UnkStruct_021D10E8;

void sub_02018380(void);
void sub_020183B0(void);
void sub_0201838C(IGT* igt);
void sub_0201838C(IGT *igt);

#endif //POKEHEARTGOLD_UNK_02018380_H
2 changes: 1 addition & 1 deletion main.lsf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Static main
Object asm/unk_02016EDC.o
Object asm/unk_02017FAC.o
Object asm/unk_02018000.o
Object asm/unk_02018380.o
Object src/unk_02018380.o
Object asm/unk_020183F0.o
Object src/camera_translation.o
Object asm/unk_020192D0.o
Expand Down
33 changes: 33 additions & 0 deletions src/unk_02018380.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "global.h"
#include "unk_02018380.h"
#include "timer_3.h"

static UnkStruct_021D10E8 s_021D10E8;

void sub_02018380(void) {
s_021D10E8.unk0 = 0;
}

void sub_0201838C(IGT *igt) {
s_021D10E8.unk0 = 1;
s_021D10E8.unk10 = 0;
s_021D10E8.unk14 = 0;
s_021D10E8.unk8 = 0;
s_021D10E8.igt = igt;
s_021D10E8.unk18 = sub_020254FC();
}

void sub_020183B0(void) {
if (s_021D10E8.unk0 == 0) {
return;
}

u64 val = sub_020254FC();
u64 val2 = sub_02025504(val - s_021D10E8.unk18);
if (s_021D10E8.unk8 >= val2) {
return;
}

AddIGTSeconds(s_021D10E8.igt, val2 - s_021D10E8.unk8);
s_021D10E8.unk8 = val2;
}

0 comments on commit c62ffab

Please sign in to comment.