mirror of
https://github.com/zeldaret/ss
synced 2026-06-20 16:01:13 -04:00
@@ -0,0 +1,5 @@
|
||||
# https://clangd.llvm.org/config
|
||||
CompileFlags:
|
||||
Add: [
|
||||
"-Wno-c++11-compat-deprecated-writable-strings"
|
||||
]
|
||||
Vendored
+1
-1
@@ -15,7 +15,7 @@
|
||||
"files.insertFinalNewline": true,
|
||||
"files.trimFinalNewlines": true,
|
||||
"files.associations": {
|
||||
"*.inc": "c",
|
||||
"*.inc": "cpp",
|
||||
".clangd": "yaml"
|
||||
},
|
||||
// Disable C/C++ IntelliSense, use clangd instead
|
||||
|
||||
@@ -199,35 +199,11 @@ d/d_text_writer.cpp:
|
||||
toBeSorted/time_area_mgr.cpp:
|
||||
.text start:0x800B9280 end:0x800BB2A0
|
||||
|
||||
toBeSorted/sceneflag_manager.cpp:
|
||||
.text start:0x800BD8C0 end:0x800BE7A8
|
||||
.sbss start:0x805753E0 end:0x805753F0
|
||||
.bss start:0x805A78D0 end:0x805A7AD8
|
||||
|
||||
toBeSorted/misc_flag_managers.cpp:
|
||||
.text start:0x800BE7B0 end:0x800BEE00
|
||||
.data start:0x80510CDC end:0x80510D04
|
||||
.sbss start:0x805753F0 end:0x805753FC
|
||||
.bss start:0x805A7AD8 end:0x805A9AD8
|
||||
|
||||
toBeSorted/flag_space.cpp:
|
||||
.text start:0x800BEE00 end:0x800BEF90
|
||||
.data start:0x80510D04 end:0x80510D10
|
||||
|
||||
toBeSorted/unk_flag_stuff.cpp:
|
||||
.text start:0x800BEF90 end:0x800BF200
|
||||
|
||||
toBeSorted/bitwise_flag_helper.cpp:
|
||||
.text start:0x800BF200 end:0x800BF264
|
||||
|
||||
toBeSorted/dungeonflag_manager.cpp:
|
||||
.text start:0x800BF8D0 end:0x800BFB9C
|
||||
.bss start:0x805A9C58 end:0x805A9C68
|
||||
|
||||
toBeSorted/skipflag_manager.cpp:
|
||||
.text start:0x800BFBA0 end:0x800BFE00
|
||||
.sbss start:0x80575408 end:0x8057540C
|
||||
.bss start:0x805A9C68 end:0x805A9C88
|
||||
d/flag/flag_managers.cpp:
|
||||
.text start:0x800BD8C0 end:0x800C0650
|
||||
.data start:0x80510B88 end:0x80510D10
|
||||
.sbss start:0x805753E0 end:0x80575410
|
||||
.bss start:0x805A78D0 end:0x805A9C88
|
||||
|
||||
toBeSorted/special_item_drop_mgr.cpp:
|
||||
.text start:0x800C7B60 end:0x800C82B0
|
||||
|
||||
+120
-120
@@ -3560,7 +3560,7 @@ fn_8009EAE0 = .text:0x8009EAE0; // type:function size:0x4
|
||||
fn_8009EAF0 = .text:0x8009EAF0; // type:function size:0xC
|
||||
fn_8009EB00 = .text:0x8009EB00; // type:function size:0xC
|
||||
fn_8009EB10 = .text:0x8009EB10; // type:function size:0xC
|
||||
fn_8009EB20 = .text:0x8009EB20; // type:function size:0x8
|
||||
setFlag__15ItemflagManagerFUs = .text:0x8009EB20; // type:function size:0x8
|
||||
copyQueuedEventToCurrentAndHandleSkipEvent = .text:0x8009EB30; // type:function size:0x36C
|
||||
fn_8009EEA0 = .text:0x8009EEA0; // type:function size:0x53C
|
||||
alsoSetAsCurrentEvent__12EventManagerFP9dAcBase_cP5EventPv = .text:0x8009F3E0; // type:function size:0x470
|
||||
@@ -4069,7 +4069,7 @@ fn_800BD7A0 = .text:0x800BD7A0; // type:function size:0x74
|
||||
fn_800BD820 = .text:0x800BD820; // type:function size:0x8
|
||||
fn_800BD830 = .text:0x800BD830; // type:function size:0x78
|
||||
fn_800BD8B0 = .text:0x800BD8B0; // type:function size:0x10
|
||||
doNothing__16SceneflagManagerFv = .text:0x800BD8C0; // type:function size:0x4
|
||||
init__16SceneflagManagerFv = .text:0x800BD8C0; // type:function size:0x4
|
||||
setShouldCommit__16SceneflagManagerFUs = .text:0x800BD8D0; // type:function size:0xC
|
||||
__ct__16SceneflagManagerFv = .text:0x800BD8E0; // type:function size:0x64
|
||||
isNotTempOrZoneFlag__16SceneflagManagerFUs = .text:0x800BD950; // type:function size:0xC
|
||||
@@ -4101,120 +4101,120 @@ unsetZoneflag__16SceneflagManagerFUsUs = .text:0x800BE3E0; // type:function size
|
||||
unsetFlag__16SceneflagManagerFUsUs = .text:0x800BE490; // type:function size:0x70
|
||||
unsetSceneflagGlobal__16SceneflagManagerFUsUs = .text:0x800BE500; // type:function size:0xE0
|
||||
unsetTempOrSceneflag__16SceneflagManagerFUs = .text:0x800BE5E0; // type:function size:0x100
|
||||
doCommit__16SceneflagManagerFv = .text:0x800BE6E0; // type:function size:0xC8
|
||||
commitIfNecessary__22CommittableFlagManagerFv = .text:0x800BE7B0; // type:function size:0x58
|
||||
doCommit__15TBoxFlagManagerFv = .text:0x800BE810; // type:function size:0x58
|
||||
checkUncommittedFlag__15TBoxFlagManagerFUs = .text:0x800BE870; // type:function size:0x68
|
||||
__ct__15TBoxFlagManagerFv = .text:0x800BE8E0; // type:function size:0x40
|
||||
init__15TBoxFlagManagerFv = .text:0x800BE920; // type:function size:0x4
|
||||
copyFromSave__15TBoxFlagManagerFs = .text:0x800BE930; // type:function size:0x5C
|
||||
checkFlag__15TBoxFlagManagerFUsUs = .text:0x800BE990; // type:function size:0x94
|
||||
getFlagCount__15TBoxFlagManagerCFv = .text:0x800BEA30; // type:function size:0x8
|
||||
setFlag__15TBoxFlagManagerFUs = .text:0x800BEA40; // type:function size:0x80
|
||||
clearSavedFlags__18EnemyDefeatManagerFv = .text:0x800BEAC0; // type:function size:0x40
|
||||
checkUncommittedFlag__18EnemyDefeatManagerFUs = .text:0x800BEB00; // type:function size:0x7C
|
||||
__ct__18EnemyDefeatManagerFv = .text:0x800BEB80; // type:function size:0x38
|
||||
init__18EnemyDefeatManagerFv = .text:0x800BEBC0; // type:function size:0xC
|
||||
copyFromSave__18EnemyDefeatManagerFUs = .text:0x800BEBD0; // type:function size:0x54
|
||||
updateFlagIndex__18EnemyDefeatManagerFUs = .text:0x800BEC30; // type:function size:0x18
|
||||
clearAll__18EnemyDefeatManagerFv = .text:0x800BEC50; // type:function size:0x34
|
||||
checkIsValidFlag__18EnemyDefeatManagerFUs = .text:0x800BEC90; // type:function size:0x18
|
||||
checkFlag__18EnemyDefeatManagerFUs = .text:0x800BECB0; // type:function size:0xA0
|
||||
getFlagCount__18EnemyDefeatManagerCFv = .text:0x800BED50; // type:function size:0x8
|
||||
setFlag__18EnemyDefeatManagerFUs = .text:0x800BED60; // type:function size:0x94
|
||||
getFlagPtrChecked__9FlagSpaceFv = .text:0x800BEE00; // type:function size:0x3C
|
||||
getFlagPtrUnchecked__9FlagSpaceFv = .text:0x800BEE40; // type:function size:0x8
|
||||
commit__16SceneflagManagerFv = .text:0x800BE6E0; // type:function size:0xC8
|
||||
commit__22CommittableFlagManagerFv = .text:0x800BE7B0; // type:function size:0x58
|
||||
doCommit__15TBoxflagManagerFv = .text:0x800BE810; // type:function size:0x58
|
||||
checkUncommittedFlag__15TBoxflagManagerFUs = .text:0x800BE870; // type:function size:0x68
|
||||
__ct__15TBoxflagManagerFv = .text:0x800BE8E0; // type:function size:0x40
|
||||
init__15TBoxflagManagerFv = .text:0x800BE920; // type:function size:0x4
|
||||
copyFromSave__15TBoxflagManagerFUl = .text:0x800BE930; // type:function size:0x5C
|
||||
checkFlag__15TBoxflagManagerFUsUs = .text:0x800BE990; // type:function size:0x94
|
||||
getFlagCount__15TBoxflagManagerCFv = .text:0x800BEA30; // type:function size:0x8
|
||||
setFlag__15TBoxflagManagerFUs = .text:0x800BEA40; // type:function size:0x80
|
||||
clearSavedFlags__16EnemyflagManagerFv = .text:0x800BEAC0; // type:function size:0x40
|
||||
checkUncommittedFlag__16EnemyflagManagerFUs = .text:0x800BEB00; // type:function size:0x7C
|
||||
__ct__16EnemyflagManagerFv = .text:0x800BEB80; // type:function size:0x38
|
||||
init__16EnemyflagManagerFv = .text:0x800BEBC0; // type:function size:0xC
|
||||
copyFromSave__16EnemyflagManagerFUs = .text:0x800BEBD0; // type:function size:0x54
|
||||
updateFlagIndex__16EnemyflagManagerFUs = .text:0x800BEC30; // type:function size:0x18
|
||||
clearAll__16EnemyflagManagerFv = .text:0x800BEC50; // type:function size:0x34
|
||||
checkIsValidFlag__16EnemyflagManagerFUs = .text:0x800BEC90; // type:function size:0x18
|
||||
checkFlag__16EnemyflagManagerFUs = .text:0x800BECB0; // type:function size:0xA0
|
||||
getFlagCount__16EnemyflagManagerCFv = .text:0x800BED50; // type:function size:0x8
|
||||
setFlag__16EnemyflagManagerFUs = .text:0x800BED60; // type:function size:0x94
|
||||
getFlagPtrChecked__9FlagSpaceCFv = .text:0x800BEE00; // type:function size:0x3C
|
||||
getFlagPtrUnchecked__9FlagSpaceCFv = .text:0x800BEE40; // type:function size:0x8
|
||||
unsetAll__9FlagSpaceFv = .text:0x800BEE50; // type:function size:0xC
|
||||
setAllToZero__9FlagSpaceFUsUs = .text:0x800BEE60; // type:function size:0x68
|
||||
copyFromSaveFile2__9FlagSpaceFPUsUsUs = .text:0x800BEED0; // type:function size:0x7C
|
||||
copyFromSaveFile__9FlagSpaceFPUsUsUs = .text:0x800BEF50; // type:function size:0x20
|
||||
filemanagerCheck__9FlagSpaceFv = .text:0x800BEF70; // type:function size:0x20
|
||||
calculateMask__12UnkFlagStuffFi = .text:0x800BEF90; // type:function size:0x18
|
||||
doNothing__12UnkFlagStuffFUl = .text:0x800BEFB0; // type:function size:0x4
|
||||
__ct__12UnkFlagStuffFUsP17UnkFlagDefinition = .text:0x800BEFC0; // type:function size:0xC
|
||||
prepareIndexShiftMask__12UnkFlagStuffFUsUlPUsPUcPUs = .text:0x800BEFD0; // type:function size:0x80
|
||||
maskForIdx__12UnkFlagStuffFUs = .text:0x800BF050; // type:function size:0x50
|
||||
getCounterOrFlag__12UnkFlagStuffFUsPUsUl = .text:0x800BF0A0; // type:function size:0x68
|
||||
setCounterOrFlag__12UnkFlagStuffFUsPUsUlUl = .text:0x800BF110; // type:function size:0x9C
|
||||
checkFlagValid__12UnkFlagStuffFUsUl = .text:0x800BF1B0; // type:function size:0x50
|
||||
copyFromSaveFile2__9FlagSpaceFPCUsUsUs = .text:0x800BEED0; // type:function size:0x7C
|
||||
copyFromSaveFile__9FlagSpaceFPCUsUsUs = .text:0x800BEF50; // type:function size:0x20
|
||||
filemanagerCheck__9FlagSpaceCFv = .text:0x800BEF70; // type:function size:0x20
|
||||
calculateMask__9FlagIndexFl = .text:0x800BEF90; // type:function size:0x18
|
||||
doNothing__9FlagIndexFUl = .text:0x800BEFB0; // type:function size:0x4
|
||||
__ct__9FlagIndexFUsP14FlagDefinition = .text:0x800BEFC0; // type:function size:0xC
|
||||
prepareIndexShiftMask__9FlagIndexFUsUlPUsPUcPUs = .text:0x800BEFD0; // type:function size:0x80
|
||||
maskForIdx__9FlagIndexFUsUs = .text:0x800BF050; // type:function size:0x50
|
||||
getCounterOrFlag__9FlagIndexFUsPCUsUl = .text:0x800BF0A0; // type:function size:0x68
|
||||
setCounterOrFlag__9FlagIndexFUsPUsUlUl = .text:0x800BF110; // type:function size:0x9C
|
||||
checkFlagValid__9FlagIndexFUsUl = .text:0x800BF1B0; // type:function size:0x50
|
||||
checkFlag__17BitwiseFlagHelperFUsUsPCUsUs = .text:0x800BF200; // type:function size:0x14
|
||||
setFlag__17BitwiseFlagHelperFUsUsPUsUs = .text:0x800BF220; // type:function size:0x20
|
||||
unsetFlag__17BitwiseFlagHelperFUsUsPUsUs = .text:0x800BF240; // type:function size:0x24
|
||||
ItemStoryManagerBase__ctor = .text:0x800BF270; // type:function size:0x28
|
||||
fn_800BF2A0 = .text:0x800BF2A0; // type:function size:0x70
|
||||
fn_800BF310 = .text:0x800BF310; // type:function size:0xC
|
||||
setupUnkFlagStuff = .text:0x800BF320; // type:function size:0x60
|
||||
StoryflagManager__copyFromSave = .text:0x800BF380; // type:function size:0x58
|
||||
ItemStoryManagerBase__init = .text:0x800BF3E0; // type:function size:0x88
|
||||
fn_800BF470 = .text:0x800BF470; // type:function size:0x4
|
||||
StoryflagManager__getCounterOrFlag = .text:0x800BF480; // type:function size:0x58
|
||||
fn_800BF4E0 = .text:0x800BF4E0; // type:function size:0x50
|
||||
fn_800BF530 = .text:0x800BF530; // type:function size:0x78
|
||||
StoryflagManager__setFlagTo1 = .text:0x800BF5B0; // type:function size:0x8
|
||||
StoryflagManager__setFlagTo0 = .text:0x800BF5C0; // type:function size:0x8
|
||||
StoryflagManager__setStoryflag = .text:0x800BF5D0; // type:function size:0x4
|
||||
getFlag__20ItemStoryManagerBaseCFUs = .text:0x800BF5E0; // type:function size:0x4
|
||||
ItemflagManager__getUncommittedFlags = .text:0x800BF5F0; // type:function size:0x4
|
||||
fn_800BF600 = .text:0x800BF600; // type:function size:0x4
|
||||
fn_800BF610 = .text:0x800BF610; // type:function size:0x18
|
||||
fn_800BF630 = .text:0x800BF630; // type:function size:0x4
|
||||
fn_800BF640 = .text:0x800BF640; // type:function size:0x10
|
||||
fn_800BF650 = .text:0x800BF650; // type:function size:0x40
|
||||
fn_800BF690 = .text:0x800BF690; // type:function size:0x4
|
||||
StoryflagManager__ctor = .text:0x800BF6A0; // type:function size:0x5C
|
||||
fn_800BF700 = .text:0x800BF700; // type:function size:0x3C
|
||||
StoryflagManager__setupUnkFlagstuff = .text:0x800BF740; // type:function size:0x10
|
||||
fn_800BF750 = .text:0x800BF750; // type:function size:0x4
|
||||
fn_800BF760 = .text:0x800BF760; // type:function size:0x4C
|
||||
StoryflagManager__setFlagTo02 = .text:0x800BF7B0; // type:function size:0x4
|
||||
ItemflagManager__ctor = .text:0x800BF7C0; // type:function size:0x5C
|
||||
fn_800BF820 = .text:0x800BF820; // type:function size:0x3C
|
||||
ItemflagManager__setupUnkFlagStuff = .text:0x800BF860; // type:function size:0x10
|
||||
fn_800BF870 = .text:0x800BF870; // type:function size:0x4
|
||||
fn_800BF880 = .text:0x800BF880; // type:function size:0x4C
|
||||
copyFromSave__18DungeonflagManagerFUs = .text:0x800BF8D0; // type:function size:0x54
|
||||
__ct__20ItemStoryManagerBaseFv = .text:0x800BF270; // type:function size:0x28
|
||||
__dt__20ItemStoryManagerBaseFv = .text:0x800BF2A0; // type:function size:0x70
|
||||
setFlagSizes__20ItemStoryManagerBaseFUsUs = .text:0x800BF310; // type:function size:0xC
|
||||
createFlagIndex__20ItemStoryManagerBaseFP14FlagDefinitionUs = .text:0x800BF320; // type:function size:0x60
|
||||
copyFromSave__20ItemStoryManagerBaseFv = .text:0x800BF380; // type:function size:0x58
|
||||
init__20ItemStoryManagerBaseFv = .text:0x800BF3E0; // type:function size:0x88
|
||||
initFlagSpace__20ItemStoryManagerBaseFv = .text:0x800BF470; // type:function size:0x4
|
||||
getFlag__20ItemStoryManagerBaseCFUs = .text:0x800BF480; // type:function size:0x58
|
||||
getUncommittedValue_Priv__20ItemStoryManagerBaseFUs = .text:0x800BF4E0; // type:function size:0x50
|
||||
setOrClearFlag__20ItemStoryManagerBaseFUsUs = .text:0x800BF530; // type:function size:0x78
|
||||
setFlag__20ItemStoryManagerBaseFUs = .text:0x800BF5B0; // type:function size:0x8
|
||||
unsetFlag__20ItemStoryManagerBaseFUs = .text:0x800BF5C0; // type:function size:0x8
|
||||
setFlagOrCounterToValue__20ItemStoryManagerBaseFUsUs = .text:0x800BF5D0; // type:function size:0x4
|
||||
getCounterOrFlag__20ItemStoryManagerBaseCFUs = .text:0x800BF5E0; // type:function size:0x4
|
||||
getUncommittedValue__20ItemStoryManagerBaseFUs = .text:0x800BF5F0; // type:function size:0x4
|
||||
unk3__20ItemStoryManagerBaseFUs = .text:0x800BF600; // type:function size:0x4
|
||||
onFlagChange__20ItemStoryManagerBaseFUs = .text:0x800BF610; // type:function size:0x18
|
||||
onDirty__20ItemStoryManagerBaseFv = .text:0x800BF630; // type:function size:0x4
|
||||
getMaskForFlag__20ItemStoryManagerBaseFUs = .text:0x800BF640; // type:function size:0x10
|
||||
doCommit_Priv__20ItemStoryManagerBaseFv = .text:0x800BF650; // type:function size:0x40
|
||||
postCommit__20ItemStoryManagerBaseFv = .text:0x800BF690; // type:function size:0x4
|
||||
__ct__16StoryflagManagerFv = .text:0x800BF6A0; // type:function size:0x5C
|
||||
copyFlagsFromSaveFirstTime__16StoryflagManagerFv = .text:0x800BF700; // type:function size:0x3C
|
||||
setupFlagIndex__16StoryflagManagerFv = .text:0x800BF740; // type:function size:0x10
|
||||
onDirty__16StoryflagManagerFv = .text:0x800BF750; // type:function size:0x4
|
||||
commit__16StoryflagManagerFv = .text:0x800BF760; // type:function size:0x4C
|
||||
unsetFlag__16StoryflagManagerFUs = .text:0x800BF7B0; // type:function size:0x4
|
||||
__ct__15ItemflagManagerFv = .text:0x800BF7C0; // type:function size:0x5C
|
||||
copyFlagsFromSaveFirstTime__15ItemflagManagerFv = .text:0x800BF820; // type:function size:0x3C
|
||||
setupFlagIndex__15ItemflagManagerFv = .text:0x800BF860; // type:function size:0x10
|
||||
onDirty__15ItemflagManagerFv = .text:0x800BF870; // type:function size:0x4
|
||||
commit__15ItemflagManagerFv = .text:0x800BF880; // type:function size:0x4C
|
||||
copyFromSave_Internal__18DungeonflagManagerFUs = .text:0x800BF8D0; // type:function size:0x54
|
||||
setCommitFlag__18DungeonflagManagerFUs = .text:0x800BF930; // type:function size:0xC
|
||||
__ct__18DungeonflagManagerFv = .text:0x800BF940; // type:function size:0x3C
|
||||
setupFlagStuff__18DungeonflagManagerFv = .text:0x800BF980; // type:function size:0x54
|
||||
copyFromSave__18DungeonflagManagerFs = .text:0x800BF9E0; // type:function size:0xC
|
||||
init__18DungeonflagManagerFv = .text:0x800BF980; // type:function size:0x54
|
||||
copyFromSave__18DungeonflagManagerFUl = .text:0x800BF9E0; // type:function size:0xC
|
||||
setToValue__18DungeonflagManagerFUsUl = .text:0x800BF9F0; // type:function size:0x6C
|
||||
setFlag__18DungeonflagManagerFUs = .text:0x800BFA60; // type:function size:0x60
|
||||
getDungeonFlag__18DungeonflagManagerFUs = .text:0x800BFAC0; // type:function size:0x50
|
||||
doCommit__18DungeonflagManagerFv = .text:0x800BFB10; // type:function size:0x8C
|
||||
copyFromSave__15SkipflagManagerFv = .text:0x800BFBA0; // type:function size:0x44
|
||||
commit__18DungeonflagManagerFv = .text:0x800BFB10; // type:function size:0x8C
|
||||
doCopyFromSave__15SkipflagManagerFv = .text:0x800BFBA0; // type:function size:0x44
|
||||
setCommitFlag__15SkipflagManagerFUs = .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
|
||||
init__15SkipflagManagerFv = .text:0x800BFC30; // type:function size:0xC
|
||||
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
|
||||
setupFlagManagers = .text:0x800BFE00; // type:function size:0x294
|
||||
__dt__15TBoxFlagManagerFv = .text:0x800C00A0; // type:function size:0x40
|
||||
__dt__18EnemyDefeatManagerFv = .text:0x800C00E0; // type:function size:0x40
|
||||
StoryflagManager__dtor = .text:0x800C0120; // type:function size:0x58
|
||||
fn_800C0180 = .text:0x800C0180; // type:function size:0x58
|
||||
fn_800C01E0 = .text:0x800C01E0; // type:function size:0x8
|
||||
copyAllFlagmanagersFromSave = .text:0x800C01F0; // type:function size:0x78
|
||||
updateFlagForFlagindex = .text:0x800C0270; // type:function size:0x58
|
||||
commitAllFlagManagers = .text:0x800C02D0; // type:function size:0x54
|
||||
checkedMemcpy = .text:0x800C0330; // type:function size:0x54
|
||||
getItemFlags = .text:0x800C0390; // type:function size:0x8
|
||||
fn_800C03A0 = .text:0x800C03A0; // type:function size:0x8
|
||||
fn_800C03B0 = .text:0x800C03B0; // type:function size:0x8
|
||||
StoryflagManager__getStoryflag = .text:0x800C03C0; // type:function size:0x8
|
||||
ItemflagManager__setToValue = .text:0x800C03D0; // type:function size:0x8
|
||||
fn_800C03E0 = .text:0x800C03E0; // type:function size:0x8
|
||||
fn_800C03F0 = .text:0x800C03F0; // type:function size:0x44
|
||||
ItemStoryManagerBase__setFlagSpacePtr = .text:0x800C0440; // type:function size:0xC
|
||||
getStoryFlagsSpacePtr = .text:0x800C0450; // type:function size:0x8
|
||||
StoryflagManager__doCommit = .text:0x800C0460; // type:function size:0x44
|
||||
StoryflagManager__setFlagsPtr = .text:0x800C04B0; // type:function size:0xC
|
||||
EnemyDefeatFlagManager__doCommit = .text:0x800C04C0; // type:function size:0x44
|
||||
fn_800C0510 = .text:0x800C0510; // type:function size:0x5C
|
||||
fn_800C0570 = .text:0x800C0570; // type:function size:0x5C
|
||||
fn_800C05D0 = .text:0x800C05D0; // type:function size:0x40
|
||||
fn_800C0610 = .text:0x800C0610; // type:function size:0x40
|
||||
commit__15SkipflagManagerFv = .text:0x800BFD90; // type:function size:0x70
|
||||
setupFlagManagers__FPQ23EGG4Heap = .text:0x800BFE00; // type:function size:0x294
|
||||
__dt__15TBoxflagManagerFv = .text:0x800C00A0; // type:function size:0x40
|
||||
__dt__16EnemyflagManagerFv = .text:0x800C00E0; // type:function size:0x40
|
||||
__dt__16StoryflagManagerFv = .text:0x800C0120; // type:function size:0x58
|
||||
__dt__15ItemflagManagerFv = .text:0x800C0180; // type:function size:0x58
|
||||
postSetup__Fv = .text:0x800C01E0; // type:function size:0x8
|
||||
copyAllFlagManagersFromSave__Fv = .text:0x800C01F0; // type:function size:0x78
|
||||
updateFlagForFlagIndex__FUs = .text:0x800C0270; // type:function size:0x58
|
||||
commitAllFlagManagers__Fv = .text:0x800C02D0; // type:function size:0x54
|
||||
checkedMemcpy__FPvUlPCvUl = .text:0x800C0330; // type:function size:0x54
|
||||
getSaveFlagSpace__15ItemflagManagerCFv = .text:0x800C0390; // type:function size:0x8
|
||||
unk3__15ItemflagManagerFUs = .text:0x800C03A0; // type:function size:0x8
|
||||
getUncommittedValue__15ItemflagManagerFUs = .text:0x800C03B0; // type:function size:0x8
|
||||
getCounterOrFlag__15ItemflagManagerCFUs = .text:0x800C03C0; // type:function size:0x8
|
||||
setFlagOrCounterToValue__15ItemflagManagerFUsUs = .text:0x800C03D0; // type:function size:0x8
|
||||
unsetFlag__15ItemflagManagerFUs = .text:0x800C03E0; // type:function size:0x8
|
||||
doCommit__15ItemflagManagerFv = .text:0x800C03F0; // type:function size:0x44
|
||||
initFlagSpace__15ItemflagManagerFv = .text:0x800C0440; // type:function size:0xC
|
||||
getSaveFlagSpace__16StoryflagManagerCFv = .text:0x800C0450; // type:function size:0x8
|
||||
doCommit__16StoryflagManagerFv = .text:0x800C0460; // type:function size:0x44
|
||||
initFlagSpace__16StoryflagManagerFv = .text:0x800C04B0; // type:function size:0xC
|
||||
doCommit__16EnemyflagManagerFv = .text:0x800C04C0; // type:function size:0x44
|
||||
__dt__32MyFlagManager<15ItemflagManager>Fv = .text:0x800C0510; // type:function size:0x5C
|
||||
__dt__33MyFlagManager<16StoryflagManager>Fv = .text:0x800C0570; // type:function size:0x5C
|
||||
__dt__33MyFlagManager<16EnemyflagManager>Fv = .text:0x800C05D0; // type:function size:0x40
|
||||
__dt__32MyFlagManager<15TBoxflagManager>Fv = .text:0x800C0610; // type:function size:0x40
|
||||
fn_800C0650 = .text:0x800C0650; // type:function size:0x3C
|
||||
fn_800C0690 = .text:0x800C0690; // type:function size:0x70
|
||||
fn_800C0700 = .text:0x800C0700; // type:function size:0x7C
|
||||
@@ -31008,15 +31008,15 @@ lbl_80510B48 = .data:0x80510B48; // type:object size:0xC
|
||||
lbl_80510B54 = .data:0x80510B54; // type:object size:0xC
|
||||
lbl_80510B60 = .data:0x80510B60; // type:object size:0x10
|
||||
lbl_80510B70 = .data:0x80510B70; // type:object size:0x18
|
||||
ItemflagManager__vtable = .data:0x80510B88; // type:object size:0x3C
|
||||
StoryflagManager__vtable = .data:0x80510BC4; // type:object size:0x3C
|
||||
lbl_80510C00 = .data:0x80510C00; // type:object size:0x14
|
||||
lbl_80510C14 = .data:0x80510C14; // type:object size:0x14
|
||||
ItemflagManager__vtableBase = .data:0x80510C28; // type:object size:0x3C
|
||||
StoryflagManager__vtableBase = .data:0x80510C64; // type:object size:0x3C
|
||||
ItemStoryManagerBase__vtable = .data:0x80510CA0; // type:object size:0x3C
|
||||
__vt__18EnemyDefeatManager = .data:0x80510CDC; // type:object size:0x14
|
||||
__vt__15TBoxFlagManager = .data:0x80510CF0; // type:object size:0x14
|
||||
__vt__32MyFlagManager<15ItemflagManager> = .data:0x80510B88; // type:object size:0x3C
|
||||
__vt__33MyFlagManager<16StoryflagManager> = .data:0x80510BC4; // type:object size:0x3C
|
||||
__vt__33MyFlagManager<16EnemyflagManager> = .data:0x80510C00; // type:object size:0x14
|
||||
__vt__32MyFlagManager<15TBoxflagManager> = .data:0x80510C14; // type:object size:0x14
|
||||
__vt__15ItemflagManager = .data:0x80510C28; // type:object size:0x3C
|
||||
__vt__16StoryflagManager = .data:0x80510C64; // type:object size:0x3C
|
||||
__vt__20ItemStoryManagerBase = .data:0x80510CA0; // type:object size:0x3C
|
||||
__vt__16EnemyflagManager = .data:0x80510CDC; // type:object size:0x14
|
||||
__vt__15TBoxflagManager = .data:0x80510CF0; // type:object size:0x14
|
||||
__vt__9FlagSpace = .data:0x80510D04; // type:object size:0xC
|
||||
lbl_80510D10 = .data:0x80510D10; // type:object size:0x38 data:4byte
|
||||
lbl_80510D48 = .data:0x80510D48; // type:object size:0x18
|
||||
@@ -39942,12 +39942,12 @@ NAND_REQUEST_THREAD = .sbss:0x805753D0; // type:object size:0x8 data:4byte
|
||||
lbl_805753D8 = .sbss:0x805753D8; // type:object size:0x8 data:4byte
|
||||
sInstance__16SceneflagManager = .sbss:0x805753E0; // type:object size:0x4 data:4byte
|
||||
sTempFlags__16SceneflagManager = .sbss:0x805753E8; // type:object size:0x8
|
||||
sInstance__15TBoxFlagManager = .sbss:0x805753F0; // type:object size:0x4 data:4byte
|
||||
sTBoxFlags__15TBoxFlagManager = .sbss:0x805753F4; // type:object size:0x4
|
||||
sInstance__18EnemyDefeatManager = .sbss:0x805753F8; // type:object size:0x4 data:4byte
|
||||
sInstance__15TBoxflagManager = .sbss:0x805753F0; // type:object size:0x4 data:4byte
|
||||
sTBoxFlags__15TBoxflagManager = .sbss:0x805753F4; // type:object size:0x4
|
||||
sInstance__16EnemyflagManager = .sbss:0x805753F8; // type:object size:0x4 data:4byte
|
||||
sInstance__16StoryflagManager = .sbss:0x805753FC; // type:object size:0x4 data:4byte
|
||||
sInstance__15ItemflagManager = .sbss:0x80575400; // type:object size:0x4 data:4byte
|
||||
DUNGEONFLAG_MANAGER = .sbss:0x80575404; // type:object size:0x4 data:4byte
|
||||
sInstance__18DungeonflagManager = .sbss:0x80575404; // type:object size:0x4 data:4byte
|
||||
sInstance__15SkipflagManager = .sbss:0x80575408; // type:object size:0x4 data:4byte
|
||||
lbl_80575410 = .sbss:0x80575410; // type:object size:0x8 data:4byte
|
||||
lbl_80575418 = .sbss:0x80575418; // type:object size:0x8
|
||||
@@ -48330,11 +48330,11 @@ FontColors1 = .bss:0x805A7730; // type:object size:0xC4 data:byte
|
||||
FontColors2 = .bss:0x805A77F4; // type:object size:0xC4 data:byte
|
||||
lbl_805A78B8 = .bss:0x805A78B8; // type:object size:0xC
|
||||
TIMESHIFT_STONE_REFS = .bss:0x805A78C4; // type:object size:0xC data:4byte
|
||||
STATIC_SCENEFLAGS = .bss:0x805A78D0; // type:object size:0x10
|
||||
STATIC_ZONE_FLAGS = .bss:0x805A78E0; // type:object size:0x1F8
|
||||
sEnemyDefeatFlags__18EnemyDefeatManager = .bss:0x805A7AD8; // type:object size:0x2000
|
||||
STATIC_STORYFLAGS = .bss:0x805A9AD8; // type:object size:0x100
|
||||
STATIC_ITEM_FLAGS = .bss:0x805A9BD8; // type:object size:0x80
|
||||
sSceneFlags__16SceneflagManager = .bss:0x805A78D0; // type:object size:0x10
|
||||
sZoneFlags__16SceneflagManager = .bss:0x805A78E0; // type:object size:0x1F8
|
||||
sEnemyDefeatFlags__16EnemyflagManager = .bss:0x805A7AD8; // type:object size:0x2000
|
||||
sFlags__16StoryflagManager = .bss:0x805A9AD8; // type:object size:0x100
|
||||
sFlags__15ItemflagManager = .bss:0x805A9BD8; // type:object size:0x80
|
||||
sDungeonFlags__18DungeonflagManager = .bss:0x805A9C58; // type:object size:0x10
|
||||
sSkipFlags__15SkipflagManager = .bss:0x805A9C68; // type:object size:0x20
|
||||
lbl_805A9C88 = .bss:0x805A9C88; // type:object size:0x10 data:4byte
|
||||
|
||||
+1
-7
@@ -321,13 +321,7 @@ config.libs = [
|
||||
"progress_category": "game",
|
||||
"host": False,
|
||||
"objects": [
|
||||
Object(Matching, "toBeSorted/unk_flag_stuff.cpp"),
|
||||
Object(Matching, "toBeSorted/bitwise_flag_helper.cpp"),
|
||||
Object(Matching, "toBeSorted/sceneflag_manager.cpp"),
|
||||
Object(NonMatching, "toBeSorted/flag_space.cpp"),
|
||||
Object(NonMatching, "toBeSorted/misc_flag_managers.cpp"),
|
||||
Object(Matching, "toBeSorted/dungeonflag_manager.cpp"),
|
||||
Object(Matching, "toBeSorted/skipflag_manager.cpp"),
|
||||
Object(Matching, "d/flag/flag_managers.cpp"),
|
||||
Object(NonMatching, "toBeSorted/special_item_drop_mgr.cpp"),
|
||||
Object(Matching, "d/d_base.cpp"),
|
||||
Object(Matching, "d/d_dvd.cpp"),
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#ifndef D_FLAG_BASEFLAG_MANAGER_H
|
||||
#define D_FLAG_BASEFLAG_MANAGER_H
|
||||
|
||||
#include "d/flag/flag_index.h"
|
||||
#include "d/flag/flag_space.h"
|
||||
|
||||
class ItemStoryManagerBase {
|
||||
public:
|
||||
ItemStoryManagerBase();
|
||||
|
||||
/** 0x08 */ virtual ~ItemStoryManagerBase();
|
||||
/** 0x0C */ virtual void initFlagSpace();
|
||||
/** 0x10 */ virtual void onDirty();
|
||||
/** 0x14 */ virtual void copyFlagsFromSaveFirstTime() = 0;
|
||||
/** 0x18 */ virtual void setupFlagIndex() = 0;
|
||||
/** 0x1C */ virtual void doCommit() = 0;
|
||||
/** 0x20 */ virtual void setFlag(u16 flag);
|
||||
/** 0x24 */ virtual void unsetFlag(u16 flag);
|
||||
/** 0x28 */ virtual void setFlagOrCounterToValue(u16 flag, u16 value);
|
||||
/** 0x2C */ virtual u16 getCounterOrFlag(u16 flag) const;
|
||||
/** 0x30 */ virtual u16 getUncommittedValue(u16 flag);
|
||||
/** 0x34 */ virtual u16 unk3(u16 arg);
|
||||
/** 0x38 */ virtual const u16 *getSaveFlagSpace() const = 0;
|
||||
|
||||
|
||||
void init();
|
||||
void copyFromSave();
|
||||
void createFlagIndex(FlagDefinition *def, u16 count);
|
||||
void doCommit_Priv();
|
||||
void setOrClearFlag(u16 flag, u16 value);
|
||||
u16 getFlag(u16 flag) const;
|
||||
void onFlagChange(u16 flag);
|
||||
u16 getMaskForFlag(u16 flag);
|
||||
void postCommit();
|
||||
|
||||
u16 getUncommittedValue_Priv(u16 flag);
|
||||
|
||||
protected:
|
||||
|
||||
void setFlagSizes(u16 flagCount, u16 flagSizeBytes);
|
||||
|
||||
/** 0x04 */ u16 mFlagCount;
|
||||
/** 0x06 */ u16 mFlagSizeBytes;
|
||||
/** 0x08 */ FlagSpace *mpFlagSpace;
|
||||
/** 0x0C */ FlagIndex *mpFlagIndex;
|
||||
/** 0x10 */ bool mDirty;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef D_FLAG_COMMITTABLE_FLAG_MANAGER_H
|
||||
#define D_FLAG_COMMITTABLE_FLAG_MANAGER_H
|
||||
|
||||
class CommittableFlagManager {
|
||||
public:
|
||||
bool mNeedsCommit;
|
||||
|
||||
virtual void doCommit() = 0;
|
||||
virtual ~CommittableFlagManager() {}
|
||||
bool commit();
|
||||
void setNeedsCommit(bool commit) {
|
||||
mNeedsCommit = commit;
|
||||
}
|
||||
CommittableFlagManager() {
|
||||
mNeedsCommit = false;
|
||||
}
|
||||
CommittableFlagManager(bool commit) {
|
||||
mNeedsCommit = commit;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef D_FLAG_DUNGEONFLAG_MANAGER_H
|
||||
#define D_FLAG_DUNGEONFLAG_MANAGER_H
|
||||
|
||||
#include "d/flag/flag_index.h"
|
||||
#include "d/flag/flag_space.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
|
||||
class DungeonflagManager {
|
||||
public:
|
||||
bool mShouldCommit;
|
||||
u16 mStageIndex;
|
||||
FlagIndex *mpFlagIndex;
|
||||
FlagSpace mFlagSpace;
|
||||
|
||||
static u16 sDungeonFlags[8];
|
||||
|
||||
void copyFromSave(u32 flag);
|
||||
void copyFromSave_Internal(u16 flagIndex);
|
||||
void setCommitFlag(u16 flag);
|
||||
DungeonflagManager();
|
||||
void init();
|
||||
void setToValue(u16 flag, u32 value);
|
||||
void setFlag(u16 flag);
|
||||
u16 getDungeonFlag(u16 flag);
|
||||
bool commit();
|
||||
|
||||
/** inline shenanigans to get copyFromSave to match */
|
||||
static inline u16 *saveFilePtr(u16 flagIndex) {
|
||||
u32 offset = (flagIndex & 0x1fff) * 8;
|
||||
return FileManager::sInstance->getDungeonFlagsConst() + offset;
|
||||
}
|
||||
|
||||
static DungeonflagManager *sInstance;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef D_FLAG_ENEMYFLAG_MANAGER_H
|
||||
#define D_FLAG_ENEMYFLAG_MANAGER_H
|
||||
|
||||
#include "d/flag/bitwise_flag_helper.h"
|
||||
#include "d/flag/committable_flag_manager.h"
|
||||
#include "d/flag/flag_space.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
|
||||
class EnemyflagManager : public CommittableFlagManager {
|
||||
public:
|
||||
FlagSpace mFlagSpace;
|
||||
BitwiseFlagHelper mFlagHelper;
|
||||
u16 mSceneIndex;
|
||||
|
||||
static u16 sEnemyDefeatFlags[4096];
|
||||
|
||||
static EnemyflagManager *sInstance;
|
||||
|
||||
void clearSavedFlags();
|
||||
bool checkUncommittedFlag(u16 flag);
|
||||
u16 checkUncommittedFlag2(u16 flag) {
|
||||
return checkUncommittedFlag(flag);
|
||||
}
|
||||
EnemyflagManager();
|
||||
void init();
|
||||
void copyFromSave(u16 sceneIndex);
|
||||
void updateFlagIndex(u16 sceneIndex);
|
||||
void clearAll();
|
||||
bool checkIsValidFlag(u16 flag);
|
||||
bool checkFlag(u16 flag);
|
||||
virtual ~EnemyflagManager() {}
|
||||
virtual u16 getFlagCount() const;
|
||||
void setFlag(u16 flag);
|
||||
|
||||
virtual void doCommit() override {
|
||||
FileManager *mgr = FileManager::sInstance;
|
||||
mgr->setEnemyDefeatFlags(mFlagSpace.getFlagPtrUnchecked(), 0, 0x1000);
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef D_FLAG_FLAG_INDEX_H
|
||||
#define D_FLAG_FLAG_INDEX_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* @brief Defines a single story or item flag.
|
||||
*/
|
||||
struct FlagDefinition {
|
||||
u8 mIndex;
|
||||
u8 mShiftMask;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Helper class for packing and unpacking flag data.
|
||||
*
|
||||
* Some flag managers store their data in a packed format, where
|
||||
* flags have a variable number of bits and can appear in varied
|
||||
* locations within a halfword.
|
||||
*/
|
||||
class FlagIndex {
|
||||
u16 mDefinitionsCount;
|
||||
FlagDefinition *mpDefinitions;
|
||||
|
||||
public:
|
||||
u16 calculateMask(s32 shift);
|
||||
void doNothing(u32 unused);
|
||||
FlagIndex(u16 count, FlagDefinition *definitions);
|
||||
void prepareIndexShiftMask(u16 counterIdx, u32 flagCount, u16 *pIndex, u8 *pShift, u16 *pMask);
|
||||
u16 maskForIdx(u16 index, u16 flagCount);
|
||||
u16 getCounterOrFlag(u16 counterIdx, const u16 *pData, u32 flagCount);
|
||||
void setCounterOrFlag(u16 counterIdx, u16 *pData, u32 flagCount, u32 value);
|
||||
|
||||
u32 checkFlagValid(u16 counterIdx, u32 flagCount);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef D_FLAG_FLAG_MANAGERS_H
|
||||
#define D_FLAG_FLAG_MANAGERS_H
|
||||
|
||||
#include "egg/core/eggHeap.h"
|
||||
|
||||
void setupFlagManagers(EGG::Heap *heap);
|
||||
void copyAllFlagManagersFromSave();
|
||||
void updateFlagForFlagIndex(u16 stage);
|
||||
void commitAllFlagManagers();
|
||||
|
||||
bool checkedMemcpy(void *dest, u32 destLen, const void *src, u32 count);
|
||||
|
||||
#endif
|
||||
@@ -16,13 +16,13 @@ public:
|
||||
mCount = count;
|
||||
}
|
||||
FlagSpace(u16 *pFlags, u16 count) : BaseFlagSpace(pFlags, count) {}
|
||||
u16 *getFlagPtrChecked();
|
||||
u16 *getFlagPtrUnchecked();
|
||||
u16 *getFlagPtrChecked() const;
|
||||
u16 *getFlagPtrUnchecked() const;
|
||||
void unsetAll();
|
||||
void setAllToZero(u16 offset, u16 flagCount);
|
||||
void copyFromSaveFile2(u16 *pSaved, u16 offset, u16 flagCount);
|
||||
void copyFromSaveFile(u16 *pSaved, u16 offset, u16 flagCount);
|
||||
virtual void filemanagerCheck();
|
||||
void copyFromSaveFile2(const u16 *pSaved, u16 offset, u16 flagCount);
|
||||
void copyFromSaveFile(const u16 *pSaved, u16 offset, u16 flagCount);
|
||||
virtual void filemanagerCheck() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
#ifndef D_FLAG_ITEMFLAG_MANAGER_H
|
||||
#define D_FLAG_ITEMFLAG_MANAGER_H
|
||||
|
||||
#include "d/flag/baseflag_manager.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
|
||||
|
||||
class ItemflagManager : public ItemStoryManagerBase {
|
||||
public:
|
||||
FlagSpace mItemFlags;
|
||||
|
||||
ItemflagManager();
|
||||
virtual ~ItemflagManager() {}
|
||||
|
||||
bool commit();
|
||||
|
||||
/** 0x0C */ virtual void initFlagSpace() override {
|
||||
mpFlagSpace = &mItemFlags;
|
||||
}
|
||||
/** 0x10 */ virtual void onDirty() override;
|
||||
/** 0x14 */ virtual void copyFlagsFromSaveFirstTime();
|
||||
/** 0x18 */ virtual void setupFlagIndex();
|
||||
/** 0x1C */ virtual void doCommit() {
|
||||
u16 sz = mFlagCount;
|
||||
u16 *flags = mpFlagSpace->getFlagPtrUnchecked();
|
||||
FileManager::sInstance->setItemFlags(flags, 0, sz);
|
||||
}
|
||||
/** 0x20 */ virtual void setFlag(u16 flag) {
|
||||
ItemStoryManagerBase::setFlag(flag & ~0x4000);
|
||||
}
|
||||
/** 0x24 */ virtual void unsetFlag(u16 flag) {
|
||||
ItemStoryManagerBase::unsetFlag(flag & ~0x4000);
|
||||
}
|
||||
/** 0x28 */ virtual void setFlagOrCounterToValue(u16 flag, u16 value) {
|
||||
ItemStoryManagerBase::setFlagOrCounterToValue(flag & ~0x4000, value);
|
||||
}
|
||||
/** 0x2C */ virtual u16 getCounterOrFlag(u16 flag) const {
|
||||
return ItemStoryManagerBase::getCounterOrFlag(flag & ~0x4000);
|
||||
}
|
||||
/** 0x30 */ virtual u16 getUncommittedValue(u16 flag) {
|
||||
return ItemStoryManagerBase::getUncommittedValue(flag & ~0x4000);
|
||||
}
|
||||
/** 0x34 */ virtual u16 unk3(u16 arg) {
|
||||
return ItemStoryManagerBase::unk3(arg & ~0x4000);
|
||||
}
|
||||
/** 0x38 */ virtual const u16 *getSaveFlagSpace() const {
|
||||
return FileManager::sInstance->getItemFlagsConst();
|
||||
};
|
||||
|
||||
u16 getFlagDirect(u16 flag) {
|
||||
return ItemStoryManagerBase::getCounterOrFlag(flag);
|
||||
}
|
||||
|
||||
public:
|
||||
static ItemflagManager *sInstance;
|
||||
static u16 sFlags[0x40];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -2,8 +2,8 @@
|
||||
#define SCENEFLAG_MANAGER_H
|
||||
|
||||
#include "common.h"
|
||||
#include "toBeSorted/bitwise_flag_helper.h"
|
||||
#include "toBeSorted/flag_space.h"
|
||||
#include "d/flag/bitwise_flag_helper.h"
|
||||
#include "d/flag/flag_space.h"
|
||||
|
||||
|
||||
class SceneflagManager {
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
static u16 sZoneFlags[0xFC];
|
||||
|
||||
static SceneflagManager *sInstance;
|
||||
void doNothing();
|
||||
void init();
|
||||
void setShouldCommit(u16 flag);
|
||||
SceneflagManager();
|
||||
s32 isNotTempOrZoneFlag(u16 flag);
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
void unsetFlag(u16 roomId, u16 flag);
|
||||
void unsetSceneflagGlobal(u16 sceneIdx, u16 flag);
|
||||
void unsetTempOrSceneflag(u16 flag);
|
||||
s32 doCommit();
|
||||
s32 commit();
|
||||
|
||||
bool checkBoolFlag(u16 roomid, u16 flag) {
|
||||
return checkFlag(roomid, flag);
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef D_FLAG_SKIPFLAG_MANAGER_H
|
||||
#define D_FLAG_SKIPFLAG_MANAGER_H
|
||||
|
||||
|
||||
#include "d/flag/bitwise_flag_helper.h"
|
||||
#include "d/flag/flag_space.h"
|
||||
|
||||
class SkipflagManager {
|
||||
public:
|
||||
SkipflagManager();
|
||||
void init();
|
||||
|
||||
void setCommitFlag(u16 flag);
|
||||
void copyFromSave();
|
||||
void setFlag(u16 flag);
|
||||
bool checkFlag(u16 flag);
|
||||
bool commit();
|
||||
static SkipflagManager *sInstance;
|
||||
|
||||
private:
|
||||
void doCopyFromSave();
|
||||
|
||||
static u16 sSkipFlags[16];
|
||||
|
||||
bool mShouldCommit;
|
||||
BitwiseFlagHelper mFlagHelper;
|
||||
FlagSpace mFlagSpace;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef D_FLAG_STORYFLAG_MANAGER_H
|
||||
#define D_FLAG_STORYFLAG_MANAGER_H
|
||||
|
||||
#include "d/flag/baseflag_manager.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
|
||||
class StoryflagManager : public ItemStoryManagerBase {
|
||||
public:
|
||||
StoryflagManager();
|
||||
|
||||
virtual ~StoryflagManager() {}
|
||||
|
||||
FlagSpace mStoryFlags;
|
||||
|
||||
bool commit();
|
||||
|
||||
/** 0x0C */ virtual void initFlagSpace() override {
|
||||
mpFlagSpace = &mStoryFlags;
|
||||
}
|
||||
/** 0x10 */ virtual void onDirty() override;
|
||||
/** 0x14 */ virtual void copyFlagsFromSaveFirstTime() override;
|
||||
/** 0x18 */ virtual void setupFlagIndex() override;
|
||||
/** 0x1C */ virtual void doCommit() override {
|
||||
u16 sz = mFlagCount;
|
||||
u16 *flags = mpFlagSpace->getFlagPtrUnchecked();
|
||||
FileManager::sInstance->setStoryFlags(flags, 0, sz);
|
||||
}
|
||||
/** 0x24 */ virtual void unsetFlag(u16 flag) override;
|
||||
/** 0x38 */ virtual const u16 *getSaveFlagSpace() const override {
|
||||
return FileManager::sInstance->getStoryFlagsConst();
|
||||
};
|
||||
|
||||
public:
|
||||
static StoryflagManager *sInstance;
|
||||
static u16 sFlags[0x80];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef D_FLAG_TBOXFLAG_MANAGER_H
|
||||
#define D_FLAG_TBOXFLAG_MANAGER_H
|
||||
|
||||
#include "d/flag/bitwise_flag_helper.h"
|
||||
#include "d/flag/committable_flag_manager.h"
|
||||
#include "d/flag/flag_space.h"
|
||||
|
||||
class TBoxflagManager : public CommittableFlagManager {
|
||||
public:
|
||||
FlagSpace mFlagSpace;
|
||||
u16 mSceneIndex;
|
||||
BitwiseFlagHelper mFlagHelper;
|
||||
|
||||
static u16 sTBoxFlags[2];
|
||||
|
||||
static TBoxflagManager *sInstance;
|
||||
|
||||
virtual void doCommit() override;
|
||||
bool checkUncommittedFlag(u16 flag);
|
||||
TBoxflagManager();
|
||||
virtual ~TBoxflagManager() {}
|
||||
void init();
|
||||
void copyFromSave(u32 sceneIndex);
|
||||
bool checkFlag(u16 sceneIndex, u16 flag);
|
||||
virtual u16 getFlagCount() const;
|
||||
void setFlag(u16 flag);
|
||||
bool checkUncommittedFlag(u16 sceneIndex, u16 flag);
|
||||
u16 checkUncommittedFlag2(u16 flag) {
|
||||
return checkUncommittedFlag(flag);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -7,7 +7,6 @@ extern "C" {
|
||||
|
||||
// void *memset(void *dest, s32 value, u32 count);
|
||||
// void *memcpy(void *dest, const void *src, u32 count);
|
||||
void *checkedMemcpy(void *dest, u16 destLen, const void *src, u16 count);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifndef FILE_MANAGER_H
|
||||
#define FILE_MANAGER_H
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "m/m_angle.h"
|
||||
@@ -76,7 +79,7 @@ public:
|
||||
/* 8000A330 */ u16 *getStoryFlagsMut();
|
||||
/* 8000A360 */ const u16 *getStoryFlagsConst() const;
|
||||
/* 8000A3B0 */ u16 *getItemFlagsMut();
|
||||
/* 8000A3E0 */ u16 *getItemFlagsConst();
|
||||
/* 8000A3E0 */ const u16 *getItemFlagsConst();
|
||||
/* 8000A430 */ u16 *getDungeonFlagsMut();
|
||||
/* 8000A460 */ u16 *getDungeonFlagsConst();
|
||||
/* 8000A4B0 */ u16 *getSceneFlagsMut();
|
||||
@@ -210,7 +213,7 @@ public:
|
||||
/* 8000CAD0 */ bool isNew_FileA();
|
||||
|
||||
/* 8000CB00 */ void setSceneFlagIndex(u16 idx);
|
||||
/* 8000CB30 */ u16 getSceneFlagIndex();
|
||||
/* 8000CB30 */ u32 getSceneFlagIndex();
|
||||
/* 8000CB80 */ s32 getFileAreaIndex();
|
||||
|
||||
/* 8000CBD0 */ void fn_8000CBD0(u8);
|
||||
@@ -285,3 +288,5 @@ public:
|
||||
}
|
||||
static FileManager *sInstance;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#ifndef ITEM_STORY_FLAG_MANAGER_H
|
||||
#define ITEM_STORY_FLAG_MANAGER_H
|
||||
|
||||
#include "toBeSorted/flag_space.h"
|
||||
#include "toBeSorted/unk_flag_stuff.h"
|
||||
|
||||
// TODO These classes have an interesting relation and there are like 5 vtables, so
|
||||
// the stuff in this header should not be relied upon for actually implementing these,
|
||||
// but we need the interface
|
||||
|
||||
class ItemStoryManagerBase {
|
||||
public:
|
||||
ItemStoryManagerBase();
|
||||
|
||||
/** 0x08 */ virtual ~ItemStoryManagerBase();
|
||||
/** 0x0C */ virtual void setFlagszptr();
|
||||
/** 0x10 */ virtual void onDirty();
|
||||
/** 0x14 */ virtual void copyFlagsFromSave() = 0;
|
||||
/** 0x18 */ virtual void setupUnkFlagsStuff() = 0;
|
||||
/** 0x1C */ virtual bool doCommit() = 0;
|
||||
/** 0x20 */ virtual void setFlag(u16 flag);
|
||||
/** 0x24 */ virtual void unsetFlag(u16 flag);
|
||||
/** 0x28 */ virtual void setFlagOrCounterToValue(u16 flag, u16 value);
|
||||
/** 0x2C */ virtual u16 getCounterOrFlag(u16 flag) const;
|
||||
/** 0x30 */ virtual u16 getUncommittedValue(u16 flag);
|
||||
/** 0x34 */ virtual void unk3();
|
||||
/** 0x38 */ virtual u16 *getSaveFlagSpace() = 0;
|
||||
|
||||
u16 getFlag(u16 flag) const;
|
||||
};
|
||||
|
||||
class StoryflagManager : public ItemStoryManagerBase {
|
||||
FlagSpace storyFlags;
|
||||
|
||||
public:
|
||||
static StoryflagManager *sInstance;
|
||||
};
|
||||
|
||||
class ItemflagManager : public ItemStoryManagerBase {
|
||||
FlagSpace itemFlags;
|
||||
|
||||
public:
|
||||
static ItemflagManager *sInstance;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,79 +0,0 @@
|
||||
#ifndef MISC_FLAG_MANAGERS_H
|
||||
#define MISC_FLAG_MANAGERS_H
|
||||
|
||||
#include "common.h"
|
||||
#include "toBeSorted/bitwise_flag_helper.h"
|
||||
#include "toBeSorted/flag_space.h"
|
||||
|
||||
class CommittableFlagManager {
|
||||
public:
|
||||
bool mNeedsCommit;
|
||||
|
||||
virtual void doCommit() = 0;
|
||||
bool commitIfNecessary();
|
||||
void setNeedsCommit(bool commit) {
|
||||
mNeedsCommit = commit;
|
||||
}
|
||||
CommittableFlagManager() {
|
||||
mNeedsCommit = false;
|
||||
}
|
||||
CommittableFlagManager(bool commit) {
|
||||
mNeedsCommit = commit;
|
||||
}
|
||||
};
|
||||
|
||||
class TBoxFlagManager : public CommittableFlagManager {
|
||||
public:
|
||||
FlagSpace mFlagSpace;
|
||||
u16 mSceneIndex;
|
||||
BitwiseFlagHelper mFlagHelper;
|
||||
|
||||
static u16 sTBoxFlags[2];
|
||||
|
||||
static TBoxFlagManager *sInstance;
|
||||
|
||||
virtual void doCommit() override;
|
||||
bool checkUncommittedFlag(u16 flag);
|
||||
TBoxFlagManager();
|
||||
virtual ~TBoxFlagManager() {}
|
||||
void init();
|
||||
void copyFromSave(s16 sceneIndex);
|
||||
bool checkFlag(u16 sceneIndex, u16 flag);
|
||||
virtual u16 getFlagCount() const;
|
||||
void setFlag(u16 flag);
|
||||
bool checkUncommittedFlag(u16 sceneIndex, u16 flag);
|
||||
u16 checkUncommittedFlag2(u16 flag) {
|
||||
return checkUncommittedFlag(flag);
|
||||
}
|
||||
};
|
||||
|
||||
// NOTE: Not actually Enemy Defeat.
|
||||
// This is a little more than that, it keeps track of live objects based on their id as a whole
|
||||
class EnemyDefeatManager : public CommittableFlagManager {
|
||||
public:
|
||||
FlagSpace mFlagSpace;
|
||||
BitwiseFlagHelper mFlagHelper;
|
||||
u16 mSceneIndex;
|
||||
|
||||
static u16 sEnemyDefeatFlags[4096];
|
||||
|
||||
static EnemyDefeatManager *sInstance;
|
||||
|
||||
void clearSavedFlags();
|
||||
bool checkUncommittedFlag(u16 flag);
|
||||
u16 checkUncommittedFlag2(u16 flag) {
|
||||
return checkUncommittedFlag(flag);
|
||||
}
|
||||
EnemyDefeatManager();
|
||||
void init();
|
||||
void copyFromSave(u16 sceneIndex);
|
||||
void updateFlagIndex(u16 sceneIndex);
|
||||
void clearAll();
|
||||
bool checkIsValidFlag(u16 flag);
|
||||
bool checkFlag(u16 flag);
|
||||
virtual ~EnemyDefeatManager() {}
|
||||
virtual u16 getFlagCount() const;
|
||||
void setFlag(u16 flag);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef UNK_FLAG_STUFF_H
|
||||
#define UNK_FLAG_STUFF_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
struct UnkFlagDefinition {
|
||||
u8 mIndex;
|
||||
u8 mShiftMask;
|
||||
};
|
||||
|
||||
class UnkFlagStuff {
|
||||
u16 mDefinitionsCount;
|
||||
UnkFlagDefinition *mpDefinitions;
|
||||
|
||||
public:
|
||||
u16 calculateMask(s32 shift);
|
||||
void doNothing(u32 unused);
|
||||
UnkFlagStuff(u16 count, UnkFlagDefinition *definitions);
|
||||
void prepareIndexShiftMask(u16 counterIdx, u32 flagCount, u16 *pIndex, u8 *pShift, u16 *pMask);
|
||||
u16 maskForIdx(u16 index);
|
||||
u32 getCounterOrFlag(u16 counterIdx, u16 *pData, u32 flagCount);
|
||||
void setCounterOrFlag(u16 counterIdx, u16 *pData, u32 flagCount, u32 value);
|
||||
u32 checkFlagValid(u16 counterIdx, u32 flagCount);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "d/a/obj/d_a_obj_bamboo_island.h"
|
||||
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "toBeSorted/room_manager.h"
|
||||
|
||||
const f32 dAcObambooIsland_c::unusedFloat1 = 100000.0f;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "nw4r/g3d/g3d_resnode.h"
|
||||
#include "nw4r/g3d/g3d_scnmdl.h"
|
||||
#include "nw4r/g3d/g3d_scnobj.h"
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "toBeSorted/room_manager.h"
|
||||
|
||||
const f32 dAcOislandNusi_c::someFloat = 100000.0f;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "d/a/obj/d_a_obj_junk_repairing.h"
|
||||
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_JUNK_REPAIR, dAcOJunkRep_c, fProfile::OBJ_JUNK_REPAIR, 0x027B, 0, 3);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "d/a/obj/d_a_obj_vortex.h"
|
||||
#include "s/s_Math.h"
|
||||
#include "toBeSorted/room_manager.h"
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_POOL_COCK, dAcOPoolCock_c, fProfile::OBJ_POOL_COCK, 0x024D, 0, 7);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "toBeSorted/attention.h"
|
||||
#include "toBeSorted/event.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "toBeSorted/scgame.h"
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "d/col/c/c_m3d_g_aab.h"
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "toBeSorted/room_manager.h"
|
||||
|
||||
static const char *const mMdlNames[] = {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "d/t/d_t_dowsing.h"
|
||||
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "toBeSorted/room_manager.h"
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "d/flag/itemflag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(T_DOWSING, dTgDowsing_c, fProfile::T_DOWSING, 0x0293, 0, 0);
|
||||
@@ -56,13 +56,13 @@ bool dTgDowsing_c::checkDowsing() const {
|
||||
|
||||
switch (mDowsingOption) {
|
||||
case TRIAL_0:
|
||||
return ItemflagManager::sInstance->getFlag(187) && !StoryflagManager::sInstance->getCounterOrFlag(93);
|
||||
return ItemflagManager::sInstance->getFlagDirect(187) && !StoryflagManager::sInstance->getCounterOrFlag(93);
|
||||
case TRIAL_1:
|
||||
return ItemflagManager::sInstance->getFlag(188) && !StoryflagManager::sInstance->getCounterOrFlag(97);
|
||||
return ItemflagManager::sInstance->getFlagDirect(188) && !StoryflagManager::sInstance->getCounterOrFlag(97);
|
||||
case TRIAL_2:
|
||||
return ItemflagManager::sInstance->getFlag(189) && !StoryflagManager::sInstance->getCounterOrFlag(98);
|
||||
return ItemflagManager::sInstance->getFlagDirect(189) && !StoryflagManager::sInstance->getCounterOrFlag(98);
|
||||
case TRIAL_3:
|
||||
return ItemflagManager::sInstance->getFlag(193) && !StoryflagManager::sInstance->getCounterOrFlag(99);
|
||||
return ItemflagManager::sInstance->getFlagDirect(193) && !StoryflagManager::sInstance->getCounterOrFlag(99);
|
||||
case PROPELLER: return DowsingTarget::hasPropellerDowsing();
|
||||
case WATER_BASIN: return DowsingTarget::hasWaterBasinDowsing();
|
||||
case CRYSTAL_BALL: return DowsingTarget::hasCrystalBallDowsing();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "d/t/d_t_genki_dws_tgt.h"
|
||||
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "toBeSorted/room_manager.h"
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "toBeSorted/scgame.h"
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/a/obj/d_a_obj_item.h"
|
||||
#include "d/col/cc/d_cc_mgr.h"
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(TAG_REACTION, dTgReaction_c, fProfile::TAG_REACTION, 0x0151, 0, 0);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "d/t/d_t_ship_window.h"
|
||||
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(TAG_SHIP_WINDOW, dTgShipWindow_c, fProfile::TAG_SHIP_WINDOW, 0x0228, 0, 0);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "d/t/d_t_sw_area.h"
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "toBeSorted/area_math.h"
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(SW_AREA_TAG, dTgSwArea_c, fProfile::SW_AREA_TAG, 0x292, 0, 0);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "d/t/d_t_time_area_check.h"
|
||||
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "toBeSorted/time_area_mgr.h"
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "d/t/d_t_timer.h"
|
||||
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(TAG_TIMER, dTgTimer_c, fProfile::TAG_TIMER, 0x029F, 0, 0);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "c/c_math.h"
|
||||
#include "toBeSorted/area_math.h"
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(TOUCH_TAG, dTgTouchTag, fProfile::TOUCH_TAG, 0x028E, 0, 0);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "toBeSorted/event.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
#include "toBeSorted/misc_flag_managers.h"
|
||||
#include "d/flag/enemyflag_manager.h"
|
||||
#include "toBeSorted/room_manager.h"
|
||||
#include "toBeSorted/scgame.h"
|
||||
#include "toBeSorted/special_item_drop_mgr.h"
|
||||
@@ -476,7 +476,7 @@ void dAcBase_c::setActorRef(dAcBase_c *ref) {
|
||||
|
||||
// May not be only purpose
|
||||
void dAcBase_c::setEnemyDefeatFlag() {
|
||||
EnemyDefeatManager::sInstance->setFlag(obj_id);
|
||||
EnemyflagManager::sInstance->setFlag(obj_id);
|
||||
}
|
||||
|
||||
// 8002d940
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "d/col/bg/d_bg_w.h"
|
||||
#include "nw4r/g3d/g3d_resfile.h"
|
||||
#include "s/s_Math.h"
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_SW, dAcOsw_c, fProfile::OBJ_SW, 0x12B, 0, 0x1002);
|
||||
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
#include "d/flag/baseflag_manager.h"
|
||||
|
||||
ItemStoryManagerBase::ItemStoryManagerBase(): mFlagCount(0), mFlagSizeBytes(0), mpFlagSpace(nullptr), mpFlagIndex(nullptr), mDirty(false) {}
|
||||
ItemStoryManagerBase::~ItemStoryManagerBase() {
|
||||
if (mpFlagIndex != nullptr) {
|
||||
delete mpFlagIndex;
|
||||
}
|
||||
}
|
||||
|
||||
void ItemStoryManagerBase::setFlagSizes(u16 flagCount, u16 flagSizeBytes) {
|
||||
mFlagCount = flagCount;
|
||||
mFlagSizeBytes = flagSizeBytes;
|
||||
}
|
||||
|
||||
/** 800bf320 */
|
||||
void ItemStoryManagerBase::createFlagIndex(FlagDefinition *def, u16 count) {
|
||||
mpFlagIndex = new FlagIndex(count, def);
|
||||
}
|
||||
|
||||
/** 800bf380 */
|
||||
void ItemStoryManagerBase::copyFromSave() {
|
||||
FlagSpace *current = mpFlagSpace;
|
||||
const u16 *saved = getSaveFlagSpace();
|
||||
current->copyFromSaveFile(saved, 0, mFlagCount);
|
||||
}
|
||||
|
||||
/** 800bf3e0 */
|
||||
void ItemStoryManagerBase::init() {
|
||||
const u16 *space = getSaveFlagSpace();
|
||||
if (space == nullptr || mpFlagIndex == nullptr) {
|
||||
initFlagSpace();
|
||||
copyFlagsFromSaveFirstTime();
|
||||
setupFlagIndex();
|
||||
}
|
||||
}
|
||||
|
||||
/** 800bf470 */
|
||||
void ItemStoryManagerBase::initFlagSpace() {
|
||||
|
||||
}
|
||||
|
||||
/** 800bf480 */
|
||||
u16 ItemStoryManagerBase::getFlag(u16 flag) const {
|
||||
const u16 *data = getSaveFlagSpace();
|
||||
return mpFlagIndex->getCounterOrFlag(flag, data, mFlagCount);
|
||||
}
|
||||
|
||||
/** 800bf4e0 */
|
||||
u16 ItemStoryManagerBase::getUncommittedValue_Priv(u16 flag) {
|
||||
u16 *data = mpFlagSpace->getFlagPtrUnchecked();
|
||||
return mpFlagIndex->getCounterOrFlag(flag, data, mFlagCount);
|
||||
}
|
||||
|
||||
/** 800bf530 */
|
||||
void ItemStoryManagerBase::setOrClearFlag(u16 flag, u16 value) {
|
||||
FlagSpace *storyFlagsPtr = mpFlagSpace;
|
||||
u16 *pData = storyFlagsPtr->getFlagPtrChecked();
|
||||
mpFlagIndex->setCounterOrFlag(flag, pData, storyFlagsPtr->mCount, value);
|
||||
onFlagChange(flag);
|
||||
}
|
||||
|
||||
/** 800bf5b0 */
|
||||
void ItemStoryManagerBase::setFlag(u16 flag) {
|
||||
setOrClearFlag(flag, true);
|
||||
}
|
||||
|
||||
/** 800bf5c0 */
|
||||
void ItemStoryManagerBase::unsetFlag(u16 flag) {
|
||||
setOrClearFlag(flag, false);
|
||||
}
|
||||
|
||||
/** 800bf5d0 */
|
||||
void ItemStoryManagerBase::setFlagOrCounterToValue(u16 flag, u16 value) {
|
||||
setOrClearFlag(flag, value);
|
||||
}
|
||||
|
||||
/** 800bf5e0 */
|
||||
u16 ItemStoryManagerBase::getCounterOrFlag(u16 flag) const {
|
||||
return ItemStoryManagerBase::getFlag(flag);
|
||||
}
|
||||
|
||||
/** 800bf5f0 */
|
||||
u16 ItemStoryManagerBase::getUncommittedValue(u16 flag) {
|
||||
return getUncommittedValue_Priv(flag);
|
||||
}
|
||||
|
||||
/** 800bf600 */
|
||||
u16 ItemStoryManagerBase::unk3(u16 flag) {
|
||||
return getMaskForFlag(flag);
|
||||
}
|
||||
|
||||
/** 800bf610 */
|
||||
void ItemStoryManagerBase::onFlagChange(u16 flag) {
|
||||
mDirty = true;
|
||||
onDirty();
|
||||
}
|
||||
|
||||
/** 800bf630 */
|
||||
void ItemStoryManagerBase::onDirty() {
|
||||
|
||||
}
|
||||
|
||||
/** 800bf640 */
|
||||
u16 ItemStoryManagerBase::getMaskForFlag(u16 flag) {
|
||||
return mpFlagIndex->maskForIdx(flag, mFlagCount);
|
||||
}
|
||||
|
||||
/** 800bf650 */
|
||||
void ItemStoryManagerBase::doCommit_Priv() {
|
||||
doCommit();
|
||||
mDirty = false;
|
||||
}
|
||||
|
||||
/* 800bf690 */
|
||||
void ItemStoryManagerBase::postCommit() {
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "toBeSorted/bitwise_flag_helper.h"
|
||||
#include "d/flag/bitwise_flag_helper.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#include "d/flag/committable_flag_manager.h"
|
||||
|
||||
/* 0x800BE7B0 */
|
||||
bool CommittableFlagManager::commit() {
|
||||
if (mNeedsCommit) {
|
||||
doCommit();
|
||||
mNeedsCommit = false;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
#include "d/flag/dungeonflag_manager.h"
|
||||
#include "d/flag/flag_index.h"
|
||||
|
||||
|
||||
// TODO move
|
||||
extern "C" FlagDefinition DungeonflagManager__FLAG_DEFINITIONS[];
|
||||
|
||||
/** 80575404 */
|
||||
DungeonflagManager *DungeonflagManager::sInstance = nullptr;
|
||||
|
||||
/** 805a9c58 */
|
||||
u16 DungeonflagManager::sDungeonFlags[8] = {};
|
||||
|
||||
/** 800bf8d0 */
|
||||
void DungeonflagManager::copyFromSave_Internal(u16 flagIndex) {
|
||||
mFlagSpace.copyFromSaveFile(saveFilePtr(flagIndex), 0, 0x8);
|
||||
}
|
||||
|
||||
/** 800bf930 */
|
||||
void DungeonflagManager::setCommitFlag(u16 flag) {
|
||||
mShouldCommit = true;
|
||||
}
|
||||
|
||||
/** 0x800bf940 */
|
||||
DungeonflagManager::DungeonflagManager()
|
||||
: mShouldCommit(false), mStageIndex(-1), mpFlagIndex(nullptr),
|
||||
mFlagSpace(sDungeonFlags, ARRAY_LENGTH(sDungeonFlags)) {}
|
||||
|
||||
/** 800bf980 */
|
||||
void DungeonflagManager::init() {
|
||||
mpFlagIndex = new FlagIndex(0x11, DungeonflagManager__FLAG_DEFINITIONS);
|
||||
mShouldCommit = false;
|
||||
}
|
||||
|
||||
/** 800bf9e0 */
|
||||
void DungeonflagManager::copyFromSave(u32 flag) {
|
||||
mStageIndex = flag;
|
||||
copyFromSave_Internal(flag);
|
||||
}
|
||||
|
||||
/** 800bf9f0 */
|
||||
void DungeonflagManager::setToValue(u16 flag, u32 value) {
|
||||
u16 *data = mFlagSpace.getFlagPtrChecked();
|
||||
mpFlagIndex->setCounterOrFlag(flag, data, 8, value);
|
||||
setCommitFlag(flag);
|
||||
}
|
||||
|
||||
/** 800bfa60 */
|
||||
void DungeonflagManager::setFlag(u16 flag) {
|
||||
u16 *data = mFlagSpace.getFlagPtrChecked();
|
||||
mpFlagIndex->setCounterOrFlag(flag, data, 8, 1);
|
||||
setCommitFlag(flag);
|
||||
}
|
||||
|
||||
/** 800fbac0 */
|
||||
u16 DungeonflagManager::getDungeonFlag(u16 flag) {
|
||||
u16 *data = mFlagSpace.getFlagPtrUnchecked();
|
||||
return mpFlagIndex->getCounterOrFlag(flag, data, 8);
|
||||
}
|
||||
|
||||
/** 800fbb10 */
|
||||
bool DungeonflagManager::commit() {
|
||||
FileManager *instance;
|
||||
u16 idx = mStageIndex;
|
||||
if (idx == 0xFFFF) {
|
||||
return false;
|
||||
} else if (mShouldCommit) {
|
||||
instance = FileManager::sInstance;
|
||||
u16 *ptr = mFlagSpace.getFlagPtrUnchecked();
|
||||
instance->setDungeonFlags(ptr, (idx & 0x1fff) * 8, 0x08);
|
||||
mShouldCommit = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
#include "d/flag/enemyflag_manager.h"
|
||||
|
||||
EnemyflagManager *EnemyflagManager::sInstance = nullptr;
|
||||
u16 EnemyflagManager::sEnemyDefeatFlags[4096] = {};
|
||||
|
||||
/* 0x800BEAC0 */
|
||||
void EnemyflagManager::clearSavedFlags() {
|
||||
u16 empty[0x1000];
|
||||
memset(empty, 0, 0x2000);
|
||||
FileManager::getInstance()->setEnemyDefeatFlags(empty, 0, 0x1000);
|
||||
}
|
||||
|
||||
/* 0x800BEB00 */
|
||||
bool EnemyflagManager::checkUncommittedFlag(u16 flag) {
|
||||
if (checkIsValidFlag(flag)) {
|
||||
return mFlagHelper.checkFlag(flag / 16, flag % 16, mFlagSpace.getFlagPtrUnchecked(), mFlagSpace.mCount);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* 0x800BEB80 */
|
||||
EnemyflagManager::EnemyflagManager()
|
||||
: CommittableFlagManager(false), mFlagSpace(sEnemyDefeatFlags, ARRAY_LENGTH(sEnemyDefeatFlags)) {}
|
||||
|
||||
/* 0x800BEBC0 */
|
||||
void EnemyflagManager::init() {
|
||||
mSceneIndex = 0;
|
||||
clearAll();
|
||||
}
|
||||
|
||||
/* 0x800BEBD0 */
|
||||
void EnemyflagManager::copyFromSave(u16 sceneIndex) {
|
||||
mSceneIndex = sceneIndex;
|
||||
u16 count = mFlagSpace.mCount;
|
||||
u16 *flags = FileManager::getInstance()->getEnemyDefeatFlagsConst();
|
||||
mFlagSpace.copyFromSaveFile(flags, 0, count);
|
||||
}
|
||||
|
||||
/* 0x800BEC30 */
|
||||
void EnemyflagManager::updateFlagIndex(u16 sceneIndex) {
|
||||
if (mSceneIndex == sceneIndex) {
|
||||
return;
|
||||
}
|
||||
mSceneIndex = sceneIndex;
|
||||
clearAll();
|
||||
}
|
||||
|
||||
/* 0x800BEC50 */
|
||||
void EnemyflagManager::clearAll() {
|
||||
clearSavedFlags();
|
||||
mFlagSpace.unsetAll();
|
||||
}
|
||||
|
||||
/* 0x800BEC90 */
|
||||
bool EnemyflagManager::checkIsValidFlag(u16 flag) {
|
||||
return flag < 0xFFFF;
|
||||
}
|
||||
|
||||
/* 0x800BECB0 */
|
||||
bool EnemyflagManager::checkFlag(u16 flag) {
|
||||
if (!checkIsValidFlag(flag)) {
|
||||
return false;
|
||||
} else {
|
||||
u16 *pData = FileManager::getInstance()->getEnemyDefeatFlagsConst();
|
||||
return mFlagHelper.checkFlag(flag / 16, flag % 16, pData, getFlagCount());
|
||||
}
|
||||
}
|
||||
|
||||
/* 0x800BED50 */
|
||||
u16 EnemyflagManager::getFlagCount() const {
|
||||
return 0x1000;
|
||||
}
|
||||
|
||||
/* 0x800BED60 */
|
||||
void EnemyflagManager::setFlag(u16 flag) {
|
||||
if (checkUncommittedFlag2(flag) != 1 && checkIsValidFlag(flag)) {
|
||||
mFlagHelper.setFlag(flag / 16, flag % 16, mFlagSpace.getFlagPtrChecked(), mFlagSpace.mCount);
|
||||
setNeedsCommit(true);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,30 @@
|
||||
#include "toBeSorted/unk_flag_stuff.h"
|
||||
#include "d/flag/flag_index.h"
|
||||
|
||||
u16 UnkFlagStuff::calculateMask(s32 shift) {
|
||||
u16 FlagIndex::calculateMask(s32 shift) {
|
||||
return (2 << (shift & 0xF)) - 1;
|
||||
}
|
||||
|
||||
void UnkFlagStuff::doNothing(u32 unused) {}
|
||||
void FlagIndex::doNothing(u32 unused) {}
|
||||
|
||||
UnkFlagStuff::UnkFlagStuff(u16 count, UnkFlagDefinition *definitions) {
|
||||
FlagIndex::FlagIndex(u16 count, FlagDefinition *definitions) {
|
||||
this->mDefinitionsCount = count;
|
||||
this->mpDefinitions = definitions;
|
||||
}
|
||||
|
||||
void UnkFlagStuff::prepareIndexShiftMask(u16 counterIdx, u32 unused, u16 *indexPtr, u8 *shiftPtr, u16 *maskPtr) {
|
||||
void FlagIndex::prepareIndexShiftMask(u16 counterIdx, u32 unused, u16 *indexPtr, u8 *shiftPtr, u16 *maskPtr) {
|
||||
doNothing(counterIdx);
|
||||
*indexPtr = mpDefinitions[counterIdx].mIndex;
|
||||
*shiftPtr = mpDefinitions[counterIdx].mShiftMask >> 4;
|
||||
*maskPtr = calculateMask(mpDefinitions[counterIdx].mShiftMask);
|
||||
}
|
||||
|
||||
u16 UnkFlagStuff::maskForIdx(u16 index) {
|
||||
u16 FlagIndex::maskForIdx(u16 index, u16 flagCount) {
|
||||
doNothing(index);
|
||||
|
||||
return calculateMask(mpDefinitions[index].mShiftMask);
|
||||
}
|
||||
|
||||
u32 UnkFlagStuff::getCounterOrFlag(u16 counterIdx, u16 *dataPtr, u32 param4) {
|
||||
u16 FlagIndex::getCounterOrFlag(u16 counterIdx, const u16 *dataPtr, u32 param4) {
|
||||
u16 index = 0;
|
||||
u8 shift = 0;
|
||||
u16 mask = 0;
|
||||
@@ -32,7 +32,7 @@ u32 UnkFlagStuff::getCounterOrFlag(u16 counterIdx, u16 *dataPtr, u32 param4) {
|
||||
return mask & (dataPtr[index] >> shift);
|
||||
}
|
||||
|
||||
void UnkFlagStuff::setCounterOrFlag(u16 counterIdx, u16 *dataPtr, u32 flagCount, u32 value) {
|
||||
void FlagIndex::setCounterOrFlag(u16 counterIdx, u16 *dataPtr, u32 flagCount, u32 value) {
|
||||
u16 index = 0;
|
||||
u8 shift = 0;
|
||||
u16 mask = 0;
|
||||
@@ -41,21 +41,13 @@ void UnkFlagStuff::setCounterOrFlag(u16 counterIdx, u16 *dataPtr, u32 flagCount,
|
||||
dataPtr[index] = (u16)(value << shift) | dataPtr[index];
|
||||
}
|
||||
|
||||
inline bool isLessThan(int a, int b) {
|
||||
return a <= b;
|
||||
}
|
||||
|
||||
u32 UnkFlagStuff::checkFlagValid(u16 counterIdx, u32 flagCount) {
|
||||
u32 FlagIndex::checkFlagValid(u16 counterIdx, u32 flagCount) {
|
||||
if (mpDefinitions == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
if (mDefinitionsCount <= counterIdx || mpDefinitions[counterIdx].mIndex == 0xFF) {
|
||||
return 0;
|
||||
} else {
|
||||
if (isLessThan(flagCount, mpDefinitions[counterIdx].mIndex)) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
return (int)mpDefinitions[counterIdx].mIndex < (int)flagCount;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
|
||||
#include "d/flag/flag_managers.h"
|
||||
|
||||
// clang-format off
|
||||
#include "common.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "m/m_heap.h"
|
||||
// vtable order
|
||||
#include "d/flag/flag_space.h"
|
||||
#include "d/flag/tboxflag_manager.h"
|
||||
#include "d/flag/enemyflag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "d/flag/itemflag_manager.h"
|
||||
|
||||
// actual managers
|
||||
#include "d/flag/sceneflag_manager.inc"
|
||||
#include "d/flag/committable_flag_manager.inc"
|
||||
#include "d/flag/tboxflag_manager.inc"
|
||||
#include "d/flag/enemyflag_manager.inc"
|
||||
#include "d/flag/flag_space.inc"
|
||||
#include "d/flag/flag_index.inc"
|
||||
#include "d/flag/bitwise_flag_helper.inc"
|
||||
#include "d/flag/baseflag_manager.inc"
|
||||
#include "d/flag/storyflag_manager.inc"
|
||||
#include "d/flag/itemflag_manager.inc"
|
||||
#include "d/flag/dungeonflag_manager.inc"
|
||||
#include "d/flag/skipflag_manager.inc"
|
||||
// clang-format on
|
||||
|
||||
|
||||
static void postSetup();
|
||||
|
||||
template <typename T>
|
||||
class MyFlagManager : public T {
|
||||
public:
|
||||
MyFlagManager<T>() {}
|
||||
~MyFlagManager<T>() {}
|
||||
};
|
||||
|
||||
void setupFlagManagers(EGG::Heap *heap) {
|
||||
if (SceneflagManager::sInstance == nullptr) {
|
||||
SceneflagManager::sInstance = new (heap) MyFlagManager<SceneflagManager>();
|
||||
mHeap m(heap);
|
||||
SceneflagManager::sInstance->init();
|
||||
}
|
||||
|
||||
if (TBoxflagManager::sInstance == nullptr) {
|
||||
TBoxflagManager::sInstance = new (heap) MyFlagManager<TBoxflagManager>();
|
||||
mHeap m(heap);
|
||||
TBoxflagManager::sInstance->init();
|
||||
}
|
||||
|
||||
if (EnemyflagManager::sInstance == nullptr) {
|
||||
EnemyflagManager::sInstance = new (heap) MyFlagManager<EnemyflagManager>();
|
||||
mHeap m(heap);
|
||||
EnemyflagManager::sInstance->init();
|
||||
}
|
||||
|
||||
if (StoryflagManager::sInstance == nullptr) {
|
||||
StoryflagManager::sInstance = new (heap) MyFlagManager<StoryflagManager>();
|
||||
mHeap m(heap);
|
||||
StoryflagManager::sInstance->init();
|
||||
}
|
||||
|
||||
if (ItemflagManager::sInstance == nullptr) {
|
||||
ItemflagManager::sInstance = new (heap) MyFlagManager<ItemflagManager>();
|
||||
mHeap m(heap);
|
||||
ItemflagManager::sInstance->init();
|
||||
}
|
||||
|
||||
if (DungeonflagManager::sInstance == nullptr) {
|
||||
DungeonflagManager::sInstance = new (heap) MyFlagManager<DungeonflagManager>();
|
||||
mHeap m(heap);
|
||||
DungeonflagManager::sInstance->init();
|
||||
}
|
||||
|
||||
if (SkipflagManager::sInstance == nullptr) {
|
||||
SkipflagManager::sInstance = new (heap) MyFlagManager<SkipflagManager>();
|
||||
mHeap m(heap);
|
||||
SkipflagManager::sInstance->init();
|
||||
}
|
||||
|
||||
postSetup();
|
||||
}
|
||||
|
||||
static void postSetup() {
|
||||
updateFlagForFlagIndex(0);
|
||||
}
|
||||
|
||||
void copyAllFlagManagersFromSave() {
|
||||
u16 flag = FileManager::sInstance->getSceneFlagIndex();
|
||||
SceneflagManager::sInstance->copyFromSave(flag);
|
||||
TBoxflagManager::sInstance->copyFromSave(flag);
|
||||
StoryflagManager::sInstance->copyFromSave();
|
||||
ItemflagManager::sInstance->copyFromSave();
|
||||
DungeonflagManager::sInstance->copyFromSave(flag);
|
||||
SkipflagManager::sInstance->copyFromSave();
|
||||
EnemyflagManager::sInstance->copyFromSave(flag);
|
||||
}
|
||||
|
||||
void updateFlagForFlagIndex(u16 stage) {
|
||||
SceneflagManager::sInstance->updateFlagindex(stage);
|
||||
TBoxflagManager::sInstance->copyFromSave(stage);
|
||||
EnemyflagManager::sInstance->updateFlagIndex(stage);
|
||||
DungeonflagManager::sInstance->copyFromSave(stage);
|
||||
}
|
||||
|
||||
void commitAllFlagManagers() {
|
||||
StoryflagManager::sInstance->commit();
|
||||
ItemflagManager::sInstance->commit();
|
||||
DungeonflagManager::sInstance->commit();
|
||||
SkipflagManager::sInstance->commit();
|
||||
SceneflagManager::sInstance->commit();
|
||||
TBoxflagManager::sInstance->commit();
|
||||
EnemyflagManager::sInstance->commit();
|
||||
}
|
||||
|
||||
bool checkedMemcpy(void *dest, u32 destLen, const void *src, u32 count) {
|
||||
if (dest == nullptr || src == nullptr || destLen < count || destLen > 0xFFFF) {
|
||||
return true;
|
||||
} else {
|
||||
memcpy(dest, src, count);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "common.h"
|
||||
#include "d/flag/flag_managers.h"
|
||||
#include "d/flag/flag_space.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
|
||||
u16 *FlagSpace::getFlagPtrChecked() const {
|
||||
filemanagerCheck();
|
||||
return mpFlags;
|
||||
}
|
||||
u16 *FlagSpace::getFlagPtrUnchecked() const {
|
||||
return mpFlags;
|
||||
}
|
||||
void FlagSpace::unsetAll() {
|
||||
setAllToZero(0, mCount);
|
||||
}
|
||||
void FlagSpace::setAllToZero(u16 offset, u16 flagCount) {
|
||||
filemanagerCheck();
|
||||
memset(mpFlags + offset, 0, (u16)(flagCount * 2));
|
||||
}
|
||||
void FlagSpace::copyFromSaveFile2(const u16 *pSaved, u16 offset, u16 flagCount) {
|
||||
filemanagerCheck();
|
||||
checkedMemcpy(mpFlags + offset, (u16)(mCount * 2), pSaved, (u16)(flagCount * 2));
|
||||
}
|
||||
|
||||
void FlagSpace::copyFromSaveFile(const u16 *pSaved, u16 offset, u16 flagCount) {
|
||||
checkedMemcpy(mpFlags + offset, (u16)(mCount * 2), pSaved, (u16)(flagCount * 2));
|
||||
}
|
||||
void FlagSpace::filemanagerCheck() const {
|
||||
if (FileManager::sInstance->mIsFileUnk1[0]) {
|
||||
return;
|
||||
}
|
||||
while (true) {}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#include "d/flag/itemflag_manager.h"
|
||||
|
||||
u16 ItemflagManager::sFlags[0x40];
|
||||
|
||||
ItemflagManager *ItemflagManager::sInstance = nullptr;
|
||||
|
||||
ItemflagManager::ItemflagManager() : mItemFlags(sFlags, 0x40) {}
|
||||
|
||||
void ItemflagManager::copyFlagsFromSaveFirstTime() {
|
||||
setFlagSizes(0x40, 0x80);
|
||||
ItemStoryManagerBase::copyFromSave();
|
||||
}
|
||||
|
||||
extern "C" FlagDefinition ItemflagManager__ITEMFLAG_DEFINITIONS[];
|
||||
|
||||
void ItemflagManager::setupFlagIndex() {
|
||||
createFlagIndex(ItemflagManager__ITEMFLAG_DEFINITIONS, 0x1FE);
|
||||
}
|
||||
|
||||
void ItemflagManager::onDirty() {}
|
||||
|
||||
bool ItemflagManager::commit() {
|
||||
if (mDirty) {
|
||||
doCommit_Priv();
|
||||
postCommit();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1,16 +1,13 @@
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "libc.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
|
||||
|
||||
SceneflagManager *SceneflagManager::sInstance = nullptr;
|
||||
u16 SceneflagManager::sTempFlags[] = {};
|
||||
u16 SceneflagManager::sSceneFlags[8] = {};
|
||||
u16 SceneflagManager::sZoneFlags[0xFC] = {};
|
||||
|
||||
void SceneflagManager::doNothing() {}
|
||||
void SceneflagManager::init() {}
|
||||
void SceneflagManager::setShouldCommit(u16 flag) {
|
||||
mShouldCommit = 1;
|
||||
}
|
||||
@@ -20,14 +17,7 @@ SceneflagManager::SceneflagManager()
|
||||
mSceneIdx = 0xFFFF;
|
||||
mShouldCommit = 0;
|
||||
}
|
||||
// SceneflagManager::SceneflagManager()
|
||||
// {
|
||||
// mSceneflags.init(sSceneFlags, ARRAY_LENGTH(sSceneFlags));
|
||||
// mTempflags.init(sTempFlags, ARRAY_LENGTH(sTempFlags));
|
||||
// mZoneflags.init(sZoneFlags, ARRAY_LENGTH(sZoneFlags));
|
||||
// mSceneIdx = 0xFFFF;
|
||||
// mShouldCommit = 0;
|
||||
// }
|
||||
|
||||
s32 SceneflagManager::isNotTempOrZoneFlag(u16 flag) {
|
||||
// return ((s32)flag - 0x80) < 0;
|
||||
return flag < 0x80;
|
||||
@@ -259,7 +249,7 @@ void SceneflagManager::unsetTempOrSceneflag(u16 flag) {
|
||||
setShouldCommit(flag);
|
||||
}
|
||||
}
|
||||
s32 SceneflagManager::doCommit() {
|
||||
s32 SceneflagManager::commit() {
|
||||
if (mSceneIdx == 0xFFFF) {
|
||||
return 0;
|
||||
} else if (mShouldCommit) {
|
||||
@@ -1,26 +1,9 @@
|
||||
#include "libc.h"
|
||||
#include "toBeSorted/bitwise_flag_helper.h"
|
||||
#include "common.h"
|
||||
#include "d/flag/bitwise_flag_helper.h"
|
||||
#include "d/flag/flag_managers.h"
|
||||
#include "d/flag/flag_space.h"
|
||||
#include "d/flag/skipflag_manager.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(u16 flag);
|
||||
SkipflagManager();
|
||||
void unsetCommitFlag();
|
||||
void thunk_copyFromSave();
|
||||
void setFlag(u16 flag);
|
||||
bool checkFlag(u16 flag);
|
||||
bool commitFlags();
|
||||
};
|
||||
|
||||
// 0x80575408
|
||||
SkipflagManager *SkipflagManager::sInstance = nullptr;
|
||||
@@ -28,7 +11,7 @@ SkipflagManager *SkipflagManager::sInstance = nullptr;
|
||||
u16 SkipflagManager::sSkipFlags[16] = {};
|
||||
|
||||
// 800bfba0
|
||||
void SkipflagManager::copyFromSave() {
|
||||
void SkipflagManager::doCopyFromSave() {
|
||||
u16 *savedSkipflags = FileManager::sInstance->getSkipFlags();
|
||||
mFlagSpace.copyFromSaveFile(savedSkipflags, 0, 0x10);
|
||||
}
|
||||
@@ -42,13 +25,13 @@ void SkipflagManager::setCommitFlag(u16 flag) {
|
||||
SkipflagManager::SkipflagManager() : mFlagSpace(sSkipFlags, ARRAY_LENGTH(sSkipFlags)), mShouldCommit(false) {}
|
||||
|
||||
// 800bfc30
|
||||
void SkipflagManager::unsetCommitFlag() {
|
||||
void SkipflagManager::init() {
|
||||
mShouldCommit = false;
|
||||
}
|
||||
|
||||
// 800bfc40
|
||||
void SkipflagManager::thunk_copyFromSave() {
|
||||
SkipflagManager::copyFromSave();
|
||||
void SkipflagManager::copyFromSave() {
|
||||
doCopyFromSave();
|
||||
}
|
||||
|
||||
// 800bfc50
|
||||
@@ -70,7 +53,7 @@ bool SkipflagManager::checkFlag(u16 flag) {
|
||||
}
|
||||
|
||||
// 800bfd90
|
||||
bool SkipflagManager::commitFlags() {
|
||||
bool SkipflagManager::commit() {
|
||||
if (mShouldCommit) {
|
||||
FileManager *instance = FileManager::sInstance;
|
||||
instance->setSkipFlagsChecked(mFlagSpace.getFlagPtrUnchecked(), 0, 0x10);
|
||||
@@ -0,0 +1,32 @@
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
|
||||
u16 StoryflagManager::sFlags[0x80];
|
||||
StoryflagManager *StoryflagManager::sInstance = nullptr;
|
||||
|
||||
StoryflagManager::StoryflagManager() : mStoryFlags(sFlags, 0x80) {}
|
||||
|
||||
void StoryflagManager::copyFlagsFromSaveFirstTime() {
|
||||
setFlagSizes(0x80, 0x100);
|
||||
ItemStoryManagerBase::copyFromSave();
|
||||
}
|
||||
|
||||
extern "C" FlagDefinition StoryflagManager__STORYFLAG_DEFINITIONS[];
|
||||
|
||||
void StoryflagManager::setupFlagIndex() {
|
||||
createFlagIndex(StoryflagManager__STORYFLAG_DEFINITIONS, 0x4B1);
|
||||
}
|
||||
|
||||
void StoryflagManager::onDirty() {}
|
||||
|
||||
bool StoryflagManager::commit() {
|
||||
if (mDirty) {
|
||||
doCommit_Priv();
|
||||
postCommit();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void StoryflagManager::unsetFlag(u16 flag) {
|
||||
ItemStoryManagerBase::unsetFlag(flag);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
#include "d/flag/tboxflag_manager.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
|
||||
TBoxflagManager *TBoxflagManager::sInstance = nullptr;
|
||||
u16 TBoxflagManager::sTBoxFlags[2] = {};
|
||||
|
||||
/* 0x800BE810 */
|
||||
void TBoxflagManager::doCommit() {
|
||||
if (mSceneIndex != 0xFFFF) {
|
||||
FileManager::getInstance()->setTBoxFlags(mFlagSpace.getFlagPtrUnchecked(), mSceneIndex * 2, 2);
|
||||
}
|
||||
}
|
||||
|
||||
/* 0x800BE870 */
|
||||
bool TBoxflagManager::checkUncommittedFlag(u16 flag) {
|
||||
return mFlagHelper.checkFlag(flag / 16, flag % 16, mFlagSpace.getFlagPtrUnchecked(), mFlagSpace.mCount);
|
||||
}
|
||||
|
||||
/* 0x800BE8E0 */
|
||||
TBoxflagManager::TBoxflagManager() : CommittableFlagManager(false), mFlagSpace(sTBoxFlags, ARRAY_LENGTH(sTBoxFlags)) {
|
||||
mSceneIndex = 0xFFFF;
|
||||
}
|
||||
|
||||
/* 0x800BE920 */
|
||||
void TBoxflagManager::init() {}
|
||||
|
||||
/* 0x800BE930 */
|
||||
void TBoxflagManager::copyFromSave(u32 sceneIndex) {
|
||||
u16 idx = sceneIndex;
|
||||
mSceneIndex = idx;
|
||||
u16 *flags = FileManager::getInstance()->getTBoxFlagsConst();
|
||||
mFlagSpace.copyFromSaveFile2(flags + (idx * 2), 0, 2);
|
||||
}
|
||||
|
||||
/* 0x800BE990 */
|
||||
bool TBoxflagManager::checkFlag(u16 sceneIndex, u16 flag) {
|
||||
s32 actualFlag = (flag + sceneIndex * 0x20);
|
||||
return mFlagHelper.checkFlag(
|
||||
actualFlag / 16, flag % 16, FileManager::getInstance()->getTBoxFlagsConst(), getFlagCount()
|
||||
);
|
||||
}
|
||||
|
||||
/* 0x800BEA30 */
|
||||
u16 TBoxflagManager::getFlagCount() const {
|
||||
return 0x200;
|
||||
}
|
||||
|
||||
/* 0x800BEA40 */
|
||||
void TBoxflagManager::setFlag(u16 flag) {
|
||||
if (checkUncommittedFlag2(flag) != 1) {
|
||||
mFlagHelper.setFlag(flag / 16, flag % 16, mFlagSpace.getFlagPtrChecked(), mFlagSpace.mCount);
|
||||
setNeedsCommit(true);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "c/c_math.h"
|
||||
#include "toBeSorted/event.h"
|
||||
#include "toBeSorted/sceneflag_manager.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "toBeSorted/scgame.h"
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "toBeSorted/counters/counter.h"
|
||||
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "d/flag/itemflag_manager.h"
|
||||
|
||||
/* 8016cc40 */ s32 Counter::checkedAdd(s32 num) {
|
||||
s32 uncommitted = getUncommittedValue();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "toBeSorted/counters/counter.h"
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "d/flag/itemflag_manager.h"
|
||||
|
||||
static u16 getBaseCapacity();
|
||||
static u16 getExtraWalletCapacity();
|
||||
@@ -28,7 +28,7 @@ struct WalletStruct {
|
||||
};
|
||||
const WalletStruct *wallet = &wallet_definitions[3];
|
||||
for (; i < 4; i++, wallet--) {
|
||||
if (ItemflagManager::sInstance->getFlag(wallet->flag)) {
|
||||
if (ItemflagManager::sInstance->getFlagDirect(wallet->flag)) {
|
||||
return wallet->capacity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include "c/c_math.h"
|
||||
#include "m/m_mtx.h"
|
||||
#include "nw4r/ut/ut_LinkList.h"
|
||||
#include "toBeSorted/item_story_flag_manager.h"
|
||||
#include "d/flag/itemflag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "toBeSorted/tlist.h"
|
||||
|
||||
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
#include "libc.h"
|
||||
#include "toBeSorted/bitwise_flag_helper.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
#include "toBeSorted/flag_space.h"
|
||||
#include "toBeSorted/unk_flag_stuff.h"
|
||||
|
||||
|
||||
// TODO move
|
||||
extern "C" UnkFlagDefinition DungeonflagManager__FLAG_DEFINITIONS[];
|
||||
|
||||
class DungeonflagManager {
|
||||
public:
|
||||
bool mShouldCommit;
|
||||
u16 mStageIndex;
|
||||
UnkFlagStuff *mFlagStuff;
|
||||
FlagSpace mFlagSpace;
|
||||
|
||||
static u16 sDungeonFlags[8];
|
||||
// static DungeonflagManager *sInstance;
|
||||
|
||||
void copyFromSave(s16 flag);
|
||||
void copyFromSave(u16 flagIndex);
|
||||
void setCommitFlag(u16 flag);
|
||||
DungeonflagManager();
|
||||
void setupFlagStuff();
|
||||
void setToValue(u16 flag, u32 value);
|
||||
void setFlag(u16 flag);
|
||||
u32 getDungeonFlag(u16 flag);
|
||||
bool doCommit();
|
||||
|
||||
/** inline shenanigans to get copyFromSave to match */
|
||||
static inline u16 *saveFilePtr(u16 flagIndex) {
|
||||
u32 offset = (flagIndex & 0x1fff) * 8;
|
||||
return FileManager::sInstance->getDungeonFlagsConst() + offset;
|
||||
}
|
||||
};
|
||||
|
||||
/** 80575404 */
|
||||
// DungeonflagManager *DungeonflagManager::sInstance = nullptr;
|
||||
|
||||
/** 805a9c58 */
|
||||
u16 DungeonflagManager::sDungeonFlags[8] = {};
|
||||
|
||||
/** 800bf8d0 */
|
||||
void DungeonflagManager::copyFromSave(u16 flagIndex) {
|
||||
mFlagSpace.copyFromSaveFile(saveFilePtr(flagIndex), 0, 0x8);
|
||||
}
|
||||
|
||||
/** 800bf930 */
|
||||
void DungeonflagManager::setCommitFlag(u16 flag) {
|
||||
mShouldCommit = true;
|
||||
}
|
||||
|
||||
/** 0x800bf940 */
|
||||
DungeonflagManager::DungeonflagManager()
|
||||
: mShouldCommit(false), mStageIndex(-1), mFlagStuff(nullptr),
|
||||
mFlagSpace(sDungeonFlags, ARRAY_LENGTH(sDungeonFlags)) {}
|
||||
|
||||
/** 800bf980 */
|
||||
void DungeonflagManager::setupFlagStuff() {
|
||||
mFlagStuff = new UnkFlagStuff(0x11, DungeonflagManager__FLAG_DEFINITIONS);
|
||||
mShouldCommit = false;
|
||||
}
|
||||
|
||||
/** 800bf9e0 */
|
||||
void DungeonflagManager::copyFromSave(s16 flag) {
|
||||
mStageIndex = flag;
|
||||
copyFromSave((u16)flag);
|
||||
}
|
||||
|
||||
/** 800bf9f0 */
|
||||
void DungeonflagManager::setToValue(u16 flag, u32 value) {
|
||||
u16 *data = mFlagSpace.getFlagPtrChecked();
|
||||
mFlagStuff->setCounterOrFlag(flag, data, 8, value);
|
||||
setCommitFlag(flag);
|
||||
}
|
||||
|
||||
/** 800bfa60 */
|
||||
void DungeonflagManager::setFlag(u16 flag) {
|
||||
u16 *data = mFlagSpace.getFlagPtrChecked();
|
||||
mFlagStuff->setCounterOrFlag(flag, data, 8, 1);
|
||||
setCommitFlag(flag);
|
||||
}
|
||||
|
||||
/** 800fbac0 */
|
||||
u32 DungeonflagManager::getDungeonFlag(u16 flag) {
|
||||
u16 *data = mFlagSpace.getFlagPtrUnchecked();
|
||||
return mFlagStuff->getCounterOrFlag(flag, data, 8);
|
||||
}
|
||||
|
||||
/** 800fbb10 */
|
||||
bool DungeonflagManager::doCommit() {
|
||||
FileManager *instance;
|
||||
u16 idx = mStageIndex;
|
||||
if (idx == 0xFFFF) {
|
||||
return false;
|
||||
} else if (mShouldCommit) {
|
||||
instance = FileManager::sInstance;
|
||||
u16 *ptr = mFlagSpace.getFlagPtrUnchecked();
|
||||
instance->setDungeonFlags(ptr, (idx & 0x1fff) * 8, 0x08);
|
||||
mShouldCommit = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ u16 *FileManager::getStoryFlagsMut() {
|
||||
return getCurrentFile()->getStoryFlags1();
|
||||
}
|
||||
/* 8000A3B0 */ u16 *FileManager::getItemFlagsMut() {}
|
||||
/* 8000A3E0 */ u16 *FileManager::getItemFlagsConst() {}
|
||||
/* 8000A3E0 */ const u16 *FileManager::getItemFlagsConst() {}
|
||||
/* 8000A430 */ u16 *FileManager::getDungeonFlagsMut() {}
|
||||
/* 8000A460 */ u16 *FileManager::getDungeonFlagsConst() {}
|
||||
/* 8000A4B0 */ u16 *FileManager::getSceneFlagsMut() {}
|
||||
@@ -234,7 +234,7 @@ u16 *FileManager::getStoryFlagsMut() {
|
||||
/* 8000CAD0 */ bool FileManager::isNew_FileA() {}
|
||||
|
||||
/* 8000CB00 */ void FileManager::setSceneFlagIndex(u16 idx) {}
|
||||
/* 8000CB30 */ u16 FileManager::getSceneFlagIndex() {}
|
||||
/* 8000CB30 */ u32 FileManager::getSceneFlagIndex() {}
|
||||
/* 8000CB80 */ s32 FileManager::getFileAreaIndex() {}
|
||||
|
||||
/* 8000CBD0 */ void FileManager::fn_8000CBD0(u8) {}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#include "toBeSorted/flag_space.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "libc.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
|
||||
u16 *FlagSpace::getFlagPtrChecked() {
|
||||
filemanagerCheck();
|
||||
return mpFlags;
|
||||
}
|
||||
u16 *FlagSpace::getFlagPtrUnchecked() {
|
||||
return mpFlags;
|
||||
}
|
||||
void FlagSpace::unsetAll() {
|
||||
setAllToZero(0, mCount);
|
||||
}
|
||||
void FlagSpace::setAllToZero(u16 offset, u16 flagCount) {
|
||||
filemanagerCheck();
|
||||
memset(mpFlags + offset, 0, (u16)(flagCount * 2));
|
||||
}
|
||||
void FlagSpace::copyFromSaveFile2(u16 *pSaved, u16 offset, u16 flagCount) {
|
||||
filemanagerCheck();
|
||||
checkedMemcpy(mpFlags + offset, mCount * 2, pSaved, flagCount * 2);
|
||||
}
|
||||
|
||||
void FlagSpace::copyFromSaveFile(u16 *pSaved, u16 offset, u16 flagCount) {
|
||||
checkedMemcpy(mpFlags + offset, mCount * 2, pSaved, flagCount * 2);
|
||||
}
|
||||
void FlagSpace::filemanagerCheck() {
|
||||
if (FileManager::sInstance->mIsFileUnk1[0]) {
|
||||
return;
|
||||
}
|
||||
while (true) {}
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
#include "toBeSorted/misc_flag_managers.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "libc.h"
|
||||
#include "toBeSorted/bitwise_flag_helper.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
#include "toBeSorted/flag_space.h"
|
||||
|
||||
|
||||
/* 0x800BE7B0 */
|
||||
bool CommittableFlagManager::commitIfNecessary() {
|
||||
if (mNeedsCommit) {
|
||||
doCommit();
|
||||
mNeedsCommit = false;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
TBoxFlagManager *TBoxFlagManager::sInstance = nullptr;
|
||||
u16 TBoxFlagManager::sTBoxFlags[2] = {};
|
||||
|
||||
/* 0x800BE810 */
|
||||
void TBoxFlagManager::doCommit() {
|
||||
if (mSceneIndex != 0xFFFF) {
|
||||
FileManager::getInstance()->setTBoxFlags(mFlagSpace.getFlagPtrUnchecked(), mSceneIndex * 2, 2);
|
||||
}
|
||||
}
|
||||
|
||||
/* 0x800BE870 */
|
||||
bool TBoxFlagManager::checkUncommittedFlag(u16 flag) {
|
||||
return mFlagHelper.checkFlag(flag / 16, flag % 16, mFlagSpace.getFlagPtrUnchecked(), mFlagSpace.mCount);
|
||||
}
|
||||
|
||||
/* 0x800BE8E0 */
|
||||
TBoxFlagManager::TBoxFlagManager() : CommittableFlagManager(false), mFlagSpace(sTBoxFlags, ARRAY_LENGTH(sTBoxFlags)) {
|
||||
mSceneIndex = 0xFFFF;
|
||||
}
|
||||
|
||||
/* 0x800BE920 */
|
||||
void TBoxFlagManager::init() {}
|
||||
|
||||
/* 0x800BE930 */
|
||||
void TBoxFlagManager::copyFromSave(s16 sceneIndex) {
|
||||
u16 idx = sceneIndex;
|
||||
mSceneIndex = idx;
|
||||
u16 *flags = FileManager::getInstance()->getTBoxFlagsConst();
|
||||
mFlagSpace.copyFromSaveFile2(flags + (idx * 2), 0, 2);
|
||||
}
|
||||
|
||||
/* 0x800BE990 */
|
||||
bool TBoxFlagManager::checkFlag(u16 sceneIndex, u16 flag) {
|
||||
s32 actualFlag = (flag + sceneIndex * 0x20);
|
||||
return mFlagHelper.checkFlag(
|
||||
actualFlag / 16, flag % 16, FileManager::getInstance()->getTBoxFlagsConst(), getFlagCount()
|
||||
);
|
||||
}
|
||||
|
||||
/* 0x800BEA30 */
|
||||
u16 TBoxFlagManager::getFlagCount() const {
|
||||
return 0x200;
|
||||
}
|
||||
|
||||
/* 0x800BEA40 */
|
||||
void TBoxFlagManager::setFlag(u16 flag) {
|
||||
if (checkUncommittedFlag2(flag) != 1) {
|
||||
mFlagHelper.setFlag(flag / 16, flag % 16, mFlagSpace.getFlagPtrChecked(), mFlagSpace.mCount);
|
||||
setNeedsCommit(true);
|
||||
}
|
||||
}
|
||||
|
||||
EnemyDefeatManager *EnemyDefeatManager::sInstance = nullptr;
|
||||
u16 EnemyDefeatManager::sEnemyDefeatFlags[4096] = {};
|
||||
|
||||
/* 0x800BEAC0 */
|
||||
void EnemyDefeatManager::clearSavedFlags() {
|
||||
u16 empty[0x1000];
|
||||
memset(empty, 0, 0x2000);
|
||||
FileManager::getInstance()->setEnemyDefeatFlags(empty, 0, 0x1000);
|
||||
}
|
||||
|
||||
/* 0x800BEB00 */
|
||||
bool EnemyDefeatManager::checkUncommittedFlag(u16 flag) {
|
||||
if (checkIsValidFlag(flag)) {
|
||||
return mFlagHelper.checkFlag(flag / 16, flag % 16, mFlagSpace.getFlagPtrUnchecked(), mFlagSpace.mCount);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* 0x800BEB80 */
|
||||
EnemyDefeatManager::EnemyDefeatManager()
|
||||
: CommittableFlagManager(false), mFlagSpace(sEnemyDefeatFlags, ARRAY_LENGTH(sEnemyDefeatFlags)) {}
|
||||
|
||||
/* 0x800BEBC0 */
|
||||
void EnemyDefeatManager::init() {
|
||||
mSceneIndex = 0;
|
||||
clearAll();
|
||||
}
|
||||
|
||||
/* 0x800BEBD0 */
|
||||
void EnemyDefeatManager::copyFromSave(u16 sceneIndex) {
|
||||
mSceneIndex = sceneIndex;
|
||||
u16 count = mFlagSpace.mCount;
|
||||
u16 *flags = FileManager::getInstance()->getEnemyDefeatFlagsConst();
|
||||
mFlagSpace.copyFromSaveFile(flags, 0, count);
|
||||
}
|
||||
|
||||
/* 0x800BEC30 */
|
||||
void EnemyDefeatManager::updateFlagIndex(u16 sceneIndex) {
|
||||
if (mSceneIndex == sceneIndex) {
|
||||
return;
|
||||
}
|
||||
mSceneIndex = sceneIndex;
|
||||
clearAll();
|
||||
}
|
||||
|
||||
/* 0x800BEC50 */
|
||||
void EnemyDefeatManager::clearAll() {
|
||||
clearSavedFlags();
|
||||
mFlagSpace.unsetAll();
|
||||
}
|
||||
|
||||
/* 0x800BEC90 */
|
||||
bool EnemyDefeatManager::checkIsValidFlag(u16 flag) {
|
||||
return flag < 0xFFFF;
|
||||
}
|
||||
|
||||
/* 0x800BECB0 */
|
||||
bool EnemyDefeatManager::checkFlag(u16 flag) {
|
||||
if (!checkIsValidFlag(flag)) {
|
||||
return false;
|
||||
} else {
|
||||
u16 *pData = FileManager::getInstance()->getEnemyDefeatFlagsConst();
|
||||
return mFlagHelper.checkFlag(flag / 16, flag % 16, pData, getFlagCount());
|
||||
}
|
||||
}
|
||||
|
||||
/* 0x800BED50 */
|
||||
u16 EnemyDefeatManager::getFlagCount() const {
|
||||
return 0x1000;
|
||||
}
|
||||
|
||||
/* 0x800BED60 */
|
||||
void EnemyDefeatManager::setFlag(u16 flag) {
|
||||
if (checkUncommittedFlag2(flag) != 1 && checkIsValidFlag(flag)) {
|
||||
mFlagHelper.setFlag(flag / 16, flag % 16, mFlagSpace.getFlagPtrChecked(), mFlagSpace.mCount);
|
||||
setNeedsCommit(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user