mirror of
https://github.com/N64Recomp/N64Recomp.git
synced 2025-05-24 12:24:59 +00:00
Mod function hooking (#124)
* Add function hooks to mod symbol format * Add function sizes to section function tables * Add support for function hooks in live generator * Add an option to the context to force function lookup for all non-relocated function calls * Include relocs in overlay data * Include R_MIPS_26 relocs in symbol file dumping/parsing * Add manual patch symbols (syms.ld) to the output overlay file and relocs * Fix which relocs were being emitted for patch sections * Fix sign extension issue with mfc1, add TODO for banker's rounding
This commit is contained in:
parent
36b5d9ae33
commit
38df8e3ddc
11 changed files with 269 additions and 41 deletions
|
@ -78,6 +78,11 @@ namespace N64Recomp {
|
|||
void (*trigger_event)(uint8_t* rdram, recomp_context* ctx, uint32_t event_index);
|
||||
int32_t *reference_section_addresses;
|
||||
int32_t *local_section_addresses;
|
||||
void (*run_hook)(uint8_t* rdram, recomp_context* ctx, size_t hook_table_index);
|
||||
// Maps function index in recompiler context to function's entry hook slot.
|
||||
std::unordered_map<size_t, size_t> entry_func_hooks;
|
||||
// Maps function index in recompiler context to function's return hook slot.
|
||||
std::unordered_map<size_t, size_t> return_func_hooks;
|
||||
};
|
||||
class LiveGenerator final : public Generator {
|
||||
public:
|
||||
|
@ -109,7 +114,7 @@ namespace N64Recomp {
|
|||
void emit_case(int case_index, const std::string& target_label) const final;
|
||||
void emit_switch_error(uint32_t instr_vram, uint32_t jtbl_vram) const final;
|
||||
void emit_switch_close() const final;
|
||||
void emit_return(const Context& context) const final;
|
||||
void emit_return(const Context& context, size_t func_index) const final;
|
||||
void emit_check_fr(int fpr) const final;
|
||||
void emit_check_nan(int fpr, bool is_double) const final;
|
||||
void emit_cop0_status_read(int reg) const final;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue