Identify shard functions and split/rename their files

This commit is contained in:
Ryan Dwyer 2021-02-10 22:34:39 +10:00
parent ce040a5d9c
commit c76a5aeb75
17 changed files with 1189 additions and 1153 deletions

View File

@ -39,6 +39,8 @@
build/ROMID/game/weather/init.o (section); \
build/ROMID/game/stubs/game_013540.o (section); \
build/ROMID/game/game_013550.o (section); \
build/ROMID/game/shards/init.o (section); \
build/ROMID/game/game_013b80.o (section); \
build/ROMID/game/game_013cf0.o (section); \
build/ROMID/game/game_013ee0.o (section); \
build/ROMID/game/game_0147a0.o (section); \
@ -54,7 +56,7 @@
build/ROMID/game/stubs/game_0153f0.o (section); \
build/ROMID/game/stubs/game_015400.o (section); \
build/ROMID/game/stubs/game_015410.o (section); \
build/ROMID/game/game_015420.o (section); \
build/ROMID/game/shards/reset.o (section); \
build/ROMID/game/game_015470.o (section); \
build/ROMID/game/title.o (section); \
build/ROMID/game/game_01afc0.o (section); \
@ -65,7 +67,7 @@
build/ROMID/game/game_01d860.o (section); \
build/ROMID/game/game_01d990.o (section); \
build/ROMID/game/casing/tick.o (section); \
build/ROMID/game/game_01de30.o (section); \
build/ROMID/game/shards/tick.o (section); \
build/ROMID/game/sparks/tick.o (section); \
build/ROMID/game/chr/chr.o (section); \
build/ROMID/game/game_02cde0.o (section); \
@ -150,7 +152,8 @@
build/ROMID/game/data/data_0258c0.o (section); \
build/ROMID/game/splat.o (section); \
build/ROMID/game/camdraw.o (section); \
build/ROMID/game/game_150820.o (section); \
build/ROMID/game/shards/create.o (section); \
build/ROMID/game/shards/render.o (section); \
build/ROMID/game/options.o (section); \
build/ROMID/game/game_152fa0.o (section); \
build/ROMID/game/game_1531a0.o (section); \

View File

@ -47,7 +47,7 @@
#include "game/stubs/game_0153f0.h"
#include "game/stubs/game_015400.h"
#include "game/stubs/game_015410.h"
#include "game/game_015420.h"
#include "game/shards.h"
#include "game/game_015470.h"
#include "game/title.h"
#include "game/game_01b0a0.h"
@ -55,7 +55,6 @@
#include "game/weather/tick.h"
#include "game/game_01d860.h"
#include "game/game_01d990.h"
#include "game/game_01de30.h"
#include "game/chr/chr.h"
#include "game/prop.h"
#include "game/game_095320.h"
@ -80,7 +79,6 @@
#include "game/credits.h"
#include "game/game_13c510.h"
#include "game/bondview.h"
#include "game/game_150820.h"
#include "game/game_1531a0.h"
#include "game/room.h"
#include "game/game_165670.h"
@ -1214,7 +1212,7 @@ Gfx *coreRender(Gfx *gdl)
gdl = bgRender(gdl);
func0f028498(var80075d68 == 15 || var8005f020);
gdl = propsRenderBulletTails(gdl);
gdl = func0f1526e4(gdl);
gdl = shardsRender(gdl);
gdl = sparksRender(gdl);
gdl = weatherRender(gdl);

View File

@ -126,71 +126,3 @@ void func0f013550(void)
}
}
}
void shardsInit(void)
{
s32 i;
g_MaxShards = 200 / PLAYERCOUNT();
if (IS4MB()) {
g_MaxShards = g_MaxShards / 2;
}
if (g_Vars.stagenum >= STAGE_TITLE) {
g_MaxShards = 0;
}
if (g_MaxShards == 0) {
g_Shards = NULL;
} else {
g_Shards = malloc(g_MaxShards * sizeof(struct shard) + 0xf & ~0xf, MEMPOOL_STAGE);
for (i = 0; i < g_MaxShards; i++) {
g_Shards[i].age60 = 0;
}
}
var8007fa80 = 0;
}
void func0f013b80(void)
{
var800ab538 = 0;
var800aabc8[0] = 0;
var800aabc8[1] = 0;
var800aabc8[3] = 0;
}
void func0f013ba0(void)
{
s32 i;
s32 j;
s32 num;
s32 val;
for (i = 0; i < 4; i++) {
if (PLAYERCOUNT() >= 2) {
val = var8007e3d0[i].valifmp;
num = var8007e3d0[i].numifmp;
} else if (g_Vars.stagenum >= STAGE_TITLE) {
val = var8007e3d0[i].valifspecial;
num = var8007e3d0[i].numifspecial;
} else {
val = var8007e3d0[i].valifsp;
num = var8007e3d0[i].numifsp;
}
if (num > 0) {
var8007e3d0[i].unk24 = malloc(num * sizeof(struct var8007e3d0_data), MEMPOOL_STAGE);
}
for (j = 0; j < num; j++) {
var8007e3d0[i].unk24[j].unk0e = 0;
}
var8007e3d0[i].numallocated = num;
var8007e3d0[i].val1 = val;
var8007e3d0[i].val2 = val;
}
}

