Skip to content

Commit fc02aec

Browse files
committed
Added a display for Mario's XZ speed
1 parent d6ce5f6 commit fc02aec

File tree

8 files changed

+93
-34
lines changed

8 files changed

+93
-34
lines changed

USER_MANUAL.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,18 @@ This menu allows you to change the HP, Max HP, FP, Max FP, held items, and statu
8383
### Displays
8484
1. **On-Screen Timer** displays a timer at the bottom-right of the screen. This timer is set to run at the current FPS, and therefore will count from 0 to 59 (0 to 49 for EU at 50hz) before reaching one second.
8585
2. **Mario's Coordinates** displays Mario's coordinates at the bottom-left of the screen. If the On-Screen Timer is active, then the position of Mario's Coordinates will be shifted upwards.
86-
3. **Jump Storage** displays a value that determines whether you have Jump Storage or not. The value will be 0 when you don't have it, and 1 when you have it. While this display is active, you can press Y three times in succession to manually give yourself Jump Storage.
87-
4. **Button Input Display** displays which buttons are pressed at the bottom-left of the screen. When this display is active, the other displays that are placed at the bottom-left of the screen are shifted upwards.
88-
5. **Stick Angle** displays the current angle held with the left stick. The four main directions are 0 for up, 90 for right, 180 for down, and 270 for left. If no angle is held, then it will simply print **Neutral**.
89-
6. **Guard/Superguard Timings** displays the following:
86+
3. **Mario's Speed XZ** displays Mario's speed, based on both the X axis and the Z axis.
87+
4. **Jump Storage** displays a value that determines whether you have Jump Storage or not. The value will be 0 when you don't have it, and 1 when you have it. While this display is active, you can press Y three times in succession to manually give yourself Jump Storage.
88+
5. **Button Input Display** displays which buttons are pressed at the bottom-left of the screen. When this display is active, the other displays that are placed at the bottom-left of the screen are shifted upwards.
89+
6. **Stick Angle** displays the current angle held with the left stick. The four main directions are 0 for up, 90 for right, 180 for down, and 270 for left. If no angle is held, then it will simply print **Neutral**.
90+
7. **Guard/Superguard Timings** displays the following:
9091
* The frame that you guarded/superguarded an attack out of the total amount of possible frames.
9192
* How many frames early you pressed A or B. It should be noted that nothing will be displayed if the button was pressed very early (more than 6 or so frames for guards, and more than 12 or so frames for superguards).
9293
* Whether you pressed too many buttons in a short period of time for the guard/superguard to be accepted.
9394
* Whether the attack can be superguarded or not (will only be displayed if you tried to superguard it).
94-
7. **Art Attack Hitboxes** displays boxes around enemies in battles when using Art Attack.
95-
8. **Yoshi Skip** displays various information about performing this skip. The main timer (labeled YST) is set to reset and start running once you leave a battle, and pauses once you press A. You can also manually reset this timer by holding Y for two seconds.
96-
9. **Palace Skip** displays various information about performing this skip. The main timer (labeled PST) is set to reset and start once you leave the pause menu, and pauses once you press X. You can also manually reset this timer by holding Y for two seconds. **PhaEmy** keeps track of the Y coordinate for the phantom ember, **ItemTimer** keeps track of the timer for the current item in the field, and **ParY** keeps track of your partner's Y coordinate.
95+
8. **Art Attack Hitboxes** displays boxes around enemies in battles when using Art Attack.
96+
9. **Yoshi Skip** displays various information about performing this skip. The main timer (labeled YST) is set to reset and start running once you leave a battle, and pauses once you press A. You can also manually reset this timer by holding Y for two seconds.
97+
10. **Palace Skip** displays various information about performing this skip. The main timer (labeled PST) is set to reset and start once you leave the pause menu, and pauses once you press X. You can also manually reset this timer by holding Y for two seconds. **PhaEmy** keeps track of the Y coordinate for the phantom ember, **ItemTimer** keeps track of the timer for the current item in the field, and **ParY** keeps track of your partner's Y coordinate.
9798

9899
### Warps
99100
This menu allows you to warp to various places around the game. The menu allows you to either choose a map from a list, or to choose a map and entrance manually. When choosing from the list, a description for each option is displayed when the cursor is over one.

ttyd-tools/rel/include/codes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ void getStickAngleString(char *stringOut);
2424
void displaySequenceInPauseMenu();
2525
void displayOnScreenTimer();
2626
void displayMarioCoordinatesBoolCheck();
27+
void displayMarioSpeedXZ();
2728
void displayJumpStorageDetails();
2829
void displayButtonInputs();
2930
void displayStickAngle();

