mirror of
https://github.com/zeldaret/ss
synced 2026-05-31 09:21:42 -04:00
Flag managers WIP, broken after rebase
This commit is contained in:
@@ -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
|
||||
toBeSorted/flag_managers/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
|
||||
|
||||
+72
-72
@@ -4107,7 +4107,7 @@ 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
|
||||
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
|
||||
@@ -4122,56 +4122,56 @@ checkIsValidFlag__18EnemyDefeatManagerFUs = .text:0x800BEC90; // type:function s
|
||||
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
|
||||
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
|
||||
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__12UnkFlagStuffFl = .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
|
||||
maskForIdx__12UnkFlagStuffFUsUs = .text:0x800BF050; // type:function size:0x50
|
||||
getCounterOrFlag__12UnkFlagStuffFUsPCUsUl = .text:0x800BF0A0; // type:function size:0x68
|
||||
setCounterOrFlag__12UnkFlagStuffFUsPUsUlUl = .text:0x800BF110; // type:function size:0x9C
|
||||
checkFlagValid__12UnkFlagStuffFUsUl = .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
|
||||
__ct__20ItemStoryManagerBaseFv = .text:0x800BF270; // type:function size:0x28
|
||||
__dt__20ItemStoryManagerBaseFv = .text:0x800BF2A0; // type:function size:0x70
|
||||
setFlagSizes__20ItemStoryManagerBaseFUsUs = .text:0x800BF310; // type:function size:0xC
|
||||
setupUnkFlagStuff__20ItemStoryManagerBaseFP17UnkFlagDefinitionUs = .text:0x800BF320; // type:function size:0x60
|
||||
copyFlagsFromSave_Priv__20ItemStoryManagerBaseFv = .text:0x800BF380; // type:function size:0x58
|
||||
init__20ItemStoryManagerBaseFv = .text:0x800BF3E0; // type:function size:0x88
|
||||
setFlagszptr__20ItemStoryManagerBaseFv = .text:0x800BF470; // type:function size:0x4
|
||||
getCounterOrFlag__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
|
||||
thunk_setOrClearFlag__20ItemStoryManagerBaseFUsUs = .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
|
||||
getUncommittedValue__20ItemStoryManagerBaseFUs = .text:0x800BF5F0; // type:function size:0x4
|
||||
FUN_800bf600__20ItemStoryManagerBaseFUs = .text:0x800BF600; // type:function size:0x4
|
||||
FUN_800bf610__20ItemStoryManagerBaseFUs = .text:0x800BF610; // type:function size:0x18
|
||||
onDirty__20ItemStoryManagerBaseFv = .text:0x800BF630; // type:function size:0x4
|
||||
FUN_800bf640__20ItemStoryManagerBaseFUs = .text:0x800BF640; // type:function size:0x10
|
||||
doCommit_Priv__20ItemStoryManagerBaseFv = .text:0x800BF650; // type:function size:0x40
|
||||
FUN_800bf690__20ItemStoryManagerBaseFv = .text:0x800BF690; // type:function size:0x4
|
||||
__ct__16StoryFlagManagerFv = .text:0x800BF6A0; // type:function size:0x5C
|
||||
copyFlagsFromSave__16StoryFlagManagerFv = .text:0x800BF700; // type:function size:0x3C
|
||||
setupUnkFlagsStuff__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
|
||||
copyFlagsFromSave__15ItemFlagManagerFv = .text:0x800BF820; // type:function size:0x3C
|
||||
setupUnkFlagsStuff__15ItemFlagManagerFv = .text:0x800BF860; // type:function size:0x10
|
||||
onDirty__15ItemFlagManagerFv = .text:0x800BF870; // type:function size:0x4
|
||||
commit__15ItemFlagManagerFv = .text:0x800BF880; // type:function size:0x4C
|
||||
copyFromSave__18DungeonflagManagerFUs = .text:0x800BF8D0; // type:function size:0x54
|
||||
setCommitFlag__18DungeonflagManagerFUs = .text:0x800BF930; // type:function size:0xC
|
||||
__ct__18DungeonflagManagerFv = .text:0x800BF940; // type:function size:0x3C
|
||||
@@ -4189,32 +4189,32 @@ thunk_copyFromSave__15SkipflagManagerFv = .text:0x800BFC40; // type:function siz
|
||||
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
|
||||
setupFlagManagers__FPQ23EGG4Heap = .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
|
||||
__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 = .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
|
||||
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
|
||||
setFlagszptr__15ItemFlagManagerFv = .text:0x800C0440; // type:function size:0xC
|
||||
getSaveFlagSpace__16StoryFlagManagerCFv = .text:0x800C0450; // type:function size:0x8
|
||||
doCommit__16StoryFlagManagerFv = .text:0x800C0460; // type:function size:0x44
|
||||
setFlagszptr__16StoryFlagManagerFv = .text:0x800C04B0; // type:function size:0xC
|
||||
doCommit__18EnemyDefeatManagerFv = .text:0x800C04C0; // type:function size:0x44
|
||||
__dt__18ItemFlagManagerSubFv = .text:0x800C0510; // type:function size:0x5C
|
||||
__dt__19StoryFlagManagerSubFv = .text:0x800C0570; // type:function size:0x5C
|
||||
__dt__21EnemyDefeatManagerSubFv = .text:0x800C05D0; // type:function size:0x40
|
||||
__dt__18TBoxFlagManagerSubFv = .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,13 +31008,13 @@ 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__18ItemFlagManagerSub = .data:0x80510B88; // type:object size:0x3C
|
||||
__vt__19StoryFlagManagerSub = .data:0x80510BC4; // type:object size:0x3C
|
||||
__vt__21EnemyDefeatManagerSub = .data:0x80510C00; // type:object size:0x14
|
||||
__vt__18TBoxFlagManagerSub = .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__18EnemyDefeatManager = .data:0x80510CDC; // type:object size:0x14
|
||||
__vt__15TBoxFlagManager = .data:0x80510CF0; // type:object size:0x14
|
||||
__vt__9FlagSpace = .data:0x80510D04; // type:object size:0xC
|
||||
@@ -39947,7 +39947,7 @@ sTBoxFlags__15TBoxFlagManager = .sbss:0x805753F4; // type:object size:0x4
|
||||
sInstance__18EnemyDefeatManager = .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,8 +48330,8 @@ 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
|
||||
sSceneFlags__16SceneflagManager = .bss:0x805A78D0; // type:object size:0x10
|
||||
sZoneFlags__16SceneflagManager = .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
|
||||
|
||||
+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(NonMatching, "toBeSorted/flag_managers/flag_managers.cpp", extra_cflags=["-i src"]),
|
||||
Object(NonMatching, "toBeSorted/special_item_drop_mgr.cpp"),
|
||||
Object(Matching, "d/d_base.cpp"),
|
||||
Object(Matching, "d/d_dvd.cpp"),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "toBeSorted/flag_space.h"
|
||||
#include "toBeSorted/unk_flag_stuff.h"
|
||||
#include "toBeSorted/file_manager.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,
|
||||
@@ -23,24 +24,113 @@ public:
|
||||
/** 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;
|
||||
/** 0x34 */ virtual void unk3(u16 arg);
|
||||
/** 0x38 */ virtual const u16 *getSaveFlagSpace() const = 0;
|
||||
|
||||
u16 getFlag(u16 flag) const;
|
||||
|
||||
void init();
|
||||
void setFlagSizes(u16 flagSizeMaybe, u16 anotherFlagSizeMaybe);
|
||||
void copyFlagsFromSave_Priv();
|
||||
void setupUnkFlagStuff(UnkFlagDefinition *def, u16 count);
|
||||
void doCommit_Priv();
|
||||
void thunk_setOrClearFlag(u16 flag, u16 value);
|
||||
void setOrClearFlag(u16 flag, u16 value);
|
||||
u16 getFlag(u16 flag) const;
|
||||
u16 FUN_800bf600(u16 flag);
|
||||
void FUN_800bf610(u16 flag);
|
||||
u16 FUN_800bf640(u16 flag);
|
||||
void FUN_800bf690();
|
||||
|
||||
u16 getUncommittedValue_Priv(u16 flag);
|
||||
|
||||
protected:
|
||||
/** 0x04 */ u16 flagSizeMaybe;
|
||||
/** 0x06 */ u16 anotherSizeMaybe;
|
||||
/** 0x08 */ FlagSpace *storyFlagsPtr;
|
||||
/** 0x0C */ UnkFlagStuff *unkFlagsPtr;
|
||||
/** 0x10 */ bool dirty;
|
||||
};
|
||||
|
||||
class StoryflagManager : public ItemStoryManagerBase {
|
||||
public:
|
||||
StoryflagManager();
|
||||
|
||||
virtual ~StoryflagManager() {}
|
||||
|
||||
FlagSpace storyFlags;
|
||||
|
||||
void init();
|
||||
bool commit();
|
||||
|
||||
/** 0x0C */ virtual void setFlagszptr() override {
|
||||
|
||||
}
|
||||
/** 0x10 */ virtual void onDirty() override;
|
||||
/** 0x14 */ virtual void copyFlagsFromSave() override;
|
||||
/** 0x18 */ virtual void setupUnkFlagsStuff() override;
|
||||
/** 0x1C */ virtual bool doCommit() override {}
|
||||
/** 0x20 */ virtual void setFlag(u16 flag) override;
|
||||
/** 0x24 */ virtual void unsetFlag(u16 flag) override;
|
||||
/** 0x28 */ virtual void setFlagOrCounterToValue(u16 flag, u16 value) override;
|
||||
/** 0x2C */ virtual u16 getCounterOrFlag(u16 flag) const override;
|
||||
/** 0x30 */ virtual u16 getUncommittedValue(u16 flag) override;
|
||||
/** 0x34 */ virtual void unk3(u16 arg) override;
|
||||
/** 0x38 */ virtual const u16 *getSaveFlagSpace() const override {
|
||||
return FileManager::sInstance->getStoryFlagsConst();
|
||||
};
|
||||
|
||||
public:
|
||||
static StoryflagManager *sInstance;
|
||||
static u16 sFlags[0x80];
|
||||
};
|
||||
|
||||
|
||||
class ItemflagManager : public ItemStoryManagerBase {
|
||||
public:
|
||||
FlagSpace itemFlags;
|
||||
|
||||
ItemflagManager();
|
||||
virtual ~ItemflagManager() {}
|
||||
|
||||
void init();
|
||||
bool commit();
|
||||
|
||||
/** 0x0C */ virtual void setFlagszptr() override {
|
||||
|
||||
}
|
||||
/** 0x10 */ virtual void onDirty() override;
|
||||
/** 0x14 */ virtual void copyFlagsFromSave();
|
||||
/** 0x18 */ virtual void setupUnkFlagsStuff();
|
||||
/** 0x1C */ virtual bool doCommit() {
|
||||
u16 sz = flagSizeMaybe;
|
||||
u16 *flags = storyFlagsPtr->getFlagPtrUnchecked();
|
||||
FileManager::sInstance->setItemFlags(flags, 0, sz);
|
||||
}
|
||||
/** 0x20 */ virtual void setFlag(u16 flag);
|
||||
/** 0x24 */ virtual void unsetFlag(u16 flag) {
|
||||
ItemStoryManagerBase::unsetFlag(flag & ~0x4000);
|
||||
}
|
||||
/** 0x28 */ virtual void setFlagOrCounterToValue(u16 flag, u16 value) {
|
||||
ItemStoryManagerBase::thunk_setOrClearFlag(flag & ~0x4000, value);
|
||||
}
|
||||
/** 0x2C */ virtual u16 getCounterOrFlag(u16 flag) const {
|
||||
return getFlag(flag & ~0x4000);
|
||||
}
|
||||
/** 0x30 */ virtual u16 getUncommittedValue(u16 flag) {
|
||||
return getUncommittedValue_Priv(flag & ~0x4000);
|
||||
}
|
||||
/** 0x34 */ virtual void unk3(u16 arg) {
|
||||
FUN_800bf600(arg & ~0x4000);
|
||||
}
|
||||
/** 0x38 */ virtual const u16 *getSaveFlagSpace() const {
|
||||
return FileManager::sInstance->getItemFlagsConst();
|
||||
};
|
||||
|
||||
public:
|
||||
static ItemflagManager *sInstance;
|
||||
static u16 sFlags[0x40];
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
#include "common.h"
|
||||
#include "toBeSorted/bitwise_flag_helper.h"
|
||||
#include "toBeSorted/flag_space.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
|
||||
class CommittableFlagManager {
|
||||
public:
|
||||
bool mNeedsCommit;
|
||||
|
||||
virtual void doCommit() = 0;
|
||||
virtual ~CommittableFlagManager() {}
|
||||
bool commitIfNecessary();
|
||||
void setNeedsCommit(bool commit) {
|
||||
mNeedsCommit = commit;
|
||||
@@ -37,7 +39,7 @@ public:
|
||||
TBoxFlagManager();
|
||||
virtual ~TBoxFlagManager() {}
|
||||
void init();
|
||||
void copyFromSave(s16 sceneIndex);
|
||||
void copyFromSave(u32 sceneIndex);
|
||||
bool checkFlag(u16 sceneIndex, u16 flag);
|
||||
virtual u16 getFlagCount() const;
|
||||
void setFlag(u16 flag);
|
||||
@@ -47,6 +49,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 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 {
|
||||
@@ -74,6 +77,11 @@ public:
|
||||
virtual ~EnemyDefeatManager() {}
|
||||
virtual u16 getFlagCount() const;
|
||||
void setFlag(u16 flag);
|
||||
|
||||
virtual void doCommit() override {
|
||||
FileManager *mgr = FileManager::sInstance;
|
||||
mgr->setItemFlags(mFlagSpace.getFlagPtrUnchecked(), 0, 0x1000);
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,8 +17,8 @@ public:
|
||||
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);
|
||||
u16 maskForIdx(u16 index, u16 flagSizeMaybe);
|
||||
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);
|
||||
};
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
+4
-2
@@ -25,7 +25,7 @@ public:
|
||||
void setupFlagStuff();
|
||||
void setToValue(u16 flag, u32 value);
|
||||
void setFlag(u16 flag);
|
||||
u32 getDungeonFlag(u16 flag);
|
||||
u16 getDungeonFlag(u16 flag);
|
||||
bool doCommit();
|
||||
|
||||
/** inline shenanigans to get copyFromSave to match */
|
||||
@@ -33,6 +33,8 @@ public:
|
||||
u32 offset = (flagIndex & 0x1fff) * 8;
|
||||
return FileManager::sInstance->getDungeonFlagsConst() + offset;
|
||||
}
|
||||
|
||||
static DungeonflagManager *sInstance;
|
||||
};
|
||||
|
||||
/** 80575404 */
|
||||
@@ -83,7 +85,7 @@ void DungeonflagManager::setFlag(u16 flag) {
|
||||
}
|
||||
|
||||
/** 800fbac0 */
|
||||
u32 DungeonflagManager::getDungeonFlag(u16 flag) {
|
||||
u16 DungeonflagManager::getDungeonFlag(u16 flag) {
|
||||
u16 *data = mFlagSpace.getFlagPtrUnchecked();
|
||||
return mFlagStuff->getCounterOrFlag(flag, data, 8);
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
// clang-format off
|
||||
|
||||
#include <toBeSorted/flag_space.h>
|
||||
#include <toBeSorted/misc_flag_managers.h>
|
||||
#include <toBeSorted/item_story_flag_manager.h>
|
||||
|
||||
#include <toBeSorted/flag_managers/sceneflag_manager.inc>
|
||||
#include <toBeSorted/item_story_flag_manager.h>
|
||||
#include <toBeSorted/flag_managers/misc_flag_managers.inc>
|
||||
#include <toBeSorted/flag_managers/flag_space.inc>
|
||||
#include <toBeSorted/flag_managers/unk_flag_stuff.inc>
|
||||
#include <toBeSorted/flag_managers/bitwise_flag_helper.inc>
|
||||
|
||||
|
||||
ItemStoryManagerBase::ItemStoryManagerBase(): flagSizeMaybe(0), anotherSizeMaybe(0), storyFlagsPtr(nullptr), unkFlagsPtr(nullptr), dirty(false) {}
|
||||
ItemStoryManagerBase::~ItemStoryManagerBase() {
|
||||
if (unkFlagsPtr != nullptr) {
|
||||
delete unkFlagsPtr;
|
||||
}
|
||||
}
|
||||
|
||||
void ItemStoryManagerBase::setFlagSizes(u16 flagSizeMaybe, u16 anotherFlagSizeMaybe) {
|
||||
this->flagSizeMaybe = flagSizeMaybe;
|
||||
this->anotherSizeMaybe = anotherFlagSizeMaybe;
|
||||
}
|
||||
|
||||
/** 800bf320 */
|
||||
void ItemStoryManagerBase::setupUnkFlagStuff(UnkFlagDefinition *def, u16 count) {
|
||||
UnkFlagStuff *stuff = new UnkFlagStuff(count, def);
|
||||
this->unkFlagsPtr = stuff;
|
||||
}
|
||||
|
||||
/** 800bf380 */
|
||||
void ItemStoryManagerBase::copyFlagsFromSave_Priv() {
|
||||
FlagSpace *current = this->storyFlagsPtr;
|
||||
const u16 *saved = this->getSaveFlagSpace();
|
||||
current->copyFromSaveFile(saved, 0, this->flagSizeMaybe);
|
||||
}
|
||||
|
||||
/** 800bf3e0 */
|
||||
void ItemStoryManagerBase::init() {
|
||||
const u16 *space = this->getSaveFlagSpace();
|
||||
if (space == nullptr || this->unkFlagsPtr == nullptr) {
|
||||
this->setFlagszptr();
|
||||
this->copyFlagsFromSave();
|
||||
this->setupUnkFlagsStuff();
|
||||
}
|
||||
}
|
||||
|
||||
/** 800bf470 */
|
||||
void ItemStoryManagerBase::setFlagszptr() {
|
||||
|
||||
}
|
||||
|
||||
/** 800bf480 */
|
||||
u16 ItemStoryManagerBase::getCounterOrFlag(u16 flag) const {
|
||||
const u16 *data = this->getSaveFlagSpace();
|
||||
return this->unkFlagsPtr->getCounterOrFlag(flag, data, this->flagSizeMaybe);
|
||||
}
|
||||
|
||||
/** 800bf4e0 */
|
||||
u16 ItemStoryManagerBase::getUncommittedValue_Priv(u16 flag) {
|
||||
u16 *data = this->storyFlagsPtr->getFlagPtrUnchecked();
|
||||
return this->unkFlagsPtr->getCounterOrFlag(flag, data, this->flagSizeMaybe);
|
||||
}
|
||||
|
||||
/** 800bf530 */
|
||||
void ItemStoryManagerBase::setOrClearFlag(u16 flag, u16 value) {
|
||||
FlagSpace *storyFlagsPtr = this->storyFlagsPtr;
|
||||
u16 *pData = storyFlagsPtr->getFlagPtrChecked();
|
||||
this->unkFlagsPtr->setCounterOrFlag(flag, pData, storyFlagsPtr->mCount, value);
|
||||
this->FUN_800bf610(flag);
|
||||
}
|
||||
|
||||
/** 800bf5b0 */
|
||||
void ItemStoryManagerBase::setFlag(u16 flag) {
|
||||
this->setOrClearFlag(flag, true);
|
||||
}
|
||||
|
||||
/** 800bf5c0 */
|
||||
void ItemStoryManagerBase::unsetFlag(u16 flag) {
|
||||
this->setOrClearFlag(flag, false);
|
||||
}
|
||||
|
||||
/** 800bf5d0 */
|
||||
void ItemStoryManagerBase::thunk_setOrClearFlag(u16 flag, u16 value) {
|
||||
this->setOrClearFlag(flag, value);
|
||||
}
|
||||
|
||||
/** 800bf5e0 */
|
||||
u16 ItemStoryManagerBase::getFlag(u16 flag) const {
|
||||
return ItemStoryManagerBase::getCounterOrFlag(flag);
|
||||
}
|
||||
|
||||
/** 800bf5f0 */
|
||||
u16 ItemStoryManagerBase::getUncommittedValue(u16 flag) {
|
||||
return this->getUncommittedValue_Priv(flag);
|
||||
}
|
||||
|
||||
/** 800bf600 */
|
||||
u16 ItemStoryManagerBase::FUN_800bf600(u16 flag) {
|
||||
return this->FUN_800bf640(flag);
|
||||
}
|
||||
|
||||
/** 800bf610 */
|
||||
void ItemStoryManagerBase::FUN_800bf610(u16 flag) {
|
||||
this->dirty = true;
|
||||
this->onDirty();
|
||||
}
|
||||
|
||||
/** 800bf630 */
|
||||
void ItemStoryManagerBase::onDirty() {
|
||||
|
||||
}
|
||||
|
||||
/** 800bf640 */
|
||||
u16 ItemStoryManagerBase::FUN_800bf640(u16 flag) {
|
||||
return this->unkFlagsPtr->maskForIdx(flag, this->flagSizeMaybe);
|
||||
}
|
||||
|
||||
/** 800bf650 */
|
||||
void ItemStoryManagerBase::doCommit_Priv() {
|
||||
this->doCommit();
|
||||
this->dirty = false;
|
||||
}
|
||||
|
||||
/* 800bf690 */
|
||||
void ItemStoryManagerBase::FUN_800bf690() {
|
||||
|
||||
}
|
||||
|
||||
StoryflagManager::StoryflagManager() : storyFlags(sFlags, 0x80) {
|
||||
|
||||
}
|
||||
|
||||
void StoryflagManager::copyFlagsFromSave() {
|
||||
setFlagSizes(0x80, 0x100);
|
||||
copyFlagsFromSave_Priv();
|
||||
}
|
||||
|
||||
extern "C" UnkFlagDefinition StoryflagManager__STORYFLAG_DEFINITIONS[];
|
||||
|
||||
void StoryflagManager::setupUnkFlagsStuff() {
|
||||
setupUnkFlagStuff(StoryflagManager__STORYFLAG_DEFINITIONS, 0x4B1);
|
||||
}
|
||||
|
||||
void StoryflagManager::onDirty() {
|
||||
|
||||
}
|
||||
|
||||
bool StoryflagManager::commit() {
|
||||
if (dirty) {
|
||||
doCommit_Priv();
|
||||
FUN_800bf690();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void StoryflagManager::unsetFlag(u16 flag) {
|
||||
ItemStoryManagerBase::unsetFlag(flag);
|
||||
}
|
||||
|
||||
ItemflagManager::ItemflagManager() : itemFlags(sFlags, 0x40) {}
|
||||
|
||||
void ItemflagManager::copyFlagsFromSave() {
|
||||
setFlagSizes(0x40, 0x80);
|
||||
copyFlagsFromSave_Priv();
|
||||
}
|
||||
|
||||
extern "C" UnkFlagDefinition ItemflagManager__ITEMFLAG_DEFINITIONS[];
|
||||
|
||||
void ItemflagManager::setupUnkFlagsStuff() {
|
||||
setupUnkFlagStuff(ItemflagManager__ITEMFLAG_DEFINITIONS, 0x1FE);
|
||||
}
|
||||
|
||||
void ItemflagManager::onDirty() {
|
||||
|
||||
}
|
||||
|
||||
bool ItemflagManager::commit() {
|
||||
if (dirty) {
|
||||
doCommit_Priv();
|
||||
FUN_800bf690();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#include <toBeSorted/flag_managers/dungeonflag_manager.inc>
|
||||
#include <toBeSorted/flag_managers/skipflag_manager.inc>
|
||||
// clang-format on
|
||||
|
||||
#include <egg/core/eggHeap.h>
|
||||
#include <m/m_heap.h>
|
||||
|
||||
static void postSetup();
|
||||
static void updateFlagForFlagIndex(u16 stage);
|
||||
class TBoxFlagManagerSub : public TBoxFlagManager {
|
||||
// virtual ~TBoxFlagManagerSub() {}
|
||||
};
|
||||
|
||||
class EnemyDefeatManagerSub : public EnemyDefeatManager {
|
||||
// virtual ~EnemyDefeatManagerSub() {}
|
||||
};
|
||||
|
||||
|
||||
class StoryflagManagerSub : public StoryflagManager {
|
||||
// virtual ~StoryflagManagerSub() {}
|
||||
};
|
||||
|
||||
class ItemflagManagerSub : public ItemflagManager {
|
||||
// virtual ~ItemflagManagerSub() {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
void setupFlagManagers(EGG::Heap *heap) {
|
||||
if (SceneflagManager::sInstance == nullptr) {
|
||||
SceneflagManager::sInstance = new (heap) SceneflagManager();
|
||||
mHeap m(heap);
|
||||
SceneflagManager::sInstance->doNothing();
|
||||
}
|
||||
|
||||
if (TBoxFlagManager::sInstance == nullptr) {
|
||||
TBoxFlagManager::sInstance = new (heap) TBoxFlagManagerSub();
|
||||
mHeap m(heap);
|
||||
TBoxFlagManager::sInstance->init();
|
||||
}
|
||||
|
||||
if (EnemyDefeatManager::sInstance == nullptr) {
|
||||
EnemyDefeatManager::sInstance = new (heap) EnemyDefeatManagerSub();
|
||||
mHeap m(heap);
|
||||
EnemyDefeatManager::sInstance->init();
|
||||
}
|
||||
|
||||
if (StoryflagManager::sInstance == nullptr) {
|
||||
StoryflagManager::sInstance = new (heap) StoryflagManagerSub();
|
||||
mHeap m(heap);
|
||||
StoryflagManager::sInstance->init();
|
||||
}
|
||||
|
||||
if (ItemflagManager::sInstance == nullptr) {
|
||||
ItemflagManager::sInstance = new (heap) ItemflagManagerSub();
|
||||
mHeap m(heap);
|
||||
ItemflagManager::sInstance->init();
|
||||
}
|
||||
|
||||
if (DungeonflagManager::sInstance == nullptr) {
|
||||
DungeonflagManager::sInstance = new (heap) DungeonflagManager();
|
||||
mHeap m(heap);
|
||||
DungeonflagManager::sInstance->setupFlagStuff();
|
||||
}
|
||||
|
||||
if (SkipflagManager::sInstance == nullptr) {
|
||||
SkipflagManager::sInstance = new (heap) SkipflagManager();
|
||||
mHeap m(heap);
|
||||
SkipflagManager::sInstance->unsetCommitFlag();
|
||||
}
|
||||
|
||||
postSetup();
|
||||
}
|
||||
|
||||
static void postSetup() {
|
||||
updateFlagForFlagIndex(0);
|
||||
}
|
||||
|
||||
void copyAllFlagManagersFromSave() {
|
||||
u16 flag = FileManager::sInstance->getSceneFlagIndex();
|
||||
SceneflagManager::sInstance->copyFromSave(flag);
|
||||
TBoxFlagManager::sInstance->copyFromSave(flag);
|
||||
StoryflagManager::sInstance->copyFlagsFromSave_Priv();
|
||||
ItemflagManager::sInstance->copyFlagsFromSave_Priv();
|
||||
DungeonflagManager::sInstance->copyFromSave(flag);
|
||||
SkipflagManager::sInstance->copyFromSave();
|
||||
EnemyDefeatManager::sInstance->copyFromSave(flag);
|
||||
}
|
||||
|
||||
static void updateFlagForFlagIndex(u16 stage) {}
|
||||
|
||||
extern "C" 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,34 @@
|
||||
#include "toBeSorted/flag_space.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
#include <common.h>
|
||||
|
||||
extern "C" bool checkedMemcpy(void *dest, u32 destLen, const void *src, u32 count);
|
||||
|
||||
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) {}
|
||||
}
|
||||
+1
-1
@@ -42,7 +42,7 @@ TBoxFlagManager::TBoxFlagManager() : CommittableFlagManager(false), mFlagSpace(s
|
||||
void TBoxFlagManager::init() {}
|
||||
|
||||
/* 0x800BE930 */
|
||||
void TBoxFlagManager::copyFromSave(s16 sceneIndex) {
|
||||
void TBoxFlagManager::copyFromSave(u32 sceneIndex) {
|
||||
u16 idx = sceneIndex;
|
||||
mSceneIndex = idx;
|
||||
u16 *flags = FileManager::getInstance()->getTBoxFlagsConst();
|
||||
+3
-1
@@ -1,8 +1,10 @@
|
||||
#include "libc.h"
|
||||
#include "common.h"
|
||||
#include "toBeSorted/bitwise_flag_helper.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
#include "toBeSorted/flag_space.h"
|
||||
|
||||
extern "C" bool checkedMemcpy(void *dest, u32 destLen, const void *src, u32 count);
|
||||
|
||||
class SkipflagManager {
|
||||
public:
|
||||
bool mShouldCommit;
|
||||
@@ -18,13 +18,13 @@ void UnkFlagStuff::prepareIndexShiftMask(u16 counterIdx, u32 unused, u16 *indexP
|
||||
*maskPtr = calculateMask(mpDefinitions[counterIdx].mShiftMask);
|
||||
}
|
||||
|
||||
u16 UnkFlagStuff::maskForIdx(u16 index) {
|
||||
u16 UnkFlagStuff::maskForIdx(u16 index, u16 flagSizeMaybe) {
|
||||
doNothing(index);
|
||||
|
||||
return calculateMask(mpDefinitions[index].mShiftMask);
|
||||
}
|
||||
|
||||
u32 UnkFlagStuff::getCounterOrFlag(u16 counterIdx, u16 *dataPtr, u32 param4) {
|
||||
u16 UnkFlagStuff::getCounterOrFlag(u16 counterIdx, const u16 *dataPtr, u32 param4) {
|
||||
u16 index = 0;
|
||||
u8 shift = 0;
|
||||
u16 mask = 0;
|
||||
@@ -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) {}
|
||||
}
|
||||
Reference in New Issue
Block a user