From 094ef834a4217fc4f420c271143fab2ab80a8fab Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 5 Oct 2022 21:05:56 +0100 Subject: [PATCH] Debug: Add highlight support for perm storage registers --- src/newgrf_spritegroup.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp index 8a18c4c11c..5ade715bfc 100644 --- a/src/newgrf_spritegroup.cpp +++ b/src/newgrf_spritegroup.cpp @@ -440,6 +440,10 @@ static char *DumpSpriteGroupAdjust(char *p, const char *last, const Deterministi /* Temp storage load */ highlight_tag = (1 << 16) | (adjust.parameter & 0xFFFF); } + if (adjust.variable == 0x7C) { + /* Perm storage load */ + highlight_tag = (2 << 16) | (adjust.parameter & 0xFFFF); + } p += seprintf(p, last, "%s", padding); for (uint i = 0; i < conditional_indent; i++) { @@ -496,6 +500,10 @@ static char *DumpSpriteGroupAdjust(char *p, const char *last, const Deterministi /* Temp storage store */ highlight_tag = (1 << 16) | (adjust.and_mask & 0xFFFF); } + if (adjust.operation == DSGA_OP_STOP && adjust.type == DSGA_TYPE_NONE && adjust.variable == 0x1A && adjust.shift_num == 0) { + /* Perm storage store */ + highlight_tag = (2 << 16) | (adjust.and_mask & 0xFFFF); + } p += seprintf(p, last, "var: %X", adjust.variable); if (adjust.variable == A2VRI_VEHICLE_CURRENT_SPEED_SCALED) { p += seprintf(p, last, " (current_speed_scaled)");