Skip to content

Commit 2de51b6

Browse files
committed
Display Sequence Position in the pause menu
1 parent c54c054 commit 2de51b6

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

ttyd-tools/rel/include/mod.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ class Mod
118118
// Display all menus inside of the Pause Menu
119119
void pauseMenuDisplayAllMenus();
120120

121+
// Display Sequence Position in the Pause Menu
122+
void pauseMenuDisplaySequence();
123+
121124
// Button Input Display
122125
void buttonInputDisplay();
123126
uint32_t mButtonInputDisplayCounter;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#include "mod.h"
2+
3+
#include <ttyd/mariost.h>
4+
#include <ttyd/swdrv.h>
5+
#include <ttyd/fontmgr.h>
6+
7+
#include <cstdio>
8+
9+
extern uint32_t PauseMenuAddressesStart;
10+
11+
namespace mod {
12+
13+
void Mod::pauseMenuDisplaySequence()
14+
{
15+
uint32_t PauseMenuAddress = *reinterpret_cast<uint32_t *>(PauseMenuAddressesStart);
16+
uint32_t CurrentTab = *reinterpret_cast<uint32_t *>(PauseMenuAddress + 0x40);
17+
uint32_t CurrentMenu = *reinterpret_cast<uint32_t *>(PauseMenuAddress + 0x24);
18+
19+
if ((ttyd::mariost::marioStGetSystemLevel() == 15) && (CurrentTab == 0) && ((CurrentMenu == 10) || ((CurrentMenu == 11))))
20+
{
21+
// Currently in the pause menu and Current Tab is Mario's stats
22+
uint32_t SequencePosition = ttyd::swdrv::swByteGet(0);
23+
24+
sprintf(mDisplayBuffer,
25+
"Seq: %lu",
26+
SequencePosition);
27+
28+
ttyd::fontmgr::FontDrawStart();
29+
uint32_t color = 0xFFFFFFFF;
30+
ttyd::fontmgr::FontDrawColor(reinterpret_cast<uint8_t *>(&color));
31+
ttyd::fontmgr::FontDrawEdge();
32+
ttyd::fontmgr::FontDrawMessage(80, 50, mDisplayBuffer);
33+
}
34+
}
35+
36+
}

ttyd-tools/rel/source/mod.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ void Mod::updateEarly()
8585
// --Codes (With Display)--
8686
reinterpret_cast<Mod *>(user)->onScreenTimer();
8787
reinterpret_cast<Mod *>(user)->buttonInputDisplay();
88+
89+
// --Misc--
90+
reinterpret_cast<Mod *>(user)->pauseMenuDisplaySequence();
8891
}, this);
8992

9093
// Call original function

0 commit comments

Comments
 (0)