jpn-final: Decompile langInit

This commit is contained in:
Ryan Dwyer 2022-03-19 21:20:53 +10:00
parent 6a363879d8
commit 9b23b0e220
13 changed files with 77 additions and 117 deletions

View File

@ -1,5 +1,5 @@
#define GAMEFILES(section) \
build/ROMID/game/game_000000.o (section); \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/game_000090.o (section); \
build/ROMID/game/game_000100.o (section); \
build/ROMID/game/game_000130.o (section); \

View File

@ -1,5 +1,5 @@
#define GAMEFILES(section) \
build/ROMID/game/game_000000.o (section); \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/game_000090.o (section); \
build/ROMID/game/game_000100.o (section); \
build/ROMID/game/game_000130.o (section); \

View File

@ -1,5 +1,5 @@
#define GAMEFILES(section) \
build/ROMID/game/game_000000.o (section); \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/game_000090.o (section); \
build/ROMID/game/game_000100.o (section); \
build/ROMID/game/game_000130.o (section); \

View File

@ -1,5 +1,5 @@
#define GAMEFILES(section) \
build/ROMID/game/game_000000.o (section); \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/game_000090.o (section); \
build/ROMID/game/game_000100.o (section); \
build/ROMID/game/game_000130.o (section); \

View File

@ -1,5 +1,5 @@
#define GAMEFILES(section) \
build/ROMID/game/game_000000.o (section); \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/game_000090.o (section); \
build/ROMID/game/game_000100.o (section); \
build/ROMID/game/game_000130.o (section); \

View File

@ -1,6 +1,5 @@
#include <ultra64.h>
#include "game/chr/chraicommands.h"
#include "game/game_000000.h"
#include "game/prop.h"
#include "stagesetup.h"
#include "data.h"

View File

