Counters except sinit won't match

This commit is contained in:
robojumper
2025-04-01 00:50:34 +02:00
parent daadae4881
commit f92ba9710d
13 changed files with 270 additions and 92 deletions
+7
View File
@@ -590,6 +590,13 @@ d/lyt/d_lyt_cursor_stick.cpp:
toBeSorted/counters/counter.cpp:
.text start:0x8016CC40 end:0x8016CD94
toBeSorted/counters/counters.cpp:
.text start:0x8016CDA0 end:0x8016DE08
.ctors start:0x804DB7B8 end:0x804DB7BC
.data start:0x80527BD0 end:0x80527FF0
.sbss start:0x80575508 end:0x80575610
.bss start:0x805B1F70 end:0x805B2010
toBeSorted/counters/rupee_counter.cpp:
.text start:0x8016DE10 end:0x8016DF98
.ctors start:0x804DB7BC end:0x804DB7C0
+76 -76
View File
@@ -9356,83 +9356,83 @@ fn_8016CB60 = .text:0x8016CB60; // type:function size:0x78
AcItem__isItemThatHasStruct = .text:0x8016CBE0; // type:function size:0x3C
AcItem__getIndex = .text:0x8016CC20; // type:function size:0x14
checkedAdd__7CounterFl = .text:0x8016CC40; // type:function size:0xF0
getCommittedValue__7CounterFv = .text:0x8016CD30; // type:function size:0x20
getUncommittedValue__7CounterFv = .text:0x8016CD50; // type:function size:0x20
getCommittedValue__7CounterCFv = .text:0x8016CD30; // type:function size:0x20
getUncommittedValue__7CounterCFv = .text:0x8016CD50; // type:function size:0x20
setValue__7CounterFUs = .text:0x8016CD70; // type:function size:0x24
DungeonCounter__getCommitedDungeonValue = .text:0x8016CDA0; // type:function size:0x64
DungeonCounter__getUncommitedDungeonValue = .text:0x8016CE10; // type:function size:0x10
DungeonCounter__setValue = .text:0x8016CE20; // type:function size:0x14
DungeonCounter__dtor = .text:0x8016CE40; // type:function size:0x40
PouchExpansionCounter__dtor = .text:0x8016CE80; // type:function size:0x40
HeartPieceCounter__dtor = .text:0x8016CEC0; // type:function size:0x40
HeartPieceCounter__addChecked = .text:0x8016CF00; // type:function size:0x84
HeartContainerCounterMaybe__dtor = .text:0x8016CF90; // type:function size:0x40
FaronGrasshopperCounter__dtor = .text:0x8016CFD0; // type:function size:0x40
WoodlandRhinoCounter__dtor = .text:0x8016D010; // type:function size:0x40
DekuHornetCounter__dtor = .text:0x8016D050; // type:function size:0x40
SkyloftMantisCounter__dtor = .text:0x8016D090; // type:function size:0x40
VolcanicLadybugCounter__dtor = .text:0x8016D0D0; // type:function size:0x40
BlessedButterflyCounter__dtor = .text:0x8016D110; // type:function size:0x40
LanayruAntCounter__dtor = .text:0x8016D150; // type:function size:0x40
SandCicadaCounter__dtor = .text:0x8016D190; // type:function size:0x40
GerudoDragonflyCounter__dtor = .text:0x8016D1D0; // type:function size:0x40
EldinRollerCounter__dtor = .text:0x8016D210; // type:function size:0x40
SkyStagBeetleCounter__dtor = .text:0x8016D250; // type:function size:0x40
StarryFireflyCounter__dtor = .text:0x8016D290; // type:function size:0x40
HornetLarvaeCounter__dtor = .text:0x8016D2D0; // type:function size:0x40
BirdFeatherCounter__dtor = .text:0x8016D310; // type:function size:0x40
TumbleweedCounter__dtor = .text:0x8016D350; // type:function size:0x40
LizardTailCounter__dtor = .text:0x8016D390; // type:function size:0x40
EldinOreCounter__dtor = .text:0x8016D3D0; // type:function size:0x40
AncientFlowerCounter__dtor = .text:0x8016D410; // type:function size:0x40
AmberRelicCounter__dtor = .text:0x8016D450; // type:function size:0x40
DuskRelicCounter__dtor = .text:0x8016D490; // type:function size:0x40
JellyBlobCounter__dtor = .text:0x8016D4D0; // type:function size:0x40
MonsterClawCounter__dtor = .text:0x8016D510; // type:function size:0x40
MonsterHornCounter__dtor = .text:0x8016D550; // type:function size:0x40
OrnamentalSkullCounter__dtor = .text:0x8016D590; // type:function size:0x40
EvilCrystalCounter__dtor = .text:0x8016D5D0; // type:function size:0x40
BlueBirdFeatherCounter__dtor = .text:0x8016D610; // type:function size:0x40
GoldenSkullCounter__dtor = .text:0x8016D650; // type:function size:0x40
GoddessPlumeCounter__dtor = .text:0x8016D690; // type:function size:0x40
GratitudeCrystalCounter__dtor = .text:0x8016D6D0; // type:function size:0x40
increaseCounter = .text:0x8016D710; // type:function size:0x20
getCounterByIndex = .text:0x8016D730; // type:function size:0x40
getMaxItemCount = .text:0x8016D770; // type:function size:0x40
GratitudeCrystalCounter__getMaxGratitudeCrystalCount = .text:0x8016D7B0; // type:function size:0x8
GoddessPlumeCounter__getMaxGoddessPlumeCount = .text:0x8016D7C0; // type:function size:0x8
GoldenSkullCounter__getMaxGoldenSkullCount = .text:0x8016D7D0; // type:function size:0x8
BlueBirdFeatherCounter__getMaxBlueBirdFeatherCount = .text:0x8016D7E0; // type:function size:0x8
EvilCrystalCounter__getMaxEvilCrystalCount = .text:0x8016D7F0; // type:function size:0x8
OrnamentalSkullCounter__getMaxOrnamentalSkullCount = .text:0x8016D800; // type:function size:0x8
MonsterHornCounter__getMaxMonsterHornCount = .text:0x8016D810; // type:function size:0x8
MonsterClawCounter__getMaxMonsterClawCount = .text:0x8016D820; // type:function size:0x8
JellyBlobCounter__getMaxJellyBlobCount = .text:0x8016D830; // type:function size:0x8
DuskRelicCounter__getMaxDuskRelicCount = .text:0x8016D840; // type:function size:0x8
AmberRelicCounter__getMaxAmberRelicCount = .text:0x8016D850; // type:function size:0x8
AncientFlowerCounter__getMaxAncientFlowerCount = .text:0x8016D860; // type:function size:0x8
EldinOreCounter__getMaxEldinOreCount = .text:0x8016D870; // type:function size:0x8
LizardTailCounter__getMaxLizardTailCount = .text:0x8016D880; // type:function size:0x8
TumbleweedCounter__getMaxTumbleweedCount = .text:0x8016D890; // type:function size:0x8
BirdFeatherCounter__getMaxBirdFeatherCount = .text:0x8016D8A0; // type:function size:0x8
HornetLarvaeCounter__getMaxHornetLarvaeCount = .text:0x8016D8B0; // type:function size:0x8
StarryFireflyCounter__getMaxStarryFireflyCount = .text:0x8016D8C0; // type:function size:0x8
SkyStagBeetleCounter__getMaxSkyStagBeetleCount = .text:0x8016D8D0; // type:function size:0x8
EldinRollerCounter__getMaxEldinRollerCount = .text:0x8016D8E0; // type:function size:0x8
GerudoDragonflyCounter__getMaxGerudoDragonflyCount = .text:0x8016D8F0; // type:function size:0x8
SandCicadaCounter__getMaxSandCicadaCount = .text:0x8016D900; // type:function size:0x8
LanayruAntCounter__getMaxLanayruAntCount = .text:0x8016D910; // type:function size:0x8
BlessedButterflyCounter__getMaxBlessedButterflyCount = .text:0x8016D920; // type:function size:0x8
VolcanicLadybugCounter__getMaxVolcanicLadybugCount = .text:0x8016D930; // type:function size:0x8
SkyloftMantisCounter__getMaxSkyloftMantisCount = .text:0x8016D940; // type:function size:0x8
DekuHornetCounter__getMaxDekuHornetCount = .text:0x8016D950; // type:function size:0x8
WoodlandRhinoCounter__getMaxWoodlandRhinoBeetleCount = .text:0x8016D960; // type:function size:0x8
FaronGrasshopperCounter__getMaxFaronGrasshopperCount = .text:0x8016D970; // type:function size:0x8
HeartContainerCounterMaybe__getMaxHeartContainerHealthCountMaybe = .text:0x8016D980; // type:function size:0x8
HeartPieceCounter__getMaxHeartPieceCount = .text:0x8016D990; // type:function size:0x8
PouchExpansionCounter__getMaxPouchExpansionCount = .text:0x8016D9A0; // type:function size:0x8
DungeonCounter__getMaxSmallKeyCount = .text:0x8016D9B0; // type:function size:0x8
ItemCounterMgr__init = .text:0x8016D9C0; // type:function size:0x448
getCommittedValue__15SmallKeyCounterCFv = .text:0x8016CDA0; // type:function size:0x64
getUncommittedValue__15SmallKeyCounterCFv = .text:0x8016CE10; // type:function size:0x10
setValue__15SmallKeyCounterFUs = .text:0x8016CE20; // type:function size:0x14
__dt__15SmallKeyCounterFv = .text:0x8016CE40; // type:function size:0x40
__dt__21PouchExpansionCounterFv = .text:0x8016CE80; // type:function size:0x40
__dt__17HeartPieceCounterFv = .text:0x8016CEC0; // type:function size:0x40
checkedAdd__17HeartPieceCounterFl = .text:0x8016CF00; // type:function size:0x84
__dt__21HeartContainerCounterFv = .text:0x8016CF90; // type:function size:0x40
__dt__23FaronGrasshopperCounterFv = .text:0x8016CFD0; // type:function size:0x40
__dt__26WoodlandRhinoBeetleCounterFv = .text:0x8016D010; // type:function size:0x40
__dt__17DekuHornetCounterFv = .text:0x8016D050; // type:function size:0x40
__dt__20SkyloftMantisCounterFv = .text:0x8016D090; // type:function size:0x40
__dt__22VolcanicLadybugCounterFv = .text:0x8016D0D0; // type:function size:0x40
__dt__23BlessedButterflyCounterFv = .text:0x8016D110; // type:function size:0x40
__dt__17LanayruAntCounterFv = .text:0x8016D150; // type:function size:0x40
__dt__17SandCicadaCounterFv = .text:0x8016D190; // type:function size:0x40
__dt__22GerudoDragonflyCounterFv = .text:0x8016D1D0; // type:function size:0x40
__dt__18EldinRollerCounterFv = .text:0x8016D210; // type:function size:0x40
__dt__20SkyStagBeetleCounterFv = .text:0x8016D250; // type:function size:0x40
__dt__20StarryFireflyCounterFv = .text:0x8016D290; // type:function size:0x40
__dt__19HornetLarvaeCounterFv = .text:0x8016D2D0; // type:function size:0x40
__dt__18BirdFeatherCounterFv = .text:0x8016D310; // type:function size:0x40
__dt__17TumbleweedCounterFv = .text:0x8016D350; // type:function size:0x40
__dt__17LizardTailCounterFv = .text:0x8016D390; // type:function size:0x40
__dt__15EldinOreCounterFv = .text:0x8016D3D0; // type:function size:0x40
__dt__20AncientFlowerCounterFv = .text:0x8016D410; // type:function size:0x40
__dt__17AmberRelicCounterFv = .text:0x8016D450; // type:function size:0x40
__dt__16DuskRelicCounterFv = .text:0x8016D490; // type:function size:0x40
__dt__16JellyBlobCounterFv = .text:0x8016D4D0; // type:function size:0x40
__dt__18MonsterClawCounterFv = .text:0x8016D510; // type:function size:0x40
__dt__18MonsterHornCounterFv = .text:0x8016D550; // type:function size:0x40
__dt__22OrnamentalSkullCounterFv = .text:0x8016D590; // type:function size:0x40
__dt__18EvilCrystalCounterFv = .text:0x8016D5D0; // type:function size:0x40
__dt__22BlueBirdFeatherCounterFv = .text:0x8016D610; // type:function size:0x40
__dt__18GoldenSkullCounterFv = .text:0x8016D650; // type:function size:0x40
__dt__19GoddessPlumeCounterFv = .text:0x8016D690; // type:function size:0x40
__dt__23GratitudeCrystalCounterFv = .text:0x8016D6D0; // type:function size:0x40
increaseCounter__FUsl = .text:0x8016D710; // type:function size:0x20
getCounterByIndex__FUs = .text:0x8016D730; // type:function size:0x40
getMaxItemCount__FUs = .text:0x8016D770; // type:function size:0x40
getMax__23GratitudeCrystalCounterCFv = .text:0x8016D7B0; // type:function size:0x8
getMax__19GoddessPlumeCounterCFv = .text:0x8016D7C0; // type:function size:0x8
getMax__18GoldenSkullCounterCFv = .text:0x8016D7D0; // type:function size:0x8
getMax__22BlueBirdFeatherCounterCFv = .text:0x8016D7E0; // type:function size:0x8
getMax__18EvilCrystalCounterCFv = .text:0x8016D7F0; // type:function size:0x8
getMax__22OrnamentalSkullCounterCFv = .text:0x8016D800; // type:function size:0x8
getMax__18MonsterHornCounterCFv = .text:0x8016D810; // type:function size:0x8
getMax__18MonsterClawCounterCFv = .text:0x8016D820; // type:function size:0x8
getMax__16JellyBlobCounterCFv = .text:0x8016D830; // type:function size:0x8
getMax__16DuskRelicCounterCFv = .text:0x8016D840; // type:function size:0x8
getMax__17AmberRelicCounterCFv = .text:0x8016D850; // type:function size:0x8
getMax__20AncientFlowerCounterCFv = .text:0x8016D860; // type:function size:0x8
getMax__15EldinOreCounterCFv = .text:0x8016D870; // type:function size:0x8
getMax__17LizardTailCounterCFv = .text:0x8016D880; // type:function size:0x8
getMax__17TumbleweedCounterCFv = .text:0x8016D890; // type:function size:0x8
getMax__18BirdFeatherCounterCFv = .text:0x8016D8A0; // type:function size:0x8
getMax__19HornetLarvaeCounterCFv = .text:0x8016D8B0; // type:function size:0x8
getMax__20StarryFireflyCounterCFv = .text:0x8016D8C0; // type:function size:0x8
getMax__20SkyStagBeetleCounterCFv = .text:0x8016D8D0; // type:function size:0x8
getMax__18EldinRollerCounterCFv = .text:0x8016D8E0; // type:function size:0x8
getMax__22GerudoDragonflyCounterCFv = .text:0x8016D8F0; // type:function size:0x8
getMax__17SandCicadaCounterCFv = .text:0x8016D900; // type:function size:0x8
getMax__17LanayruAntCounterCFv = .text:0x8016D910; // type:function size:0x8
getMax__23BlessedButterflyCounterCFv = .text:0x8016D920; // type:function size:0x8
getMax__22VolcanicLadybugCounterCFv = .text:0x8016D930; // type:function size:0x8
getMax__20SkyloftMantisCounterCFv = .text:0x8016D940; // type:function size:0x8
getMax__17DekuHornetCounterCFv = .text:0x8016D950; // type:function size:0x8
getMax__26WoodlandRhinoBeetleCounterCFv = .text:0x8016D960; // type:function size:0x8
getMax__23FaronGrasshopperCounterCFv = .text:0x8016D970; // type:function size:0x8
getMax__21HeartContainerCounterCFv = .text:0x8016D980; // type:function size:0x8
getMax__17HeartPieceCounterCFv = .text:0x8016D990; // type:function size:0x8
getMax__21PouchExpansionCounterCFv = .text:0x8016D9A0; // type:function size:0x8
getMax__15SmallKeyCounterCFv = .text:0x8016D9B0; // type:function size:0x8
__sinit_\counters_cpp = .text:0x8016D9C0; // type:function size:0x448 scope:local
getBaseCapacity__Fv = .text:0x8016DE10; // type:function size:0xAC scope:local
getExtraWalletCapacity__Fv = .text:0x8016DEC0; // type:function size:0x2C scope:local
__dt__12RupeeCounterFv = .text:0x8016DEF0; // type:function size:0x40 scope:weak
+1
View File
@@ -367,6 +367,7 @@ config.libs = [
Object(NonMatching, "toBeSorted/nand_request_thread.cpp"),
Object(Matching, "toBeSorted/save_file.cpp"),
Object(Matching, "toBeSorted/counters/counter.cpp"),
Object(NonMatching, "toBeSorted/counters/counters.cpp"),
Object(Matching, "toBeSorted/counters/rupee_counter.cpp"),
Object(Matching, "toBeSorted/counters/arrow_counter.cpp"),
Object(Matching, "toBeSorted/counters/bomb_counter.cpp"),
+8 -4
View File
@@ -6,14 +6,18 @@
class Counter {
public:
Counter(u16 id) : counterId(id) {}
virtual ~Counter(){};
virtual ~Counter() {}
virtual s32 checkedAdd(s32 num);
virtual u16 getCommittedValue();
virtual u16 getMax() = 0;
virtual u16 getUncommittedValue();
virtual u16 getCommittedValue() const;
virtual u16 getMax() const = 0;
virtual u16 getUncommittedValue() const;
virtual void setValue(u16 num);
u16 counterId;
};
s32 increaseCounter(u16 counterIdx, s32 value);
s32 getCounterByIndex(u16 counterIdx);
s32 getMaxItemCount(u16 counterIdx);
#endif
+1 -1
View File
@@ -4,7 +4,7 @@ class ArrowCounter : public Counter {
public:
ArrowCounter();
/* 8016DFA0 */ ~ArrowCounter() {}
/* 8016E000 */ virtual u16 getMax() override {
/* 8016E000 */ virtual u16 getMax() const override {
return 20;
};
};
+1 -1
View File
@@ -4,7 +4,7 @@ class BombCounter : public Counter {
public:
BombCounter();
/* 8016E020 */ ~BombCounter() {}
/* 8016E080 */ virtual u16 getMax() override {
/* 8016E080 */ virtual u16 getMax() const override {
return 10;
}
};
+2 -2
View File
@@ -21,11 +21,11 @@
return result <= max ? 0 : (result - max);
}
/* 8016cd30 */ u16 Counter::getCommittedValue() {
/* 8016cd30 */ u16 Counter::getCommittedValue() const {
return ItemflagManager::sInstance->getCounterOrFlag(counterId | 0x4000);
}
/* 8016cd50 */ u16 Counter::getUncommittedValue() {
/* 8016cd50 */ u16 Counter::getUncommittedValue() const {
return ItemflagManager::sInstance->getUncommittedValue(counterId | 0x4000);
}
+169
View File
@@ -0,0 +1,169 @@
#include "d/flag/dungeonflag_manager.h"
#include "toBeSorted/counters/counter.h"
class SmallKeyCounter : public Counter {
public:
SmallKeyCounter() : Counter(0xF) {}
virtual u16 getMax() const override {
return 15;
}
virtual u16 getCommittedValue() const override;
virtual u16 getUncommittedValue() const override;
virtual void setValue(u16 num) override;
};
u16 SmallKeyCounter::getCommittedValue() const {
u16 counter = counterId;
return DungeonflagManager::sInstance->getCounterOrFlag(counter, 8);
}
u16 SmallKeyCounter::getUncommittedValue() const {
return DungeonflagManager::sInstance->getDungeonFlag(counterId);
}
void SmallKeyCounter::setValue(u16 num) {
return DungeonflagManager::sInstance->setToValue(counterId, num);
}
static SmallKeyCounter sSmallKeyCounter;
#define MAKE_COMMON_COUNTER(name, id, max) \
class name##Counter : public Counter { \
public: \
name##Counter() : Counter(id) {} \
virtual u16 getMax() const override { \
return max; \
} \
}; \
static name##Counter s##name##Counter;
MAKE_COMMON_COUNTER(PouchExpansion, 0x1EA, 7);
class HeartPieceCounter : public Counter {
public:
HeartPieceCounter() : Counter(0x1E9) {}
virtual s32 checkedAdd(s32 num) override;
virtual u16 getMax() const override {
return 3;
}
};
static HeartPieceCounter sHeartPieceCounter;
s32 HeartPieceCounter::checkedAdd(s32 num) {
if (num > 0) {
s32 uncommitted = getUncommittedValue();
s32 newCount = uncommitted + num;
setValue(newCount % 4);
}
return 0;
}
MAKE_COMMON_COUNTER(HeartContainer, 0x1Fd, 24);
MAKE_COMMON_COUNTER(FaronGrasshopper, 0x1B9, 99);
MAKE_COMMON_COUNTER(WoodlandRhinoBeetle, 0x1BA, 99);
MAKE_COMMON_COUNTER(DekuHornet, 0x1BB, 99);
MAKE_COMMON_COUNTER(SkyloftMantis, 0x1BC, 99);
MAKE_COMMON_COUNTER(VolcanicLadybug, 0x1BD, 99);
MAKE_COMMON_COUNTER(BlessedButterfly, 0x1BE, 99);
MAKE_COMMON_COUNTER(LanayruAnt, 0x1BF, 99);
MAKE_COMMON_COUNTER(SandCicada, 0x1C0, 99);
MAKE_COMMON_COUNTER(GerudoDragonfly, 0x1C1, 99);
MAKE_COMMON_COUNTER(EldinRoller, 0x1C2, 99);
MAKE_COMMON_COUNTER(SkyStagBeetle, 0x1C3, 99);
MAKE_COMMON_COUNTER(StarryFirefly, 0x1C4, 99);
MAKE_COMMON_COUNTER(HornetLarvae, 0x1A5, 99);
MAKE_COMMON_COUNTER(BirdFeather, 0x1A6, 99);
MAKE_COMMON_COUNTER(Tumbleweed, 0x1A7, 99); // TIM!!
MAKE_COMMON_COUNTER(LizardTail, 0x1A8, 99);
MAKE_COMMON_COUNTER(EldinOre, 0x1A9, 99);
MAKE_COMMON_COUNTER(AncientFlower, 0x1AA, 99);
MAKE_COMMON_COUNTER(AmberRelic, 0x1AB, 99);
MAKE_COMMON_COUNTER(DuskRelic, 0x1AC, 99);
MAKE_COMMON_COUNTER(JellyBlob, 0x1AD, 99);
MAKE_COMMON_COUNTER(MonsterClaw, 0x1AE, 99);
MAKE_COMMON_COUNTER(MonsterHorn, 0x1AF, 99);
MAKE_COMMON_COUNTER(OrnamentalSkull, 0x1B0, 99);
MAKE_COMMON_COUNTER(EvilCrystal, 0x1B1, 99);
MAKE_COMMON_COUNTER(BlueBirdFeather, 0x1B2, 99);
MAKE_COMMON_COUNTER(GoldenSkull, 0x1B3, 99);
MAKE_COMMON_COUNTER(GoddessPlume, 0x1B4, 99);
MAKE_COMMON_COUNTER(GratitudeCrystal, 0x1B5, 127);
// I don't want to move all of these to headers yet
extern TumbleweedCounter ARROW_COUNTER;
extern TumbleweedCounter BOMB_COUNTER;
extern TumbleweedCounter EXTRA_WALLET_COUNTER;
extern TumbleweedCounter KEY_PIECE_COUNTER;
extern TumbleweedCounter RUPEE_COUNTER;
extern TumbleweedCounter SLINGSHOT_SEED_COUNTER;
extern TumbleweedCounter TEAR_COUNTER;
class Counters {
public:
Counters() {
// mCounters\[([0-9]+)\] = &([A-Za-z_]+);
mCounters[0] = &RUPEE_COUNTER;
mCounters[1] = &ARROW_COUNTER;
mCounters[2] = &BOMB_COUNTER;
mCounters[3] = &TEAR_COUNTER;
mCounters[4] = &SLINGSHOT_SEED_COUNTER;
mCounters[5] = &KEY_PIECE_COUNTER;
mCounters[6] = &sSmallKeyCounter;
mCounters[7] = &sPouchExpansionCounter;
mCounters[8] = &sHeartPieceCounter;
mCounters[9] = &sHeartContainerCounter;
mCounters[10] = &sFaronGrasshopperCounter;
mCounters[11] = &sWoodlandRhinoBeetleCounter;
mCounters[12] = &sDekuHornetCounter;
mCounters[13] = &sSkyloftMantisCounter;
mCounters[14] = &sVolcanicLadybugCounter;
mCounters[15] = &sBlessedButterflyCounter;
mCounters[16] = &sLanayruAntCounter;
mCounters[17] = &sSandCicadaCounter;
mCounters[18] = &sGerudoDragonflyCounter;
mCounters[19] = &sEldinRollerCounter;
mCounters[20] = &sSkyStagBeetleCounter;
mCounters[21] = &sStarryFireflyCounter;
mCounters[22] = &sHornetLarvaeCounter;
mCounters[23] = &sBirdFeatherCounter;
mCounters[24] = &sTumbleweedCounter;
mCounters[25] = &sLizardTailCounter;
mCounters[26] = &sEldinOreCounter;
mCounters[27] = &sAncientFlowerCounter;
mCounters[28] = &sAmberRelicCounter;
mCounters[29] = &sDuskRelicCounter;
mCounters[30] = &sJellyBlobCounter;
mCounters[31] = &sMonsterClawCounter;
mCounters[32] = &sMonsterHornCounter;
mCounters[33] = &sOrnamentalSkullCounter;
mCounters[34] = &sEvilCrystalCounter;
mCounters[35] = &sBlueBirdFeatherCounter;
mCounters[36] = &sGoldenSkullCounter;
mCounters[37] = &sGoddessPlumeCounter;
mCounters[38] = &sGratitudeCrystalCounter;
mCounters[39] = &EXTRA_WALLET_COUNTER;
}
Counter *mCounters[40];
};
Counters sCounters;
s32 increaseCounter(u16 counterIdx, s32 value) {
return sCounters.mCounters[counterIdx]->checkedAdd(value);
}
s32 getCounterByIndex(u16 counterIdx) {
return sCounters.mCounters[counterIdx]->getCommittedValue();
}
s32 getMaxItemCount(u16 counterIdx) {
return sCounters.mCounters[counterIdx]->getMax();
}
@@ -4,7 +4,7 @@ class ExtraWalletCounter : public Counter {
public:
ExtraWalletCounter();
/* 8016E220 */ ~ExtraWalletCounter() {}
/* 8016E280 */ virtual u16 getMax() override {
/* 8016E280 */ virtual u16 getMax() const override {
return 3;
}
};
@@ -4,7 +4,7 @@ class KeyPieceCounter : public Counter {
public:
KeyPieceCounter();
/* 8016E1A0 */ ~KeyPieceCounter() {}
/* 8016E200 */ virtual u16 getMax() override {
/* 8016E200 */ virtual u16 getMax() const override {
return 5;
}
};
+1 -4
View File
@@ -9,7 +9,7 @@ class RupeeCounter : public Counter {
public:
RupeeCounter();
/* 8016DEF0 */ ~RupeeCounter() {}
/* 8016DF50 */ virtual u16 getMax() override {
/* 8016DF50 */ virtual u16 getMax() const override {
return (getBaseCapacity() + getExtraWalletCapacity());
}
};
@@ -36,9 +36,6 @@ struct WalletStruct {
return 300;
}
// TODO main counters class
extern "C" u16 getCounterByIndex(u16);
/* 8016DEC0 */ static u16 getExtraWalletCapacity() {
return 300 * getCounterByIndex(0x27); // Maybe 0x27 corresponds to item 27 -> small wallet?
}
@@ -4,7 +4,7 @@ class SlingshotSeedCounter : public Counter {
public:
SlingshotSeedCounter();
/* 8016E120 */ ~SlingshotSeedCounter() {}
/* 8016E180 */ virtual u16 getMax() override {
/* 8016E180 */ virtual u16 getMax() const override {
return 20;
};
};
+1 -1
View File
@@ -4,7 +4,7 @@ class TearCounter : public Counter {
public:
TearCounter();
/* 8016E0A0 */ ~TearCounter() {}
/* 8016E100 */ virtual u16 getMax() override {
/* 8016E100 */ virtual u16 getMax() const override {
return 15;
};
};