File tree Expand file tree Collapse file tree 10 files changed +108
-9
lines changed Expand file tree Collapse file tree 10 files changed +108
-9
lines changed Original file line number Diff line number Diff line change 827
827
// w_atan2.c
828
828
80276394:atan2
829
829
830
+ // OSCache.c
831
+ // 8029A84C:DCEnable
832
+ // 8029A860:DCInvalidateRange
833
+ 8029A88C:DCFlushRange
834
+ // 8029A8BC:DCStoreRange
835
+ // 8029A8EC:DCFlushRangeNoSync
836
+ // 8029A918:DCStoreRangeNoSync
837
+ // 8029A944:DCZeroRange
838
+ 8029A970:ICInvalidateRange
839
+ // 8029A9A4:ICFlashInvalidate
840
+ // 8029A9B4:ICEnable
841
+ // 8029A9C8:__LCEnable
842
+ // 8029AA94:LCEnable
843
+ // 8029AACC:LCDisable
844
+ // 8029AAF4:LCStoreBlocks
845
+ // 8029AB18:LCStoreData
846
+ // 8029ABC4:LCQueueWait
847
+ // 8029ABD8:L2GlobalInvalidate
848
+ // 8029AC70:DMAErrorHandler
849
+ // 8029ADD0:__OSCacheInit
850
+
830
851
// GXGeometry.c
831
852
// 802B9A68:__GXSetDirtyState
832
853
802B9AE8:GXBegin
Original file line number Diff line number Diff line change 824
824
// w_atan2.c
825
825
8026C588:atan2
826
826
827
+ // OSCache.c
828
+ // 802909FC:DCEnable
829
+ // 80290A10:DCInvalidateRange
830
+ 80290A3C:DCFlushRange
831
+ // 80290A6C:DCStoreRange
832
+ // 80290A9C:DCFlushRangeNoSync
833
+ // 80290AC8:DCStoreRangeNoSync
834
+ // 80290AF4:DCZeroRange
835
+ 80290B20:ICInvalidateRange
836
+ // 80290B54:ICFlashInvalidate
837
+ // 80290B64:ICEnable
838
+ // 80290B78:__LCEnable
839
+ // 80290C44:LCEnable
840
+ // 80290C7C:LCDisable
841
+ // 80290CA4:LCStoreBlocks
842
+ // 80290CC8:LCStoreData
843
+ // 80290D74:LCQueueWait
844
+ // 80290D88:L2GlobalInvalidate
845
+ // 80290E20:DMAErrorHandler
846
+ // 80290F80:__OSCacheInit
847
+
827
848
// GXGeometry.c
828
849
// 802AFBE8:__GXSetDirtyState
829
850
802AFC68:GXBegin
Original file line number Diff line number Diff line change 827
827
// w_atan2.c
828
828
802725A0:atan2
829
829
830
+ // OSCache.c
831
+ // 80296A14:DCEnable
832
+ // 80296A28:DCInvalidateRange
833
+ 80296A54:DCFlushRange
834
+ // 80296A84:DCStoreRange
835
+ // 80296AB4:DCFlushRangeNoSync
836
+ // 80296AE0:DCStoreRangeNoSync
837
+ // unused:DCZeroRange
838
+ 80296B0C:ICInvalidateRange
839
+ // 80296B40:ICFlashInvalidate
840
+ // 80296B50:ICEnable
841
+ // unused:__LCEnable
842
+ // unused:LCEnable
843
+ // 80296B64:LCDisable
844
+ // unused:LCStoreBlocks
845
+ // unused:LCStoreData
846
+ // unused:LCQueueWait
847
+ // 80296B8C:L2GlobalInvalidate
848
+ // 80296C24:DMAErrorHandler
849
+ // 80296D84:__OSCacheInit
850
+
830
851
// GXGeometry.c
831
852
// 802B59EC:__GXSetDirtyState
832
853
802B5A6C:GXBegin
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #include < cstdint>
4
+
5
+ namespace ttyd ::OSCache {
6
+
7
+ extern " C" {
8
+
9
+ // DCEnable
10
+ // DCInvalidateRange
11
+ void DCFlushRange (void *startAddress, uint32_t numberOfBytesToFlush);
12
+ // DCStoreRange
13
+ // DCFlushRangeNoSync
14
+ // DCStoreRangeNoSync
15
+ // DCZeroRange
16
+ void ICInvalidateRange (void *startAddress, uint32_t numberOfBytesToInvalidate);
17
+ // ICFlashInvalidate
18
+ // ICEnable
19
+ // __LCEnable
20
+ // LCEnable
21
+ // LCDisable
22
+ // LCStoreBlocks
23
+ // LCStoreData
24
+ // LCQueueWait
25
+ // L2GlobalInvalidate
26
+ // DMAErrorHandler
27
+ // __OSCacheInit
28
+
29
+ }
30
+
31
+ }
Original file line number Diff line number Diff line change 4
4
5
5
namespace ttyd ::seqdrv {
6
6
7
- enum class SeqIndex : uint32_t
7
+ enum class SeqIndex : int32_t
8
8
{
9
9
kLogo = 0 ,
10
10
kTitle ,
@@ -19,7 +19,7 @@ enum class SeqIndex : uint32_t
19
19
struct SeqInfo
20
20
{
21
21
SeqIndex seq;
22
- uint32_t state;
22
+ int32_t state;
23
23
const char *mapName;
24
24
const char *beroName;
25
25
uint32_t counter;
@@ -33,9 +33,9 @@ extern "C" {
33
33
void seqInit_MARIOSTORY ();
34
34
void seqMain ();
35
35
void seqSetSeq (SeqIndex seq, const char *mapName, const char *beroName);
36
- uint32_t seqGetSeq ();
37
- uint32_t seqGetPrevSeq ();
38
- uint32_t seqGetNextSeq ();
36
+ int32_t seqGetSeq ();
37
+ int32_t seqGetPrevSeq ();
38
+ int32_t seqGetNextSeq ();
39
39
bool seqCheckSeq ();
40
40
41
41
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ void Mod::gameOver()
13
13
{
14
14
if ((ttyd::system::keyGetButton (0 ) & GameOverCombo) == (GameOverCombo))
15
15
{
16
- uint32_t Logo = static_cast <uint32_t >(ttyd::seqdrv::SeqIndex::kLogo );
16
+ int32_t Logo = static_cast <uint32_t >(ttyd::seqdrv::SeqIndex::kLogo );
17
17
if (ttyd::seqdrv::seqGetNextSeq () != Logo)
18
18
{
19
19
// The game will crash if the following code runs during the Logo
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ void Mod::reloadScreen()
25
25
uint32_t NextSeq = ttyd::seqdrv::seqGetNextSeq ();
26
26
uint32_t Game = static_cast <uint32_t >(ttyd::seqdrv::SeqIndex::kGame );
27
27
uint32_t MapChange = static_cast <uint32_t >(ttyd::seqdrv::SeqIndex::kMapChange );
28
- uint32_t SystemLevel = ttyd::mariost::marioStGetSystemLevel ();
29
28
30
29
if ((NextSeq >= Game) && (NextSeq <= MapChange))
31
30
{
@@ -37,6 +36,7 @@ void Mod::reloadScreen()
37
36
ttyd::string::strcpy (NewMap, NextMap);
38
37
ttyd::seqdrv::seqSetSeq (ttyd::seqdrv::SeqIndex::kMapChange , NewMap, NewBero);
39
38
39
+ uint32_t SystemLevel = ttyd::mariost::marioStGetSystemLevel ();
40
40
if (SystemLevel != 0 )
41
41
{
42
42
if (SystemLevel == 15 )
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ void Mod::saveAnywhere()
19
19
// Save Script is not running
20
20
if ((ttyd::system::keyGetButton (0 ) & SaveAnywhereCombo) == (SaveAnywhereCombo))
21
21
{
22
- uint32_t Game = static_cast <uint32_t >(ttyd::seqdrv::SeqIndex::kGame );
22
+ int32_t Game = static_cast <uint32_t >(ttyd::seqdrv::SeqIndex::kGame );
23
23
if ((ttyd::seqdrv::seqGetNextSeq () == Game) && (ttyd::mariost::marioStGetSystemLevel () != 15 ))
24
24
{
25
25
// Not in the Pause Menu
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ void Mod::spawnItem()
20
20
{
21
21
if (!spawnItemDisable)
22
22
{
23
- uint32_t Game = static_cast <uint32_t >(ttyd::seqdrv::SeqIndex::kGame );
23
+ int32_t Game = static_cast <uint32_t >(ttyd::seqdrv::SeqIndex::kGame );
24
24
if ((ttyd::seqdrv::seqGetNextSeq () == Game) && (ttyd::mariost::marioStGetSystemLevel () != 15 ))
25
25
{
26
26
// Not in pause menu
Original file line number Diff line number Diff line change 1
1
#include " patch.h"
2
2
3
+ #include < ttyd/OSCache.h>
4
+
3
5
#include < cstdint>
4
6
5
7
namespace mod ::patch {
@@ -12,6 +14,9 @@ void writeBranch(void *ptr, void *destination)
12
14
13
15
uint32_t *p = reinterpret_cast <uint32_t *>(ptr);
14
16
*p = value;
17
+
18
+ ttyd::OSCache::DCFlushRange (destination, sizeof (uint32_t ));
19
+ ttyd::OSCache::ICInvalidateRange (destination, sizeof (uint32_t ));
15
20
}
16
21
17
22
}
You can’t perform that action at this time.
0 commit comments