]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Add missing opcode names to the disassembler.
authorRudolf Polzer <divVerent@gmail.com>
Fri, 1 Nov 2024 18:41:00 +0000 (14:41 -0400)
committerRudolf Polzer <divVerent@gmail.com>
Fri, 8 Nov 2024 13:02:02 +0000 (08:02 -0500)
Also fix instruction coloring and naming in disassembler.

- For some reason, all LOAD_ instructions are called FIELD_ now. Weren't
  they called INDIRECT_ once? Well, anyway, not touching that, just
  making it consistent with itself.

- Match new instructions in color to existing ones doing the same.

prvm_exec.c
prvm_execprogram.h

index 8cfc97a95c28c7be7caf0f4acdd67549366c4f0f..ae95de9651dd7deaf97a6407b4cb3d9506abdbce 100644 (file)
@@ -21,20 +21,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 #include "progsvm.h"
 
+// Should only contain the opcodes DP actually implements, so unknown opcodes
+// are more readably marked as such in disassembly. Thus, best keep this in sync
+// with the list in prvm_execprogram.h.
 static const char *prvm_opnames[] =
 {
 "^5DONE",
-
 "MUL_F",
 "MUL_V",
 "MUL_FV",
 "MUL_VF",
-
 "DIV",
-
 "ADD_F",
 "ADD_V",
-
 "SUB_F",
 "SUB_V",
 
@@ -79,16 +78,13 @@ static const char *prvm_opnames[] =
 "^1STOREP_FNC",
 
 "^5RETURN",
-
 "^2NOT_F",
 "^2NOT_V",
 "^2NOT_S",
 "^2NOT_ENT",
 "^2NOT_FNC",
-
 "^5IF",
 "^5IFNOT",
-
 "^3CALL0",
 "^3CALL1",
 "^3CALL2",
@@ -98,20 +94,14 @@ static const char *prvm_opnames[] =
 "^3CALL6",
 "^3CALL7",
 "^3CALL8",
-
 "^1STATE",
-
 "^5GOTO",
-
 "^2AND",
 "^2OR",
 
 "BITAND",
 "BITOR",
 
-
-
-
 NULL,
 NULL,
 NULL,
@@ -178,8 +168,8 @@ NULL,
 NULL,
 NULL,
 
-"LOAD_I",
-"STOREP_I",
+"^6FIELD_I",
+"^1STOREP_I",
 
 NULL,
 NULL,
@@ -199,29 +189,30 @@ NULL,
 
 "DIV_VF",
 
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
 NULL,
 NULL,
 NULL,
 
-"STORE_P",
+"GLOBALADDRESS",
+"ADD_PIW",
+"LOADA_F",
+"LOADA_V",
+"LOADA_S",
+"LOADA_ENT",
+"LOADA_FLD",
+"LOADA_FNC",
+"LOADA_I",
 
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
+"STORE_P",
+"^6FIELD_P",
+
+"LOADP_F",
+"LOADP_V",
+"LOADP_S",
+"LOADP_ENT",
+"LOADP_FLD",
+"LOADP_FNC",
+"LOADP_I",
 
 "LE_I",
 "GE_I",
index 6b112342e76934909b213bb997aaae4cd2a134c2..d303944ebce3ff117fa5d2d705e2554d2587d4fc 100644 (file)
@@ -206,6 +206,7 @@ prvm_eval_t *src;
        NULL,
        NULL,
        NULL,
+
        &&handle_OP_GLOBALADDRESS,
        &&handle_OP_ADD_PIW,
        &&handle_OP_LOADA_F,