some stuff

This commit is contained in:
dark-samus 2021-01-16 01:34:36 -05:00
parent a2b010ca37
commit a4b5d8f200
11 changed files with 303 additions and 258 deletions

View File

@ -115,9 +115,3 @@ glabel D_802EB150
glabel D_802EB158
.double 6.283180236816406
glabel jtbl_802EB160_10C9E0
.word L802E2F78_1047F8, L802E2FA4_104824, L802E2FA4_104824, L802E2FA4_104824, L802E2FA4_104824, L802E2FA4_104824, L802E2FA4_104824, L802E2FA4_104824, L802E2F30_1047B0, L802E2F48_1047C8, L802E2F60_1047E0, L802E2F30_1047B0, L802E2F48_1047C8, L802E2F60_1047E0
glabel jtbl_802EB198_10CA18
.word L802E305C_1048DC, L802E3064_1048E4, L802E3064_1048E4, L802E3064_1048E4, L802E3064_1048E4, L802E3064_1048E4, L802E3064_1048E4, L802E3064_1048E4, L802E3014_104894, L802E302C_1048AC, L802E3044_1048C4, L802E3020_1048A0, L802E3038_1048B8, L802E3050_1048D0

View File

@ -11,6 +11,5 @@
#include "si.h"
#include "messages.h"
#include "ld_addrs.h"
#include "stdarg.h"
#endif

View File

