From ea0b230bb99d2f6fad2b757ce3581146fe6ae581 Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 5 Jan 2017 19:03:24 +0000 Subject: [PATCH] winport: fix bugs in memview reducing characters after 0x80 to be dots (due to erroneous signed char < 0x20 test) meant to address bug #768 --- trunk/src/drivers/win/memview.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/trunk/src/drivers/win/memview.cpp b/trunk/src/drivers/win/memview.cpp index 8ba9f63e..17bf4e11 100644 --- a/trunk/src/drivers/win/memview.cpp +++ b/trunk/src/drivers/win/memview.cpp @@ -427,9 +427,8 @@ int LoadTableFile() } void UnloadTableFile(){ - int i, j; - for(i = 0;i < 256;i++){ - j = i; + for(int i = 0;i < 256;i++){ + int j = i; if(j < 0x20)j = 0x2E; //if(j > 0x7e)j = 0x2E; chartable[i] = j; @@ -533,7 +532,7 @@ void UpdateMemoryView(int draw_all) SetBkColor(HDataDC,RGB(0,0,0)); MoveToEx(HDataDC, (59 + j) * MemFontWidth, MemFontHeight * ((i - CurOffset) / 16), NULL); //todo: try moving this above the for loop str[0] = chartable[byteValue]; - if(str[0] < 0x20)str[0] = 0x2E; + if((u8)str[0] < 0x20)str[0] = 0x2E; //if(str[0] > 0x7e)str[0] = 0x2E; str[1] = 0; TextOut(HDataDC,0,0,str,1); @@ -575,7 +574,7 @@ void UpdateMemoryView(int draw_all) MoveToEx(HDataDC,(59+j)*MemFontWidth,MemFontHeight*((i-CurOffset)/16),NULL); //todo: try moving this above the for loop str[0] = chartable[byteValue]; - if(str[0] < 0x20)str[0] = 0x2E; + if((u8)str[0] < 0x20)str[0] = 0x2E; //if(str[0] > 0x7e)str[0] = 0x2E; str[1] = 0; TextOut(HDataDC,0,0,str,1);