From a8f28692d1d6ef2aa93862c8f0a6297df0e4c500 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 1 Nov 2024 14:41:00 -0400 Subject: [PATCH] Add missing opcode names to the disassembler. 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 | 57 +++++++++++++++++++--------------------------- prvm_execprogram.h | 1 + 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/prvm_exec.c b/prvm_exec.c index 8cfc97a9..ae95de96 100644 --- a/prvm_exec.c +++ b/prvm_exec.c @@ -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", diff --git a/prvm_execprogram.h b/prvm_execprogram.h index 6b112342..d303944e 100644 --- a/prvm_execprogram.h +++ b/prvm_execprogram.h @@ -206,6 +206,7 @@ prvm_eval_t *src; NULL, NULL, NULL, + &&handle_OP_GLOBALADDRESS, &&handle_OP_ADD_PIW, &&handle_OP_LOADA_F, -- 2.39.2