mirror of
https://github.com/zeldaret/ss
synced 2026-07-10 22:41:46 -04:00
Start skipflag_manager
This commit is contained in:
@@ -122,6 +122,11 @@ toBeSorted/unk_flag_stuff.cpp:
|
||||
toBeSorted/bitwise_flag_helper.cpp:
|
||||
.text start:0x800BF200 end:0x800BF264
|
||||
|
||||
toBeSorted/skipflag_manager.cpp:
|
||||
.text start:0x800BFBA0 end:0x800BFE00
|
||||
.sbss start:0x80575408 end:0x80575410
|
||||
.bss start:0x805A9C68 end:0x805A9C88
|
||||
|
||||
f/f_base.cpp:
|
||||
.text start:0x802E12F0 end:0x802E2680
|
||||
.ctors start:0x804DB8C0 end:0x804DB8C4
|
||||
|
||||
@@ -4180,14 +4180,14 @@ fn_800BF9F0 = .text:0x800BF9F0; // type:function size:0x6C
|
||||
fn_800BFA60 = .text:0x800BFA60; // type:function size:0x60
|
||||
fn_800BFAC0 = .text:0x800BFAC0; // type:function size:0x50
|
||||
fn_800BFB10 = .text:0x800BFB10; // type:function size:0x8C
|
||||
fn_800BFBA0 = .text:0x800BFBA0; // type:function size:0x44
|
||||
fn_800BFBF0 = .text:0x800BFBF0; // type:function size:0xC
|
||||
fn_800BFC00 = .text:0x800BFC00; // type:function size:0x2C
|
||||
fn_800BFC30 = .text:0x800BFC30; // type:function size:0xC
|
||||
fn_800BFC40 = .text:0x800BFC40; // type:function size:0x4
|
||||
fn_800BFC50 = .text:0x800BFC50; // type:function size:0xD0
|
||||
fn_800BFD20 = .text:0x800BFD20; // type:function size:0x68
|
||||
fn_800BFD90 = .text:0x800BFD90; // type:function size:0x70
|
||||
copyFromSave__15SkipflagManagerFv = .text:0x800BFBA0; // type:function size:0x44
|
||||
setCommitFlag__15SkipflagManagerFv = .text:0x800BFBF0; // type:function size:0xC
|
||||
__ct__15SkipflagManagerFv = .text:0x800BFC00; // type:function size:0x2C
|
||||
unsetCommitFlag__15SkipflagManagerFv = .text:0x800BFC30; // type:function size:0xC
|
||||
thunk_copyFromSave__15SkipflagManagerFv = .text:0x800BFC40; // type:function size:0x4
|
||||
setFlag__15SkipflagManagerFUs = .text:0x800BFC50; // type:function size:0xD0
|
||||
checkFlag__15SkipflagManagerFUs = .text:0x800BFD20; // type:function size:0x68
|
||||
commitFlags__15SkipflagManagerFv = .text:0x800BFD90; // type:function size:0x70
|
||||
fn_800BFE00 = .text:0x800BFE00; // type:function size:0x294
|
||||
fn_800C00A0 = .text:0x800C00A0; // type:function size:0x40
|
||||
fn_800C00E0 = .text:0x800C00E0; // type:function size:0x40
|
||||
|
||||
@@ -274,6 +274,7 @@ config.libs = [
|
||||
Object(Matching, "toBeSorted/sceneflag_manager.cpp"),
|
||||
Object(NonMatching, "toBeSorted/flag_space.cpp"),
|
||||
Object(NonMatching, "toBeSorted/misc_flag_managers.cpp"),
|
||||
Object(NonMatching, "toBeSorted/skipflag_manager.cpp"),
|
||||
Object(Matching, "d/d_base.cpp"),
|
||||
Object(NonMatching, "d/d_heap.cpp"),
|
||||
Object(NonMatching, "d/d_stage.cpp"),
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
#include <libc.h>
|
||||
#include "toBeSorted/bitwise_flag_helper.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
#include "toBeSorted/flag_space.h"
|
||||
|
||||
class SkipflagManager {
|
||||
public:
|
||||
bool mShouldCommit;
|
||||
BitwiseFlagHelper mFlagHelper;
|
||||
FlagSpace mFlagSpace;
|
||||
|
||||
static u16 sSkipFlags[16];
|
||||
static SkipflagManager *sInstance;
|
||||
|
||||
void copyFromSave();
|
||||
void setCommitFlag();
|
||||
SkipflagManager();
|
||||
void unsetCommitFlag();
|
||||
void thunk_copyFromSave();
|
||||
void setFlag(u16 flag);
|
||||
bool checkFlag(u16 flag);
|
||||
bool commitFlags();
|
||||
};
|
||||
|
||||
SkipflagManager *SkipflagManager::sInstance = nullptr;
|
||||
u16 SkipflagManager::sSkipFlags[16] = {};
|
||||
|
||||
// 800bfba0
|
||||
void SkipflagManager::copyFromSave() {
|
||||
u16* savedSkipflags = FileManager::sInstance->getSkipFlags();
|
||||
mFlagSpace.copyFromSaveFile(savedSkipflags, 0, 0x10);
|
||||
}
|
||||
|
||||
// 800bfbf0
|
||||
void SkipflagManager::setCommitFlag() {
|
||||
mShouldCommit = true;
|
||||
}
|
||||
|
||||
// 800bfc00
|
||||
SkipflagManager::SkipflagManager() : mFlagSpace(sSkipFlags, ARRAY_LENGTH(sSkipFlags)) {
|
||||
mShouldCommit = false;
|
||||
}
|
||||
|
||||
// 800bfc30
|
||||
void SkipflagManager::unsetCommitFlag() {
|
||||
mShouldCommit = false;
|
||||
}
|
||||
|
||||
// 800bfc40
|
||||
void SkipflagManager::thunk_copyFromSave() {
|
||||
SkipflagManager::copyFromSave();
|
||||
}
|
||||
|
||||
// 800bfc50
|
||||
void SkipflagManager::setFlag(u16 flag) {
|
||||
mFlagHelper.setFlag(flag / 16, flag % 16, mFlagSpace.getFlagPtrChecked(), mFlagSpace.mCount);
|
||||
|
||||
u16* savedSkipflags;
|
||||
checkedMemcpy(savedSkipflags, 0x20, FileManager::sInstance->getSkipFlags(), 0x20);
|
||||
|
||||
mFlagHelper.setFlag(flag / 16, flag % 16, savedSkipflags, 0x10);
|
||||
FileManager::sInstance->setSkipFlagsChecked(savedSkipflags, 0, 0x10);
|
||||
setCommitFlag();
|
||||
}
|
||||
|
||||
// 800bfd20
|
||||
bool SkipflagManager::checkFlag(u16 flag) {
|
||||
u16* savedSkipflags = FileManager::sInstance->getSkipFlags();
|
||||
return mFlagHelper.checkFlag(flag / 16, flag % 16, savedSkipflags, 0x10);
|
||||
}
|
||||
|
||||
// 800bfd90
|
||||
bool SkipflagManager::commitFlags() {
|
||||
if (mShouldCommit) {
|
||||
FileManager::sInstance->setSkipFlagsChecked(mFlagSpace.getFlagPtrUnchecked(), 0, 0x10);
|
||||
mShouldCommit = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user