Print unused memory to HUD

This commit is contained in:
Ryan Dwyer
2022-10-22 20:03:56 +10:00
parent d89fef7ea9
commit 4e9d88fab9
3 changed files with 26 additions and 0 deletions
+15
View File
@@ -87,6 +87,8 @@
#include "lib/lib_06440.h"
#include "lib/lib_317f0.h"
#include "lib/main.h"
#include "lib/mema.h"
#include "lib/memp.h"
#include "lib/mtx.h"
#include "lib/music.h"
#include "lib/rng.h"
@@ -953,6 +955,8 @@ void lvFindThreats(void)
u8 g_LvShowRates = 0;
u8 g_LvAntialias = 1;
u8 g_LvRateIndex = 59;
u8 g_LvOom = 0;
u32 g_LvOomSize = 0;
u8 g_LvFrameRates[60];
void lvRecordRate(void)
@@ -1067,6 +1071,17 @@ Gfx *lvPrintRateText(Gfx *gdl)
x = 10;
sprintf(buffer, "Antialias %s\n", g_LvAntialias ? "on" : "off");
gdl = textRender(gdl, &x, &y, buffer, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0x00ff00a0, 0x000000a0, viGetWidth(), viGetHeight(), 0, 0);
sprintf(buffer, "mema free %d KB\n", memaGetLongestFree() / 1024);
gdl = textRender(gdl, &x, &y, buffer, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0x00ff00a0, 0x000000a0, viGetWidth(), viGetHeight(), 0, 0);
sprintf(buffer, "memp free %d KB\n", mempGetStageFree() / 1024);
gdl = textRender(gdl, &x, &y, buffer, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0x00ff00a0, 0x000000a0, viGetWidth(), viGetHeight(), 0, 0);
if (g_LvOom) {
sprintf(buffer, "mem%c OOM %x\n", g_LvOom, g_LvOomSize);
gdl = textRender(gdl, &x, &y, buffer, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0xff0000a0, 0x000000a0, viGetWidth(), viGetHeight(), 0, 0);
}
}
return gdl;