Skip to content

Commit

Permalink
Merge pull request #51 from dplewis/4f7f0
Browse files Browse the repository at this point in the history
Decompile 4F7F0.c
  • Loading branch information
RevoSucks committed Jul 30, 2023
2 parents 62bb0e3 + ef597ad commit 9750951
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 3 deletions.
5 changes: 4 additions & 1 deletion diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,10 @@ def search_map_file(fn_name):
rom = int(tokens[5], 0)
ram_to_rom = rom - ram
if line.endswith(" " + fn_name):
ram = int(line.split()[0], 0)
try:
ram = int(line.split()[0], 0)
except:
ram = int(line.split()[1], 0)
if cur_objfile is not None and ram_to_rom is not None:
cands.append((cur_objfile, ram + ram_to_rom))
last_line = line
Expand Down
1 change: 1 addition & 0 deletions include/libleo/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ extern u16 leoLba_to_phys(u32 lba);
extern s32 __leoActive;
extern s32 __leoResetCalled;
extern s32 __leoQueuesCreated;
extern s32 currentCommand;
extern u32 LEO_country_code;
extern u32 LEOasic_bm_ctl_shadow;
extern u32 LEOasic_seq_ctl_shadow;
Expand Down
2 changes: 1 addition & 1 deletion splat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ segments:
- [0x4BDC0, asm]
- [0x4CBC0, asm]
- [0x4F410, asm]
- [0x4F7F0, asm]
- [0x4F7F0, c]
- [0x4F870, asm]
- [0x4FDB0, asm]
- [0x4FE60, asm]
Expand Down
39 changes: 39 additions & 0 deletions src/4F7F0.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include "common.h"

struct UnkArray4 {
u32 unk0;
u32 unk4;
u16 unk8;
u16 unkA;
f32 unkC;
u32 unk10;
u32 unk14;
u32 unk18;
u32 unk1C;
};
struct UnkStructUnk8 {
char filler[0x88];
u32 unk88;
};
struct UnkStruct8004EBF0 {
char filler[0x8];
struct UnkStructUnk8* unk8;
};
void func_80047500(void*, u8, void*, void*);
struct UnkArray4* func_800495F8();
struct UnkArray4* D_80078584;

void func_8004EBF0(struct UnkStruct8004EBF0* arg0, f32 arg1) {
struct UnkArray4 *temp_v0;

if (arg0->unk8 != NULL) {
temp_v0 = func_800495F8();
if (temp_v0 != NULL) {
temp_v0->unk4 = (s32) (D_80078584->unk1C + arg0->unk8->unk88);
temp_v0->unk8 = 7;
temp_v0->unkC = arg1;
temp_v0->unk0 = 0;
func_80047500(arg0->unk8, 3, temp_v0, arg0);
}
}
}
1 change: 1 addition & 0 deletions src/C030.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "ultra64.h"
#include "ultra64/controller.h"
#include "controller.h"

extern s32 D_800697E0;
extern u8 D_800A82B0[32];
Expand Down
1 change: 0 additions & 1 deletion src/libleo/leomecha.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <ultra64.h>
#include "libleo/internal.h"

extern s32 currentCommand;
extern u32 asic_cur_status; // static?
extern u32 unit_atten; // static?

Expand Down

0 comments on commit 9750951

Please sign in to comment.