Attempt to decompile aiSpeak

This commit is contained in:
Ryan Dwyer 2019-11-28 22:10:29 +10:00
parent e43d5a7f53
commit de121b141d
4 changed files with 43 additions and 4 deletions

View File

@ -6359,7 +6359,7 @@ bool aiShowText2(void)
* @cmd 00cd
*/
GLOBAL_ASM(
glabel ai00cd
glabel aiSpeak
/* f056040: 27bdffb8 */ addiu $sp,$sp,-72
/* f056044: afb10020 */ sw $s1,0x20($sp)
/* f056048: 3c11800a */ lui $s1,%hi(g_Vars)
@ -6479,6 +6479,45 @@ glabel ai00cd
/* f0561f4: 00001025 */ or $v0,$zero,$zero
);
// Mismatch due to different registers
//bool aiSpeak(void)
//{
// u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
// struct chrdata *chr = chrFindById(g_Vars.chrdata, cmd[2]);
// s16 audio_id = cmd[6] | (cmd[5] << 8);
// s16 text_id = cmd[4] | (cmd[3] << 8);
// s32 prevplayernum = g_Vars.currentplayernum;
// s32 playernum = g_Vars.currentplayernum;
// u32 audioref;
// char *text = text_id >= 0 ? textGet(text_id) : NULL;
//
// if (chr && chr->pos && chr->pos->type == POSITIONTYPE_PLAYER) {
// playernum = posGetPlayerNum(chr->pos);
// }
//
// setCurrentPlayerNum(playernum);
//
// if (text && cmd[2] != CHR_P1P2) {
// func0f0926bc(g_Vars.chrdata->pos, 9, 0xffff);
// }
//
// if (cmd[2] == CHR_P1P2) {
// audioref = audioPlayFromWorldPosition(cmd[7], audio_id, 0, g_Vars.chrdata->pos, 0, 512);
// } else {
// audioref = audioPlayFromWorldPosition(cmd[7], audio_id, 0, g_Vars.chrdata->pos, 9, 512);
// }
//
// if (text && !audioIsFiltered(audio_id)) {
// func0f0de160(text, 6, cmd[8], audioref);
// }
//
// setCurrentPlayerNum(prevplayernum);
//
// g_Vars.aioffset += 9;
//
// return false;
//}
/**
* @cmd 00ce
*/

View File

@ -207,7 +207,7 @@
/*0x00ca*/ bool aiDuplicateChr(void);
/*0x00cb*/ bool aiMessage(void);
/*0x00cc*/ bool aiShowText2(void);
/*0x00cd*/ bool ai00cd(void);
/*0x00cd*/ bool aiSpeak(void);
/*0x00ce*/ bool aiPlaySound(void);
/*0x00cf*/ bool ai00cf(void);
/*0x00d0*/ bool ai00d0(void);

View File

@ -47,6 +47,6 @@ s32 textGetFileId(s32 bank);
void textSetBankSimple(s32 bank);
void textSetBank(s32 bank, s32 arg1, s32 arg2);
void textClearBank(s32 bank);
char *textGet(u32 textid);
char *textGet(s32 textid);
#endif

View File

@ -14337,7 +14337,7 @@ bool (*g_CommandPointers[])(void) = {
/*0x00ca*/ aiDuplicateChr,
/*0x00cb*/ aiMessage,
/*0x00cc*/ aiShowText2,
/*0x00cd*/ ai00cd,
/*0x00cd*/ aiSpeak,
/*0x00ce*/ aiPlaySound,
/*0x00cf*/ ai00cf,
/*0x00d0*/ ai00d0,