Added on_error handler for Module

This commit is contained in:
Nekotekina 2015-07-27 18:43:32 +03:00
parent 5815d90eb4
commit 25056f49c4
4 changed files with 52 additions and 0 deletions

View file

@ -198,6 +198,12 @@ void execute_ppu_func_by_index(PPUThread& CPU, u32 index)
CPU.PC = VM_CAST(CPU.LR & ~3) - 4;
}
// execute module-specific error check
if ((s64)CPU.GPR[3] < 0 && func->module && func->module->on_error)
{
func->module->on_error(CPU.GPR[3], func);
}
CPU.hle_code = last_code;
}
else
@ -610,6 +616,11 @@ Module::~Module()
void Module::Init()
{
on_load = nullptr;
on_unload = nullptr;
on_stop = nullptr;
on_error = nullptr;
m_init();
}