From bedca8fa14494b92dbe1384a6d3710a51225fd7b Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Thu, 28 Mar 2024 20:58:58 +0800 Subject: [PATCH] (draft) Add a special case for cell "details" This special case of "details" value would print as ':' in the ASCII display mode. It is used in "positive/negative" graph display only. Signed-off-by: Kang-Che Sung --- Meter.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Meter.c b/Meter.c index 45d8e77d4..63ee7b34c 100644 --- a/Meter.c +++ b/Meter.c @@ -1015,6 +1015,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext* blanksAtEnd = (blanksAtEnd % 8) / dotAlignment * dotAlignment; *details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd); } + if (*details == 0x3C) { + *details = 0x24; + } } /* fallthrough */ @@ -1039,7 +1042,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) { // byte contains specific bit patterns, it indicates that only half cell // should be displayed in the ASCII display mode. The bits are supposed // to be filled in the Unicode display mode. - if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) { + if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) { if (details == 0x14 || details == 0x28) { // Special case details = 0x18; } else { @@ -1077,6 +1080,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) { c = upperHalf; } else if ((details & 0x39) == 0x28) { c = lowerHalf; + } else if (details == 0x24) { + c = fullCell; // End of special cases } else if (popCount8(details) > 4) { c = fullCell;