Match the single-counter TUs

This commit is contained in:
robojumper
2024-05-02 13:48:08 +02:00
parent 1ecdfe9a4d
commit cf42625664
11 changed files with 278 additions and 42 deletions
+15
View File
@@ -0,0 +1,15 @@
#include <toBeSorted/counters/counter.h>
class ArrowCounter : public Counter {
public:
ArrowCounter();
/* 8016DFA0 */ ~ArrowCounter() {}
virtual u16 getMax() override;
};
/* 80575618 */ ArrowCounter lbl_80575618;
/* 8016DFE0 */ ArrowCounter::ArrowCounter() : Counter(0x1f2) {}
/* 8016E000 */ u16 ArrowCounter::getMax() {
return 20;
}
+15
View File
@@ -0,0 +1,15 @@
#include <toBeSorted/counters/counter.h>
class BombCounter : public Counter {
public:
BombCounter();
/* 8016E020 */ ~BombCounter() {}
virtual u16 getMax() override;
};
/* 80575620 */ BombCounter lbl_80575620;
/* 8016E060 */ BombCounter::BombCounter(): Counter(0x1f3) { }
/* 8016E080 */ u16 BombCounter::getMax() {
return 10;
}
@@ -0,0 +1,16 @@
#include <toBeSorted/counters/counter.h>
class ExtraWalletCounter : public Counter {
public:
ExtraWalletCounter();
/* 8016E220 */ ~ExtraWalletCounter() {}
virtual u16 getMax() override;
};
/* 80575640 */ ExtraWalletCounter lbl_80575640;
/* 8016E260 */ ExtraWalletCounter::ExtraWalletCounter(): Counter(0x1fc) { }
/* 8016E280 */ u16 ExtraWalletCounter::getMax() {
return 3;
}
@@ -0,0 +1,15 @@
#include <toBeSorted/counters/counter.h>
class KeyPieceCounter : public Counter {
public:
KeyPieceCounter();
/* 8016E1A0 */ ~KeyPieceCounter() {}
virtual u16 getMax() override;
};
/* 80575638 */ KeyPieceCounter lbl_80575638;
/* 8016E1E0 */ KeyPieceCounter::KeyPieceCounter() : Counter(0x1f9) {}
/* 8016E200 */ u16 KeyPieceCounter::getMax() {
return 5;
}
+52
View File
@@ -0,0 +1,52 @@
#include <toBeSorted/counters/counter.h>
class RupeeCounter : public Counter {
public:
RupeeCounter();
/* 8016DEF0 */ ~RupeeCounter() {}
virtual u16 getMax() override;
};
struct WalletStruct {
u32 flag;
u16 capacity;
};
/* 804E91B0 */
const struct WalletStruct wallet_definitions[4] = {
{0x6c, 500},
{0x6d, 1000},
{0x6e, 5000},
{0x6f, 9000},
};
// TODO set up item flag manager
extern "C" void *lbl_80575400;
extern "C" u16 fn_800BF5E0(void *data, u16 flag);
/* 8016DE10 */ u16 getBaseCapacity() {
int i = 0;
WalletStruct tmp[4] = {wallet_definitions[0], wallet_definitions[1], wallet_definitions[2], wallet_definitions[3]};
const WalletStruct *wallet = &tmp[3];
for (; i < 4; i++, wallet--) {
if (fn_800BF5E0(lbl_80575400, wallet->flag)) {
return wallet->capacity;
}
}
return 300;
}
// TODO main counters class
extern "C" u16 fn_8016D730(u16);
/* 8016DEC0 */ u16 getExtraWalletCapacity() {
return 300 * fn_8016D730(0x27);
}
/* 80575610 */ RupeeCounter lbl_80575610;
/* 8016DF30 */ RupeeCounter::RupeeCounter() : Counter(0x1f5) {}
/* 8016DF50 */ u16 RupeeCounter::getMax() {
return (getBaseCapacity() + getExtraWalletCapacity());
}
@@ -0,0 +1,15 @@
#include <toBeSorted/counters/counter.h>
class SlingshotSeedCounter : public Counter {
public:
SlingshotSeedCounter();
/* 8016E120 */ ~SlingshotSeedCounter() {}
virtual u16 getMax() override;
};
/* 80575630 */ SlingshotSeedCounter lbl_80575630;
/* 8016E160 */ SlingshotSeedCounter::SlingshotSeedCounter() : Counter(0x1ed) {}
/* 8016E180 */ u16 SlingshotSeedCounter::getMax() {
return 20;
}
+15
View File
@@ -0,0 +1,15 @@
#include <toBeSorted/counters/counter.h>
class TearCounter : public Counter {
public:
TearCounter();
/* 8016E0A0 */ ~TearCounter() {}
virtual u16 getMax() override;
};
/* 80575628 */ TearCounter lbl_80575628;
/* 8016E0E0 */ TearCounter::TearCounter(): Counter(0x1f4) { }
/* 8016E100 */ u16 TearCounter::getMax() {
return 15;
}