jpn-final: Decompile titleInit

This commit is contained in:
Ryan Dwyer 2022-03-19 21:36:13 +10:00
parent 9b23b0e220
commit 8d209d59c2
11 changed files with 42 additions and 88 deletions

View File

@ -1,6 +1,6 @@
#define GAMEFILES(section) \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/game_000090.o (section); \
build/ROMID/game/titleinit.o (section); \
build/ROMID/game/game_000100.o (section); \
build/ROMID/game/game_000130.o (section); \
build/ROMID/game/stubs/game_000840.o (section); \

View File

@ -1,6 +1,6 @@
#define GAMEFILES(section) \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/game_000090.o (section); \
build/ROMID/game/titleinit.o (section); \
build/ROMID/game/game_000100.o (section); \
build/ROMID/game/game_000130.o (section); \
build/ROMID/game/stubs/game_000840.o (section); \

View File

@ -1,6 +1,6 @@
#define GAMEFILES(section) \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/game_000090.o (section); \
build/ROMID/game/titleinit.o (section); \
build/ROMID/game/game_000100.o (section); \
build/ROMID/game/game_000130.o (section); \
build/ROMID/game/stubs/game_000840.o (section); \

View File

@ -1,6 +1,6 @@
#define GAMEFILES(section) \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/game_000090.o (section); \
build/ROMID/game/titleinit.o (section); \
build/ROMID/game/game_000100.o (section); \
build/ROMID/game/game_000130.o (section); \
build/ROMID/game/stubs/game_000840.o (section); \

View File

@ -1,6 +1,6 @@
#define GAMEFILES(section) \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/game_000090.o (section); \
build/ROMID/game/titleinit.o (section); \
build/ROMID/game/game_000100.o (section); \
build/ROMID/game/game_000130.o (section); \
build/ROMID/game/stubs/game_000840.o (section); \

View File

@ -1,66 +0,0 @@
#include <ultra64.h>
#include "constants.h"
#include "game/game_000090.h"
#include "game/game_000130.h"
#include "game/chr/chr.h"
#include "bss.h"
#include "data.h"
#include "types.h"
#if VERSION >= VERSION_JPN_FINAL
GLOBAL_ASM(
glabel func0f000090
/* f000100: 2402ffff */ li $v0,-1
/* f000104: 3c038006 */ lui $v1,0x8006
/* f000108: 3c018006 */ lui $at,0x8006
/* f00010c: 24632398 */ addiu $v1,$v1,0x2398
/* f000110: ac222394 */ sw $v0,0x2394($at)
/* f000114: ac600000 */ sw $zero,0x0($v1)
/* f000118: 3c0e8009 */ lui $t6,0x8009
/* f00011c: 91ce1160 */ lbu $t6,0x1160($t6)
/* f000120: 24040001 */ li $a0,0x1
/* f000124: 24050080 */ li $a1,0x80
/* f000128: 148e0003 */ bne $a0,$t6,.JF0f000138
/* f00012c: 3c018006 */ lui $at,0x8006
/* f000130: 240f000a */ li $t7,0xa
/* f000134: ac6f0000 */ sw $t7,0x0($v1)
.JF0f000138:
/* f000138: ac2023a4 */ sw $zero,0x23a4($at)
/* f00013c: 3c018006 */ lui $at,0x8006
/* f000140: ac2223c4 */ sw $v0,0x23c4($at)
/* f000144: 3c018006 */ lui $at,0x8006
/* f000148: ac2023c0 */ sw $zero,0x23c0($at)
/* f00014c: 3c018006 */ lui $at,0x8006
/* f000150: ac2423c8 */ sw $a0,0x23c8($at)
/* f000154: 3c018006 */ lui $at,0x8006
/* f000158: ac2023cc */ sw $zero,0x23cc($at)
/* f00015c: 3c018006 */ lui $at,0x8006
/* f000160: ac2023d0 */ sw $zero,0x23d0($at)
/* f000164: 3c03800a */ lui $v1,0x800a
/* f000168: 3c018006 */ lui $at,0x8006
/* f00016c: 2463e6e8 */ addiu $v1,$v1,-6424
/* f000170: ac2423d4 */ sw $a0,0x23d4($at)
/* f000174: a0600004 */ sb $zero,0x4($v1)
/* f000178: a0650005 */ sb $a1,0x5($v1)
/* f00017c: a0650006 */ sb $a1,0x6($v1)
/* f000180: 03e00008 */ jr $ra
/* f000184: a0650007 */ sb $a1,0x7($v1)
);
#else
void func0f000090(void)
{
g_TitleMode = -1;
g_TitleNextMode = TITLEMODE_LEGAL;
g_TitleTimer = 0;
g_TitleNextStage = -1;
var800624e0 = 0;
var800624e8 = 1;
var800624ec = 0;
var800624f0 = 0;
var800624f4 = 1;
g_MissionConfig.pdmodereaction = 0;
g_MissionConfig.pdmodehealth = 128;
g_MissionConfig.pdmodedamage = 128;
g_MissionConfig.pdmodeaccuracy = 128;
}
#endif