53
src/game/game_013b80.c Normal file
View File

@ -0,0 +1,53 @@
#include <ultra64.h>
#include "constants.h"
#include "game/data/data_000000.h"
#include "game/data/data_0083d0.h"
#include "game/data/data_00e460.h"
#include "game/data/data_0160b0.h"
#include "game/data/data_01a3a0.h"
#include "game/data/data_020df0.h"
#include "game/data/data_02da90.h"
#include "gvars/gvars.h"
#include "lib/memory.h"
#include "types.h"
void func0f013b80(void)
{
var800ab538 = 0;
var800aabc8[0] = 0;
var800aabc8[1] = 0;
var800aabc8[3] = 0;
}
void func0f013ba0(void)
{
s32 i;
s32 j;
s32 num;
s32 val;
for (i = 0; i < 4; i++) {
if (PLAYERCOUNT() >= 2) {
val = var8007e3d0[i].valifmp;
num = var8007e3d0[i].numifmp;
} else if (g_Vars.stagenum >= STAGE_TITLE) {
val = var8007e3d0[i].valifspecial;
num = var8007e3d0[i].numifspecial;
} else {
val = var8007e3d0[i].valifsp;
num = var8007e3d0[i].numifsp;
}
if (num > 0) {
var8007e3d0[i].unk24 = malloc(num * sizeof(struct var8007e3d0_data), MEMPOOL_STAGE);
}
for (j = 0; j < num; j++) {
var8007e3d0[i].unk24[j].unk0e = 0;
}
var8007e3d0[i].numallocated = num;
var8007e3d0[i].val1 = val;
var8007e3d0[i].val2 = val;
}
}

View File

@ -45,7 +45,6 @@
#include "game/explosions/explosions.h"
#include "game/smoke/smoke.h"
#include "game/sparks/sparks.h"
#include "game/game_150820.h"
#include "game/game_1531a0.h"
#include "game/room.h"
#include "game/game_1655c0.h"
@ -34922,7 +34921,7 @@ glabel func0f084cf0
/* f084d78: c46a0010 */ lwc1 $f10,0x10($v1)
/* f084d7c: afb00024 */ sw $s0,0x24($sp)
/* f084d80: afae0020 */ sw $t6,0x20($sp)
/* f084d84: 0fc54208 */ jal func0f150820
/* f084d84: 0fc54208 */ jal shardsCreate
/* f084d88: e7aa001c */ swc1 $f10,0x1c($sp)
/* f084d8c: 10000011 */ b .L0f084dd4
/* f084d90: 3c04bcde */ lui $a0,0xbcde
@ -34940,7 +34939,7 @@ glabel func0f084cf0
/* f084dbc: c4660010 */ lwc1 $f6,0x10($v1)
/* f084dc0: afb00024 */ sw $s0,0x24($sp)
/* f084dc4: afa00020 */ sw $zero,0x20($sp)
/* f084dc8: 0fc54208 */ jal func0f150820
/* f084dc8: 0fc54208 */ jal shardsCreate
/* f084dcc: e7a6001c */ swc1 $f6,0x1c($sp)
/* f084dd0: 3c04bcde */ lui $a0,0xbcde
.L0f084dd4:
@ -35034,7 +35033,7 @@ glabel func0f084e58
/* f084f14: c50a0010 */ lwc1 $f10,0x10($t0)
/* f084f18: afa00020 */ sw $zero,0x20($sp)
/* f084f1c: afab0024 */ sw $t3,0x24($sp)
/* f084f20: 0fc54208 */ jal func0f150820
/* f084f20: 0fc54208 */ jal shardsCreate
/* f084f24: e7aa001c */ swc1 $f10,0x1c($sp)
/* f084f28: 8fa4008c */ lw $a0,0x8c($sp)
/* f084f2c: 0fc4f903 */ jal func0f13e40c
@ -35098,7 +35097,7 @@ glabel func0f084f64
/* f085000: c60a0010 */ lwc1 $f10,0x10($s0)
/* f085004: afa00020 */ sw $zero,0x20($sp)
/* f085008: afa80024 */ sw $t0,0x24($sp)
/* f08500c: 0fc54208 */ jal func0f150820
/* f08500c: 0fc54208 */ jal shardsCreate
/* f085010: e7aa001c */ swc1 $f10,0x1c($sp)
/* f085014: 8fa4008c */ lw $a0,0x8c($sp)
.L0f085018:

