Skip to content

Commit a28d90c

Browse files
committed
Edits and fixes
Set up MarioLockHPToggleC to use the proper function to get the pointer to Mario's stats, use the proper atan2 function (as well as correcting the parameters), stopped using cmath, slight edit in InfiniteItemUsageA to save a line, fixed more pointers in parameters.
1 parent f28c81f commit a28d90c

File tree

12 files changed

+102
-35
lines changed

12 files changed

+102
-35
lines changed

ttyd-tools/rel/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ endif
7878
#---------------------------------------------------------------------------------
7979
# any extra libraries we wish to link with the project
8080
#---------------------------------------------------------------------------------
81-
LIBS := -lm
81+
# Temporarily remove the math library to avoid conflicts
82+
# LIBS := -lm
83+
LIBS :=
8284

8385
#---------------------------------------------------------------------------------
8486
# list of directories containing libraries, this must be the top level containing

ttyd-tools/rel/include/ttyd.eu.lst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@
564564
// 800F9520:BattlePartyAnimeLoad
565565
// 800F9560:BattleGetPartnerPtr
566566
// 800F9594:BattleGetPartyPtr
567-
// 800F9614:BattleGetMarioPtr
567+
800F9614:BattleGetMarioPtr
568568
// 800F9680:BattleGetSystemPtr
569569
// 800F96E0:BattleGetUnitPartsPtr
570570
// 800F9720:BattleSetUnitPtr
@@ -824,8 +824,8 @@
824824
802713F0:strcpy
825825
// 802714A8:strlen
826826

827-
// e_atan2.c
828-
80273220:__ieee754_atan2
827+
// w_atan2.c
828+
80276394:atan2
829829

830830
// GXGeometry.c
831831
// 802B9A68:__GXSetDirtyState

ttyd-tools/rel/include/ttyd.jp.lst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@
561561
// 800F3760:BattlePartyAnimeLoad
562562
// 800F37A0:BattleGetPartnerPtr
563563
// 800F37D4:BattleGetPartyPtr
564-
// 800F3854:BattleGetMarioPtr
564+
800F3854:BattleGetMarioPtr
565565
// 800F38C0:BattleGetSystemPtr
566566
// 800F3920:BattleGetUnitPartsPtr
567567
// 800F3960:BattleSetUnitPtr
@@ -821,8 +821,8 @@
821821
802675E4:strcpy
822822
// 8026769C:strlen
823823

824-
// e_atan2.c
825-
80269414:__ieee754_atan2
824+
// w_atan2.c
825+
8026C588:atan2
826826

827827
// GXGeometry.c
828828
// 802AFBE8:__GXSetDirtyState

ttyd-tools/rel/include/ttyd.us.lst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@
564564
// 800F86B4:BattlePartyAnimeLoad
565565
// 800F86F4:BattleGetPartnerPtr
566566
// 800F8728:BattleGetPartyPtr
567-
// 800F87A8:BattleGetMarioPtr
567+
800F87A8:BattleGetMarioPtr
568568
// 800F8814:BattleGetSystemPtr
569569
// 800F8874:BattleGetUnitPartsPtr
570570
// 800F88B4:BattleSetUnitPtr
@@ -824,8 +824,8 @@
824824
8026D5FC:strcpy
825825
// 8026D6B4:strlen
826826

827-
// e_atan2.c
828-
8026F42C:__ieee754_atan2
827+
// w_atan2.c
828+
802725A0:atan2
829829

830830
// GXGeometry.c
831831
// 802B59EC:__GXSetDirtyState
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#pragma once
2+
3+
#include <cstdint>
4+
5+
namespace ttyd::battle {
6+
7+
extern "C" {
8+
9+
// BattleConsumeReserveItem
10+
// BattleStatusWindowCheck
11+
// BattleStatusWindowSystemOff
12+
// BattleStatusWindowEventOff
13+
// BattleStatusWindowSystemOn
14+
// BattleStatusWindowEventOn
15+
// BattleStatusWindowAPRecoveryOff
16+
// BattleStatusWindowAPRecoveryOn
17+
// BattleMajinaiEndCheck
18+
// BattleMajinaiDone
19+
// BattleMajinaiCheck
20+
// battleDisableHResetCheck
21+
// BattleAfterReactionMain
22+
// BattleAfterReactionRelease
23+
// BattleAfterReactionEntry
24+
// BattleAfterReactionQueueInit
25+
// BattleCheckUnitBroken
26+
// BattleGetFloorHeight
27+
// BattleGetStockExp
28+
// BattleStoreExp
29+
// BattleStoreCoin
30+
// BattlePartyInfoWorkInit
31+
// _EquipItem
32+
// BtlUnit_EquipItem
33+
// BattleTransPartyIdToUnitKind
34+
// BattleTransPartyId
35+
// BattleChangeParty
36+
// BattlePartyAnimeLoad
37+
// BattleGetPartnerPtr
38+
// BattleGetPartyPtr
39+
void *BattleGetMarioPtr(void *battleAddressesPointer);
40+
// BattleGetSystemPtr
41+
// BattleGetUnitPartsPtr
42+
// BattleSetUnitPtr
43+
// BattleGetUnitPtr
44+
// BattleFree
45+
// BattleAlloc
46+
// BattleIncSeq
47+
// BattleGetSeq
48+
// BattleSetSeq
49+
// BattleSetMarioParamToFieldBattle
50+
// Btl_UnitSetup
51+
// BattleEnd
52+
// BattleMain
53+
// BattleInit
54+
// battleSeqEndCheck
55+
// battleMain
56+
57+
}
58+
59+
}

ttyd-tools/rel/include/ttyd/e_atan2.h

Lines changed: 0 additions & 11 deletions
This file was deleted.

ttyd-tools/rel/include/ttyd/evtmgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bool evtCheckID(uint32_t threadID);
2424
// evtRestart
2525
// evtBrotherEntry
2626
// evtChildEntry
27-
uint32_t evtEntryType(uint32_t *script, uint32_t unk1, uint32_t unk2, uint32_t unk3);
27+
uint32_t evtEntryType(void *script, uint32_t unk1, uint32_t unk2, uint32_t unk3);
2828
// evtEntry
2929
// evtEntryRunCheck
3030
// evtmgrReInit

ttyd-tools/rel/include/ttyd/itemdrv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extern "C" {
2525
// itemHitCheck
2626
// itemNameToPtr
2727
// itemDelete
28-
void *itemEntry(const char *name, uint32_t id, uint32_t mode, int32_t wasCollectedExpr, uint32_t *pickupScript, float coordinateX, float coordinateY, float coordinateZ);
28+
void *itemEntry(const char *name, uint32_t id, uint32_t mode, int32_t wasCollectedExpr, void *pickupScript, float coordinateX, float coordinateY, float coordinateZ);
2929
// itemModeChange
3030
// itemMain
3131
// unk_JP_US_PAL_023
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#pragma once
2+
3+
namespace ttyd::w_atan2 {
4+
5+
extern "C" {
6+
7+
double atan2(double coordinateY, double coordinateX);
8+
9+
}
10+
11+
}

ttyd-tools/rel/source/assembly/InfiniteItemUsageA.s

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ lis %r5,button_input_high
2020
lhz %r5,button_input_low(%r5)
2121
and %r5,%r5,%r12
2222
cmpw %r5,%r12
23-
bne+ Exit
24-
blr
25-
26-
Exit:
23+
beqlr-
2724
stwu %sp,-0x20(%sp)
2825

2926
BranchInfiniteItemUsage:

0 commit comments

Comments
 (0)