Decompile phSetFileId

This commit is contained in:
Ryan Dwyer 2021-09-28 18:26:09 +10:00
parent 4f7d35cdab
commit fcc66cbb7f
3 changed files with 10 additions and 18 deletions

View File

@ -8233,7 +8233,7 @@ glabel func0f15015c
/* f1507b0: 27bd14f8 */ addiu $sp,$sp,0x14f8
);
void func0f1507b4(s32 index, struct fileguid *guid)
void phGetGuid(s32 index, struct fileguid *guid)
{
u8 *ptr = func0f14a06c(index);
@ -8241,18 +8241,10 @@ void func0f1507b4(s32 index, struct fileguid *guid)
guid->deviceserial = *(u16 *) &ptr[0x3fc];
}
GLOBAL_ASM(
glabel func0f1507e8
/* f1507e8: 27bdffe8 */ addiu $sp,$sp,-24
/* f1507ec: afbf0014 */ sw $ra,0x14($sp)
/* f1507f0: afa40018 */ sw $a0,0x18($sp)
/* f1507f4: 0fc5281b */ jal func0f14a06c
/* f1507f8: 2404ffff */ addiu $a0,$zero,-1
/* f1507fc: a44003fc */ sh $zero,0x3fc($v0)
/* f150800: 8fae0018 */ lw $t6,0x18($sp)
/* f150804: ac4e03f8 */ sw $t6,0x3f8($v0)
/* f150808: 8fbf0014 */ lw $ra,0x14($sp)
/* f15080c: 27bd0018 */ addiu $sp,$sp,0x18
/* f150810: 03e00008 */ jr $ra
/* f150814: 00000000 */ nop
);
void phSetFileId(s32 fileid)
{
u8 *ptr = func0f14a06c(-1);
*(u16 *) &ptr[0x3fc] = 0;
*(s32 *) &ptr[0x3f8] = fileid;
}

View File

@ -8636,7 +8636,7 @@ void mpplayerfileSaveWad(s32 playernum, struct savebuffer *buffer)
if (g_MpPlayers[playernum].base.mpheadnum >= mpGetNumHeads2()) {
struct fileguid guid;
func0f1507b4(g_MpPlayers[playernum].base.mpheadnum - mpGetNumHeads2(), &guid);
phGetGuid(g_MpPlayers[playernum].base.mpheadnum - mpGetNumHeads2(), &guid);
savebufferWriteGuid(buffer, &guid);
} else {
struct fileguid guid;

View File

@ -86,7 +86,7 @@ u32 func0f14fdb0(void);
u32 func0f14ff94(void);
u32 func0f150068(void);
s32 func0f15015c(s32 device, s32 filenum, u8 *arg2);
void func0f1507b4(s32 index, struct fileguid *guid);
void phGetGuid(s32 index, struct fileguid *guid);
extern const char var7f1b6050[];
extern const char var7f1b6058[];