File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ bool checkButtonCombo(uint16_t combo);
12
12
bool checkButtonComboEveryFrame (uint16_t combo);
13
13
bool checkForSpecificSeq (ttyd::seqdrv::SeqIndex wantedSeq);
14
14
bool checkIfInGame ();
15
+ void *getCurrentRELPointer ();
15
16
void *getBattlePointer ();
16
17
void *getMarioBattlePointer ();
17
18
void *getPartnerBattlePointer ();
Original file line number Diff line number Diff line change @@ -66,9 +66,7 @@ bool checkIfInGame()
66
66
ttyd::seqdrv::SeqIndex CurrentSeq = ttyd::seqdrv::seqGetSeq ();
67
67
if (CurrentSeq == Game)
68
68
{
69
- uint32_t Current_REL_Loaded_Pointer = *reinterpret_cast <uint32_t *>(
70
- *reinterpret_cast <uint32_t *>(GlobalWorkPointer) + 0x15C );
71
-
69
+ uint32_t Current_REL_Loaded_Pointer = reinterpret_cast <uint32_t >(getCurrentRELPointer ());
72
70
if (Current_REL_Loaded_Pointer != 0 )
73
71
{
74
72
#ifdef TTYD_US
@@ -91,10 +89,15 @@ bool checkIfInGame()
91
89
return false ;
92
90
}
93
91
92
+ void *getCurrentRELPointer ()
93
+ {
94
+ return *reinterpret_cast <uint32_t **>(
95
+ *reinterpret_cast <uint32_t *>(GlobalWorkPointer) + 0x15C );
96
+ }
97
+
94
98
void *getBattlePointer ()
95
99
{
96
- uint32_t *BattlePointer = *reinterpret_cast <uint32_t **>(BattleAddressesStart);
97
- return BattlePointer;
100
+ return *reinterpret_cast <uint32_t **>(BattleAddressesStart);
98
101
}
99
102
100
103
void *getMarioBattlePointer ()
@@ -270,7 +273,7 @@ void recheckJumpAndHammerLevels()
270
273
271
274
uint32_t getCurrentPitFloor ()
272
275
{
273
- return ttyd::swdrv::swByteGet (1321 ) + 1 ; // GSW(1321);
276
+ return ttyd::swdrv::swByteGet (1321 ) + 1 ; // GSW(1321)
274
277
}
275
278
276
279
void clearGSWFsRange (uint32_t lowerBound, uint32_t upperBound)
Original file line number Diff line number Diff line change @@ -373,9 +373,7 @@ void performRELPatches()
373
373
}
374
374
375
375
// Make sure a REL file is currently loaded
376
- uint32_t Current_REL_Loaded_Pointer = *reinterpret_cast <uint32_t *>(
377
- *reinterpret_cast <uint32_t *>(GlobalWorkPointer) + 0x15C );
378
-
376
+ uint32_t Current_REL_Loaded_Pointer = reinterpret_cast <uint32_t >(getCurrentRELPointer ());
379
377
if (Current_REL_Loaded_Pointer == 0 )
380
378
{
381
379
return ;
You can’t perform that action at this time.
0 commit comments