@ -326,13 +326,15 @@ typedef UNK_TYPE* DynamicEntityList[MAX_DYNAMIC_ENTITIES];
typedef struct StaticEntityData {
/* 0x00 */ s16 flags;
/* 0x02 */ s16 argSize;
/* 0x04 */ char unk_04[8];
/* 0x04 */ UNK_PTR unk_04;
/* 0x08 */ char unk_08[4];
/* 0x0C */ UNK_FUN_PTR(unk_data_func);
/* 0x10 */ UNK_PTR unk_data_ptr1;
/* 0x14 */ UNK_PTR unk_data_ptr2;
/* 0x18 */ s32 dmaStart;
/* 0x1C */ s32 dmaEnd;
/* 0x20 */ char unk_20[4];
/* 0x20 */ s8 entityType;
/* 0x21 */ char unk_21[3];
} StaticEntityData; // size = 0x24
typedef struct MusicPlayer {

View File

@ -65,9 +65,9 @@
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
typedef char* __gnuc_va_list;
typedef char *__gnuc_va_list;
#else
typedef void* __gnuc_va_list;
typedef void *__gnuc_va_list;
#endif
#endif
@ -90,7 +90,7 @@ typedef void* __gnuc_va_list;
(AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
#undef va_end
void va_end(__gnuc_va_list); /* Defined in libgcc.a */
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
#define va_end(AP) ((void)0)
/* We cast to void * and then to TYPE * because this avoids

View File

@ -17,16 +17,16 @@
typedef struct {
/* Pointer to FP regs. */
char* __fp_regs;
char *__fp_regs;
/* Number of FP regs remaining. */
int __fp_left;
/* Pointer to GP regs followed by stack parameters. */
char* __gp_regs;
char *__gp_regs;
} __gnuc_va_list;
#else /* ! (defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
typedef char* __gnuc_va_list;
typedef char * __gnuc_va_list;
#endif /* ! (defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
#endif /* not __GNUC_VA_LIST */
@ -165,7 +165,7 @@ enum {
#endif /* ! _STDARG_H */
#ifndef va_end
void va_end(__gnuc_va_list); /* Defined in libgcc.a */
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
#endif
#define va_end(__AP) ((void)0)

View File

@ -97,9 +97,9 @@
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
typedef char* __gnuc_va_list;
typedef char *__gnuc_va_list;
#else
typedef void* __gnuc_va_list;
typedef void *__gnuc_va_list;
#endif
#endif

View File

@ -574,109 +574,3 @@ void func_802E2BA4(s32 entityIndex) {
#else
INCLUDE_ASM(s32, "code_102c80", func_802E2BA4);
#endif
// file split
#ifdef NON_MATCHING
// Needs rodata support
void func_802E2EB0(Entity* entity) {
u32 type;
void* a2 = NULL;
void* a1 = NULL;
((struct802E1400*)entity->dataBuf)->unk_38 = entity->position.y;
type = get_entity_type((u8)entity->listIndex);
if ((type - 24) < 3) {
entity->scale.x = 0.5f;
entity->scale.y = 0.5f;
entity->scale.z = 0.5f;
}
switch (type) {
case 21:
case 24:
a1 = &D_0A0031E0;
a2 = &D_0A001508;
break;
case 22:
case 25:
a1 = &D_0A0031B0;
a2 = &D_0A0014D8;
break;
case 23:
case 26:
a1 = &D_0A002F78;
a2 = &D_0A001218;
break;
case 13:
play_sound_at_position(0x158, 0, entity->position.x, entity->position.y, entity->position.z);
a1 = &D_0A003F70;
a2 = &D_0A002318;
break;
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
break;
}
if (a2 == NULL) {
return;
}
func_802E246C(entity, a1, a2);
}
#else
INCLUDE_ASM(void, "code_102c80", func_802E2EB0, Entity* entity);
#endif
#ifdef NON_MATCHING
//Needs rodata support
void func_802E2FD0(Entity* entity) {
u32 type;
void* addr = NULL;
type = get_entity_type(entity->listIndex);
switch (type) {
case 21:
addr = &D_802E9C8C;
break;
case 24:
addr = &D_802E9CF8;
break;
case 22:
addr = &D_802E9CB0;
break;
case 25:
addr = &D_802E9D1C;
break;
case 23:
addr = &D_802E9CD4;
break;
case 26:
addr = &D_802E9D40;
break;
case 13:
addr = &D_802E9D64;
break;
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
break;
}
if (addr == NULL) {
return;
}
create_entity(addr, entity->position.x, entity->position.y, entity->position.z, 0, 0x80000000);
}
#else
INCLUDE_ASM(s32, "code_102c80", func_802E2FD0);
#endif

View File

@ -1,5 +1,139 @@
#include "common.h"
INCLUDE_ASM(s32, "code_104730", func_802E2EB0);
extern UNK_TYPE D_0A0031E0;
extern UNK_TYPE D_0A001508;
extern UNK_TYPE D_0A0031B0;
extern UNK_TYPE D_0A0014D8;
extern UNK_TYPE D_0A002F78;
extern UNK_TYPE D_0A001218;
extern UNK_TYPE D_0A003F70;
extern UNK_TYPE D_0A002318;
INCLUDE_ASM(s32, "code_104730", func_802E2FD0);
void func_802E2EB0(Entity* entity) {
u32 type;
void* a2 = NULL;
void* a1 = NULL;
((struct802E1400*)entity->dataBuf)->unk_38 = entity->position.y;
type = get_entity_type((u8)entity->listIndex);
if ((type - 24) < 3) {
entity->scale.x = 0.5f;
entity->scale.y = 0.5f;
entity->scale.z = 0.5f;
}
switch (type) {
case 21:
case 24:
a1 = &D_0A0031E0;
a2 = &D_0A001508;
break;
case 22:
case 25:
a1 = &D_0A0031B0;
a2 = &D_0A0014D8;
break;
case 23:
case 26:
a1 = &D_0A002F78;
a2 = &D_0A001218;
break;
case 13:
play_sound_at_position(0x158, 0, entity->position.x, entity->position.y, entity->position.z);
a1 = &D_0A003F70;
a2 = &D_0A002318;
break;
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
break;
}
if (a2 == NULL) {
return;
}
func_802E246C(entity, a1, a2);
}
typedef struct struct802E9C40 {
/* 0x00 */ char unk_00[0x10];
/* 0x10 */ UNK_PTR unk_10;
/* 0x14 */ char unk_14[0x1C];
} struct802E9C40; // size = 0x20
typedef struct struct802E9C70 {
/* 0x00 */ char unk_00[0x10];
/* 0x10 */ UNK_PTR unk_10;
/* 0x14 */ char unk_14[8];
} struct802E9C70;
extern UNK_TYPE D_802E9828;
void func_802E263C(Entity* entity);
struct802E9C40 D_802E9C40 = {{0, 0, 0, 7, 0, 0, 0, 0x20, 0, 0, 0, 3, 0, 0, 0, 0}, func_802E263C, {0, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0, 7, 0x20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
struct802E9C70 D_802E9C70 = {{0, 0, 0, 4, 0, 0, 0, 0x11, 0, 0, 0, 1, 0, 0, 0, 0x3C}, &D_802E9828, {0, 0, 0, 2, 0, 0, 0, 0}};
//ROM addrs; todo
extern UNK_TYPE D_00E32420;
extern UNK_TYPE D_00E35670;
extern UNK_TYPE D_00E38890;
extern UNK_TYPE D_00E3B870;
extern UNK_TYPE D_00E3E260;
extern UNK_TYPE D_00E42240;
StaticEntityData D_802E9C8C = {0, 0x250, &D_802E9C70, {0, 0, 0, 0}, func_802E2EB0, &D_802E9C40, NULL, &D_00E32420, &D_00E35670, 21, {0x10, 0x10, 0x10}};
StaticEntityData D_802E9CB0 = {0, 0x250, &D_802E9C70, {0, 0, 0, 0}, func_802E2EB0, &D_802E9C40, NULL, &D_00E35670, &D_00E38890, 22, {0x10, 0x10, 0x10}};
StaticEntityData D_802E9CD4 = {0, 0x250, &D_802E9C70, {0, 0, 0, 0}, func_802E2EB0, &D_802E9C40, NULL, &D_00E38890, &D_00E3B870, 23, {0x10, 0x10, 0x10}};
StaticEntityData D_802E9CF8 = {0, 0x250, &D_802E9C70, {0, 0, 0, 0}, func_802E2EB0, &D_802E9C40, NULL, &D_00E32420, &D_00E35670, 24, {0x08, 0x08, 0x08}};
StaticEntityData D_802E9D1C = {0, 0x250, &D_802E9C70, {0, 0, 0, 0}, func_802E2EB0, &D_802E9C40, NULL, &D_00E35670, &D_00E38890, 25, {0x08, 0x08, 0x08}};
StaticEntityData D_802E9D40 = {0, 0x250, &D_802E9C70, {0, 0, 0, 0}, func_802E2EB0, &D_802E9C40, NULL, &D_00E38890, &D_00E3B870, 26, {0x08, 0x08, 0x08}};
StaticEntityData D_802E9D64 = {0, 0x250, &D_802E9C70, {0, 0, 0, 0}, func_802E2EB0, &D_802E9C40, NULL, &D_00E3E260, &D_00E42240, 13, {0x08, 0x08, 0x08}};
void func_802E2FD0(Entity* entity) {
u32 type;
StaticEntityData* addr = NULL;
type = get_entity_type(entity->listIndex);
switch (type) {
case 21:
addr = &D_802E9C8C;
break;
case 24:
addr = &D_802E9CF8;
break;
case 22:
addr = &D_802E9CB0;
break;
case 25:
addr = &D_802E9D1C;
break;
case 23:
addr = &D_802E9CD4;
break;
case 26:
addr = &D_802E9D40;
break;
case 13:
addr = &D_802E9D64;
break;
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
break;
}
if (addr == NULL) {
return;
}
create_entity(addr, entity->position.x, entity->position.y, entity->position.z, 0, 0x80000000);
}

View File

@ -1,4 +1,5 @@
#include "common.h"
#include "stdlib/stdarg.h"
u32 func_80025D74(void* arg0, const unsigned char* str, s32 count);

View File

@ -308,7 +308,7 @@ segments:
files:
- [0x102610, c, code_102610_len_2330]
- [0x102C80, c]
- [0x104730, c]
- [0x104730, c, code_104730]
- [0x104940, c, code_104940_len_dc0]
- [0x105700, c, code_105700_len_2130]
- [0x105F90, c]
@ -324,7 +324,10 @@ segments:
#- [0x10AB70, i4, shadow/10AB70, 32, 32]
#- [0x10AD70, i4, shadow/10AD70, 32, 32]
- [0x10AF70, bin] # TODO
- [0x10B4C0, .data, code_104730]
- [0x10B608, bin]
- [0x10C880, rodata, code_102c80]
- [0x10C9E0, .rodata, code_104730]
- [0x10CA50, rodata, code_104940_len_dc0]
- [0x10CAF0, bin]
- [0x1164B8, ci8, peach_letter, 150, 105]

View File

@ -82,3 +82,21 @@ D_0A004350 = 0x0A004350;
D_0A0026F0 = 0x0A0026F0;
D_00074210 = 0x00074210;
D_00074230 = 0x00074230;
D_0A0031E0 = 0x0A0031E0;
D_0A001508 = 0x0A001508;
D_0A0031B0 = 0x0A0031B0;
D_0A0014D8 = 0x0A0014D8;
D_0A002F78 = 0x0A002F78;
D_0A001218 = 0x0A001218;
D_0A003F70 = 0x0A003F70;
D_0A002318 = 0x0A002318;
D_802E9828 = 0x802E9828;
D_802E9C40 = 0x802E9C40;
D_802E9C70 = 0x802E9C70;
D_00E32420 = 0x00E32420;
D_00E35670 = 0x00E35670;
D_00E38890 = 0x00E38890;
D_00E3B870 = 0x00E3B870;
D_00E3E260 = 0x00E3E260;
D_00E42240 = 0x00E42240;