Add "screen" command to panic UI

This commit is contained in:
EnderIce2
2024-02-29 00:05:59 +02:00
parent 455c8a82de
commit 72ee2075ae
2 changed files with 28 additions and 2 deletions

View File

@ -40,10 +40,12 @@
#include "keyboard.hpp"
extern void ExPrint(const char *Format, ...);
extern Video::Font *CrashFont;
extern void DiagnosticDataCollection();
extern void InitFont();
extern Video::Font *CrashFont;
extern void *FbBeforePanic;
struct StackFrame
{
struct StackFrame *bp;
@ -789,6 +791,7 @@ nsa void UserInput(char *Input)
ExPrint("\eCACACA mem - Display memory information.\n");
ExPrint("\eAAAAAA dump [addr] [len] - Dump [len] bytes from [addr].\n");
ExPrint("\eCACACA diag - Collect diagnostic information.\n");
ExPrint("\eAAAAAA screen - Display the final output prior to system panic.\n");
}
else if (strcmp(Input, "clear") == 0)
{
@ -918,6 +921,17 @@ nsa void UserInput(char *Input)
{
DiagnosticDataCollection();
}
else if (strcmp(Input, "screen") == 0)
{
if (unlikely(FbBeforePanic == nullptr))
{
ExPrint("\eFF0000No screen data available\n");
goto End;
}
memcpy(Display->GetBuffer, FbBeforePanic, Display->GetSize);
Display->UpdateBuffer();
return;
}
#ifdef DEBUG
else if (strcmp(Input, "pt") == 0)
{