| 460 | } |
| 461 | |
| 462 | void N64Recomp::CGenerator::emit_switch(const Context& recompiler_context, const JumpTable& jtbl, int reg) const { |
| 463 | (void)recompiler_context; |
| 464 | (void)reg; |
| 465 | // TODO generate code to subtract the jump table address from the register's value instead. |
| 466 | // Once that's done, the addend temp can be deleted to simplify the generator interface. |
| 467 | std::string jump_variable = fmt::format("jr_addend_{:08X}", jtbl.jr_vram); |
| 468 | |
| 469 | fmt::print(output_file, "switch ({} >> 2) {{\n", jump_variable); |
| 470 | } |
| 471 | |
| 472 | void N64Recomp::CGenerator::emit_case(int case_index, const std::string& target_label) const { |
| 473 | fmt::print(output_file, "case {}: goto {}; break;\n", case_index, target_label); |
no outgoing calls
no test coverage detected