@ -1,94 +0,0 @@
#include <ultra64.h>
#include "constants.h"
#include "bss.h"
#include "lib/memp.h"
#include "data.h"
#include "types.h"
u8 *g_FrameBuffers[2];
#if VERSION >= VERSION_JPN_FINAL
GLOBAL_ASM(
glabel func0f000000
/* f000000: 3c0e8009 */ lui $t6,0x8009
/* f000004: 91ce1160 */ lbu $t6,0x1160($t6)
/* f000008: 27bdffe8 */ addiu $sp,$sp,-24
/* f00000c: 24010001 */ li $at,0x1
/* f000010: 15c10006 */ bne $t6,$at,.JF0f00002c
/* f000014: afbf0014 */ sw $ra,0x14($sp)
/* f000018: 3c06800a */ lui $a2,0x800a
/* f00001c: 24c6d140 */ addiu $a2,$a2,-11968
/* f000020: 240f007c */ li $t7,0x7c
/* f000024: 10000005 */ b .JF0f00003c
/* f000028: accf0000 */ sw $t7,0x0($a2)
.JF0f00002c:
/* f00002c: 3c06800a */ lui $a2,0x800a
/* f000030: 24c6d140 */ addiu $a2,$a2,-11968
/* f000034: 241800ae */ li $t8,0xae
/* f000038: acd80000 */ sw $t8,0x0($a2)
.JF0f00003c:
/* f00003c: 8cc40000 */ lw $a0,0x0($a2)
/* f000040: 24050006 */ li $a1,0x6
/* f000044: 0004c880 */ sll $t9,$a0,0x2
/* f000048: 0324c823 */ subu $t9,$t9,$a0
/* f00004c: 0c0048e2 */ jal mempAlloc
/* f000050: 00192140 */ sll $a0,$t9,0x5
/* f000054: 3c06800a */ lui $a2,0x800a
/* f000058: 3c01800b */ lui $at,0x800b
/* f00005c: ac22b5a4 */ sw $v0,-0x4a5c($at)
/* f000060: 24c6d140 */ addiu $a2,$a2,-11968
/* f000064: 8cc40000 */ lw $a0,0x0($a2)
/* f000068: 24050006 */ li $a1,0x6
/* f00006c: 00044040 */ sll $t0,$a0,0x1
/* f000070: 2504000f */ addiu $a0,$t0,0xf
/* f000074: 3489000f */ ori $t1,$a0,0xf
/* f000078: 0c0048e2 */ jal mempAlloc
/* f00007c: 3924000f */ xori $a0,$t1,0xf
/* f000080: 3c06800a */ lui $a2,0x800a
/* f000084: 24c6d140 */ addiu $a2,$a2,-11968
/* f000088: 8ccb0000 */ lw $t3,0x0($a2)
/* f00008c: 3c05800b */ lui $a1,0x800b
/* f000090: 24a5b5a8 */ addiu $a1,$a1,-19032
/* f000094: aca20000 */ sw $v0,0x0($a1)
/* f000098: 19600012 */ blez $t3,.JF0f0000e4
/* f00009c: 00002025 */ move $a0,$zero
/* f0000a0: 00001825 */ move $v1,$zero
/* f0000a4: 8cac0000 */ lw $t4,0x0($a1)
.JF0f0000a8:
/* f0000a8: 24840001 */ addiu $a0,$a0,0x1
/* f0000ac: 01831021 */ addu $v0,$t4,$v1
/* f0000b0: 904d0000 */ lbu $t5,0x0($v0)
/* f0000b4: 31aeff3f */ andi $t6,$t5,0xff3f
/* f0000b8: a04e0000 */ sb $t6,0x0($v0)
/* f0000bc: 8caf0000 */ lw $t7,0x0($a1)
/* f0000c0: 01e31021 */ addu $v0,$t7,$v1
/* f0000c4: 94590000 */ lhu $t9,0x0($v0)
/* f0000c8: 24630002 */ addiu $v1,$v1,0x2
/* f0000cc: 37283fff */ ori $t0,$t9,0x3fff
/* f0000d0: a4480000 */ sh $t0,0x0($v0)
/* f0000d4: 8cc90000 */ lw $t1,0x0($a2)
/* f0000d8: 0089082a */ slt $at,$a0,$t1
/* f0000dc: 5420fff2 */ bnezl $at,.JF0f0000a8
/* f0000e0: 8cac0000 */ lw $t4,0x0($a1)
.JF0f0000e4:
/* f0000e4: 8fbf0014 */ lw $ra,0x14($sp)
/* f0000e8: 27bd0018 */ addiu $sp,$sp,0x18
/* f0000ec: 03e00008 */ jr $ra
/* f0000f0: 00000000 */ nop
);
#else
void func0f000000(void)
{
s32 i;
if (g_Jpn) {
var800aabb4 = mempAlloc(0x2e80, MEMPOOL_PERMANENT);
var800aabb8 = mempAlloc(0x100, MEMPOOL_PERMANENT);
for (i = 0; i < 0x7c; i++) {
var800aabb8[i].unk00_00 = 0;
var800aabb8[i].unk00_02 = 0x3fff;
}
}
}
#endif

View File

@ -1,6 +1,5 @@
#include <ultra64.h>
#include "game/chr/chraicommands.h"
#include "game/game_000000.h"
#include "game/prop.h"
#include "game/inventory/items.h"
#include "stagesetup.h"

37
src/game/langinit.c Normal file
View File

@ -0,0 +1,37 @@
#include <ultra64.h>
#include "constants.h"
#include "bss.h"
#include "lib/memp.h"
#include "data.h"
#include "types.h"
u8 *g_FrameBuffers[2];
extern s32 var8009d140jf;
void langInit(void)
{
s32 i;
#if VERSION >= VERSION_JPN_FINAL
var8009d140jf = IS4MB() ? 124 : 174;
var800aabb4 = mempAlloc(var8009d140jf * sizeof(struct var800aabb4), MEMPOOL_PERMANENT);
var800aabb8 = mempAlloc(ALIGN16(var8009d140jf * sizeof(struct var800aabb8)), MEMPOOL_PERMANENT);
for (i = 0; i < var8009d140jf; i++) {
var800aabb8[i].unk00_00 = 0;
var800aabb8[i].unk00_02 = 0x3fff;
}
#else
if (g_Jpn) {
var800aabb4 = mempAlloc(124 * sizeof(struct var800aabb4), MEMPOOL_PERMANENT);
var800aabb8 = mempAlloc(ALIGN16(124 * sizeof(struct var800aabb8)), MEMPOOL_PERMANENT);
for (i = 0; i < 124; i++) {
var800aabb8[i].unk00_00 = 0;
var800aabb8[i].unk00_02 = 0x3fff;
}
}
#endif
}

View File

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

View File

@ -4,6 +4,7 @@
#include "data.h"
#include "types.h"
void langInit(void);
void langTick(void);
u32 langGetLangBankIndexFromStagenum(s32 stagenum);

