Decompile more of AdventureFlags.cpp (#118)

* fix flags getters and associated relocs

* explicit ARM and improve existing matches

* match CopyTo

* document a bit the flag system and progress on unmatched functions

* remaining bottom functions

* func_ov00_02097810 params and name fix

* fix build issues

* move flag base definition to its own file

* document item flags

---------

Co-authored-by: Yanis002 <Yanis002@users.noreply.github.com>
Co-authored-by: Aetias <aetias@outlook.com>
This commit is contained in:
Yanis
2025-07-22 16:17:02 +02:00
committed by GitHub
parent 383ca6aaa2
commit cf8f5a80b1
16 changed files with 562 additions and 306 deletions
+3 -2
View File
@@ -10,6 +10,7 @@
#include "Save/AdventureFlags.hpp"
#include "System/OverlayManager.hpp"
#include "Unknown/UnkStruct_020eec68.hpp"
#include "flags.h"
static const char *sShipPartTypes[] = {"anc", "bow", "hul", "can", "dco", "pdl", "fnl", "brg"};
@@ -408,7 +409,7 @@ THUMB void ItemManager::SetTreasureSalvaged(u32 index) {
}
THUMB void ItemManager::RemoveItem(ItemFlag item) {
RESET_FLAG(mItemFlags.flags, item);
UNSET_FLAG(mItemFlags.flags, item);
if (item >= ItemFlag_EQUIP_START && item <= ItemFlag_EQUIP_END) {
(*mAmmo)[item] = 0;
}
@@ -993,7 +994,7 @@ ARM void ItemManager::func_ov00_020ae4dc(s32 param1) {
ARM void ItemManager::SetPotion(u32 index, Potion potion) {
mPotions[index] = potion;
if (potion == Potion_None) {
RESET_FLAG(mItemFlags.flags, index + ItemFlag_PotionA);
UNSET_FLAG(mItemFlags.flags, index + ItemFlag_PotionA);
} else {
SET_FLAG(mItemFlags.flags, index + ItemFlag_PotionA);
}