Skip to content

Commit 0c963ce

Browse files
committed
Added a display for showing the total amount of evts currently active
1 parent c0c042d commit 0c963ce

File tree

7 files changed

+54
-4
lines changed

7 files changed

+54
-4
lines changed

ttyd-tools/rel/include/codes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void displayBridgeSkipDetails();
3838
void displayBlimpTicketSkipDetails();
3939
void displayActionCommandsTiming();
4040
void displayEffsActive();
41+
void displayEvtsActive();
4142

4243
int32_t warpToMap(uint32_t value);
4344
int32_t warpToMapByEvent(int32_t index);

ttyd-tools/rel/include/draw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void drawBridgeSkipDetails();
125125
void drawBlimpTicketSkipDetails();
126126
void drawActionCommandsTiming();
127127
void drawEffsActive();
128+
void drawEvtsActive();
128129
void drawSettingsCurrentWork();
129130

130131
void drawHeapArrayErrors();

ttyd-tools/rel/include/global.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ enum DISPLAYS_OPTIONS
350350
ART_ATTACK_HITBOXES,
351351
MEMORY_USAGE,
352352
EFFS_ACTIVE,
353+
EVTS_ACTIVE,
353354
YOSHI_SKIP,
354355
PALACE_SKIP,
355356
BRIDGE_SKIP,
@@ -921,7 +922,7 @@ struct NpcNameToPtrErrorStruct
921922
extern MenuVars MenuVar;
922923
extern Menus Menu[32];
923924
extern Cheats Cheat[25];
924-
extern bool Displays[16];
925+
extern bool Displays[17];
925926
extern char DisplayBuffer[256];
926927
extern MemoryWatchStruct MemoryWatch[60];
927928

ttyd-tools/rel/source/codes.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,6 +1537,16 @@ void displayEffsActive()
15371537
drawFunctionOnDebugLayerWithOrder(drawEffsActive, 1.f);
15381538
}
15391539

1540+
void displayEvtsActive()
1541+
{
1542+
if (!Displays[EVTS_ACTIVE])
1543+
{
1544+
return;
1545+
}
1546+
1547+
drawFunctionOnDebugLayerWithOrder(drawEvtsActive, 1.f);
1548+
}
1549+
15401550
int32_t warpToMap(uint32_t value)
15411551
{
15421552
// Make sure the player is currently in the game

ttyd-tools/rel/source/draw.cpp

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <ttyd/itemdrv.h>
3333
#include <ttyd/battle_ac.h>
3434
#include <ttyd/effdrv.h>
35+
#include <ttyd/evtmgr.h>
3536
#include <ttyd/battle_unit.h>
3637
#include <ttyd/battle_disp.h>
3738
#include <ttyd/pmario_sound.h>
@@ -4660,6 +4661,39 @@ void drawEffsActive()
46604661
drawText(tempDisplayBuffer, PosX, PosY, Alpha, Color, Scale);
46614662
}
46624663

4664+
void drawEvtsActive()
4665+
{
4666+
uint32_t Color = 0xFFFFFFFF;
4667+
uint8_t Alpha = 0xFF;
4668+
int32_t PosX = -232;
4669+
int32_t PosY = 40;
4670+
float Scale = 0.65;
4671+
4672+
// Get the total amount of evts active
4673+
ttyd::evtmgr::EvtWork *EvtWrk = ttyd::evtmgr::evtGetWork();
4674+
int32_t MaxEntries = EvtWrk->entryCount;
4675+
int32_t CurrentCount = 0;
4676+
4677+
ttyd::evtmgr::EvtEntry *EvtEntry = &EvtWrk->entries[0];
4678+
for (int32_t i = 0; i < MaxEntries; i++)
4679+
{
4680+
if (EvtEntry->flags & (1 << 0)) // Check if 0 bit is active
4681+
{
4682+
CurrentCount++;
4683+
}
4684+
EvtEntry++;
4685+
}
4686+
4687+
// Draw the total amount of evts active out of the max
4688+
char *tempDisplayBuffer = DisplayBuffer;
4689+
sprintf(tempDisplayBuffer,
4690+
"Evts Active: %" PRId32 "/%" PRId32,
4691+
CurrentCount,
4692+
MaxEntries);
4693+
4694+
drawText(tempDisplayBuffer, PosX, PosY, Alpha, Color, Scale);
4695+
}
4696+
46634697
void drawSettingsCurrentWork()
46644698
{
46654699
const char *String;
@@ -4740,7 +4774,7 @@ void drawMemoryUsage()
47404774
uint32_t Color = 0xFFFFFFFF;
47414775
uint8_t Alpha = 0xFF;
47424776
int32_t PosX = -232;
4743-
int32_t PosY = 40;
4777+
int32_t PosY = 20;
47444778
float Scale = 0.6;
47454779

47464780
char **tempMemoryUsageBuffer = HeapInfo.MemoryUsageBuffer;

ttyd-tools/rel/source/global.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace mod {
55

6-
const char *VersionNumber = "v3.0.46";
6+
const char *VersionNumber = "v3.0.47d";
77

88
const char *RootLines[] =
99
{
@@ -1520,6 +1520,7 @@ const char *DisplaysLines[] =
15201520
"Art Attack Hitboxes",
15211521
"Memory Usage",
15221522
"Effs Active",
1523+
"Evts Active",
15231524
"Yoshi Skip",
15241525
"Palace Skip",
15251526
"Bridge Skip",
@@ -1853,12 +1854,13 @@ uint8_t DisplaysOrder[] =
18531854
BRIDGE_SKIP,
18541855
EFFS_ACTIVE,
18551856
MEMORY_USAGE,
1857+
EVTS_ACTIVE,
18561858
};
18571859

18581860
struct MenuVars MenuVar;
18591861
struct Menus Menu[32];
18601862
struct Cheats Cheat[25];
1861-
bool Displays[16];
1863+
bool Displays[17];
18621864
char DisplayBuffer[256];
18631865
struct MemoryWatchStruct MemoryWatch[60];
18641866

ttyd-tools/rel/source/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,7 @@ void Mod::run()
981981
displaySequenceInPauseMenu();
982982
displayActionCommandsTiming();
983983
displayEffsActive();
984+
displayEvtsActive();
984985

985986
// Check the heaps
986987
checkHeaps();

0 commit comments

Comments
 (0)