ttyd-tools/rel/include/draw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ void drawOnScreenTimerButtonCombos();
106106
void drawOnScreenTimer();
107107
void drawSequenceInPauseMenu();
108108
void drawMarioCoordinates();
109+
void drawMarioSpeedXZ();
109110
void drawJumpStorageDetails();
110111
void drawButtonInputs();
111112
void drawStickAngle();

ttyd-tools/rel/include/global.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ enum DISPLAYS_OPTIONS
319319
{
320320
ONSCREEN_TIMER = 0,
321321
MARIO_COORDINATES,
322+
MARIO_SPEED_XZ,
322323
JUMP_STORAGE,
323324
BUTTON_INPUT_DISPLAY,
324325
STICK_ANGLE,
@@ -634,7 +635,7 @@ struct WarpByIndexStruct
634635

635636
extern Menus Menu[27];
636637
extern Cheats Cheat[22];
637-
extern bool Displays[9];
638+
extern bool Displays[10];
638639
extern char DisplayBuffer[256];
639640
extern char HeapBuffer[1024];
640641
extern MemoryWatchStruct MemoryWatch[60];

ttyd-tools/rel/source/codes.cpp

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,16 @@ void displayMarioCoordinatesBoolCheck()
846846
drawFunctionOnDebugLayer(drawMarioCoordinates);
847847
}
848848

849+
void displayMarioSpeedXZ()
850+
{
851+
if (!Displays[MARIO_SPEED_XZ])
852+
{
853+
return;
854+
}
855+
856+
drawFunctionOnDebugLayer(drawMarioSpeedXZ);
857+
}
858+
849859
void displayJumpStorageDetails()
850860
{
851861
if (!Displays[JUMP_STORAGE])
@@ -898,12 +908,6 @@ void displayStickAngle()
898908
return;
899909
}
900910

901-
// Don't display if the Guard/Superguard timings display is active
902-
if (DisplayActionCommands.DisplayTimer > 0)
903-
{
904-
return;
905-
}
906-
907911
drawFunctionOnDebugLayer(drawStickAngle);
908912
}
909913

@@ -940,12 +944,6 @@ void displayYoshiSkipDetails()
940944
return;
941945
}
942946

943-
// Don't display if the Guard/Superguard timings display is active
944-
if (DisplayActionCommands.DisplayTimer > 0)
945-
{
946-
return;
947-
}
948-
949947
if (checkForSpecificSeq(ttyd::seqdrv::SeqIndex::kBattle)) // In battle
950948
{
951949
// Pause in battle
@@ -1000,12 +998,6 @@ void displayPalaceSkipDetails()
1000998
return;
1001999
}
10021000

1003-
// Don't display if the Guard/Superguard timings display is active
1004-
if (DisplayActionCommands.DisplayTimer > 0)
1005-
{
1006-
return;
1007-
}
1008-
10091001
uint32_t SystemLevel = getSystemLevel();
10101002
if (SystemLevel == 15)
10111003
{

ttyd-tools/rel/source/draw.cpp

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3335,7 +3335,6 @@ void drawOnScreenTimer()
33353335
Displays[PALACE_SKIP] ||
33363336
Displays[YOSHI_SKIP])
33373337
{
3338-
33393338
PosY += 20;
33403339
}
33413340
}
@@ -3378,6 +3377,38 @@ void drawMarioCoordinates()
33783377
drawText(tempDisplayBuffer, PosX, PosY, Alpha, TextColor, Scale);
33793378
}
33803379

3380+
void drawMarioSpeedXZ()
3381+
{
3382+
uint32_t TextColor = 0xFFFFFFFF;
3383+
uint8_t Alpha = 0xFF;
3384+
int32_t PosX = -232;
3385+
int32_t PosY = -162;
3386+
float Scale = 0.75;
3387+
3388+
// Move the text up if the input display is active
3389+
if (Displays[BUTTON_INPUT_DISPLAY])
3390+
{
3391+
PosY += 20;
3392+
}
3393+
3394+
// Move the text up if the Mario coordinates display is active
3395+
if (Displays[MARIO_COORDINATES] ||
3396+
Displays[PALACE_SKIP] ||
3397+
Displays[YOSHI_SKIP])
3398+
{
3399+
PosY += 20;
3400+
}
3401+
3402+
ttyd::mario::Player *player = ttyd::mario::marioGetPtr();
3403+
char *tempDisplayBuffer = DisplayBuffer;
3404+
3405+
sprintf(tempDisplayBuffer,
3406+
"MarSpeedXZ: %.6f",
3407+
player->wPlayerEffectiveSpeed);
3408+
3409+
drawText(tempDisplayBuffer, PosX, PosY, Alpha, TextColor, Scale);
3410+
}
3411+
33813412
void drawJumpStorageDetails()
33823413
{
33833414
uint32_t TextColor = 0xFFFFFFFF;
@@ -3451,6 +3482,12 @@ void drawStickAngle()
34513482
PosY += 20;
34523483
}
34533484

