Skip to content

Commit 0aadeaf

Browse files
committed
Memory menu - Display the current and max watch counts
1 parent efb4088 commit 0aadeaf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

ttyd-tools/rel/source/draw.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,30 @@ void drawMemoryWatches()
14321432

14331433
// Draw the current page
14341434
drawPageNumber(PosX, PosY, tempCurrentPage);
1435+
1436+
// Draw the total amount of watches out of the max
1437+
int32_t CurrentWatchCount = 0;
1438+
for (int32_t i = 0; i < TotalMenuOptions; i++)
1439+
{
1440+
if (MemoryWatch[i].Address)
1441+
{
1442+
CurrentWatchCount++;
1443+
}
1444+
else
1445+
{
1446+
break;
1447+
}
1448+
}
1449+
1450+
// Draw the counts as int32_ts, to prevent long text if they somehow become negative
1451+
char *tempDisplayBuffer = DisplayBuffer;
1452+
1453+
sprintf(tempDisplayBuffer,
1454+
"%" PRId32 "/%" PRId32,
1455+
CurrentWatchCount,
1456+
TotalMenuOptions);
1457+
1458+
drawText(tempDisplayBuffer, PosX + TypeOffset, PosY, Alpha, Color, Scale);
14351459
PosY -= 40;
14361460

14371461
// Draw the headers for the values

0 commit comments

Comments
 (0)