| 703 | } |
| 704 | |
| 705 | bool N64Recomp::Context::import_reference_context(const N64Recomp::Context& reference_context) { |
| 706 | reference_sections.resize(reference_context.sections.size()); |
| 707 | reference_symbols.reserve(reference_context.functions.size()); |
| 708 | |
| 709 | // Copy the reference context's sections into the real context's reference sections. |
| 710 | for (size_t section_index = 0; section_index < reference_context.sections.size(); section_index++) { |
| 711 | const N64Recomp::Section& section_in = reference_context.sections[section_index]; |
| 712 | N64Recomp::ReferenceSection& section_out = reference_sections[section_index]; |
| 713 | |
| 714 | section_out.rom_addr = section_in.rom_addr; |
| 715 | section_out.ram_addr = section_in.ram_addr; |
| 716 | section_out.size = section_in.size; |
| 717 | section_out.relocatable = section_in.relocatable; |
| 718 | } |
| 719 | |
| 720 | // Copy the functions from the reference context into the reference context's function map. |
| 721 | for (const N64Recomp::Function& func_in: reference_context.functions) { |
| 722 | if (!add_reference_symbol(func_in.name, func_in.section_index, func_in.vram, true)) { |
| 723 | return false; |
| 724 | } |
| 725 | } |
| 726 | |
| 727 | return true; |
| 728 | } |
| 729 | |
| 730 | // Reads a data symbol file and adds its contents into this context's reference data symbols. |
| 731 | bool N64Recomp::Context::read_data_reference_syms(const std::filesystem::path& data_syms_file_path) { |