1053
src/game/shards/create.c Normal file

File diff suppressed because it is too large Load Diff

39
src/game/shards/init.c Normal file
View File

@ -0,0 +1,39 @@
#include <ultra64.h>
#include "constants.h"
#include "game/data/data_000000.h"
#include "game/data/data_0083d0.h"
#include "game/data/data_00e460.h"
#include "game/data/data_0160b0.h"
#include "game/data/data_01a3a0.h"
#include "game/data/data_020df0.h"
#include "game/data/data_02da90.h"
#include "gvars/gvars.h"
#include "lib/memory.h"
#include "types.h"
void shardsInit(void)
{
s32 i;
g_MaxShards = 200 / PLAYERCOUNT();
if (IS4MB()) {
g_MaxShards = g_MaxShards / 2;
}
if (g_Vars.stagenum >= STAGE_TITLE) {
g_MaxShards = 0;
}
if (g_MaxShards == 0) {
g_Shards = NULL;
} else {
g_Shards = malloc(g_MaxShards * sizeof(struct shard) + 0xf & ~0xf, MEMPOOL_STAGE);
for (i = 0; i < g_MaxShards; i++) {
g_Shards[i].age60 = 0;
}
}
var8007fa80 = 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,6 @@
#include "game/game_107fb0.h"
#include "game/inventory/inventory.h"
#include "game/explosions/explosions.h"
#include "game/game_150820.h"
#include "game/game_1531a0.h"
#include "game/room.h"
#include "game/training/menus.h"
@ -2869,7 +2868,7 @@ glabel var7f1b94e4
/* f1a01c4: c5060010 */ lwc1 $f6,0x10($t0)
/* f1a01c8: afb10024 */ sw $s1,0x24($sp)
/* f1a01cc: afae0020 */ sw $t6,0x20($sp)
/* f1a01d0: 0fc54208 */ jal func0f150820
/* f1a01d0: 0fc54208 */ jal shardsCreate
/* f1a01d4: e7a6001c */ swc1 $f6,0x1c($sp)
/* f1a01d8: 92af0455 */ lbu $t7,0x455($s5)
/* f1a01dc: 24070005 */ addiu $a3,$zero,0x5
@ -3659,7 +3658,7 @@ glabel var7f1b94e4
// if (g_FrNumSounds);
//
// // 1d0
// func0f150820(&prop->pos, &obj->realrot[0], &obj->realrot[3], &obj->realrot[6],
// shardsCreate(&prop->pos, &obj->realrot[0], &obj->realrot[3], &obj->realrot[6],
// model08thing->unk04[0], model08thing->unk04[1], model08thing->unk04[2],
// model08thing->unk04[3], 2, prop);
//

View File

@ -3,9 +3,6 @@
#include <ultra64.h>
#include "types.h"
u32 func0f013550(void);
void shardsInit(void);
void func0f013b80(void);
void func0f013ba0(void);
void func0f013550(void);
#endif

View File

@ -0,0 +1,9 @@
#ifndef _IN_GAME_GAME_013B80_H
#define _IN_GAME_GAME_013B80_H
#include <ultra64.h>
#include "types.h"
void func0f013b80(void);
void func0f013ba0(void);
#endif

View File

@ -1,8 +0,0 @@
#ifndef IN_GAME_GAME_015420_H
#define IN_GAME_GAME_015420_H
#include <ultra64.h>
#include "types.h"
u32 shardsReset(void);
#endif

View File

@ -1,8 +0,0 @@
#ifndef _IN_GAME_GAME_01DE30_H
#define _IN_GAME_GAME_01DE30_H
#include <ultra64.h>
#include "types.h"
void shardsTick(void);
#endif

View File

@ -1,12 +0,0 @@
#ifndef IN_GAME_GAME_150820_H
#define IN_GAME_GAME_150820_H
#include <ultra64.h>
#include "types.h"
u16 func0f150820(struct coord *pos, f32 *rotx, f32 *roty, f32 *rotz, f32 arg4, f32 arg5, f32 arg6, f32 arg7, u32 arg8, struct prop *prop);
u32 func0f150d38(void);
Gfx *func0f151780(Gfx *gdl);
Gfx *func0f151ed0(Gfx *gdl);
Gfx *func0f1526e4(Gfx *gdl);
#endif

12
src/include/game/shards.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef IN_GAME_SHARDS_H
#define IN_GAME_SHARDS_H
#include <ultra64.h>
#include "types.h"
u16 shardsCreate(struct coord *pos, f32 *rotx, f32 *roty, f32 *rotz, f32 arg4, f32 arg5, f32 arg6, f32 arg7, u32 arg8, struct prop *prop);
void shardsInit(void);
Gfx *shardsRender(Gfx *gdl);
void shardsReset(void);
void shardsTick(void);
#endif