View File

@ -1,6 +1,5 @@
#include <ultra64.h>
#include "constants.h"
#include "game/game_000090.h"
#include "game/game_000130.h"
#include "game/chr/chr.h"
#include "bss.h"

29
src/game/titleinit.c Normal file
View File

@ -0,0 +1,29 @@
#include <ultra64.h>
#include "constants.h"
#include "bss.h"
#include "data.h"
#include "types.h"
void titleInit(void)
{
g_TitleMode = -1;
g_TitleNextMode = TITLEMODE_LEGAL;
#if VERSION >= VERSION_JPN_FINAL
if (IS4MB()) {
g_TitleNextMode = TITLEMODE_NOEXPANSION;
}
#endif
g_TitleTimer = 0;
g_TitleNextStage = -1;
var800624e0 = 0;
var800624e8 = 1;
var800624ec = 0;
var800624f0 = 0;
var800624f4 = 1;
g_MissionConfig.pdmodereaction = 0;
g_MissionConfig.pdmodehealth = 128;
g_MissionConfig.pdmodedamage = 128;
g_MissionConfig.pdmodeaccuracy = 128;
}

View File

@ -1,9 +0,0 @@
#ifndef IN_GAME_GAME_000090_H
#define IN_GAME_GAME_000090_H
#include <ultra64.h>
#include "data.h"
#include "types.h"
void func0f000090(void);
#endif

View File

@ -8,6 +8,8 @@ extern u32 var800624d4;
extern u32 var800624d8;
extern u32 var800624dc;
void titleInit(void);
char *mpPlayerGetWeaponOfChoiceName(u32 playernum, u32 slot);
void func0f01616c(void *light, u8 arg1, u8 arg2, u8 arg3, f32 arg4, struct coord *arg5);
void titleInitLegal(void);

View File

@ -6,7 +6,6 @@
#include "game/cheats.h"
#include "game/debug.h"
#include "game/lang.h"
#include "game/game_000090.h"
#include "game/game_000100.h"
#include "game/game_000130.h"
#include "game/stubs/game_000840.h"
@ -677,7 +676,7 @@ glabel mainInit
/* da54: 00000000 */ nop
/* da58: 0fc0023c */ jal stub0f000860
/* da5c: 00000000 */ nop
/* da60: 0fc00040 */ jal func0f000090
/* da60: 0fc00040 */ jal titleInit
/* da64: 00000000 */ nop
/* da68: 0c0026e7 */ jal viConfigureForLegal
/* da6c: 00000000 */ nop
@ -1072,7 +1071,7 @@ glabel mainInit
/* d7e8: 00000000 */ nop
/* d7ec: 0fc00218 */ jal stub0f000860
/* d7f0: 00000000 */ nop
/* d7f4: 0fc00024 */ jal func0f000090
/* d7f4: 0fc00024 */ jal titleInit
/* d7f8: 00000000 */ nop
/* d7fc: 0c0026c0 */ jal viConfigureForLegal
/* d800: 00000000 */ nop
@ -1497,7 +1496,7 @@ glabel mainInit
/* d888: 00000000 */ nop
/* d88c: 0fc00218 */ jal stub0f000860
/* d890: 00000000 */ nop
/* d894: 0fc00024 */ jal func0f000090
/* d894: 0fc00024 */ jal titleInit
/* d898: 00000000 */ nop
/* d89c: 0c0026ba */ jal viConfigureForLegal
/* d8a0: 00000000 */ nop
@ -1900,7 +1899,7 @@ glabel mainInit
/* daac: 00000000 */ nop
/* dab0: 0fc00218 */ jal stub0f000860
/* dab4: 00000000 */ nop
/* dab8: 0fc00024 */ jal func0f000090
/* dab8: 0fc00024 */ jal titleInit
/* dabc: 00000000 */ nop
/* dac0: 0c0026fe */ jal viConfigureForLegal
/* dac4: 00000000 */ nop
@ -2273,7 +2272,7 @@ glabel mainInit
/* dfbc: 00000000 */ sll $zero,$zero,0x0
/* dfc0: 0fc00218 */ jal stub0f000860
/* dfc4: 00000000 */ sll $zero,$zero,0x0
/* dfc8: 0fc00024 */ jal func0f000090
/* dfc8: 0fc00024 */ jal titleInit
/* dfcc: 00000000 */ sll $zero,$zero,0x0
/* dfd0: 0c002767 */ jal viConfigureForLegal
/* dfd4: 00000000 */ sll $zero,$zero,0x0
@ -2495,7 +2494,7 @@ const char var70053aa0[] = " -ml0 -me0 -mgfx100 -mvtx50 -mt700 -ma400";
// func0f000130();
// stub0f000850();
// stub0f000860();
// func0f000090();
// titleInit();
// viConfigureForLegal();
// viBlack(true);
//