Attempt to decompile ai000b

This commit is contained in:
Ryan Dwyer 2019-11-05 20:47:43 +10:00
parent a473175f9a
commit 874d4959bc
5 changed files with 70 additions and 6 deletions

View File

@ -455,6 +455,67 @@ glabel ai000b
/* f04e3ac: 00001025 */ or $v0,$zero,$zero
);
// Mismatch because the compiler adds divide-by-zero checks to the division.
// We need something like -mno-check-zero-division but that option doesn't exist
// in our version of the compiler.
//bool ai000b(void)
//{
// u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
// u32 anim_id = cmd[3] | (cmd[2] << 8);
// struct chrdata *chr = NULL;
// s32 startframe = cmd[5] | (cmd[4] << 8);
// s32 endframe = cmd[7] | (cmd[6] << 8);
// float fstartframe;
// float fendframe;
//
// if (g_Vars.chrdata) {
// chr = chrFindById(g_Vars.chrdata, cmd[10]);
// }
//
// if (startframe == 0xffff) {
// fstartframe = 0;
// } else if (startframe == 0xfffe) {
// fstartframe = func00023768(anim_id) - 1;
// } else {
// fstartframe = startframe;
// }
//
// if (endframe == 0xffff) {
// fendframe = -1.0;
// } else {
// fendframe = endframe;
// }
//
// if (chr && chr->unk020) {
// float result = 1.0 / cmd[11];
//
// if (g_Vars.in_cutscene) {
// if (startframe != 0xfffe) {
// fstartframe += var8009de20 * result * 0.25;
// }
//
// chr->pos->unk3a = 0;
// }
//
// func0f03af44(chr, anim_id, fstartframe, fendframe, cmd[8], cmd[9], result);
//
// if (startframe == 0xfffe) {
// func0f0220ec(chr, 1, 1);
//
// if (chr->pos->unk00 == 6) {
// u32 playernum = posGetPlayerNum(chr->pos);
// struct player *player = g_Vars.players[playernum];
// player->unk078 = chr->ground;
// player->unk074 = chr->ground;
// }
// }
// }
//
// g_Vars.aioffset += 12;
//
// return false;
//}
/**
* @cmd 000c
*/

View File

@ -33,5 +33,6 @@ u32 func0f01a348(void);
u32 func0f01aba8(void);
u32 func0f01b148(void);
u32 func0f01b154(void);
void func0f03af44(struct chrdata *chr, u32 anim_id, float fstartframe, float fendframe, u8 flags, u8 transition, float result);
#endif

View File

@ -189,7 +189,7 @@ struct g_vars {
/*0004c0*/ u32 unk0004c0;
/*0004c4*/ u32 unk0004c4;
/*0004c8*/ u32 unk0004c8;
/*0004cc*/ u32 in_cutscene;
/*0004cc*/ s32 in_cutscene;
/*0004d0*/ u32 unk0004d0;
/*0004d4*/ u32 unk0004d4;
/*0004d8*/ u32 unk0004d8;
@ -355,6 +355,7 @@ extern u32 var80090af8;
extern u32 var80090afc;
extern u32 var8009cac0;
extern u32 var8009cac4;
extern u32 var8009de20;
extern u32 var8009de24;
extern u32 g_EepromFlags;

View File

@ -282,7 +282,7 @@ u32 func00023108(void);
u32 func0002319c(void);
u32 func00023314(void);
u32 func0002373c(void);
u32 func00023768(void);
s32 func00023768(s16 anim_id);
u32 func00023794(void);
u32 func000237dc(void);
u32 func0002384c(void);

View File

@ -46,7 +46,8 @@ struct position {
u32 unk2c;
u32 unk30;
u32 unk34;
u32 unk38;
s16 unk38;
s16 unk3a;
u32 unk3c;
u32 unk40;
};
@ -121,7 +122,7 @@ struct chrdata {
/*0x0ac*/ u32 unk0ac;
/*0x0b0*/ u32 sumground;
/*0x0b4*/ u32 manground;
/*0x0b8*/ u32 ground;
/*0x0b8*/ float ground;
/*0x0bc*/ struct coord fallspeed;
/*0x0c8*/ struct coord prevpos;
/*0x0d4*/ u32 lastwalk60;
@ -501,8 +502,8 @@ struct player {
/*0x068*/ u32 unk068;
/*0x06c*/ u32 unk06c;
/*0x070*/ u32 unk070;
/*0x074*/ u32 unk074;
/*0x078*/ u32 unk078;
/*0x074*/ float unk074;
/*0x078*/ float unk078;
/*0x07c*/ u32 unk07c;
/*0x080*/ u32 unk080;
/*0x084*/ u32 unk084;