mirror of
https://github.com/N64Recomp/N64Recomp.git
synced 2026-05-07 17:31:48 +00:00
Switch offline mod recompilation to use a base global event index instead of per-event global indices
This commit is contained in:
parent
747cd9f6ac
commit
5b98d7544a
2 changed files with 4 additions and 4 deletions
|
|
@ -165,8 +165,8 @@ int main(int argc, const char** argv) {
|
|||
output_file << "RECOMP_EXPORT recomp_func_t* reference_symbol_funcs[" << std::max(size_t{1},num_reference_symbols) << "] = {0};\n\n";
|
||||
|
||||
// Write provided event array (maps internal event indices to global ones).
|
||||
output_file << "// Mapping of internal event indices to global ones.\n";
|
||||
output_file << "RECOMP_EXPORT uint32_t event_indices[" << std::max(size_t{1}, mod_context.event_symbols.size()) <<"] = {0};\n\n";
|
||||
output_file << "// Base global event index for this mod's events.\n";
|
||||
output_file << "RECOMP_EXPORT uint32_t base_event_index;\n\n";
|
||||
|
||||
// Write the event trigger function pointer.
|
||||
output_file << "// Pointer to the runtime function for triggering events.\n";
|
||||
|
|
|
|||
|
|
@ -242,11 +242,11 @@ bool process_instruction(const N64Recomp::Context& context, const N64Recomp::Fun
|
|||
if (reloc_section == N64Recomp::SectionEvent) {
|
||||
needs_link_branch = link_branch;
|
||||
if (indent) {
|
||||
if (!print_unconditional_branch(" recomp_trigger_event(rdram, ctx, event_indices[{}])", reloc_reference_symbol)) {
|
||||
if (!print_unconditional_branch(" recomp_trigger_event(rdram, ctx, base_event_index + {})", reloc_reference_symbol)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!print_unconditional_branch("recomp_trigger_event(rdram, ctx, event_indices[{}])", reloc_reference_symbol)) {
|
||||
if (!print_unconditional_branch("recomp_trigger_event(rdram, ctx, base_event_index + {})", reloc_reference_symbol)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue