Skip to content

Commit

Permalink
rosalina: add kernel version and mcu fw ver. to debug menu
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxSH committed Jan 7, 2021
1 parent f54c709 commit 2452166
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
7 changes: 5 additions & 2 deletions sysmodules/rosalina/include/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,16 @@ typedef struct Menu {
MenuItem items[16];
} Menu;

extern u32 menuCombo;
extern bool isHidInitialized;
extern u32 mcuFwVersion;

// From main.c
extern bool isN3DS;
extern bool menuShouldExit;
extern bool preTerminationRequested;
extern Handle preTerminationEvent;

extern u32 menuCombo;

u32 waitInputWithTimeout(s32 msec);
u32 waitInput(void);

Expand Down
1 change: 0 additions & 1 deletion sysmodules/rosalina/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ void initSystem(void)
bool menuShouldExit = false;
bool preTerminationRequested = false;
Handle preTerminationEvent;
extern bool isHidInitialized;

static void handleTermNotification(u32 notificationId)
{
Expand Down
3 changes: 1 addition & 2 deletions sysmodules/rosalina/source/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "menus/cheats.h"
#include "minisoc.h"

u32 menuCombo = 0;
bool isHidInitialized = false;
u32 mcuFwVersion = 0;

Expand Down Expand Up @@ -226,8 +227,6 @@ MyThread *menuCreateThread(void)
return &menuThread;
}

u32 menuCombo;

void menuThreadMain(void)
{
if(isN3DS)
Expand Down
12 changes: 11 additions & 1 deletion sysmodules/rosalina/source/menus.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,23 @@ void RosalinaMenu_ShowDebugInfo(void)
u32 kextPa = (u32)((u64)kextAddrSize >> 32);
u32 kextSize = (u32)kextAddrSize;

u32 kernelVer = osGetKernelVersion();
do
{
Draw_Lock();
Draw_DrawString(10, 10, COLOR_TITLE, "Rosalina -- Debug info");

u32 posY = Draw_DrawString(10, 30, COLOR_WHITE, memoryMap);
Draw_DrawFormattedString(10, posY, COLOR_WHITE, "Kernel ext PA: %08lx - %08lx\n", kextPa, kextPa + kextSize);
posY = Draw_DrawFormattedString(10, posY, COLOR_WHITE, "Kernel ext PA: %08lx - %08lx\n\n", kextPa, kextPa + kextSize);
posY = Draw_DrawFormattedString(
10, posY, COLOR_WHITE, "Kernel version: %lu.%lu-%lu\n",
GET_VERSION_MAJOR(kernelVer), GET_VERSION_MINOR(kernelVer), GET_VERSION_REVISION(kernelVer)
);
if (mcuFwVersion != 0)
posY = Draw_DrawFormattedString(
10, posY, COLOR_WHITE, "MCU FW version: %lu.%lu\n",
GET_VERSION_MAJOR(mcuFwVersion), GET_VERSION_MINOR(mcuFwVersion)
);
Draw_FlushFramebuffer();
Draw_Unlock();
}
Expand Down

0 comments on commit 2452166

Please sign in to comment.