From 727b490a0ce9ad08a7b1864a5a09a41840748d54 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 27 Aug 2023 12:28:16 +0900 Subject: [PATCH] [gamecode] Improve hops instruction readability --- libs/gamecode/opcodes.py | 2 +- libs/gamecode/pr_debug.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/libs/gamecode/opcodes.py b/libs/gamecode/opcodes.py index bff6ad7b9..67050abbb 100644 --- a/libs/gamecode/opcodes.py +++ b/libs/gamecode/opcodes.py @@ -221,7 +221,7 @@ hops_formats = { "opcode": "OP_HOPS", "mnemonic": "hops", "opname": "hops", - "format": "%Ga<%Hb>, %gc", + "format": "%Hb %Ga, %gc", "widths": "-1, 0, 1", "types": "ev_void, ev_short, ev_void", } diff --git a/libs/gamecode/pr_debug.c b/libs/gamecode/pr_debug.c index 6df86a203..0cf11f479 100644 --- a/libs/gamecode/pr_debug.c +++ b/libs/gamecode/pr_debug.c @@ -1205,11 +1205,20 @@ extend_string (pr_debug_data_t *data, pr_uint_t ext) static const char * hop_string (pr_debug_data_t *data, pr_uint_t hop) { + progs_t *pr = data->pr; + prdeb_resources_t *res = pr->pr_debug_resources; static const char *hop_string[] = { - "&", "|", "^", "+", - "!&", "!|", "!^", "+", + "and", "or", "xor", "add", + "nad", "nor", "xnor", "add", }; - return hop_string[hop & 7]; + static const char *type_string[2][8] = { + {"I", "I", "I", "I", "I", "I", "I", "F"}, + {"L", "L", "L", "L", "L", "L", "L", "D"}, + }; + return va (res->va, "%s.%s{%d}", + hop_string[hop & 7], + type_string[(hop >> 5) & 1][hop & 7], + ((hop >> 3) & 3) + 1); } static const char *