From be4b8096d46da5b17021a729e36f3c06ad8830ea Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 16 Oct 2002 06:44:41 +0000 Subject: [PATCH] two new instructions: move and movep: basicly memmove. qfcc support coming as soon as I get it working :) --- include/QF/pr_comp.h | 3 +++ libs/gamecode/engine/pr_exec.c | 8 ++++++++ libs/gamecode/engine/pr_opcode.c | 3 +++ 3 files changed, 14 insertions(+) diff --git a/include/QF/pr_comp.h b/include/QF/pr_comp.h index a3de24f99..ab021cecf 100644 --- a/include/QF/pr_comp.h +++ b/include/QF/pr_comp.h @@ -255,6 +255,9 @@ typedef enum { OP_GE_P, OP_LT_P, OP_GT_P, + + OP_MOVE, + OP_MOVEP, } pr_opcode_e; typedef struct opcode_s { diff --git a/libs/gamecode/engine/pr_exec.c b/libs/gamecode/engine/pr_exec.c index ac5681f5c..1249b48f3 100644 --- a/libs/gamecode/engine/pr_exec.c +++ b/libs/gamecode/engine/pr_exec.c @@ -889,6 +889,14 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum) OPC.integer_var = OPA.integer_var != OPB.integer_var; break; + case OP_MOVE: + memmove (&OPC, &OPA, st->b); + break; + case OP_MOVEP: + memmove (pr->pr_globals + OPC.integer_var, + pr->pr_globals + OPA.integer_var, OPB.uinteger_var); + break; + // LordHavoc: to be enabled when Progs version 7 (or whatever it will be numbered) is finalized /* case OP_BOUNDCHECK: diff --git a/libs/gamecode/engine/pr_opcode.c b/libs/gamecode/engine/pr_opcode.c index 464bc8825..60afbd386 100644 --- a/libs/gamecode/engine/pr_opcode.c +++ b/libs/gamecode/engine/pr_opcode.c @@ -247,6 +247,9 @@ opcode_t pr_opcodes[] = { {"==", "eq.p", OP_EQ_P, false, ev_pointer, ev_pointer, ev_integer, PROG_VERSION}, {"!=", "ne.p", OP_NE_P, false, ev_pointer, ev_pointer, ev_integer, PROG_VERSION}, + {"", "move", OP_MOVE, true, ev_struct, ev_short, ev_struct, PROG_VERSION}, + {"", "movep", OP_MOVEP, true, ev_pointer, ev_integer, ev_pointer, PROG_VERSION}, + // end of table {0}, };