From 0943cd0e3f31a76a7b826c5fe2e1c510e04452f0 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 30 Aug 2015 07:24:53 +0000 Subject: [PATCH] Mapster32: in manual member editing, Shift+ENTER allows toggling individual bits For values that are displayed in hex. Patch by The Mechanic, with modifications. git-svn-id: https://svn.eduke32.com/eduke32@5338 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/astub.c | 53 +++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 90a4fb359..2bd3d3f32 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -10850,6 +10850,8 @@ static void handlemed(int32_t dohex, const char *disp_membername, const char *ed int32_t flags = sign; sign &= 1; + assert(!dohex || thesizeof == sizeof(int16_t)); + if (thesizeof==sizeof(int8_t)) { if (sign) @@ -10858,7 +10860,12 @@ static void handlemed(int32_t dohex, const char *disp_membername, const char *ed val = *(uint8_t *)themember; } else if (thesizeof==sizeof(int16_t)) + { val = *(int16_t *)themember; + // Bug fix : Do not sign extend when dealing with hex values + if (dohex) + val &= 0xFFFF; + } else //if (thesizeof==sizeof(int32_t)) val = *(int32_t *)themember; @@ -10870,23 +10877,43 @@ static void handlemed(int32_t dohex, const char *disp_membername, const char *ed for (; i= 0) + *(int16_t *)themember = (int16_t)((1<