3485+
// Move the text up if the Mario Speed XZ display is active
3486+
if (Displays[MARIO_SPEED_XZ])
3487+
{
3488+
PosY += 20;
3489+
}
3490+
34543491
// Move the text up if Mario's Coordinates are displayed, or if the Palace Skip display is active
34553492
if (Displays[MARIO_COORDINATES] || Displays[PALACE_SKIP])
34563493
{
@@ -3513,6 +3550,12 @@ void drawYoshiSkipDetails()
35133550
PosY += 20;
35143551
}
35153552

3553+
// Move the text up if the Mario Speed XZ display is active
3554+
if (Displays[MARIO_SPEED_XZ])
3555+
{
3556+
PosY += 20;
3557+
}
3558+
35163559
// Draw the text
35173560
char StickAngleString[12];
35183561
getStickAngleString(StickAngleString);
@@ -3657,6 +3700,12 @@ void drawPalaceSkipDetails()
36573700
PosY += 20;
36583701
}
36593702

3703+
// Move the text up if the Mario Speed XZ display is active
3704+
if (Displays[MARIO_SPEED_XZ])
3705+
{
3706+
PosY += 20;
3707+
}
3708+
36603709
// Draw the text
36613710
char *tempDisplayBuffer = DisplayBuffer;
36623711
sprintf(tempDisplayBuffer,

ttyd-tools/rel/source/global.cpp

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

77
namespace mod {
88

9-
const char *VersionNumber = "v3.0.26";
9+
const char *VersionNumber = "v3.0.27";
1010

1111
const char *RootLines[] =
1212
{
@@ -1166,13 +1166,15 @@ uint8_t DisplaysOrder[] =
11661166
YOSHI_SKIP,
11671167
PALACE_SKIP,
11681168
STICK_ANGLE,
1169+
MARIO_SPEED_XZ,
11691170
};
11701171

11711172
const char *DisplaysLines[] =
11721173
{
11731174
"Return",
11741175
"On-Screen Timer",
11751176
"Mario's Coordinates",
1177+
"Mario's Speed XZ",
11761178
"Jump Storage",
11771179
"Button Input Display",
11781180
"Stick Angle",
@@ -1321,7 +1323,7 @@ const char ButtonInputDisplay[] =
13211323

13221324
struct Menus Menu[27];
13231325
struct Cheats Cheat[22];
1324-
bool Displays[9];
1326+
bool Displays[10];
13251327
char DisplayBuffer[256];
13261328
char HeapBuffer[1024];
13271329
struct MemoryWatchStruct MemoryWatch[60];

ttyd-tools/rel/source/main.cpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -735,23 +735,35 @@ void Mod::run()
735735
// Run if currently repositioning watches
736736
if (!MenuIsDisplayed || HideMenu)
737737
{
738+
// Don't display some displays if the Guard/Superguard timings display is active
739+
if (DisplayActionCommands.DisplayTimer == 0)
740+
{
741+
// Only run button-based codes if currently not changing button combos
742+
if (!tempChangingCheatButtonCombo)
743+
{
744+
displayYoshiSkipDetails();
745+
displayPalaceSkipDetails();
746+
}
747+
748+
// Run each display function that isn't button-based
749+
displayMarioCoordinatesBoolCheck();
750+
displayMarioSpeedXZ();
751+
displayStickAngle();
752+
displayMemoryWatches();
753+
}
754+
738755
// Only run button-based codes if currently not changing button combos
739756
if (!tempChangingCheatButtonCombo)
740757
{
741758
displayOnScreenTimer();
742759
displayJumpStorageDetails();
743760
displayButtonInputs();
744-
displayYoshiSkipDetails();
745-
displayPalaceSkipDetails();
746761
}
747762

748763
// Run each display function that isn't button-based
749764
spawnItem(); // Needs to always run due to the adjustable value menu sometimes being displayed
750765
displaySequenceInPauseMenu();
751-
displayMarioCoordinatesBoolCheck();
752766
displayActionCommandsTiming();
753-
displayStickAngle();
754-
displayMemoryWatches();
755767

756768
// Perform any necessaery REL patches
757769
performRELPatches();

0 commit comments

Comments
 (0)