mirror of
https://github.com/zeldaret/ss
synced 2026-05-24 15:20:58 -04:00
Merge pull request #45 from robojumper/d_rawarchive
d_rawarchive matching and various arc managers
This commit is contained in:
@@ -107,6 +107,7 @@ d/d_player.cpp:
|
||||
|
||||
d/d_rawarchive.cpp:
|
||||
.text start:0x80061B10 end:0x800629D0
|
||||
.data start:0x8050DDD8 end:0x8050DDF8
|
||||
|
||||
d/d_scene.cpp:
|
||||
.text start:0x800629D0 end:0x80062E40
|
||||
@@ -118,6 +119,26 @@ d/d_stage.cpp:
|
||||
d/d_sys.cpp:
|
||||
.text start:0x80064250 end:0x80064920
|
||||
|
||||
toBeSorted/arc_managers/current_stage_arc_manager.cpp:
|
||||
.text start:0x80068FD0 end:0x80069910
|
||||
.ctors start:0x804DB6A8 end:0x804DB6AC
|
||||
.data start:0x8050DFE0 end:0x8050E010
|
||||
.sdata start:0x80571D30 end:0x80571D40
|
||||
.sbss start:0x80575278 end:0x80575280
|
||||
.bss start:0x805A0868 end:0x805A08C8
|
||||
|
||||
toBeSorted/arc_managers/oarc_manager.cpp:
|
||||
.text start:0x80069910 end:0x80069ED4
|
||||
.data start:0x8050E010 end:0x8050E038
|
||||
.sdata start:0x80571D40 end:0x80571D68
|
||||
.sbss start:0x80575280 end:0x80575288
|
||||
|
||||
toBeSorted/arc_managers/layout_arc_manager.cpp:
|
||||
.text start:0x8006A0C0 end:0x8006A2D4
|
||||
.data start:0x8050E048 end:0x8050E054
|
||||
.sdata start:0x80571D68 end:0x80571D70
|
||||
.sbss start:0x80575288 end:0x80575290
|
||||
|
||||
toBeSorted/sceneflag_manager.cpp:
|
||||
.text start:0x800BD8C0 end:0x800BE7A8
|
||||
.sbss start:0x805753E0 end:0x805753F0
|
||||
|
||||
+105
-105
@@ -723,7 +723,7 @@ fn_8001F680 = .text:0x8001F680; // type:function size:0x70
|
||||
fn_8001F6F0 = .text:0x8001F6F0; // type:function size:0x4
|
||||
fn_8001F700 = .text:0x8001F700; // type:function size:0xA8
|
||||
fn_8001F7B0 = .text:0x8001F7B0; // type:function size:0x64
|
||||
fn_8001F820 = .text:0x8001F820; // type:function size:0xD0
|
||||
sprintf__15SizedString<32>FPCce = .text:0x8001F820; // type:function size:0xD0
|
||||
fn_8001F8F0 = .text:0x8001F8F0; // type:function size:0x14
|
||||
fn_8001F910 = .text:0x8001F910; // type:function size:0xD4
|
||||
fn_8001F9F0 = .text:0x8001F9F0; // type:function size:0xB4
|
||||
@@ -1552,7 +1552,7 @@ fn_8003D590 = .text:0x8003D590; // type:function size:0x30
|
||||
fn_8003D5C0 = .text:0x8003D5C0; // type:function size:0x4
|
||||
fn_8003D5D0 = .text:0x8003D5D0; // type:function size:0xC
|
||||
fn_8003D5E0 = .text:0x8003D5E0; // type:function size:0x68
|
||||
fn_8003D650 = .text:0x8003D650; // type:function size:0xD0
|
||||
sprintf__16SizedString<128>FPCce = .text:0x8003D650; // type:function size:0xD0
|
||||
fn_8003D720 = .text:0x8003D720; // type:function size:0x40
|
||||
fn_8003D760 = .text:0x8003D760; // type:function size:0x11C
|
||||
fn_8003D880 = .text:0x8003D880; // type:function size:0x20C
|
||||
@@ -2741,35 +2741,35 @@ fn_80061AB0 = .text:0x80061AB0; // type:function size:0x5C
|
||||
fn_80061B10 = .text:0x80061B10; // type:function size:0x88
|
||||
fn_80061BA0 = .text:0x80061BA0; // type:function size:0x34
|
||||
fn_80061BE0 = .text:0x80061BE0; // type:function size:0x10
|
||||
fn_80061BF0 = .text:0x80061BF0; // type:function size:0x28
|
||||
fn_80061C20 = .text:0x80061C20; // type:function size:0x80
|
||||
fn_80061CA0 = .text:0x80061CA0; // type:function size:0xA0
|
||||
fn_80061D40 = .text:0x80061D40; // type:function size:0x8
|
||||
fn_80061D50 = .text:0x80061D50; // type:function size:0x8
|
||||
fn_80061D60 = .text:0x80061D60; // type:function size:0x104
|
||||
fn_80061E70 = .text:0x80061E70; // type:function size:0x74
|
||||
fn_80061EF0 = .text:0x80061EF0; // type:function size:0xD0
|
||||
fn_80061FC0 = .text:0x80061FC0; // type:function size:0x34
|
||||
fn_80062000 = .text:0x80062000; // type:function size:0x9C
|
||||
fn_800620A0 = .text:0x800620A0; // type:function size:0x104
|
||||
fn_800621B0 = .text:0x800621B0; // type:function size:0x14C
|
||||
fn_80062300 = .text:0x80062300; // type:function size:0x5C
|
||||
fn_80062360 = .text:0x80062360; // type:function size:0x14
|
||||
fn_80062380 = .text:0x80062380; // type:function size:0x74
|
||||
fn_80062400 = .text:0x80062400; // type:function size:0x90
|
||||
fn_80062490 = .text:0x80062490; // type:function size:0xAC
|
||||
fn_80062540 = .text:0x80062540; // type:function size:0xB0
|
||||
fn_800625F0 = .text:0x800625F0; // type:function size:0x44
|
||||
fn_80062640 = .text:0x80062640; // type:function size:0x44
|
||||
fn_80062690 = .text:0x80062690; // type:function size:0x2C
|
||||
fn_800626C0 = .text:0x800626C0; // type:function size:0x5C
|
||||
fn_80062720 = .text:0x80062720; // type:function size:0x60
|
||||
fn_80062780 = .text:0x80062780; // type:function size:0x80
|
||||
fn_80062800 = .text:0x80062800; // type:function size:0x34
|
||||
fn_80062840 = .text:0x80062840; // type:function size:0x80
|
||||
fn_800628C0 = .text:0x800628C0; // type:function size:0x90
|
||||
fn_80062950 = .text:0x80062950; // type:function size:0x34
|
||||
fn_80062990 = .text:0x80062990; // type:function size:0x40
|
||||
__ct__14dRawArcEntry_cFv = .text:0x80061BF0; // type:function size:0x28
|
||||
__dt__14dRawArcEntry_cFv = .text:0x80061C20; // type:function size:0x80
|
||||
searchCallback__14dRawArcEntry_cFPvPvPC11ARCDirEntryPCcb = .text:0x80061CA0; // type:function size:0xA0
|
||||
searchCallback1__14dRawArcEntry_cFPvPvPC11ARCDirEntryPCc = .text:0x80061D40; // type:function size:0x8
|
||||
searchCallback2__14dRawArcEntry_cFPvPvPC11ARCDirEntryPCc = .text:0x80061D50; // type:function size:0x8
|
||||
destroy__14dRawArcEntry_cFPv = .text:0x80061D60; // type:function size:0x104
|
||||
loadArcFromDiskChecked__14dRawArcEntry_cFPCcPCcUcPQ23EGG4Heap = .text:0x80061E70; // type:function size:0x74
|
||||
loadArcFromDisk__14dRawArcEntry_cFPCcPCcUcPQ23EGG4Heap = .text:0x80061EF0; // type:function size:0xD0
|
||||
checkArcExistsOnDisk__14dRawArcEntry_cFPCcPCc = .text:0x80061FC0; // type:function size:0x34
|
||||
checkArcExistsOnDiskInner__14dRawArcEntry_cFR16SizedString<128>PCcPCc = .text:0x80062000; // type:function size:0x9C
|
||||
mount__14dRawArcEntry_cFPCcPvPvUcPQ23EGG4Heap = .text:0x800620A0; // type:function size:0x104
|
||||
ensureLoadedMaybe__14dRawArcEntry_cFPv = .text:0x800621B0; // type:function size:0x14C
|
||||
onMount__14dRawArcEntry_cFPv = .text:0x80062300; // type:function size:0x5C
|
||||
__ct__14dRawArcTable_cFv = .text:0x80062360; // type:function size:0x14
|
||||
__dt__14dRawArcTable_cFv = .text:0x80062380; // type:function size:0x74
|
||||
init__14dRawArcTable_cFUsPvPQ23EGG4Heap = .text:0x80062400; // type:function size:0x90
|
||||
getArcOrLoadFromDisk__14dRawArcTable_cFPCcPCcUcPQ23EGG4Heap = .text:0x80062490; // type:function size:0xAC
|
||||
addEntryFromSuperArc__14dRawArcTable_cFPCcPvUcPQ23EGG4Heap = .text:0x80062540; // type:function size:0xB0
|
||||
ensureLoadedMaybe2__14dRawArcTable_cFPCc = .text:0x800625F0; // type:function size:0x44
|
||||
ensureLoadedMaybe__14dRawArcTable_cFPCc = .text:0x80062640; // type:function size:0x44
|
||||
hasEntry__14dRawArcTable_cFPCc = .text:0x80062690; // type:function size:0x2C
|
||||
decreaseRefCount__14dRawArcTable_cFPCc = .text:0x800626C0; // type:function size:0x5C
|
||||
getDataFromOarc__14dRawArcTable_cFPCcPCc = .text:0x80062720; // type:function size:0x60
|
||||
getSubEntryData__14dRawArcTable_cFPCcPCc = .text:0x80062780; // type:function size:0x80
|
||||
getLoadedArcData__14dRawArcTable_cFPCc = .text:0x80062800; // type:function size:0x34
|
||||
ensureAllEntriesLoaded__14dRawArcTable_cFv = .text:0x80062840; // type:function size:0x80
|
||||
findEntry__14dRawArcTable_cCFPCc = .text:0x800628C0; // type:function size:0x90
|
||||
findEmptySlot__14dRawArcTable_cFv = .text:0x80062950; // type:function size:0x34
|
||||
findLoadedEntry__14dRawArcTable_cFPCc = .text:0x80062990; // type:function size:0x40
|
||||
fn_800629D0 = .text:0x800629D0; // type:function size:0x60
|
||||
fn_80062A30 = .text:0x80062A30; // type:function size:0x50
|
||||
fn_80062A80 = .text:0x80062A80; // type:function size:0x58
|
||||
@@ -2982,58 +2982,58 @@ fn_80068E70 = .text:0x80068E70; // type:function size:0xC
|
||||
fn_80068E80 = .text:0x80068E80; // type:function size:0x6C
|
||||
fn_80068EF0 = .text:0x80068EF0; // type:function size:0xC0
|
||||
fn_80068FB0 = .text:0x80068FB0; // type:function size:0x20
|
||||
fn_80068FD0 = .text:0x80068FD0; // type:function size:0x54
|
||||
fn_80069030 = .text:0x80069030; // type:function size:0x64
|
||||
fn_800690A0 = .text:0x800690A0; // type:function size:0x14
|
||||
fn_800690C0 = .text:0x800690C0; // type:function size:0x218
|
||||
fn_800692E0 = .text:0x800692E0; // type:function size:0x38
|
||||
fn_80069320 = .text:0x80069320; // type:function size:0x14
|
||||
fn_80069340 = .text:0x80069340; // type:function size:0x14
|
||||
fn_80069360 = .text:0x80069360; // type:function size:0x10C
|
||||
fn_80069470 = .text:0x80069470; // type:function size:0x5C
|
||||
fn_800694D0 = .text:0x800694D0; // type:function size:0x74
|
||||
fn_80069550 = .text:0x80069550; // type:function size:0x38
|
||||
fn_80069590 = .text:0x80069590; // type:function size:0x3C
|
||||
fn_800695D0 = .text:0x800695D0; // type:function size:0x28
|
||||
fn_80069600 = .text:0x80069600; // type:function size:0x48
|
||||
fn_80069650 = .text:0x80069650; // type:function size:0x48
|
||||
fn_800696A0 = .text:0x800696A0; // type:function size:0x8
|
||||
fn_800696B0 = .text:0x800696B0; // type:function size:0x12C
|
||||
fn_800697E0 = .text:0x800697E0; // type:function size:0xB0
|
||||
fn_80069890 = .text:0x80069890; // type:function size:0x64
|
||||
fn_80069900 = .text:0x80069900; // type:function size:0x10
|
||||
fn_80069910 = .text:0x80069910; // type:function size:0x44
|
||||
fn_80069960 = .text:0x80069960; // type:function size:0x64
|
||||
fn_800699D0 = .text:0x800699D0; // type:function size:0x14
|
||||
fn_800699F0 = .text:0x800699F0; // type:function size:0x34
|
||||
fn_80069A30 = .text:0x80069A30; // type:function size:0x48
|
||||
fn_80069A80 = .text:0x80069A80; // type:function size:0x44
|
||||
fn_80069AD0 = .text:0x80069AD0; // type:function size:0x8
|
||||
fn_80069AE0 = .text:0x80069AE0; // type:function size:0x8
|
||||
fn_80069AF0 = .text:0x80069AF0; // type:function size:0x30
|
||||
fn_80069B20 = .text:0x80069B20; // type:function size:0x8
|
||||
fn_80069B30 = .text:0x80069B30; // type:function size:0x10
|
||||
fn_80069B40 = .text:0x80069B40; // type:function size:0x10
|
||||
fn_80069B50 = .text:0x80069B50; // type:function size:0x10
|
||||
fn_80069B60 = .text:0x80069B60; // type:function size:0x178
|
||||
fn_80069CE0 = .text:0x80069CE0; // type:function size:0x178
|
||||
fn_80069E60 = .text:0x80069E60; // type:function size:0x8
|
||||
fn_80069E70 = .text:0x80069E70; // type:function size:0x64
|
||||
__ct__22CurrentStageArcManagerFv = .text:0x80068FD0; // type:function size:0x54
|
||||
__dt__22CurrentStageArcManagerFv = .text:0x80069030; // type:function size:0x64
|
||||
init__22CurrentStageArcManagerFPQ23EGG4Heap = .text:0x800690A0; // type:function size:0x14
|
||||
setStage__22CurrentStageArcManagerFPCc = .text:0x800690C0; // type:function size:0x218
|
||||
decrement__22CurrentStageArcManagerFv = .text:0x800692E0; // type:function size:0x38
|
||||
getData__22CurrentStageArcManagerFPCc = .text:0x80069320; // type:function size:0x14
|
||||
getFileFromCurrentLay0Arc__22CurrentStageArcManagerFPCc = .text:0x80069340; // type:function size:0x14
|
||||
loadFileFromExtraLayerArc__22CurrentStageArcManagerFi = .text:0x80069360; // type:function size:0x10C
|
||||
unloadExtraLayerArc__22CurrentStageArcManagerFv = .text:0x80069470; // type:function size:0x5C
|
||||
loadRoomArc__22CurrentStageArcManagerFi = .text:0x800694D0; // type:function size:0x74
|
||||
addEntryFromSuperArc__22CurrentStageArcManagerFPCcPv = .text:0x80069550; // type:function size:0x38
|
||||
unloadRoomArc__22CurrentStageArcManagerFi = .text:0x80069590; // type:function size:0x3C
|
||||
decrement__22CurrentStageArcManagerFPCc = .text:0x800695D0; // type:function size:0x28
|
||||
loadFromRoomArc__22CurrentStageArcManagerFiPCc = .text:0x80069600; // type:function size:0x48
|
||||
getDataFromRoomArc__22CurrentStageArcManagerFiPCc = .text:0x80069650; // type:function size:0x48
|
||||
getHeap__Fv = .text:0x800696A0; // type:function size:0x8
|
||||
getCurrentStageDirectory__22CurrentStageArcManagerFv = .text:0x800696B0; // type:function size:0x12C
|
||||
getRoomArcDirectory__22CurrentStageArcManagerCFi = .text:0x800697E0; // type:function size:0xB0
|
||||
create__22CurrentStageArcManagerFPQ23EGG4Heap = .text:0x80069890; // type:function size:0x64
|
||||
__sinit_\current_stage_arc_manager_cpp = .text:0x80069900; // type:function size:0x10 scope:local
|
||||
__ct__11OarcManagerFv = .text:0x80069910; // type:function size:0x44
|
||||
__dt__11OarcManagerFv = .text:0x80069960; // type:function size:0x64
|
||||
init__11OarcManagerFPQ23EGG4Heap = .text:0x800699D0; // type:function size:0x14
|
||||
checkIfObjectArcExistsOnDisk__11OarcManagerFPCc = .text:0x800699F0; // type:function size:0x34
|
||||
loadObjectArcFromDisk__11OarcManagerFPCcPQ23EGG4Heap = .text:0x80069A30; // type:function size:0x48
|
||||
addEntryFromSuperArc__11OarcManagerFPCcPvPQ23EGG4Heap = .text:0x80069A80; // type:function size:0x44
|
||||
ensureLoaded1__11OarcManagerFPCc = .text:0x80069AD0; // type:function size:0x8
|
||||
ensureLoaded2__11OarcManagerFPCc = .text:0x80069AE0; // type:function size:0x8
|
||||
decrement__11OarcManagerFPCc = .text:0x80069AF0; // type:function size:0x30
|
||||
getData__11OarcManagerFPCcPCc = .text:0x80069B20; // type:function size:0x8
|
||||
getMdlFromArc2__11OarcManagerFPCc = .text:0x80069B30; // type:function size:0x10
|
||||
getMdlFromArc__11OarcManagerFPCc = .text:0x80069B40; // type:function size:0x10
|
||||
getZevFromArc__11OarcManagerFPCc = .text:0x80069B50; // type:function size:0x10
|
||||
getDzbFromArc__11OarcManagerFPCcPCc = .text:0x80069B60; // type:function size:0x178
|
||||
getPlcFromArc__11OarcManagerFPCcPCc = .text:0x80069CE0; // type:function size:0x178
|
||||
getSubEntryData__11OarcManagerFPCcPCc = .text:0x80069E60; // type:function size:0x8
|
||||
create__11OarcManagerFPQ23EGG4Heap = .text:0x80069E70; // type:function size:0x64
|
||||
fn_80069EE0 = .text:0x80069EE0; // type:function size:0x6C
|
||||
fn_80069F50 = .text:0x80069F50; // type:function size:0xC
|
||||
fn_80069F60 = .text:0x80069F60; // type:function size:0x88
|
||||
fn_80069FF0 = .text:0x80069FF0; // type:function size:0xC4
|
||||
fn_8006A0C0 = .text:0x8006A0C0; // type:function size:0x44
|
||||
fn_8006A110 = .text:0x8006A110; // type:function size:0x64
|
||||
fn_8006A180 = .text:0x8006A180; // type:function size:0x14
|
||||
fn_8006A1A0 = .text:0x8006A1A0; // type:function size:0x48
|
||||
fn_8006A1F0 = .text:0x8006A1F0; // type:function size:0x8
|
||||
fn_8006A200 = .text:0x8006A200; // type:function size:0x8
|
||||
fn_8006A210 = .text:0x8006A210; // type:function size:0x8
|
||||
fn_8006A220 = .text:0x8006A220; // type:function size:0x30
|
||||
fn_8006A250 = .text:0x8006A250; // type:function size:0x8
|
||||
fn_8006A260 = .text:0x8006A260; // type:function size:0x8
|
||||
fn_8006A270 = .text:0x8006A270; // type:function size:0x64
|
||||
__ct__16LayoutArcManagerFv = .text:0x8006A0C0; // type:function size:0x44
|
||||
__dt__16LayoutArcManagerFv = .text:0x8006A110; // type:function size:0x64
|
||||
init__16LayoutArcManagerFPQ23EGG4Heap = .text:0x8006A180; // type:function size:0x14
|
||||
loadLayoutArcFromDisk__16LayoutArcManagerFPCcPQ23EGG4Heap = .text:0x8006A1A0; // type:function size:0x48
|
||||
ensureLoaded1__16LayoutArcManagerFPCc = .text:0x8006A1F0; // type:function size:0x8
|
||||
ensureLoaded2__16LayoutArcManagerFPCc = .text:0x8006A200; // type:function size:0x8
|
||||
hasEntry__16LayoutArcManagerFPCc = .text:0x8006A210; // type:function size:0x8
|
||||
decrement__16LayoutArcManagerFPCc = .text:0x8006A220; // type:function size:0x30
|
||||
getData__16LayoutArcManagerFPCcPCc = .text:0x8006A250; // type:function size:0x8
|
||||
getLoadedData__16LayoutArcManagerFPCc = .text:0x8006A260; // type:function size:0x8
|
||||
create__16LayoutArcManagerFPQ23EGG4Heap = .text:0x8006A270; // type:function size:0x64
|
||||
fn_8006A2E0 = .text:0x8006A2E0; // type:function size:0x6C
|
||||
fn_8006A350 = .text:0x8006A350; // type:function size:0xC
|
||||
fn_8006A360 = .text:0x8006A360; // type:function size:0x88
|
||||
@@ -26141,7 +26141,7 @@ getFileFast__Q23EGG7ArchiveFlPQ23EGG4Heapl = .text:0x80493DC0; // type:function
|
||||
countFileCallbackFunc__3EGGFPvPvUlPC11ARCDirEntryPCc = .text:0x80493F10; // type:function size:0x18
|
||||
countFile__Q23EGG7ArchiveFv = .text:0x80493F30; // type:function size:0x38
|
||||
searchInsideWithPath__3EGGFPQ23EGG7ArchiveP9ARCHandlePFPvPvUlPC11ARCDirEntryPCc_vPvPcUl = .text:0x80493F70; // type:function size:0x144
|
||||
searchInside__Q23EGG7ArchiveFPFPvPvUlPC11ARCDirEntryPCc_vPv = .text:0x804940C0; // type:function size:0x74
|
||||
searchInside__Q23EGG7ArchiveFPFPvPvPC11ARCDirEntryPCc_vPv = .text:0x804940C0; // type:function size:0x74
|
||||
loadFromDisc__EGG__Archive = .text:0x80494140; // type:function size:0x114
|
||||
initialize__Q23EGG7DvdFileFv = .text:0x80494260; // type:function size:0x40
|
||||
__ct__Q23EGG7DvdFileFv = .text:0x804942A0; // type:function size:0x44
|
||||
@@ -27385,11 +27385,11 @@ strlen = .text:0x804C64DC; // type:function size:0x1C scope:weak
|
||||
__va_arg = .text:0x804C64F8; // type:function size:0xC8 scope:global
|
||||
__register_global_object = .text:0x804C65C0; // type:function size:0x18 scope:global
|
||||
__destroy_global_chain = .text:0x804C65D8; // type:function size:0x48 scope:global
|
||||
fn_804C6620 = .text:0x804C6620; // type:function size:0x104
|
||||
__construct_new_array = .text:0x804C6620; // type:function size:0x104
|
||||
fn_804C6724 = .text:0x804C6724; // type:function size:0xBC
|
||||
__construct_array = .text:0x804C67E0; // type:function size:0xF8
|
||||
__destroy_arr = .text:0x804C68D8; // type:function size:0x78
|
||||
fn_804C6950 = .text:0x804C6950; // type:function size:0x80
|
||||
__destroy_new_array = .text:0x804C6950; // type:function size:0x80
|
||||
__ptmf_test = .text:0x804C69D0; // type:function size:0x30
|
||||
fn_804C6A00 = .text:0x804C6A00; // type:function size:0x3C
|
||||
__ptmf_scall = .text:0x804C6A3C; // type:function size:0x28
|
||||
@@ -30762,8 +30762,8 @@ lbl_8050DD58 = .data:0x8050DD58; // type:object size:0x18
|
||||
lbl_8050DD70 = .data:0x8050DD70; // type:object size:0x30
|
||||
lbl_8050DDA0 = .data:0x8050DDA0; // type:object size:0x18
|
||||
lbl_8050DDB8 = .data:0x8050DDB8; // type:object size:0x20
|
||||
lbl_8050DDD8 = .data:0x8050DDD8; // type:object size:0x10
|
||||
lbl_8050DDE8 = .data:0x8050DDE8; // type:object size:0x10
|
||||
lbl_8050DDD8 = .data:0x8050DDD8; // type:object size:0xE data:string
|
||||
lbl_8050DDE8 = .data:0x8050DDE8; // type:object size:0xB data:string
|
||||
lbl_8050DDF8 = .data:0x8050DDF8; // type:object size:0x50
|
||||
lbl_8050DE48 = .data:0x8050DE48; // type:object size:0x10
|
||||
lbl_8050DE58 = .data:0x8050DE58; // type:object size:0x5C
|
||||
@@ -30783,15 +30783,15 @@ lbl_8050DFB0 = .data:0x8050DFB0; // type:object size:0xC
|
||||
lbl_8050DFBC = .data:0x8050DFBC; // type:object size:0xC
|
||||
lbl_8050DFC8 = .data:0x8050DFC8; // type:object size:0xC
|
||||
lbl_8050DFD4 = .data:0x8050DFD4; // type:object size:0xC
|
||||
lbl_8050DFE0 = .data:0x8050DFE0; // type:object size:0xC
|
||||
lbl_8050DFEC = .data:0x8050DFEC; // type:object size:0xC
|
||||
lbl_8050DFF8 = .data:0x8050DFF8; // type:object size:0xC
|
||||
lbl_8050E004 = .data:0x8050E004; // type:object size:0xC
|
||||
lbl_8050DFE0 = .data:0x8050DFE0; // type:object size:0xA data:string
|
||||
lbl_8050DFEC = .data:0x8050DFEC; // type:object size:0xB data:string
|
||||
lbl_8050DFF8 = .data:0x8050DFF8; // type:object size:0x9 data:string
|
||||
__vt__22CurrentStageArcManager = .data:0x8050E004; // type:object size:0xC
|
||||
lbl_8050E010 = .data:0x8050E010; // type:object size:0x10 data:string
|
||||
lbl_8050E020 = .data:0x8050E020; // type:object size:0xC data:string
|
||||
lbl_8050E02C = .data:0x8050E02C; // type:object size:0xC
|
||||
__vt__11OarcManager = .data:0x8050E02C; // type:object size:0xC
|
||||
lbl_8050E038 = .data:0x8050E038; // type:object size:0x10
|
||||
lbl_8050E048 = .data:0x8050E048; // type:object size:0xC
|
||||
__vt__16LayoutArcManager = .data:0x8050E048; // type:object size:0xC
|
||||
lbl_8050E054 = .data:0x8050E054; // type:object size:0xC
|
||||
lbl_8050E060 = .data:0x8050E060; // type:object size:0x30
|
||||
lbl_8050E090 = .data:0x8050E090; // type:object size:0x2FC
|
||||
@@ -35664,7 +35664,7 @@ lbl_80541980 = .data:0x80541980; // type:object size:0x28
|
||||
lbl_805419A8 = .data:0x805419A8; // type:object size:0x40
|
||||
lbl_805419E8 = .data:0x805419E8; // type:object size:0xC data:string
|
||||
lbl_805419F4 = .data:0x805419F4; // type:object size:0xC data:string
|
||||
lbl_80541A00 = .data:0x80541A00; // type:object size:0x10
|
||||
@LOCAL@getModuleTypeString__20DynamicModuleControlCFv@REL_LOAD_TYPES = .data:0x80541A00; // type:object size:0x10
|
||||
__vt__20DynamicModuleControl = .data:0x80541A10; // type:object size:0x30
|
||||
__vt__24DynamicModuleControlBase = .data:0x80541A40; // type:object size:0x30
|
||||
lbl_80541A70 = .data:0x80541A70; // type:object size:0x808
|
||||
@@ -37658,14 +37658,14 @@ lbl_80571D10 = .sdata:0x80571D10; // type:object size:0x8
|
||||
lbl_80571D18 = .sdata:0x80571D18; // type:object size:0x8
|
||||
lbl_80571D20 = .sdata:0x80571D20; // type:object size:0x8
|
||||
lbl_80571D28 = .sdata:0x80571D28; // type:object size:0x8 data:string
|
||||
lbl_80571D30 = .sdata:0x80571D30; // type:object size:0x8
|
||||
lbl_80571D38 = .sdata:0x80571D38; // type:object size:0x8
|
||||
lbl_80571D40 = .sdata:0x80571D40; // type:object size:0x8
|
||||
lbl_80571D48 = .sdata:0x80571D48; // type:object size:0x8
|
||||
lbl_80571D50 = .sdata:0x80571D50; // type:object size:0x8
|
||||
lbl_80571D58 = .sdata:0x80571D58; // type:object size:0x8
|
||||
lbl_80571D60 = .sdata:0x80571D60; // type:object size:0x8
|
||||
lbl_80571D68 = .sdata:0x80571D68; // type:object size:0x8
|
||||
lbl_80571D30 = .sdata:0x80571D30; // type:object size:0x7 data:string
|
||||
lbl_80571D38 = .sdata:0x80571D38; // type:object size:0x7 data:string
|
||||
lbl_80571D40 = .sdata:0x80571D40; // type:object size:0x7 data:string
|
||||
lbl_80571D48 = .sdata:0x80571D48; // type:object size:0x5 data:string
|
||||
lbl_80571D50 = .sdata:0x80571D50; // type:object size:0x5 data:string
|
||||
lbl_80571D58 = .sdata:0x80571D58; // type:object size:0x5 data:string
|
||||
lbl_80571D60 = .sdata:0x80571D60; // type:object size:0x5 data:string
|
||||
lbl_80571D68 = .sdata:0x80571D68; // type:object size:0x7 data:string
|
||||
lbl_80571D70 = .sdata:0x80571D70; // type:object size:0x4
|
||||
lbl_80571D74 = .sdata:0x80571D74; // type:object size:0x4
|
||||
lbl_80571D78 = .sdata:0x80571D78; // type:object size:0x4 data:wstring
|
||||
@@ -39821,10 +39821,10 @@ lbl_80575260 = .sbss:0x80575260; // type:object size:0x8 data:4byte
|
||||
lbl_80575268 = .sbss:0x80575268; // type:object size:0x8 data:4byte
|
||||
lbl_80575270 = .sbss:0x80575270; // type:object size:0x1 data:byte
|
||||
lbl_80575274 = .sbss:0x80575274; // type:object size:0x4 data:4byte
|
||||
lbl_80575278 = .sbss:0x80575278; // type:object size:0x4 data:4byte
|
||||
lbl_8057527C = .sbss:0x8057527C; // type:object size:0x1 data:byte
|
||||
lbl_80575280 = .sbss:0x80575280; // type:object size:0x8 data:4byte
|
||||
lbl_80575288 = .sbss:0x80575288; // type:object size:0x8 data:4byte
|
||||
sInstance__22CurrentStageArcManager = .sbss:0x80575278; // type:object size:0x4 data:4byte
|
||||
@GUARD@getCurrentStageDirectory__22CurrentStageArcManagerFv@sStageDirTmp = .sbss:0x8057527C; // type:object size:0x1 data:byte
|
||||
sInstance__11OarcManager = .sbss:0x80575280; // type:object size:0x4 data:4byte
|
||||
sInstance__16LayoutArcManager = .sbss:0x80575288; // type:object size:0x8 data:4byte
|
||||
lbl_80575290 = .sbss:0x80575290; // type:object size:0x4
|
||||
lbl_80575294 = .sbss:0x80575294; // type:object size:0x4
|
||||
lbl_80575298 = .sbss:0x80575298; // type:object size:0x4 data:4byte
|
||||
@@ -48208,8 +48208,8 @@ lbl_805A07E4 = .bss:0x805A07E4; // type:object size:0xC
|
||||
lbl_805A07F0 = .bss:0x805A07F0; // type:object size:0xC
|
||||
lbl_805A07FC = .bss:0x805A07FC; // type:object size:0x44 data:byte
|
||||
lbl_805A0840 = .bss:0x805A0840; // type:object size:0x28 data:byte
|
||||
lbl_805A0868 = .bss:0x805A0868; // type:object size:0x40 data:byte
|
||||
lbl_805A08A8 = .bss:0x805A08A8; // type:object size:0x20 data:byte
|
||||
@LOCAL@getCurrentStageDirectory__22CurrentStageArcManagerFv@sStageDirTmp = .bss:0x805A0868; // type:object size:0x40 data:byte
|
||||
s_roomArcTmp = .bss:0x805A08A8; // type:object size:0x20 data:byte
|
||||
lbl_805A08C8 = .bss:0x805A08C8; // type:object size:0x138 data:2byte
|
||||
lbl_805A0A00 = .bss:0x805A0A00; // type:object size:0x28 data:byte
|
||||
lbl_805A0A28 = .bss:0x805A0A28; // type:object size:0x28 data:byte
|
||||
|
||||
@@ -287,10 +287,14 @@ config.libs = [
|
||||
Object(NonMatching, "d/d_dvd_unk.cpp"),
|
||||
Object(NonMatching, "d/d_dylink.cpp"),
|
||||
Object(NonMatching, "d/d_heap.cpp"),
|
||||
Object(Matching, "d/d_rawarchive.cpp"),
|
||||
Object(NonMatching, "d/d_stage.cpp"),
|
||||
Object(NonMatching, "d/d_sys.cpp"),
|
||||
Object(NonMatching, "d/a/d_a_base.cpp"),
|
||||
Object(NonMatching, "d/a/obj/d_a_obj_base.cpp"),
|
||||
Object(Matching, "toBeSorted/arc_managers/current_stage_arc_manager.cpp"),
|
||||
Object(Matching, "toBeSorted/arc_managers/oarc_manager.cpp"),
|
||||
Object(Matching, "toBeSorted/arc_managers/layout_arc_manager.cpp"),
|
||||
Object(Matching, "toBeSorted/save_file.cpp"),
|
||||
Object(Matching, "toBeSorted/counters/counter.cpp"),
|
||||
Object(Matching, "toBeSorted/counters/rupee_counter.cpp"),
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
#ifndef D_RAWARCHIVE_H
|
||||
#define D_RAWARCHIVE_H
|
||||
|
||||
#include <common.h>
|
||||
#include <m/m_dvd.h>
|
||||
// clang-format off
|
||||
#include <sized_string.h>
|
||||
// clang-format on
|
||||
|
||||
// TODO: loading status could be an enum (-2/-1/0/+1)
|
||||
|
||||
// Ghidra: ArcManagerEntry
|
||||
// size: 0x40
|
||||
class dRawArcEntry_c {
|
||||
public:
|
||||
dRawArcEntry_c();
|
||||
~dRawArcEntry_c();
|
||||
|
||||
bool destroy(void *arg);
|
||||
bool loadArcFromDiskChecked(const char *fileName, const char *dirName, u8 mountDirection, EGG::Heap *heap);
|
||||
bool loadArcFromDisk(const char *fileName, const char *dirName, u8 mountDirection, EGG::Heap *heap);
|
||||
static BOOL checkArcExistsOnDisk(const char *fileName, const char *dirName);
|
||||
static BOOL checkArcExistsOnDiskInner(SizedString<128> &path, const char *fileName, const char *dirName);
|
||||
|
||||
int mount(const char *name, void *data, void *callbackArg, u8 mountDirection, EGG::Heap *heap);
|
||||
int onMount(void *callbackArg);
|
||||
|
||||
int ensureLoadedMaybe(void *callbackArg);
|
||||
|
||||
inline bool isReferenced() {
|
||||
return mRefCount != 0;
|
||||
}
|
||||
|
||||
inline const char *name() const {
|
||||
return &mArcName;
|
||||
}
|
||||
|
||||
inline bool isNotLoaded() {
|
||||
return mpArc == nullptr;
|
||||
}
|
||||
|
||||
inline bool isLoading() {
|
||||
return mpDvdReq != nullptr;
|
||||
}
|
||||
|
||||
inline void increaseRefCount() {
|
||||
mRefCount++;
|
||||
}
|
||||
|
||||
inline void decreaseRefCount() {
|
||||
mRefCount--;
|
||||
}
|
||||
|
||||
inline void *getData() {
|
||||
return mpData;
|
||||
}
|
||||
|
||||
inline EGG::Archive *getArc() {
|
||||
return mpArc;
|
||||
}
|
||||
|
||||
private:
|
||||
static void searchCallback(void *, void *, const ARCDirEntry *, const char *, bool);
|
||||
static void searchCallback1(void *, void *, const ARCDirEntry *, const char *);
|
||||
static void searchCallback2(void *, void *, const ARCDirEntry *, const char *);
|
||||
|
||||
private:
|
||||
/* 0x00 */ SizedString<32> mArcName;
|
||||
/* 0x20 */ u16 mRefCount;
|
||||
/* 0x24 */ mDvd_mountMemArchive_c *mpDvdReq;
|
||||
/* 0x28 */ EGG::Archive *mpArc;
|
||||
/* 0x2C */ EGG::Heap *mpCommandHeap;
|
||||
/* 0x30 */ void *mpData;
|
||||
/* 0x34 */ u32 mAmountRead;
|
||||
/* 0x38 */ u32 mChecksum;
|
||||
/* 0x3C */ EGG::FrmHeap *mpFrmHeap;
|
||||
};
|
||||
|
||||
// Ghidra: ArcManagerEntryTable
|
||||
// size: 0xC
|
||||
class dRawArcTable_c {
|
||||
public:
|
||||
dRawArcTable_c();
|
||||
~dRawArcTable_c();
|
||||
|
||||
bool init(u16 count, void *callbackArg, EGG::Heap *heap);
|
||||
BOOL getArcOrLoadFromDisk(const char *name, const char *dirName, u8 mountDirection, EGG::Heap *heap);
|
||||
BOOL addEntryFromSuperArc(const char *name, void *data, u8 mountDirection, EGG::Heap *heap);
|
||||
int ensureLoadedMaybe2(const char *name);
|
||||
int ensureLoadedMaybe(const char *name);
|
||||
bool hasEntry(const char *name);
|
||||
BOOL decreaseRefCount(const char *name);
|
||||
void *getDataFromOarc(const char *name, const char *path);
|
||||
void *getSubEntryData(const char *name, const char *path);
|
||||
void *getLoadedArcData(const char *name);
|
||||
int ensureAllEntriesLoaded();
|
||||
dRawArcEntry_c *findEntry(const char *name) const;
|
||||
dRawArcEntry_c *findEmptySlot();
|
||||
dRawArcEntry_c *findLoadedEntry(const char *name);
|
||||
|
||||
private:
|
||||
/* 0x0 */ dRawArcEntry_c *mpEntries;
|
||||
/* 0x4 */ u16 mCount;
|
||||
/* 0x8 */ void *mCallbackArg;
|
||||
};
|
||||
|
||||
#endif;
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
/* 80493a40 */ static Archive *mountNandFile(NANDFileInfo *, Heap *heap, s32 align);
|
||||
/* 80493ac0 */ static Archive *loadFST(const char *fileName, Heap *heap, s32 align);
|
||||
/* 80493b80 */ void unmount();
|
||||
/* 80493c20 */ u32 getFile(const char *name, FileInfo *out);
|
||||
/* 80493c20 */ void *getFile(const char *name, FileInfo *out);
|
||||
/* 80493cf0 */ s32 convertPathToEntryID(const char *path);
|
||||
/* 80493d00 */ void *getFileFast(s32 entryId, FileInfo *fileinfo);
|
||||
/* 80493dc0 */ void *getFileFast(s32 entryId, Heap *heap, s32 align);
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public:
|
||||
/* 802f1590 */ static void createCommandHeap(size_t size, EGG::Heap *parentHeap);
|
||||
/* 802f15c0 */ static void createDylinkHeap(size_t size, EGG::Heap *parentHeap);
|
||||
/* 802f15f0 */ static EGG::AssertHeap *createAssertHeap(EGG::Heap *parentHeap);
|
||||
/* 802f1640 */ static EGG::Heap *makeHeapOnCurrentGameHeap(size_t size, const char *name, u32 align, u32 flags);
|
||||
/* 802f1640 */ static EGG::FrmHeap *makeHeapOnCurrentGameHeap(size_t size, const char *name, u32 align, u32 flags);
|
||||
|
||||
static int getDefaultGameHeapId();
|
||||
|
||||
|
||||
@@ -74,9 +74,9 @@ typedef struct ARCEntry {
|
||||
|
||||
typedef struct ARCDirEntry {
|
||||
ARCHandle *handle; // at 0x0
|
||||
u32 path_begin; // at 0x4
|
||||
u32 path_it; // at 0x8
|
||||
u32 path_end; // at 0xC
|
||||
u32 entryNum; // at 0x4
|
||||
u32 isDir; // at 0x8
|
||||
const char *name; // at 0xC
|
||||
} ARCDirEntry;
|
||||
|
||||
BOOL ARCGetCurrentDir(ARCHandle *handle, char *string, u32 maxlen);
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
#ifndef SIZED_STRING_H
|
||||
#define SIZED_STRING_H
|
||||
|
||||
#include <MSL_C/string.h>
|
||||
|
||||
/**
|
||||
* A statically sized string buffer used for resource
|
||||
* identification where strings are guaranteed to be short.
|
||||
*
|
||||
* Note: We aren't aware of any other projects that use a similar
|
||||
* class and given that SS has no debugging info anywhere it's hard
|
||||
* to be certain about anything.
|
||||
*/
|
||||
template <size_t Size>
|
||||
struct SizedString {
|
||||
SizedString() {
|
||||
mChars[0] = '\0';
|
||||
}
|
||||
|
||||
SizedString(const char *src) {
|
||||
operator=(src);
|
||||
}
|
||||
|
||||
char mChars[Size];
|
||||
|
||||
char *operator&() {
|
||||
return mChars;
|
||||
}
|
||||
|
||||
const char *operator&() const {
|
||||
return mChars;
|
||||
}
|
||||
|
||||
void operator=(const char *src) {
|
||||
if (src != mChars) {
|
||||
mChars[0] = '\0';
|
||||
operator+=(src);
|
||||
}
|
||||
}
|
||||
|
||||
void operator+=(const char *src) {
|
||||
if (src != nullptr) {
|
||||
size_t destLen = strlen(mChars);
|
||||
size_t copyLen = strlen(src);
|
||||
|
||||
// Make sure copy length isnt more than destination length
|
||||
if (destLen + copyLen + 1 >= Size) {
|
||||
size_t tmpLen = Size - destLen;
|
||||
copyLen = tmpLen - 1;
|
||||
}
|
||||
|
||||
strncpy(mChars + destLen, src, copyLen);
|
||||
|
||||
// make sure string is null terminated
|
||||
size_t offset = destLen + copyLen;
|
||||
mChars[offset] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
int sprintf(const char *fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
int printed = vsnprintf(this->mChars, Size, fmt, args);
|
||||
if (printed != strlen(this->mChars)) {
|
||||
this->mChars[0] = '\0';
|
||||
}
|
||||
va_end(list);
|
||||
return printed;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,37 +0,0 @@
|
||||
#ifndef ARC_MANAGER_H
|
||||
#define ARC_MANAGER_H
|
||||
|
||||
#include <common.h>
|
||||
|
||||
// Ghidra: ArcManagerEntry
|
||||
// size: 0x40
|
||||
struct ArcManagerEntry {
|
||||
/* 0x00 */ char arc_name[0x20];
|
||||
/* 0x20 */ u16 ref_count;
|
||||
/* 0x24 */ int dvd_req_ptr;
|
||||
/* 0x28 */ int archive_ptr;
|
||||
/* 0x2C */ int heap_ptr_0;
|
||||
/* 0x30 */ char field_0x30[0x3C - 0x30];
|
||||
/* 0x3C */ int heap_ptr_1;
|
||||
};
|
||||
|
||||
// Ghidra: ArcManagerEntryTable
|
||||
// size: 0xC
|
||||
class ArcMangerEntryTable {
|
||||
public:
|
||||
/* 0x0 */ ArcManagerEntry *entries;
|
||||
/* 0x4 */ u16 count;
|
||||
/* 0x8 */ u32 field_0x8;
|
||||
|
||||
public:
|
||||
ArcMangerEntryTable();
|
||||
};
|
||||
|
||||
class OarcManager {
|
||||
public:
|
||||
void *getDataFromOarc(char *oarcName, char *fileName);
|
||||
};
|
||||
|
||||
OarcManager g_OarcManager;
|
||||
|
||||
#endif;
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef CURRENT_STAGE_ARC_MANAGER_H
|
||||
#define CURRENT_STAGE_ARC_MANAGER_H
|
||||
|
||||
#include <d/d_rawarchive.h>
|
||||
#include <egg/core/eggHeap.h>
|
||||
#include <sized_string.h>
|
||||
|
||||
class CurrentStageArcManager {
|
||||
CurrentStageArcManager();
|
||||
virtual ~CurrentStageArcManager();
|
||||
|
||||
SizedString<32> mStageName;
|
||||
SizedString<32> mCurrentLoadingStageArcName;
|
||||
SizedString<32> mStageExtraLayerArcName;
|
||||
|
||||
dRawArcTable_c mArcTable;
|
||||
|
||||
static CurrentStageArcManager *sInstance;
|
||||
|
||||
static bool create(EGG::Heap *heap);
|
||||
|
||||
void init(EGG::Heap *heap);
|
||||
bool setStage(const char *stage);
|
||||
bool decrement();
|
||||
void *getData(const char *fileName);
|
||||
void *getFileFromCurrentLay0Arc(const char *fileName);
|
||||
bool loadFileFromExtraLayerArc(int layer);
|
||||
bool unloadExtraLayerArc();
|
||||
bool loadRoomArc(int room);
|
||||
bool addEntryFromSuperArc(const char *name, void *data);
|
||||
bool unloadRoomArc(int room);
|
||||
bool decrement(const char *path);
|
||||
void *loadFromRoomArc(int roomId, const char *fileName);
|
||||
void *getDataFromRoomArc(int roomId, const char *fileName);
|
||||
const char *getCurrentStageDirectory();
|
||||
const char *getRoomArcDirectory(int room) const;
|
||||
|
||||
static EGG::ExpHeap *getHeap();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef LAYOUT_ARC_MANAGER_H
|
||||
#define LAYOUT_ARC_MANAGER_H
|
||||
|
||||
#include <d/d_rawarchive.h>
|
||||
#include <egg/core/eggHeap.h>
|
||||
#include <sized_string.h>
|
||||
|
||||
class LayoutArcManager {
|
||||
LayoutArcManager();
|
||||
virtual ~LayoutArcManager();
|
||||
|
||||
dRawArcTable_c mArcTable;
|
||||
|
||||
static LayoutArcManager *sInstance;
|
||||
|
||||
static bool create(EGG::Heap *heap);
|
||||
|
||||
void init(EGG::Heap *heap);
|
||||
|
||||
bool loadLayoutArcFromDisk(const char *object, EGG::Heap *heap);
|
||||
void ensureLoaded1(const char *object);
|
||||
void ensureLoaded2(const char *object);
|
||||
bool hasEntry(const char *object);
|
||||
bool decrement(const char *path);
|
||||
void *getData(const char *oarcName, const char *fileName);
|
||||
void *getLoadedData(const char *path);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef OARC_MANAGER_H
|
||||
#define OARC_MANAGER_H
|
||||
|
||||
#include <d/d_rawarchive.h>
|
||||
#include <egg/core/eggHeap.h>
|
||||
#include <sized_string.h>
|
||||
|
||||
class OarcManager {
|
||||
OarcManager();
|
||||
virtual ~OarcManager();
|
||||
|
||||
dRawArcTable_c mArcTable;
|
||||
|
||||
static OarcManager *sInstance;
|
||||
|
||||
static bool create(EGG::Heap *heap);
|
||||
|
||||
void init(EGG::Heap *heap);
|
||||
|
||||
bool checkIfObjectArcExistsOnDisk(const char *object);
|
||||
bool loadObjectArcFromDisk(const char *object, EGG::Heap *heap);
|
||||
bool addEntryFromSuperArc(const char *object, void *data, EGG::Heap *heap);
|
||||
void ensureLoaded1(const char *object);
|
||||
void ensureLoaded2(const char *object);
|
||||
bool decrement(const char *path);
|
||||
void *getData(const char *oarcName, const char *fileName);
|
||||
|
||||
void *getMdlFromArc2(const char *oarcName);
|
||||
void *getMdlFromArc(const char *oarcName);
|
||||
void *getZevFromArc(const char *oarcName);
|
||||
void *getDzbFromArc(const char *oarcName, const char *fileName);
|
||||
void *getPlcFromArc(const char *oarcName, const char *fileName);
|
||||
void *getSubEntryData(const char *oarcName, const char *fileName);
|
||||
};
|
||||
|
||||
#endif
|
||||
+8
-11
@@ -1,6 +1,8 @@
|
||||
#include <d/d_dvd.h>
|
||||
#include <m/m_dvd.h>
|
||||
|
||||
// clang-format off
|
||||
#include <sized_string.h>
|
||||
// clang-format on
|
||||
namespace dDvd {
|
||||
|
||||
/** 800520f0 */
|
||||
@@ -19,25 +21,20 @@ loader_c::loader_c() {
|
||||
/** 80052130 */
|
||||
loader_c::~loader_c() {}
|
||||
|
||||
// sprintf2
|
||||
extern "C" void fn_8003D650(char *out, const char *fmt, ...);
|
||||
|
||||
/** 80052170 */
|
||||
void *loader_c::request(const char *path, u8 mountDirection, EGG::Heap *heap) {
|
||||
char buf[128];
|
||||
|
||||
if (mpBuffer != nullptr) {
|
||||
return mpBuffer;
|
||||
}
|
||||
if (mpCommand == 0) {
|
||||
mSize = -1;
|
||||
mpHeap = heap != nullptr ? heap : mDvd::getArchiveHeap();
|
||||
buf[0] = '\0';
|
||||
fn_8003D650(buf, "US%s", path);
|
||||
if (!mDvd::IsExistPath(buf)) {
|
||||
fn_8003D650(buf, "%s", path);
|
||||
SizedString<128> buf;
|
||||
buf.sprintf("US%s", path);
|
||||
if (!mDvd::IsExistPath(&buf)) {
|
||||
buf.sprintf("%s", path);
|
||||
}
|
||||
mpCommand = mDvd_toMainRam_normal_c::create(buf, mountDirection, heap);
|
||||
mpCommand = mDvd_toMainRam_normal_c::create(&buf, mountDirection, heap);
|
||||
}
|
||||
if (mpCommand != nullptr && mpCommand->mStatus != 0) {
|
||||
mpBuffer = mpCommand->mDataPtr;
|
||||
|
||||
@@ -0,0 +1,398 @@
|
||||
#include <d/d_rawarchive.h>
|
||||
#include <rvl/VI.h>
|
||||
|
||||
class UnkManager {
|
||||
public:
|
||||
/* vtable at 8050df50 */
|
||||
/** 800651c0 */
|
||||
virtual void CreateArc(void *data, const char *path);
|
||||
/** 800653d0 */
|
||||
virtual void DestroyArc(const char *path);
|
||||
|
||||
u32 stage;
|
||||
};
|
||||
|
||||
extern "C" int fn_80061B10(void *d, u32 len) {
|
||||
u32 *data = (u32 *)d;
|
||||
u32 result = 0;
|
||||
// Compiler will unroll this loop
|
||||
for (u32 len_words = len / 4; len_words != 0; len_words--) {
|
||||
result += *data++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C" int fn_80061BA0(void *data, u32 len) {
|
||||
int result = fn_80061B10(data, len);
|
||||
return result != 0 ? result : -1;
|
||||
}
|
||||
|
||||
extern "C" void fn_80061BE0(UnkManager *mgr, const char *name, size_t len) {
|
||||
// Sets stage to all spaces
|
||||
mgr->stage = 0x20202020;
|
||||
// copies the stage name?
|
||||
memcpy((char *)&mgr->stage, name, len);
|
||||
}
|
||||
|
||||
dRawArcEntry_c::dRawArcEntry_c() {
|
||||
mRefCount = 0;
|
||||
mpDvdReq = nullptr;
|
||||
mpArc = nullptr;
|
||||
mpCommandHeap = nullptr;
|
||||
mpData = nullptr;
|
||||
mChecksum = 0;
|
||||
mpFrmHeap = 0;
|
||||
}
|
||||
|
||||
dRawArcEntry_c::~dRawArcEntry_c() {
|
||||
// Wait for request to complete before destroying
|
||||
if (mpDvdReq->mStatus == 0) {
|
||||
do {
|
||||
VIWaitForRetrace();
|
||||
} while (mpDvdReq->mStatus == 0);
|
||||
}
|
||||
destroy(nullptr);
|
||||
}
|
||||
|
||||
void dRawArcEntry_c::searchCallback(void *arg, void *data, const ARCDirEntry *entry, const char *path, bool ctrl) {
|
||||
UnkManager *mgr = (UnkManager *)arg;
|
||||
if (entry->isDir) {
|
||||
int len = strlen(entry->name);
|
||||
fn_80061BE0(mgr, entry->name, len <= 4 ? len : 4);
|
||||
} else {
|
||||
// dolphin: arg vtable at 8050df50
|
||||
// any others?
|
||||
if (ctrl) {
|
||||
mgr->CreateArc(data, path);
|
||||
// branch to 800651c0, sets up room
|
||||
} else {
|
||||
mgr->DestroyArc(path);
|
||||
// branch to 800653d0, destroys room
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dRawArcEntry_c::searchCallback1(void *a, void *b, const ARCDirEntry *c, const char *d) {
|
||||
searchCallback(a, b, c, d, true);
|
||||
}
|
||||
|
||||
void dRawArcEntry_c::searchCallback2(void *a, void *b, const ARCDirEntry *c, const char *d) {
|
||||
searchCallback(a, b, c, d, false);
|
||||
}
|
||||
|
||||
bool dRawArcEntry_c::destroy(void *arg) {
|
||||
if (mpDvdReq != nullptr) {
|
||||
if (mpDvdReq->mStatus == 0) {
|
||||
// Can't destroy if the request is still ongoing
|
||||
return false;
|
||||
}
|
||||
mpArc = mpDvdReq->mDataPtr;
|
||||
mpData = mpDvdReq->getArcBinary();
|
||||
mAmountRead = mpDvdReq->mAmountRead;
|
||||
mpCommandHeap = mpDvdReq->mHeap;
|
||||
mpDvdReq->do_delete();
|
||||
mpDvdReq = nullptr;
|
||||
}
|
||||
|
||||
if (mpArc != nullptr) {
|
||||
if (arg != nullptr) {
|
||||
mpArc->searchInside(searchCallback2, arg);
|
||||
}
|
||||
|
||||
if (mpFrmHeap != nullptr) {
|
||||
mHeap::destroyFrmHeap(mpFrmHeap);
|
||||
mpFrmHeap = nullptr;
|
||||
}
|
||||
mpArc->unmount();
|
||||
mpArc = nullptr;
|
||||
}
|
||||
|
||||
if (mpData != nullptr) {
|
||||
EGG::Heap::free(mpData, nullptr);
|
||||
mpData = nullptr;
|
||||
}
|
||||
|
||||
mAmountRead = 0;
|
||||
mChecksum = 0;
|
||||
mpCommandHeap = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dRawArcEntry_c::loadArcFromDiskChecked(const char *fileName, const char *dirName, u8 mountDirection,
|
||||
EGG::Heap *heap) {
|
||||
SizedString<128> path;
|
||||
|
||||
if (checkArcExistsOnDiskInner(path, fileName, dirName)) {
|
||||
return loadArcFromDisk(fileName, &path, mountDirection, heap);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool dRawArcEntry_c::loadArcFromDisk(const char *arcName, const char *arcPath, u8 mountDirection, EGG::Heap *heap) {
|
||||
mpDvdReq = mDvd_mountMemArchive_c::create(arcPath, mountDirection, heap);
|
||||
if (mpDvdReq == nullptr) {
|
||||
return false;
|
||||
}
|
||||
mArcName = arcName;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL dRawArcEntry_c::checkArcExistsOnDisk(const char *fileName, const char *dirName) {
|
||||
SizedString<128> path;
|
||||
return checkArcExistsOnDiskInner(path, fileName, dirName);
|
||||
}
|
||||
|
||||
// sprintf2
|
||||
extern "C" void fn_8003D650(char *out, const char *fmt, ...);
|
||||
|
||||
BOOL dRawArcEntry_c::checkArcExistsOnDiskInner(SizedString<128> &path, const char *fileName, const char *dirName) {
|
||||
path.sprintf("/US/%s/%s.arc", dirName, fileName);
|
||||
if (!mDvd::IsExistPath(&path)) {
|
||||
path.sprintf("/%s/%s.arc", dirName, fileName);
|
||||
if (!mDvd::IsExistPath(&path)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int dRawArcEntry_c::mount(const char *name, void *data, void *callbackArg, u8 mountDirection, EGG::Heap *heap) {
|
||||
mArcName = name;
|
||||
mpArc = EGG::Archive::mount(data, heap, (mountDirection == 0 || mountDirection == 1) ? 4 : -4);
|
||||
if (mpArc == nullptr) {
|
||||
return -1;
|
||||
} else {
|
||||
int result = onMount(callbackArg);
|
||||
int ret = 0;
|
||||
if (result == -1) {
|
||||
ret = result;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
int dRawArcEntry_c::ensureLoadedMaybe(void *callbackArg) {
|
||||
if (mpArc == nullptr) {
|
||||
if (mpDvdReq == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mpDvdReq->mStatus == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
mpArc = mpDvdReq->mDataPtr;
|
||||
mpData = mpDvdReq->getArcBinary();
|
||||
mAmountRead = mpDvdReq->mAmountRead;
|
||||
if (mpData != nullptr) {
|
||||
u32 blockSize = EGG::ExpHeap::getSizeForMBlock(mpData);
|
||||
if (mAmountRead != blockSize) {
|
||||
mAmountRead = blockSize;
|
||||
}
|
||||
}
|
||||
|
||||
mpCommandHeap = mpDvdReq->mHeap;
|
||||
mpDvdReq->do_delete();
|
||||
mpDvdReq = nullptr;
|
||||
if (mpArc == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
mpFrmHeap = mHeap::makeHeapOnCurrentGameHeap(-1, name(), 0x20, 0);
|
||||
if (mpFrmHeap == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
int result = onMount(callbackArg);
|
||||
mHeap::restoreCurrentHeap();
|
||||
mHeap::adjustFrmHeap(mpFrmHeap);
|
||||
mChecksum = fn_80061BA0(mpData, mAmountRead);
|
||||
if (result == -1) {
|
||||
return result;
|
||||
}
|
||||
DCStoreRange(mpFrmHeap, mpFrmHeap->mHeapHandle->end - (u8 *)mpFrmHeap);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dRawArcEntry_c::onMount(void *callbackArg) {
|
||||
mpArc->countFile();
|
||||
if (callbackArg != nullptr) {
|
||||
mpArc->searchInside(searchCallback1, callbackArg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
dRawArcTable_c::dRawArcTable_c() {
|
||||
mpEntries = nullptr;
|
||||
mCount = 0;
|
||||
mCallbackArg = nullptr;
|
||||
}
|
||||
|
||||
dRawArcTable_c::~dRawArcTable_c() {
|
||||
if (mpEntries) {
|
||||
delete[] mpEntries;
|
||||
mpEntries = nullptr;
|
||||
mCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool dRawArcTable_c::init(u16 count, void *callbackArg, EGG::Heap *heap) {
|
||||
mpEntries = new (heap, 0x04) dRawArcEntry_c[count]();
|
||||
if (mpEntries == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mCount = count;
|
||||
mCallbackArg = callbackArg;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL dRawArcTable_c::getArcOrLoadFromDisk(const char *name, const char *dirName, u8 mountDirection, EGG::Heap *heap) {
|
||||
dRawArcEntry_c *entry = findEntry(name);
|
||||
if (entry == nullptr) {
|
||||
entry = findEmptySlot();
|
||||
if (entry == nullptr) {
|
||||
return false;
|
||||
}
|
||||
bool result = entry->loadArcFromDiskChecked(name, dirName, mountDirection, heap);
|
||||
if (!result) {
|
||||
entry->destroy(mCallbackArg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
entry->increaseRefCount();
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL dRawArcTable_c::addEntryFromSuperArc(const char *name, void *data, u8 mountDirection, EGG::Heap *heap) {
|
||||
dRawArcEntry_c *entry = findEntry(name);
|
||||
if (entry == nullptr) {
|
||||
entry = findEmptySlot();
|
||||
if (entry == nullptr) {
|
||||
return false;
|
||||
}
|
||||
int result = entry->mount(name, data, mCallbackArg, mountDirection, heap);
|
||||
if (result != 0) {
|
||||
entry->destroy(mCallbackArg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
entry->increaseRefCount();
|
||||
return true;
|
||||
}
|
||||
|
||||
int dRawArcTable_c::ensureLoadedMaybe2(const char *name) {
|
||||
dRawArcEntry_c *entry = findEntry(name);
|
||||
if (entry == nullptr) {
|
||||
return -2;
|
||||
}
|
||||
return entry->ensureLoadedMaybe(mCallbackArg);
|
||||
}
|
||||
|
||||
int dRawArcTable_c::ensureLoadedMaybe(const char *name) {
|
||||
dRawArcEntry_c *entry = findEntry(name);
|
||||
if (entry == nullptr) {
|
||||
return -2;
|
||||
}
|
||||
return entry->ensureLoadedMaybe(mCallbackArg);
|
||||
}
|
||||
|
||||
bool dRawArcTable_c::hasEntry(const char *name) {
|
||||
return findEntry(name) != nullptr;
|
||||
}
|
||||
|
||||
BOOL dRawArcTable_c::decreaseRefCount(const char *name) {
|
||||
dRawArcEntry_c *entry = findEntry(name);
|
||||
if (entry == nullptr) {
|
||||
return false;
|
||||
}
|
||||
entry->decreaseRefCount();
|
||||
if (!entry->isReferenced()) {
|
||||
entry->destroy(mCallbackArg);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void *dRawArcTable_c::getDataFromOarc(const char *name, const char *path) {
|
||||
void *data = nullptr;
|
||||
dRawArcEntry_c *entry = findLoadedEntry(name);
|
||||
if (entry != nullptr) {
|
||||
EGG::Archive *arc = entry->getArc();
|
||||
if (arc != nullptr) {
|
||||
data = arc->getFile(path, nullptr);
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
void *dRawArcTable_c::getSubEntryData(const char *name, const char *path) {
|
||||
void *data = nullptr;
|
||||
dRawArcEntry_c *entry = findLoadedEntry(name);
|
||||
if (entry != nullptr) {
|
||||
EGG::Archive *arc = entry->getArc();
|
||||
if (arc != nullptr) {
|
||||
int num = arc->convertPathToEntryID(path);
|
||||
if (num >= 0) {
|
||||
data = arc->getFileFast(num, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
void *dRawArcTable_c::getLoadedArcData(const char *name) {
|
||||
dRawArcEntry_c *entry = findLoadedEntry(name);
|
||||
return entry == nullptr ? nullptr : entry->getData();
|
||||
}
|
||||
|
||||
int dRawArcTable_c::ensureAllEntriesLoaded() {
|
||||
dRawArcEntry_c *entry = mpEntries;
|
||||
int result = 0;
|
||||
for (int i = 0; i < mCount; i++) {
|
||||
if (entry->isLoading()) {
|
||||
result = entry->ensureLoadedMaybe(mCallbackArg);
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
entry++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" bool strequals(const char *, const char *);
|
||||
|
||||
dRawArcEntry_c *dRawArcTable_c::findEntry(const char *name) const {
|
||||
dRawArcEntry_c *entry = mpEntries;
|
||||
for (int i = 0; i < mCount; i++) {
|
||||
if (entry->isReferenced() && strequals(entry->name(), name)) {
|
||||
return entry;
|
||||
}
|
||||
entry++;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
dRawArcEntry_c *dRawArcTable_c::findEmptySlot() {
|
||||
dRawArcEntry_c *entry = mpEntries;
|
||||
for (int i = 0; i < mCount; i++) {
|
||||
if (!entry->isReferenced()) {
|
||||
return entry;
|
||||
}
|
||||
entry++;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
dRawArcEntry_c *dRawArcTable_c::findLoadedEntry(const char *name) {
|
||||
dRawArcEntry_c *entry = findEntry(name);
|
||||
if (entry == nullptr) {
|
||||
return nullptr;
|
||||
} else if (entry->isNotLoaded()) {
|
||||
return nullptr;
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
+1
-1
@@ -207,6 +207,6 @@ EGG::AssertHeap *mHeap::createAssertHeap(EGG::Heap *parent) {
|
||||
return g_assertHeap;
|
||||
}
|
||||
|
||||
EGG::Heap *mHeap::makeHeapOnCurrentGameHeap(size_t size, const char *name, u32 align, u32 flags) {
|
||||
EGG::FrmHeap *mHeap::makeHeapOnCurrentGameHeap(size_t size, const char *name, u32 align, u32 flags) {
|
||||
return makeFrmHeapAndUpdate(size, g_gameHeaps[0], name, align, flags);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
#include <d/d_heap.h>
|
||||
#include <toBeSorted/arc_managers/current_stage_arc_manager.h>
|
||||
|
||||
CurrentStageArcManager *CurrentStageArcManager::sInstance;
|
||||
|
||||
CurrentStageArcManager::CurrentStageArcManager() {
|
||||
sInstance = this;
|
||||
}
|
||||
|
||||
CurrentStageArcManager::~CurrentStageArcManager() {
|
||||
sInstance = nullptr;
|
||||
}
|
||||
|
||||
extern char lbl_80575250;
|
||||
|
||||
void CurrentStageArcManager::init(EGG::Heap *heap) {
|
||||
mArcTable.init(18, &lbl_80575250, heap);
|
||||
}
|
||||
|
||||
bool CurrentStageArcManager::setStage(const char *newStage) {
|
||||
mStageName = newStage;
|
||||
|
||||
mCurrentLoadingStageArcName.sprintf("%s_stg_l0", mStageName);
|
||||
if (dRawArcEntry_c::checkArcExistsOnDisk(&mCurrentLoadingStageArcName, getCurrentStageDirectory())) {
|
||||
return (bool)mArcTable.getArcOrLoadFromDisk(&mCurrentLoadingStageArcName, getCurrentStageDirectory(), 0,
|
||||
dHeap::work2Heap.heap);
|
||||
} else {
|
||||
mCurrentLoadingStageArcName.sprintf("%s_stg", mStageName);
|
||||
return (bool)mArcTable.getArcOrLoadFromDisk(&mCurrentLoadingStageArcName, getCurrentStageDirectory(), 0,
|
||||
dHeap::work2Heap.heap);
|
||||
}
|
||||
}
|
||||
|
||||
bool CurrentStageArcManager::decrement() {
|
||||
return mArcTable.decreaseRefCount(&mCurrentLoadingStageArcName);
|
||||
}
|
||||
|
||||
void *CurrentStageArcManager::getData(const char *fileName) {
|
||||
return mArcTable.getDataFromOarc(&mCurrentLoadingStageArcName, fileName);
|
||||
}
|
||||
|
||||
void *CurrentStageArcManager::getFileFromCurrentLay0Arc(const char *fileName) {
|
||||
return mArcTable.getSubEntryData(&mCurrentLoadingStageArcName, fileName);
|
||||
}
|
||||
|
||||
bool CurrentStageArcManager::loadFileFromExtraLayerArc(int layer) {
|
||||
if (layer == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
mStageExtraLayerArcName.sprintf("%s_stg_l%d", mStageName, layer);
|
||||
if (dRawArcEntry_c::checkArcExistsOnDisk(&mStageExtraLayerArcName, getCurrentStageDirectory())) {
|
||||
return (bool)mArcTable.getArcOrLoadFromDisk(&mStageExtraLayerArcName, getCurrentStageDirectory(), 0,
|
||||
dHeap::work2Heap.heap);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool CurrentStageArcManager::unloadExtraLayerArc() {
|
||||
if (mArcTable.hasEntry(&mStageExtraLayerArcName)) {
|
||||
return mArcTable.decreaseRefCount(&mStageExtraLayerArcName);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CurrentStageArcManager::loadRoomArc(int room) {
|
||||
return (bool)mArcTable.getArcOrLoadFromDisk(getRoomArcDirectory(room), getCurrentStageDirectory(), 0,
|
||||
dHeap::work2Heap.heap);
|
||||
}
|
||||
|
||||
bool CurrentStageArcManager::addEntryFromSuperArc(const char *path, void *data) {
|
||||
return (bool)mArcTable.addEntryFromSuperArc(path, data, 0, EGG::Heap::sCurrentHeap);
|
||||
}
|
||||
|
||||
bool CurrentStageArcManager::unloadRoomArc(int room) {
|
||||
mArcTable.decreaseRefCount(getRoomArcDirectory(room));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CurrentStageArcManager::decrement(const char *path) {
|
||||
mArcTable.decreaseRefCount(path);
|
||||
return true;
|
||||
}
|
||||
|
||||
void *CurrentStageArcManager::loadFromRoomArc(int roomId, const char *fileName) {
|
||||
return mArcTable.getDataFromOarc(getRoomArcDirectory(roomId), fileName);
|
||||
}
|
||||
|
||||
void *CurrentStageArcManager::getDataFromRoomArc(int roomId, const char *fileName) {
|
||||
return mArcTable.getSubEntryData(getRoomArcDirectory(roomId), fileName);
|
||||
}
|
||||
|
||||
EGG::ExpHeap *getHeap() {
|
||||
return dHeap::workExHeap.heap;
|
||||
}
|
||||
|
||||
const char *CurrentStageArcManager::getCurrentStageDirectory() {
|
||||
static SizedString<64> sStageDirTmp;
|
||||
sStageDirTmp = "Stage/";
|
||||
sStageDirTmp += &mStageName;
|
||||
|
||||
return &sStageDirTmp;
|
||||
}
|
||||
|
||||
static SizedString<32> s_roomArcTmp;
|
||||
|
||||
const char *CurrentStageArcManager::getRoomArcDirectory(int room) const {
|
||||
s_roomArcTmp.sprintf("%s_r%02d", mStageName, room);
|
||||
return &s_roomArcTmp;
|
||||
}
|
||||
|
||||
bool CurrentStageArcManager::create(EGG::Heap *heap) {
|
||||
new (heap, 0x04) CurrentStageArcManager();
|
||||
|
||||
if (CurrentStageArcManager::sInstance == nullptr) {
|
||||
return false;
|
||||
}
|
||||
CurrentStageArcManager::sInstance->init(heap);
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
#include <d/d_heap.h>
|
||||
#include <toBeSorted/arc_managers/layout_arc_manager.h>
|
||||
|
||||
LayoutArcManager *LayoutArcManager::sInstance;
|
||||
|
||||
LayoutArcManager::LayoutArcManager() {
|
||||
sInstance = this;
|
||||
}
|
||||
|
||||
LayoutArcManager::~LayoutArcManager() {
|
||||
sInstance = nullptr;
|
||||
}
|
||||
|
||||
extern char lbl_80575250;
|
||||
|
||||
void LayoutArcManager::init(EGG::Heap *heap) {
|
||||
mArcTable.init(16, &lbl_80575250, heap);
|
||||
}
|
||||
|
||||
bool LayoutArcManager::loadLayoutArcFromDisk(const char *object, EGG::Heap *heap) {
|
||||
if (heap == nullptr) {
|
||||
heap = dHeap::layoutResHeap.heap;
|
||||
}
|
||||
return mArcTable.getArcOrLoadFromDisk(object, "Layout", 0, heap);
|
||||
}
|
||||
|
||||
void LayoutArcManager::ensureLoaded1(const char *object) {
|
||||
mArcTable.ensureLoadedMaybe2(object);
|
||||
}
|
||||
|
||||
void LayoutArcManager::ensureLoaded2(const char *object) {
|
||||
mArcTable.ensureLoadedMaybe(object);
|
||||
}
|
||||
|
||||
bool LayoutArcManager::hasEntry(const char *object) {
|
||||
return mArcTable.hasEntry(object);
|
||||
}
|
||||
|
||||
bool LayoutArcManager::decrement(const char *path) {
|
||||
return mArcTable.decreaseRefCount(path);
|
||||
}
|
||||
|
||||
void *LayoutArcManager::getData(const char *oarcName, const char *fileName) {
|
||||
return mArcTable.getDataFromOarc(oarcName, fileName);
|
||||
}
|
||||
|
||||
void *LayoutArcManager::getLoadedData(const char *path) {
|
||||
return mArcTable.getLoadedArcData(path);
|
||||
}
|
||||
|
||||
bool LayoutArcManager::create(EGG::Heap *heap) {
|
||||
new (heap, 0x04) LayoutArcManager();
|
||||
|
||||
if (LayoutArcManager::sInstance == nullptr) {
|
||||
return false;
|
||||
}
|
||||
LayoutArcManager::sInstance->init(heap);
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
#include <d/d_heap.h>
|
||||
#include <toBeSorted/arc_managers/oarc_manager.h>
|
||||
|
||||
OarcManager *OarcManager::sInstance;
|
||||
|
||||
OarcManager::OarcManager() {
|
||||
sInstance = this;
|
||||
}
|
||||
|
||||
OarcManager::~OarcManager() {
|
||||
sInstance = nullptr;
|
||||
}
|
||||
|
||||
extern char lbl_80575250;
|
||||
|
||||
void OarcManager::init(EGG::Heap *heap) {
|
||||
mArcTable.init(200, &lbl_80575250, heap);
|
||||
}
|
||||
|
||||
bool OarcManager::checkIfObjectArcExistsOnDisk(const char *object) {
|
||||
return dRawArcEntry_c::checkArcExistsOnDisk(object, "Object");
|
||||
}
|
||||
|
||||
bool OarcManager::loadObjectArcFromDisk(const char *object, EGG::Heap *heap) {
|
||||
if (heap == nullptr) {
|
||||
heap = dHeap::work2Heap.heap;
|
||||
}
|
||||
return mArcTable.getArcOrLoadFromDisk(object, "Object", 0, heap);
|
||||
}
|
||||
|
||||
bool OarcManager::addEntryFromSuperArc(const char *object, void *data, EGG::Heap *heap) {
|
||||
if (heap == nullptr) {
|
||||
heap = EGG::Heap::sCurrentHeap;
|
||||
}
|
||||
return mArcTable.addEntryFromSuperArc(object, data, 0, heap);
|
||||
}
|
||||
|
||||
void OarcManager::ensureLoaded1(const char *object) {
|
||||
mArcTable.ensureLoadedMaybe2(object);
|
||||
}
|
||||
|
||||
void OarcManager::ensureLoaded2(const char *object) {
|
||||
mArcTable.ensureLoadedMaybe(object);
|
||||
}
|
||||
|
||||
bool OarcManager::decrement(const char *path) {
|
||||
return mArcTable.decreaseRefCount(path);
|
||||
}
|
||||
|
||||
void *OarcManager::getData(const char *oarcName, const char *fileName) {
|
||||
return mArcTable.getDataFromOarc(oarcName, fileName);
|
||||
}
|
||||
|
||||
void *OarcManager::getMdlFromArc2(const char *oarcName) {
|
||||
return mArcTable.getDataFromOarc(oarcName, "g3d/model.brres");
|
||||
}
|
||||
|
||||
void *OarcManager::getMdlFromArc(const char *oarcName) {
|
||||
return mArcTable.getSubEntryData(oarcName, "g3d/model.brres");
|
||||
}
|
||||
|
||||
void *OarcManager::getZevFromArc(const char *oarcName) {
|
||||
return mArcTable.getDataFromOarc(oarcName, "dat/zev.dat");
|
||||
}
|
||||
|
||||
void *OarcManager::getDzbFromArc(const char *oarcName, const char *fileName) {
|
||||
SizedString<32> str = "dzb/";
|
||||
str += fileName;
|
||||
str += ".dzb";
|
||||
return mArcTable.getDataFromOarc(oarcName, &str);
|
||||
}
|
||||
|
||||
void *OarcManager::getPlcFromArc(const char *oarcName, const char *fileName) {
|
||||
SizedString<32> str = "dat/";
|
||||
str += fileName;
|
||||
str += ".plc";
|
||||
return mArcTable.getDataFromOarc(oarcName, &str);
|
||||
}
|
||||
|
||||
void *OarcManager::getSubEntryData(const char *oarcName, const char *fileName) {
|
||||
return mArcTable.getSubEntryData(oarcName, fileName);
|
||||
}
|
||||
|
||||
bool OarcManager::create(EGG::Heap *heap) {
|
||||
new (heap, 0x04) OarcManager();
|
||||
|
||||
if (OarcManager::sInstance == nullptr) {
|
||||
return false;
|
||||
}
|
||||
OarcManager::sInstance->init(heap);
|
||||
return true;
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "toBeSorted/file_manager.h"
|
||||
#include "f/f_base.h"
|
||||
#include <m/m_heap.h>
|
||||
// #include "libc.h"
|
||||
#include <MSL_C/string.h>
|
||||
// clang-format off
|
||||
#include <sized_string.h>
|
||||
// clang-format on
|
||||
|
||||
// This class here makes no sense and the name might
|
||||
// be a total misnomer, but this gets the sinit section correct
|
||||
@@ -101,29 +102,6 @@ u16 *FileManager::getStoryFlagsMut() {
|
||||
/* 8000AA30 */ u16 *FileManager::getSkipFlags() {}
|
||||
/* 8000AA40 */ void FileManager::setSkipFlagsChecked(u16 *flags, u32 offset, u16 count) {}
|
||||
|
||||
// This does strncat things - append src to dest
|
||||
inline void fake_strncat(char *dest, const char *src, size_t max_len) {
|
||||
if (src != nullptr) {
|
||||
size_t len = strlen(dest);
|
||||
size_t count = strlen(src);
|
||||
count = len + count + 1 >= max_len ? max_len - len - 1 : count;
|
||||
strncpy(dest + len, src, count);
|
||||
// one instshuffle here - this should be (len + count),
|
||||
// but then regalloc blows up and uses one more register in initFile
|
||||
dest[count + len] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
// A function like this is inlined into in a bunch of area-related code
|
||||
// It doesn't make a whole lot of sense to use strncat on a string just
|
||||
// clipped to zero length...
|
||||
inline void strnsth(char *dest, const char *src, size_t max_len) {
|
||||
if (src != dest) {
|
||||
dest[0] = '\0';
|
||||
fake_strncat(dest, src, max_len);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8000AAA0 */ void FileManager::initFile(int fileNum) {
|
||||
|
||||
mIsFileInvalid[1] = 1;
|
||||
@@ -140,10 +118,9 @@ inline void strnsth(char *dest, const char *src, size_t max_len) {
|
||||
file->selectedDowsingSlot = 0x8;
|
||||
file->lastUsedPouchItemSlot = 0x8;
|
||||
|
||||
char buf[0x20];
|
||||
buf[0] = '\0';
|
||||
strnsth(buf, "F405", 0x20);
|
||||
file->setAreaT1(buf);
|
||||
SizedString<32> buf;
|
||||
buf = "F405";
|
||||
file->setAreaT1(&buf);
|
||||
file->room_id_t1 = 0;
|
||||
file->forced_layer_t1 = 0;
|
||||
file->entrance_t1_load_flag = 1;
|
||||
|
||||
Reference in New Issue
Block a user