View File

@ -5229,6 +5229,33 @@ struct texture {
u32 unk04;
};
struct var800aabb4 {
/*0x00*/ u32 unk00;
/*0x04*/ u32 unk04;
/*0x08*/ u32 unk08;
/*0x0c*/ u32 unk0c;
/*0x10*/ u32 unk10;
/*0x14*/ u32 unk14;
/*0x18*/ u32 unk18;
/*0x1c*/ u32 unk1c;
/*0x20*/ u32 unk20;
/*0x24*/ u32 unk24;
/*0x28*/ u32 unk28;
/*0x2c*/ u32 unk2c;
/*0x30*/ u32 unk30;
/*0x34*/ u32 unk34;
/*0x38*/ u32 unk38;
/*0x3c*/ u32 unk3c;
/*0x40*/ u32 unk40;
/*0x44*/ u32 unk44;
/*0x48*/ u32 unk48;
/*0x4c*/ u32 unk4c;
/*0x50*/ u32 unk50;
/*0x54*/ u32 unk54;
/*0x58*/ u32 unk58;
/*0x5c*/ u32 unk5c;
};
struct var800aabb8 {
u16 unk00_00 : 2;
u16 unk00_02 : 14;

View File

@ -5,7 +5,7 @@
#include "game/camdraw.h"
#include "game/cheats.h"
#include "game/debug.h"
#include "game/game_000000.h"
#include "game/lang.h"
#include "game/game_000090.h"
#include "game/game_000100.h"
#include "game/game_000130.h"
@ -623,7 +623,7 @@ glabel mainInit
/* d97c: 00000000 */ nop
/* d980: 0fc02c88 */ jal loadTextureList
/* d984: 00000000 */ nop
/* d988: 0fc00000 */ jal func0f000000
/* d988: 0fc00000 */ jal langInit
/* d98c: 00000000 */ nop
/* d990: 0fc59fc2 */ jal lv0f167af8
/* d994: 00000000 */ nop
@ -1018,7 +1018,7 @@ glabel mainInit
/* d710: 00000000 */ nop
/* d714: 0fc02c68 */ jal loadTextureList
/* d718: 00000000 */ nop
/* d71c: 0fc00000 */ jal func0f000000
/* d71c: 0fc00000 */ jal langInit
/* d720: 00000000 */ nop
/* d724: 0fc5a29e */ jal lv0f167af8
/* d728: 00000000 */ nop
@ -1443,7 +1443,7 @@ glabel mainInit
/* d7b0: 00000000 */ nop
/* d7b4: 0fc02c68 */ jal loadTextureList
/* d7b8: 00000000 */ nop
/* d7bc: 0fc00000 */ jal func0f000000
/* d7bc: 0fc00000 */ jal langInit
/* d7c0: 00000000 */ nop
/* d7c4: 0fc5a45a */ jal lv0f167af8
/* d7c8: 00000000 */ nop
@ -1846,7 +1846,7 @@ glabel mainInit
/* d9d4: 00000000 */ nop
/* d9d8: 0fc02c64 */ jal loadTextureList
/* d9dc: 00000000 */ nop
/* d9e0: 0fc00000 */ jal func0f000000
/* d9e0: 0fc00000 */ jal langInit
/* d9e4: 00000000 */ nop
/* d9e8: 0fc59ebe */ jal lv0f167af8
/* d9ec: 00000000 */ nop
@ -2219,7 +2219,7 @@ glabel mainInit
/* dee4: 00000000 */ sll $zero,$zero,0x0
/* dee8: 0fc02b90 */ jal loadTextureList
/* deec: 00000000 */ sll $zero,$zero,0x0
/* def0: 0fc00000 */ jal func0f000000
/* def0: 0fc00000 */ jal langInit
/* def4: 00000000 */ sll $zero,$zero,0x0
/* def8: 0fc5890e */ jal lv0f167af8
/* defc: 00000000 */ sll $zero,$zero,0x0
@ -2468,7 +2468,7 @@ const char var70053aa0[] = " -ml0 -me0 -mgfx100 -mvtx50 -mt700 -ma400";
// func0f176ddc();
// func000034d0();
// loadTextureList();
// func0f000000();
// langInit();
// lv0f167af8();
// cheatsDisableAll();
// func0000e9c0();