[gamecode] Correct call's mode selection

Call's operand c is used to specify where the return value of the
function is to be stored. This gets both the correct function being
called, and the value being returned correctly. Test still fails due to
the stack restoration issue.
This commit is contained in:
Bill Currie 2022-01-17 14:29:14 +09:00
parent b3909dbe4c
commit cf3106ce28

View file

@ -3141,7 +3141,7 @@ pr_exec_ruamoko (progs_t *pr, int exitdepth)
case OP_CALL_B:
case OP_CALL_C:
case OP_CALL_D:
mm = pr_call_mode (pr, st, st->c & 3);
mm = pr_call_mode (pr, st, st_op - OP_CALL_B + 1);
function = mm->func_var;
pr->pr_argc = 0;
// op_c specifies the location for the return value if any