Skip to content

Commit 1a558ce

Browse files
committed
Removed some uses of #ifndef
1 parent 33d03a7 commit 1a558ce

File tree

6 files changed

+82
-82
lines changed

6 files changed

+82
-82
lines changed

ttyd-tools/rel/include/global.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,12 +692,12 @@ extern const char *WarpDestinations[];
692692
extern uint8_t WarpDestinationsSize;
693693
extern const char *WarpDescriptions[];
694694

695-
#ifndef TTYD_JP
696-
extern const char ButtonInputDisplay[];
697-
#else
695+
#ifdef TTYD_JP
698696
extern const char *CheatsEventNames[];
699697
extern const char *ButtonInputDisplay[];
700698
extern const char *PointerText;
699+
#else
700+
extern const char ButtonInputDisplay[];
701701
#endif
702702

703703
extern bool HideMenu;

ttyd-tools/rel/source/draw.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3419,13 +3419,13 @@ void drawButtonInputs()
34193419

34203420
if (ButtonInput & (1 << i))
34213421
{
3422-
#ifndef TTYD_JP
3422+
#ifdef TTYD_JP
34233423
sprintf(tempDisplayBuffer,
3424-
"%c",
3424+
"%s",
34253425
ButtonInputDisplay[Counter]);
34263426
#else
34273427
sprintf(tempDisplayBuffer,
3428-
"%s",
3428+
"%c",
34293429
ButtonInputDisplay[Counter]);
34303430
#endif
34313431

ttyd-tools/rel/source/global.cpp

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -667,25 +667,7 @@ uint8_t StatsMarioOptionsLinesSize = sizeof(StatsMarioOptionsLines) / sizeof(Sta
667667

668668
uint16_t StatsMarioIcons[] =
669669
{
670-
#ifndef TTYD_JP
671-
403, // Coins
672-
423, // HP
673-
424, // FP
674-
425, // BP
675-
423, // Max HP
676-
424, // Max FP
677-
422, // Level
678-
422, // Rank
679-
404, // Star Points
680-
405, // Star Pieces
681-
266, // Shine Sprites
682-
415, // Special Moves
683-
154, // Star Power
684-
154, // Max Star Power
685-
390, // Shop Points
686-
327, // Piantas Stored
687-
327, // Current Piantas
688-
#else
670+
#ifdef TTYD_JP
689671
395, // Coins
690672
415, // HP
691673
416, // FP
@@ -703,6 +685,24 @@ uint16_t StatsMarioIcons[] =
703685
382, // Shop Points
704686
319, // Piantas Stored
705687
319, // Current Piantas
688+
#else
689+
403, // Coins
690+
423, // HP
691+
424, // FP
692+
425, // BP
693+
423, // Max HP
694+
424, // Max FP
695+
422, // Level
696+
422, // Rank
697+
404, // Star Points
698+
405, // Star Pieces
699+
266, // Shine Sprites
700+
415, // Special Moves
701+
154, // Star Power
702+
154, // Max Star Power
703+
390, // Shop Points
704+
327, // Piantas Stored
705+
327, // Current Piantas
706706
#endif
707707
};
708708

@@ -1094,35 +1094,7 @@ uint8_t BattlesStatusesLinesSize = sizeof(BattlesStatusesLines) / sizeof(Battles
10941094

10951095
uint16_t BattlesStatusesIcons[] =
10961096
{
1097-
#ifndef TTYD_JP
1098-
397, // Sleep
1099-
398, // Stop
1100-
379, // Dizzy
1101-
223, // Poision
1102-
223, // Poison Amount
1103-
409, // Confused
1104-
388, // Electrified
1105-
412, // Dodgy
1106-
15, // Burn
1107-
392, // Frozen
1108-
375, // Big/Shrink
1109-
375, // Big/Shrink Amount
1110-
47, // Attack Up/Down
1111-
47, // Attack Up/Down Amount
1112-
48, // Defense Up/Down
1113-
48, // Defense Up/Down Amount
1114-
37, // Charged
1115-
186, // Allergic
1116-
408, // Invisible
1117-
203, // Payback
1118-
426, // Fast
1119-
390, // Slow
1120-
386, // HP Regen
1121-
386, // HP Regen Amount
1122-
389, // FP Regen
1123-
389, // FP Regen Amount
1124-
362, // Defeated Flag
1125-
#else
1097+
#ifdef TTYD_JP
11261098
389, // Sleep
11271099
390, // Stop
11281100
371, // Dizzy
@@ -1150,6 +1122,34 @@ uint16_t BattlesStatusesIcons[] =
11501122
381, // FP Regen
11511123
381, // FP Regen Amount
11521124
354, // Defeated Flag
1125+
#else
1126+
397, // Sleep
1127+
398, // Stop
1128+
379, // Dizzy
1129+
223, // Poision
1130+
223, // Poison Amount
1131+
409, // Confused
1132+
388, // Electrified
1133+
412, // Dodgy
1134+
15, // Burn
1135+
392, // Frozen
1136+
375, // Big/Shrink
1137+
375, // Big/Shrink Amount
1138+
47, // Attack Up/Down
1139+
47, // Attack Up/Down Amount
1140+
48, // Defense Up/Down
1141+
48, // Defense Up/Down Amount
1142+
37, // Charged
1143+
186, // Allergic
1144+
408, // Invisible
1145+
203, // Payback
1146+
426, // Fast
1147+
390, // Slow
1148+
386, // HP Regen
1149+
386, // HP Regen Amount
1150+
389, // FP Regen
1151+
389, // FP Regen Amount
1152+
362, // Defeated Flag
11531153
#endif
11541154
};
11551155

@@ -1275,23 +1275,7 @@ const char *ReturnPlaceholder[] =
12751275
"Return",
12761276
};
12771277

1278-
#ifndef TTYD_JP
1279-
const char ButtonInputDisplay[] =
1280-
{
1281-
static_cast<char>(171), // Left
1282-
static_cast<char>(187), // Right
1283-
static_cast<char>(179), // Down
1284-
static_cast<char>(178), // Up
1285-
'Z',
1286-
'R',
1287-
'L',
1288-
'A',
1289-
'B',
1290-
'X',
1291-
'Y',
1292-
'S',
1293-
};
1294-
#else
1278+
#ifdef TTYD_JP
12951279
uint8_t ButtonLeft[] = {0x81, 0xA9, 0};
12961280
uint8_t ButtonRight[] = {0x81, 0xA8, 0};
12971281
uint8_t ButtonDown[] = {0x81, 0xAB, 0};
@@ -1315,6 +1299,22 @@ const char *ButtonInputDisplay[] =
13151299

13161300
uint8_t PointerTextValues[] = {0x50, 0x81, 0xA8, 0};
13171301
const char *PointerText = reinterpret_cast<const char *>(&PointerTextValues);
1302+
#else
1303+
const char ButtonInputDisplay[] =
1304+
{
1305+
static_cast<char>(171), // Left
1306+
static_cast<char>(187), // Right
1307+
static_cast<char>(179), // Down
1308+
static_cast<char>(178), // Up
1309+
'Z',
1310+
'R',
1311+
'L',
1312+
'A',
1313+
'B',
1314+
'X',
1315+
'Y',
1316+
'S',
1317+
};
13181318
#endif
13191319

13201320
struct Menus Menu[27];

ttyd-tools/rel/source/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,10 @@ const char *Mod::getCustomMessage(const char *msgKey)
344344
// Only needs to change when not on the train
345345
if (!compareStrings(tempNextArea, "rsh"))
346346
{
347-
#ifndef TTYD_JP
348-
const char *message = "<select 0 0 0 40>No\nAlright\nChoose this option";
349-
#else
347+
#ifdef TTYD_JP
350348
const char *message = "<select 0 0 300 40>No\nAlright\nChoose this option";
349+
#else
350+
const char *message = "<select 0 0 0 40>No\nAlright\nChoose this option";
351351
#endif
352352

353353
return message;

ttyd-tools/rel/source/memorywatch.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ const char *getAddressString(int32_t slot)
3939
const char *tempPointerText;
4040
if (MemoryWatch[slot].AddressOffsetAmount > 0)
4141
{
42-
#ifndef TTYD_JP
43-
tempPointerText = "P=";
44-
#else
42+
#ifdef TTYD_JP
4543
tempPointerText = PointerText;
44+
#else
45+
tempPointerText = "P=";
4646
#endif
4747
}
4848
else

ttyd-tools/rel/source/menufunctions.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,14 +1669,14 @@ uint32_t followersOptionsButtonControls()
16691669
// Set specific bytes
16701670
if (ReturnCode >= 0)
16711671
{
1672-
#ifndef TTYD_JP
1673-
ttyd::mario::Player *player = ttyd::mario::marioGetPtr();
1674-
player->wFollowerFlags[1] = ReturnCode; // 0x246
1675-
player->prevFollowerId[1] = NewFollower; // 0x248
1676-
#else
1672+
#ifdef TTYD_JP
16771673
uint32_t MarioPtr = reinterpret_cast<uint32_t>(ttyd::mario::marioGetPtr());
16781674
*reinterpret_cast<uint8_t *>(MarioPtr + 0x242) = ReturnCode;
16791675
*reinterpret_cast<uint8_t *>(MarioPtr + 0x244) = NewFollower;
1676+
#else
1677+
ttyd::mario::Player *player = ttyd::mario::marioGetPtr();
1678+
player->wFollowerFlags[1] = ReturnCode; // 0x246
1679+
player->prevFollowerId[1] = NewFollower; // 0x248
16801680
#endif
16811681
}
16821682

0 commit comments

Comments
 (0)