MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / emit_function_call_lookup

Method emit_function_call_lookup

LiveRecomp/live_generator.cpp:1368–1384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1366}
1367
1368void N64Recomp::LiveGenerator::emit_function_call_lookup(uint32_t addr) const {
1369 // Load the address immediate into the first argument.
1370 sljit_emit_op1(compiler, SLJIT_MOV32, SLJIT_R0, 0, SLJIT_IMM, int32_t(addr));
1371
1372 // Call get_function.
1373 sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS1(P, 32), SLJIT_IMM, sljit_sw(inputs.get_function));
1374
1375 // Copy the return value into R3 so that it can be used for icall
1376 sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_R3, 0, SLJIT_RETURN_REG, 0);
1377
1378 // Load rdram and ctx into R0 and R1.
1379 sljit_emit_op2(compiler, SLJIT_ADD, SLJIT_R0, 0, Registers::rdram, 0, SLJIT_IMM, rdram_offset);
1380 sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_R1, 0, Registers::ctx, 0);
1381
1382 // Call the function.
1383 sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS2V(P, P), SLJIT_R3, 0);
1384}
1385
1386void N64Recomp::LiveGenerator::emit_function_call_by_register(int reg) const {
1387 // Load the register's value into the first argument.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected