Implement DG_NEW and DG_STR_TO_METHOD instructions

Used in Rance 9.
This commit is contained in:
kichikuou
2026-03-28 08:18:41 +09:00
parent 65ff73ca06
commit ecc04bc9bb
+11 -2
View File
@@ -2298,8 +2298,17 @@ static enum opcode execute_instruction(enum opcode opcode)
}
break;
}
//case DG_NEW:
//case DG_STR_TO_METHOD:
case DG_NEW: {
stack_push(heap_alloc_page(alloc_page(DELEGATE_PAGE, 0, 0)));
break;
}
case DG_STR_TO_METHOD: {
stack_pop(); // delegate type index
int str = stack_pop().i;
stack_push(get_function_by_name(heap_get_string(str)->text));
heap_unref(str);
break;
}
// -- NOOPs ---
case FUNC:
break;