some fManager, fBase, mHeap, f - lists and tree stuff

This commit is contained in:
elijah-thomas774
2024-03-17 17:40:00 -04:00
parent c2a4909bd2
commit 606cc15eed
29 changed files with 1270 additions and 344 deletions
+3 -3
View File
@@ -7,9 +7,9 @@
"files.encoding": "utf8",
"editor.defaultFormatter": "xaver.clang-format"
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
// "[python]": {
// "editor.defaultFormatter": "ms-python.black-formatter"
// },
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"search.useIgnoreFiles": false,
+85
View File
@@ -38,11 +38,69 @@ d/a/e/d_a_e_base.cpp:
.text start:0x8002F300 end:0x80030CB0
.ctors start:0x804DB664 end:0x804DB668
d/d_ac_npc_kyui.cpp:
.text start:0x8004D810 end:0x80050800
.ctors start:0x804DB670 end:0x804DB674
d/d_base.cpp:
.text start:0x80050800 end:0x80050A14
.data start:0x80503380 end:0x805033D0
.sbss start:0x805750C0 end:0x805750CC
d/d_cc.cpp:
.text start:0x80050A20 end:0x800520F0
d/d_dvd.cpp:
.text start:0x800520F0 end:0x80052E00
d/d_dylink.cpp:
.text start:0x80052E00 end:0x80053A30
.ctors start:0x804DB674 end:0x804DB678
d/d_fader.cpp:
.text start:0x80053A30 end:0x80053E70
.ctors start:0x804DB678 end:0x804DB67C
d/d_font_manager.cpp:
.text start:0x80053E70 end:0x800541D0
.ctors start:0x804DB67C end:0x804DB680
d/d_gfx.cpp:
.text start:0x800541F0 end:0x80054B00
d/d_heap.cpp:
.text start:0x80054B00 end:0x80054F30
.ctors start:0x804DB680 end:0x804DB684
.rodata start:0x804DE008 end:0x804DE188
.sbss start:0x805751A8 end:0x805751D0
d/d_main.cpp:
.text start:0x80054F30 end:0x80055170
d/d_pad.cpp:
.text start:0x80055170 end:0x80059CE0
.ctors start:0x804DB684 end:0x804DB688
d/d_pad_player.cpp:
.text start:0x80059CE0 end:0x8005B6E0
d/d_player.cpp:
.text start:0x8005B6E0 end:0x80061B10
.ctors start:0x804DB688 end:0x804DB690
d/d_rawarchive.cpp:
.text start:0x80061B10 end:0x800629D0
d/d_scene.cpp:
.text start:0x800629D0 end:0x80062E40
.ctors start:0x804DB690 end:0x804DB694
d/d_stage.cpp:
.text start:0x80062E40 end:0x80064250
d/d_sys.cpp:
.text start:0x80064250 end:0x80064920
toBeSorted/sceneflag_manager.cpp:
.text start:0x800BD8C0 end:0x800BE7A8
.sbss start:0x805753E0 end:0x805753F0
@@ -61,6 +119,33 @@ toBeSorted/unk_flag_stuff.cpp:
toBeSorted/bitwise_flag_helper.cpp:
.text start:0x800BF200 end:0x800BF264
f/f_base.cpp:
.text start:0x802E12F0 end:0x802E2680
.ctors start:0x804DB8C0 end:0x804DB8C4
.data start:0x80542278 end:0x805423A8
.sdata start:0x80573FB8 end:0x80573FBC
.sbss start:0x80575BA8 end:0x80575BB8
.bss start:0x805B84C8 end:0x805B84D8
f/f_list.cpp:
.text start:0x802E2680 end:0x802E28C0
f/f_manager.cpp:
.text start:0x802E28C0 end:0x802E2C0C
.ctors start:0x804DB8C4 end:0x804DB8C8
.data start:0x805423A8 end:0x805423E8
.sdata start:0x80573FC0 end:0x80573FC8
.sbss start:0x80575BB8 end:0x80575BC0
.bss start:0x805B84D8 end:0x805B8588
m/m_heap.cpp:
.text start:0x802F0F00 end:0x802F1660
.rodata start:0x804F0570 end:0x804F0580
.data start:0x80542990 end:0x80542AA8
.sdata start:0x80573FF8 end:0x80574000
.sbss start:0x80575C38 end:0x80575C50
.bss start:0x805CB078 end:0x805CB088
m/m_mtx.cpp:
.text start:0x802F1660 end:0x802F1F20
.ctors start:0x804DB8D4 end:0x804DB8D8
+95 -95
View File
@@ -2214,16 +2214,16 @@ fn_80054AD0 = .text:0x80054AD0; // type:function size:0x10
fn_80054AE0 = .text:0x80054AE0; // type:function size:0x14
fn_80054B00 = .text:0x80054B00; // type:function size:0x40
fn_80054B40 = .text:0x80054B40; // type:function size:0x20
fn_80054B60 = .text:0x80054B60; // type:function size:0x64
fn_80054BD0 = .text:0x80054BD0; // type:function size:0x18
fn_80054BF0 = .text:0x80054BF0; // type:function size:0x18
fn_80054C10 = .text:0x80054C10; // type:function size:0x18
fn_80054C30 = .text:0x80054C30; // type:function size:0x18
fn_80054C50 = .text:0x80054C50; // type:function size:0x18
fn_80054C70 = .text:0x80054C70; // type:function size:0x18
fn_80054C90 = .text:0x80054C90; // type:function size:0x18
fn_80054CB0 = .text:0x80054CB0; // type:function size:0x18
fn_80054CD0 = .text:0x80054CD0; // type:function size:0x18
init__5dHeapFPCcUlPQ23EGG4Heap = .text:0x80054B60; // type:function size:0x64
createWork1Heap__5dHeapFUlPQ23EGG4Heap = .text:0x80054BD0; // type:function size:0x18
createWork2Heap__5dHeapFUlPQ23EGG4Heap = .text:0x80054BF0; // type:function size:0x18
createWorkExHeap__5dHeapFUlPQ23EGG4Heap = .text:0x80054C10; // type:function size:0x18
createLayoutHeap__5dHeapFUlPQ23EGG4Heap = .text:0x80054C30; // type:function size:0x18
createLayoutExHeap__5dHeapFUlPQ23EGG4Heap = .text:0x80054C50; // type:function size:0x18
createLayoutEx2Heap__5dHeapFUlPQ23EGG4Heap = .text:0x80054C70; // type:function size:0x18
createLayoutResHeap__5dHeapFUlPQ23EGG4Heap = .text:0x80054C90; // type:function size:0x18
createFontHeap__5dHeapFUlPQ23EGG4Heap = .text:0x80054CB0; // type:function size:0x18
createHBMHeap__5dHeapFUlPQ23EGG4Heap = .text:0x80054CD0; // type:function size:0x18
fn_80054CF0 = .text:0x80054CF0; // type:function size:0x88
fn_80054D80 = .text:0x80054D80; // type:function size:0x98
fn_80054E20 = .text:0x80054E20; // type:function size:0x88
@@ -17279,9 +17279,9 @@ fn_802E07F0 = .text:0x802E07F0; // type:function size:0x24
fn_802E0820 = .text:0x802E0820; // type:function size:0x34
fn_802E0860 = .text:0x802E0860; // type:function size:0x60
fn_802E08C0 = .text:0x802E08C0; // type:function size:0x40
fn_802E0900 = .text:0x802E0900; // type:function size:0xAC
fn_802E09B0 = .text:0x802E09B0; // type:function size:0x30
fn_802E09E0 = .text:0x802E09E0; // type:function size:0x30
remove__9cListMg_cFP9cListNd_c = .text:0x802E0900; // type:function size:0xAC
append__9cListMg_cFP9cListNd_c = .text:0x802E09B0; // type:function size:0x30
prepend__9cListMg_cFP9cListNd_c = .text:0x802E09E0; // type:function size:0x30
fn_802E0A10 = .text:0x802E0A10; // type:function size:0x40
fn_802E0A50 = .text:0x802E0A50; // type:function size:0x5C
fn_802E0AB0 = .text:0x802E0AB0; // type:function size:0x34
@@ -17294,16 +17294,16 @@ fn_802E0D80 = .text:0x802E0D80; // type:function size:0x38
fn_802E0DC0 = .text:0x802E0DC0; // type:function size:0x48
fn_802E0E10 = .text:0x802E0E10; // type:function size:0xC
fn_802E0E20 = .text:0x802E0E20; // type:function size:0x44
fn_802E0E70 = .text:0x802E0E70; // type:function size:0x30
__ct__9cTreeNd_cFv = .text:0x802E0E70; // type:function size:0x30
fn_802E0EA0 = .text:0x802E0EA0; // type:function size:0x18
fn_802E0EC0 = .text:0x802E0EC0; // type:function size:0x94
fn_802E0F60 = .text:0x802E0F60; // type:function size:0x98
fn_802E1000 = .text:0x802E1000; // type:function size:0xBC
fn_802E10C0 = .text:0x802E10C0; // type:function size:0x38
fn_802E1100 = .text:0x802E1100; // type:function size:0x40
fn_802E1140 = .text:0x802E1140; // type:function size:0x8C
addTreeNode__9cTreeMg_cFP9cTreeNd_cP9cTreeNd_c = .text:0x802E0EC0; // type:function size:0x94
removeTreeNode__9cTreeMg_cFP9cTreeNd_c = .text:0x802E0F60; // type:function size:0x98
addTreeNode__9cTreeMg_cFP9cTreeNd_cP9cTreeNd_c = .text:0x802E1000; // type:function size:0xBC
getTreeNext__9cTreeNd_cCFv = .text:0x802E10C0; // type:function size:0x38
getTreeNextNotChild__9cTreeNd_cCFv = .text:0x802E1100; // type:function size:0x40
Delete__11fBaHelper_cFv = .text:0x802E1140; // type:function size:0x8C
fn_802E11D0 = .text:0x802E11D0; // type:function size:0xBC
fn_802E1290 = .text:0x802E1290; // type:function size:0x58
LoadOnlyOne__11fBaHelper_cFv = .text:0x802E1290; // type:function size:0x58
__ct__7fBase_cFv = .text:0x802E12F0; // type:function size:0x190
__dt__7fBase_cFv = .text:0x802E1480; // type:function size:0x78
commonPack__7fBase_cFM7fBase_cFPCvPv_iM7fBase_cFPCvPv_iM7fBase_cFPCvPvQ27fBase_c12MAIN_STATE_e_v = .text:0x802E1500; // type:function size:0xB4
@@ -17326,13 +17326,13 @@ drawPack__7fBase_cFv = .text:0x802E1AE0; // type:function size:0xA8
deleteReady__7fBase_cFv = .text:0x802E1B90; // type:function size:0x4
connectProc__7fBase_cFv = .text:0x802E1BA0; // type:function size:0x25C
deleteRequest__7fBase_cFv = .text:0x802E1E00; // type:function size:0x74
fn_802E1E80 = .text:0x802E1E80; // type:function size:0x8C
fn_802E1F10 = .text:0x802E1F10; // type:function size:0x20
fn_802E1F30 = .text:0x802E1F30; // type:function size:0x54
forceUpdate__7fBase_cFv = .text:0x802E1E80; // type:function size:0x8C
getConnectRoot__7fBase_cFv = .text:0x802E1F10; // type:function size:0x20
getConnectTreeNext__7fBase_cFP7fBase_c = .text:0x802E1F30; // type:function size:0x54
getConnectParent__7fBase_cCFv = .text:0x802E1F90; // type:function size:0x1C
getConnectChild__7fBase_cCFv = .text:0x802E1FB0; // type:function size:0x1C
getConnectBrNext__7fBase_cCFv = .text:0x802E1FD0; // type:function size:0x1C
fn_802E1FF0 = .text:0x802E1FF0; // type:function size:0x98
updateExecutePriority__7fBase_cFUs = .text:0x802E1FF0; // type:function size:0x98
setConnectChild__7fBase_cFP7fBase_c = .text:0x802E2090; // type:function size:0x50
entryFrmHeap__7fBase_cFUlPQ23EGG4Heap = .text:0x802E20E0; // type:function size:0x1FC
entryFrmHeapNonAdjust__7fBase_cFUlPQ23EGG4Heap = .text:0x802E22E0; // type:function size:0xC0
@@ -17341,30 +17341,30 @@ __nw__7fBase_cFUl = .text:0x802E23B0; // type:function size:0x5C
__dl__7fBase_cFPv = .text:0x802E2410; // type:function size:0xC
runCreate__7fBase_cFv = .text:0x802E2420; // type:function size:0x78
getChildProcessCreateState__7fBase_cCFv = .text:0x802E24A0; // type:function size:0x70
fn_802E2510 = .text:0x802E2510; // type:function size:0x2C
checkChildProcessCreateState__7fBase_cCFv = .text:0x802E2510; // type:function size:0x2C
setTmpCtData__7fBase_cFUsP9fTrNdBa_cUlUc = .text:0x802E2540; // type:function size:0x1C
fBase_make__7fBase_cFUsP9fTrNdBa_cUlUc = .text:0x802E2560; // type:function size:0x98
createChild__7fBase_cFUsP7fBase_cUlUc = .text:0x802E2600; // type:function size:0x3C
createRoot__7fBase_cFUsUlUc = .text:0x802E2640; // type:function size:0x14
fn_802E2660 = .text:0x802E2660; // type:function size:0x14
fn_802E2680 = .text:0x802E2680; // type:function size:0x60
fn_802E26E0 = .text:0x802E26E0; // type:function size:0x74
fn_802E2760 = .text:0x802E2760; // type:function size:0x2C
fn_802E2790 = .text:0x802E2790; // type:function size:0x3C
fn_802E27D0 = .text:0x802E27D0; // type:function size:0x5C
fn_802E2830 = .text:0x802E2830; // type:function size:0x48
fn_802E2880 = .text:0x802E2880; // type:function size:0x40
fn_802E28C0 = .text:0x802E28C0; // type:function size:0x10
fn_802E28D0 = .text:0x802E28D0; // type:function size:0x48
fn_802E2920 = .text:0x802E2920; // type:function size:0x54
__sinit_\f_base_cpp = .text:0x802E2660; // type:function size:0x14 scope:local
addNode__11fLiMgPTMF_cFP11fLiNdPrio_c = .text:0x802E2680; // type:function size:0x60
walkPack__11fLiMgPTMF_cFv = .text:0x802E26E0; // type:function size:0x74
searchNodeByID__9fLiMgBa_cCF9fBaseID_e = .text:0x802E2760; // type:function size:0x2C
searchNodeByProfName__9fLiMgBa_cCFUsP9fLiNdBa_c = .text:0x802E2790; // type:function size:0x3C
link__9fLiNdBa_cFP7fBase_c = .text:0x802E27D0; // type:function size:0x5C
unlink__9fLiNdBa_cFv = .text:0x802E2830; // type:function size:0x48
__dt__9fLiMgBa_cFv = .text:0x802E2880; // type:function size:0x40
getSearchTableNum__10fManager_cFv = .text:0x802E28C0; // type:function size:0x10
searchBaseByID__10fManager_cF9fBaseID_e = .text:0x802E28D0; // type:function size:0x48
searchBaseByProfName__10fManager_cFUsPC7fBase_c = .text:0x802E2920; // type:function size:0x54
searchBaseByGroupType__10fManager_cFUcPC7fBase_c = .text:0x802E2980; // type:function size:0x54
fn_802E29E0 = .text:0x802E29E0; // type:function size:0xC0
fn_802E2AA0 = .text:0x802E2AA0; // type:function size:0x138
fn_802E2BE0 = .text:0x802E2BE0; // type:function size:0x10
fn_802E2BF0 = .text:0x802E2BF0; // type:function size:0x1C
fn_802E2C10 = .text:0x802E2C10; // type:function size:0x84
fn_802E2CA0 = .text:0x802E2CA0; // type:function size:0x68
fn_802E2D10 = .text:0x802E2D10; // type:function size:0x68
mainLoop__10fManager_cFv = .text:0x802E29E0; // type:function size:0xC0
__sinit_\f_manager_cpp = .text:0x802E2AA0; // type:function size:0x138
__ct__9fLiMgBa_cFv = .text:0x802E2BE0; // type:function size:0x10
fn_802E2BF0 = .text:0x802E2BF0; // type:function size:0x1C scope:local
walkPack__11fTrMgPTMF_cFv = .text:0x802E2C10; // type:function size:0x84
searchNodeByProfName__9fTrMgBa_cCFUsPC9fTrNdBa_c = .text:0x802E2CA0; // type:function size:0x68
searchNodeByGroupType__9fTrMgBa_cCFUcPC9fTrNdBa_c = .text:0x802E2D10; // type:function size:0x68
fn_802E2D80 = .text:0x802E2D80; // type:function size:0x10
fn_802E2D90 = .text:0x802E2D90; // type:function size:0x3C
fn_802E2DD0 = .text:0x802E2DD0; // type:function size:0x94
@@ -17814,27 +17814,27 @@ fn_802F0C50 = .text:0x802F0C50; // type:function size:0x160
fn_802F0DB0 = .text:0x802F0DB0; // type:function size:0x8
fn_802F0DC0 = .text:0x802F0DC0; // type:function size:0x13C
fn_802F0F00 = .text:0x802F0F00; // type:function size:0x34
fn_802F0F40 = .text:0x802F0F40; // type:function size:0x4
fn_802F0F50 = .text:0x802F0F50; // type:function size:0x10C
fn_802F1060 = .text:0x802F1060; // type:function size:0x68
fn_802F10D0 = .text:0x802F10D0; // type:function size:0x18
fn_802F10F0 = .text:0x802F10F0; // type:function size:0x10C
fn_802F1200 = .text:0x802F1200; // type:function size:0x1C
fn_802F1220 = .text:0x802F1220; // type:function size:0x68
fn_802F1290 = .text:0x802F1290; // type:function size:0x18
setCurrentHeap__5mHeapFPQ23EGG4Heap = .text:0x802F0F40; // type:function size:0x4
createExpHeap__5mHeapFUlPQ23EGG4HeapPCcUlUl = .text:0x802F0F50; // type:function size:0x10C
adjustExpHeap__5mHeapFPQ23EGG7ExpHeap = .text:0x802F1060; // type:function size:0x68
expHeapCost__5mHeapFUlUl = .text:0x802F10D0; // type:function size:0x18
createFrmHeap__5mHeapFUlPQ23EGG4HeapPCcUlUl = .text:0x802F10F0; // type:function size:0x10C
destroyFrmHeap__5mHeapFPQ23EGG7FrmHeap = .text:0x802F1200; // type:function size:0x1C
adjustFrmHeap__5mHeapFPQ23EGG7FrmHeap = .text:0x802F1220; // type:function size:0x68
frmHeapCost__5mHeapFUlUl = .text:0x802F1290; // type:function size:0x18
fn_802F12B0 = .text:0x802F12B0; // type:function size:0x38
fn_802F12F0 = .text:0x802F12F0; // type:function size:0x58
fn_802F1350 = .text:0x802F1350; // type:function size:0x74
fn_802F13D0 = .text:0x802F13D0; // type:function size:0xC
fn_802F13E0 = .text:0x802F13E0; // type:function size:0x2C
fn_802F1410 = .text:0x802F1410; // type:function size:0x40
fn_802F1450 = .text:0x802F1450; // type:function size:0x8
fn_802F1460 = .text:0x802F1460; // type:function size:0xAC
fn_802F1510 = .text:0x802F1510; // type:function size:0x44
fn_802F1560 = .text:0x802F1560; // type:function size:0x2C
fn_802F1590 = .text:0x802F1590; // type:function size:0x2C
fn_802F15C0 = .text:0x802F15C0; // type:function size:0x2C
fn_802F15F0 = .text:0x802F15F0; // type:function size:0x50
createHeap__5mHeapFUlPQ23EGG4HeapPCc = .text:0x802F1350; // type:function size:0x74
saveCurrentHeap__5mHeapFv = .text:0x802F13D0; // type:function size:0xC
restoreCurrentHeap__5mHeapFv = .text:0x802F13E0; // type:function size:0x2C
makeFrmHeapAndUpdate__5mHeapFUlPQ23EGG4HeapPCciUi = .text:0x802F1410; // type:function size:0x40
getDefaultGameHeapId__5mHeapFv = .text:0x802F1450; // type:function size:0x8
createGameHeap__5mHeapFiUlPQ23EGG4Heap = .text:0x802F1460; // type:function size:0xAC
createGameHeap1__5mHeapFUlPQ23EGG4Heap = .text:0x802F1510; // type:function size:0x44
createArchiveHeap__5mHeapFUlPQ23EGG4Heap = .text:0x802F1560; // type:function size:0x2C
createCommandHeap__5mHeapFUlPQ23EGG4Heap = .text:0x802F1590; // type:function size:0x2C
createDylinkHeap__5mHeapFUlPQ23EGG4Heap = .text:0x802F15C0; // type:function size:0x2C
createAssertHeap__5mHeapFPQ23EGG4Heap = .text:0x802F15F0; // type:function size:0x50
fn_802F1640 = .text:0x802F1640; // type:function size:0x20
fn_802F1660 = .text:0x802F1660; // type:function size:0x44
fn_802F16B0 = .text:0x802F16B0; // type:function size:0xBC
@@ -27387,12 +27387,12 @@ __register_global_object = .text:0x804C65C0; // type:function size:0x18 scope:gl
__destroy_global_chain = .text:0x804C65D8; // type:function size:0x48 scope:global
fn_804C6620 = .text:0x804C6620; // type:function size:0x104
fn_804C6724 = .text:0x804C6724; // type:function size:0xBC
fn_804C67E0 = .text:0x804C67E0; // type:function size:0xF8
__construct_array = .text:0x804C67E0; // type:function size:0xF8
fn_804C68D8 = .text:0x804C68D8; // type:function size:0x78
fn_804C6950 = .text:0x804C6950; // type:function size:0x80
fn_804C69D0 = .text:0x804C69D0; // type:function size:0x30
__ptmf_test = .text:0x804C69D0; // type:function size:0x30
fn_804C6A00 = .text:0x804C6A00; // type:function size:0x3C
fn_804C6A3C = .text:0x804C6A3C; // type:function size:0x28
__ptmf_scall = .text:0x804C6A3C; // type:function size:0x28
fn_804C6A64 = .text:0x804C6A64; // type:function size:0x5C
fn_804C6AC0 = .text:0x804C6AC0; // type:function size:0x4C
_savefpr_14 = .text:0x804C6AC0; // type:label scope:global
@@ -27837,7 +27837,7 @@ lbl_804DCBF0 = .rodata:0x804DCBF0; // type:object size:0x13E0
lbl_804DDFD0 = .rodata:0x804DDFD0; // type:object size:0xC data:4byte
lbl_804DDFDC = .rodata:0x804DDFDC; // type:object size:0x14 data:4byte
lbl_804DDFF0 = .rodata:0x804DDFF0; // type:object size:0x18
lbl_804DE008 = .rodata:0x804DE008; // type:object size:0x28
@stringBase@ = .rodata:0x804DE008; // type:object size:0x28 scope:local data:string_table
lbl_804DE030 = .rodata:0x804DE030; // type:object size:0x28
lbl_804DE058 = .rodata:0x804DE058; // type:object size:0x2C
lbl_804DE084 = .rodata:0x804DE084; // type:object size:0x2C
@@ -28755,7 +28755,7 @@ lbl_804F0460 = .rodata:0x804F0460; // type:object size:0x20
lbl_804F0480 = .rodata:0x804F0480; // type:object size:0x60
lbl_804F04E0 = .rodata:0x804F04E0; // type:object size:0x50
lbl_804F0530 = .rodata:0x804F0530; // type:object size:0x40 data:double
lbl_804F0570 = .rodata:0x804F0570; // type:object size:0x10
s_GameHeapNames__5mHeap = .rodata:0x804F0570; // type:object size:0x10
lbl_804F0580 = .rodata:0x804F0580; // type:object size:0x8 data:float
lbl_804F0588 = .rodata:0x804F0588; // type:object size:0x10 data:float
lbl_804F0598 = .rodata:0x804F0598; // type:object size:0x4 data:float
@@ -33705,7 +33705,7 @@ lbl_80529DEC = .data:0x80529DEC; // type:object size:0xC
lbl_80529DF8 = .data:0x80529DF8; // type:object size:0xC data:string
lbl_80529E04 = .data:0x80529E04; // type:object size:0x7C
lbl_80529E80 = .data:0x80529E80; // type:object size:0x24
lbl_80529EA4 = .data:0x80529EA4; // type:object size:0xF4
lbl_80529EA4 = .data:0x80529EA4; // type:object size:0x94
lbl_80529F98 = .data:0x80529F98; // type:object size:0x9C
lbl_8052A034 = .data:0x8052A034; // type:object size:0xC data:string
lbl_8052A040 = .data:0x8052A040; // type:object size:0x38
@@ -39010,8 +39010,8 @@ lbl_80573FA0 = .sdata:0x80573FA0; // type:object size:0x8
lbl_80573FA8 = .sdata:0x80573FA8; // type:object size:0x8
lbl_80573FB0 = .sdata:0x80573FB0; // type:object size:0x4 data:4byte
lbl_80573FB4 = .sdata:0x80573FB4; // type:object size:0x4 data:4byte
m_rootUniqueID__7fBase_c = .sdata:0x80573FB8; // type:object size:0x8 data:4byte
lbl_80573FC0 = .sdata:0x80573FC0; // type:object size:0x8 data:4byte
m_rootUniqueID__7fBase_c = .sdata:0x80573FB8; // type:object size:0x4 data:4byte
m_nowLoopProc__10fManager_c = .sdata:0x80573FC0; // type:object size:0x8 data:4byte
lbl_80573FC8 = .sdata:0x80573FC8; // type:object size:0x8 data:4byte
lbl_80573FD0 = .sdata:0x80573FD0; // type:object size:0x4
lbl_80573FD4 = .sdata:0x80573FD4; // type:object size:0x1 data:byte
@@ -39021,7 +39021,7 @@ lbl_80573FE4 = .sdata:0x80573FE4; // type:object size:0x4 data:string
lbl_80573FE8 = .sdata:0x80573FE8; // type:object size:0x4 data:string
lbl_80573FEC = .sdata:0x80573FEC; // type:object size:0x8
lbl_80573FF4 = .sdata:0x80573FF4; // type:object size:0x4 data:string
lbl_80573FF8 = .sdata:0x80573FF8; // type:object size:0x8 data:byte
g_DefaultGameHeapId__5mHeap = .sdata:0x80573FF8; // type:object size:0x8 data:byte
lbl_80574000 = .sdata:0x80574000; // type:object size:0x8 data:4byte
lbl_80574008 = .sdata:0x80574008; // type:object size:0x8
lbl_80574010 = .sdata:0x80574010; // type:object size:0x8
@@ -39724,14 +39724,14 @@ lbl_8057519C = .sbss:0x8057519C; // type:object size:0x4 data:float
lbl_805751A0 = .sbss:0x805751A0; // type:object size:0x4 data:float
lbl_805751A4 = .sbss:0x805751A4; // type:object size:0x4 data:float
work1Heap__5dHeap = .sbss:0x805751A8; // type:object size:0x4 data:4byte
lbl_805751AC = .sbss:0x805751AC; // type:object size:0x4 data:4byte
lbl_805751B0 = .sbss:0x805751B0; // type:object size:0x4 data:4byte
lbl_805751B4 = .sbss:0x805751B4; // type:object size:0x4 data:4byte
lbl_805751B8 = .sbss:0x805751B8; // type:object size:0x4 data:4byte
lbl_805751BC = .sbss:0x805751BC; // type:object size:0x4 data:4byte
lbl_805751C0 = .sbss:0x805751C0; // type:object size:0x4 data:4byte
lbl_805751C4 = .sbss:0x805751C4; // type:object size:0x4 data:4byte
lbl_805751C8 = .sbss:0x805751C8; // type:object size:0x8 data:4byte
work2Heap__5dHeap = .sbss:0x805751AC; // type:object size:0x4 data:4byte
workExHeap__5dHeap = .sbss:0x805751B0; // type:object size:0x4 data:4byte
layoutHeap__5dHeap = .sbss:0x805751B4; // type:object size:0x4 data:4byte
layoutExHeap__5dHeap = .sbss:0x805751B8; // type:object size:0x4 data:4byte
layoutEx2Heap__5dHeap = .sbss:0x805751BC; // type:object size:0x4 data:4byte
layoutResHeap__5dHeap = .sbss:0x805751C0; // type:object size:0x4 data:4byte
fontHeap__5dHeap = .sbss:0x805751C4; // type:object size:0x4 data:4byte
HBMHeap__5dHeap = .sbss:0x805751C8; // type:object size:0x8 data:4byte
lbl_805751D0 = .sbss:0x805751D0; // type:object size:0x8 data:4byte
lbl_805751D8 = .sbss:0x805751D8; // type:object size:0x4 data:4byte
lbl_805751DC = .sbss:0x805751DC; // type:object size:0x4 data:4byte
@@ -40228,10 +40228,10 @@ lbl_80575B94 = .sbss:0x80575B94; // type:object size:0x4 data:4byte
lbl_80575B98 = .sbss:0x80575B98; // type:object size:0x4 data:4byte
lbl_80575B9C = .sbss:0x80575B9C; // type:object size:0x4 data:4byte
lbl_80575BA0 = .sbss:0x80575BA0; // type:object size:0x8 data:4byte
lbl_80575BA8 = .sbss:0x80575BA8; // type:object size:0x8 data:4byte
m_forceExecuteList__7fBase_c = .sbss:0x80575BA8; // type:object size:0x8 data:4byte
sLoadAsyncCallback__7fBase_c = .sbss:0x80575BB0; // type:object size:0x4 data:4byte
sUnloadCallback__7fBase_c = .sbss:0x80575BB4; // type:object size:0x4 data:4byte
lbl_80575BB8 = .sbss:0x80575BB8; // type:object size:0x8 data:4byte
m_StopProcInf__10fManager_c = .sbss:0x80575BB8; // type:object size:0x4 data:4byte
sProfileList__8fProfile = .sbss:0x80575BC0; // type:object size:0x8 data:4byte
lbl_80575BC8 = .sbss:0x80575BC8; // type:object size:0x4 data:4byte
lbl_80575BCC = .sbss:0x80575BCC; // type:object size:0x1 data:byte
@@ -40259,11 +40259,11 @@ lbl_80575C2C = .sbss:0x80575C2C; // type:object size:0x4 data:4byte
lbl_80575C30 = .sbss:0x80575C30; // type:object size:0x1 data:byte
lbl_80575C31 = .sbss:0x80575C31; // type:object size:0x1 data:byte
lbl_80575C34 = .sbss:0x80575C34; // type:object size:0x4 data:4byte
lbl_80575C38 = .sbss:0x80575C38; // type:object size:0x4 data:4byte
lbl_80575C3C = .sbss:0x80575C3C; // type:object size:0x4 data:4byte
lbl_80575C40 = .sbss:0x80575C40; // type:object size:0x4 data:4byte
lbl_80575C44 = .sbss:0x80575C44; // type:object size:0x4 data:4byte
lbl_80575C48 = .sbss:0x80575C48; // type:object size:0x8 data:4byte
s_SavedCurrentHeap__5mHeap = .sbss:0x80575C38; // type:object size:0x4 data:4byte
g_archiveHeap__5mHeap = .sbss:0x80575C3C; // type:object size:0x4 data:4byte
g_commandHeap__5mHeap = .sbss:0x80575C40; // type:object size:0x4 data:4byte
g_dylinkHeap__5mHeap = .sbss:0x80575C44; // type:object size:0x4 data:4byte
g_assertHeap__5mHeap = .sbss:0x80575C48; // type:object size:0x8 data:4byte
lbl_80575C50 = .sbss:0x80575C50; // type:object size:0x4 data:4byte
lbl_80575C54 = .sbss:0x80575C54; // type:object size:0x4 data:4byte
lbl_80575C58 = .sbss:0x80575C58; // type:object size:0x4 data:4byte
@@ -49046,13 +49046,13 @@ lbl_805B83A0 = .bss:0x805B83A0; // type:object size:0x100
lbl_805B84A0 = .bss:0x805B84A0; // type:object size:0x10 data:4byte
lbl_805B84B0 = .bss:0x805B84B0; // type:object size:0xC
lbl_805B84BC = .bss:0x805B84BC; // type:object size:0xC
lbl_805B84C8 = .bss:0x805B84C8; // type:object size:0x10 data:2byte
lbl_805B84D8 = .bss:0x805B84D8; // type:object size:0x10 data:4byte
lbl_805B84E8 = .bss:0x805B84E8; // type:object size:0x14 data:4byte
lbl_805B84FC = .bss:0x805B84FC; // type:object size:0x14 data:4byte
lbl_805B8510 = .bss:0x805B8510; // type:object size:0x14 data:4byte
lbl_805B8524 = .bss:0x805B8524; // type:object size:0x24 data:4byte
lbl_805B8548 = .bss:0x805B8548; // type:object size:0x40
m_tmpCtData__7fBase_c = .bss:0x805B84C8; // type:object size:0x10 data:4byte
m_connectManage__10fManager_c = .bss:0x805B84D8; // type:object size:0x10 data:4byte
m_createManage__10fManager_c = .bss:0x805B84E8; // type:object size:0x14 data:4byte
m_executeManage__10fManager_c = .bss:0x805B84FC; // type:object size:0x14 data:4byte
m_drawManage__10fManager_c = .bss:0x805B8510; // type:object size:0x14 data:4byte
m_deleteManage__10fManager_c = .bss:0x805B8524; // type:object size:0x14 data:4byte
m_searchManage__10fManager_c = .bss:0x805B8548; // type:object size:0x40
lbl_805B8588 = .bss:0x805B8588; // type:object size:0xC
lbl_805B8594 = .bss:0x805B8594; // type:object size:0xC
lbl_805B85A0 = .bss:0x805B85A0; // type:object size:0x20 data:4byte
@@ -49063,7 +49063,7 @@ lbl_805C1638 = .bss:0x805C1638; // type:object size:0x9930
lbl_805CAF68 = .bss:0x805CAF68; // type:object size:0x30
lbl_805CAF98 = .bss:0x805CAF98; // type:object size:0x10
lbl_805CAFA8 = .bss:0x805CAFA8; // type:object size:0xD0
lbl_805CB078 = .bss:0x805CB078; // type:object size:0x10 data:4byte
g_gameHeaps__5mHeap = .bss:0x805CB078; // type:object size:0x10 data:4byte
lbl_805CB088 = .bss:0x805CB088; // type:object size:0x30 data:4byte
lbl_805CB0B8 = .bss:0x805CB0B8; // type:object size:0x10 data:4byte
lbl_805CB0C8 = .bss:0x805CB0C8; // type:object size:0x10
+10 -1
View File
@@ -120,7 +120,7 @@ if not is_windows():
# Tool versions
config.compilers_tag = "20231018"
config.dtk_tag = "v0.6.5"
config.dtk_tag = "v0.7.5"
config.sjiswrap_tag = "v1.1.1"
config.wibo_tag = "0.6.9"
@@ -185,6 +185,8 @@ cflags_dolphin = [
cflags_framework = [
*cflags_base,
"-inline noauto",
"-str reuse",
]
# EGG flags
@@ -273,11 +275,18 @@ config.libs = [
Object(NonMatching, "toBeSorted/flag_space.cpp"),
Object(NonMatching, "toBeSorted/misc_flag_managers.cpp"),
Object(Matching, "d/d_base.cpp"),
Object(NonMatching, "d/d_heap.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/save_file.cpp"),
Object(NonMatching, "toBeSorted/file_manager.cpp"),
Object(NonMatching, "toBeSorted/save_manager.cpp"),
Object(NonMatching, "f/f_base.cpp"),
Object(NonMatching, "f/f_list.cpp"),
Object(NonMatching, "f/f_manager.cpp"),
Object(NonMatching, "m/m_heap.cpp"),
Object(NonMatching, "m/m_mtx.cpp"),
# framework (f_name)
# d stuff (d_name)
+4
View File
@@ -65,6 +65,10 @@ public:
*/
bool removeTreeNode(cTreeNd_c *node);
const cTreeNd_c *getRoot() const {
return mpRootNode;
}
protected:
cTreeNd_c *mpRootNode; ///< The root node of the tree.
};
+27 -4
View File
@@ -1,8 +1,31 @@
#pragma once
#include "egg/core/eggHeap.h"
#include "egg/core/eggExpHeap.h"
class dHeap {
public:
static EGG::Heap* work1Heap;
};
public:
EGG::ExpHeap *heap;
public:
static dHeap work1Heap;
static dHeap work2Heap;
static dHeap workExHeap;
static dHeap layoutHeap;
static dHeap layoutExHeap;
static dHeap layoutEx2Heap;
static dHeap layoutResHeap;
static dHeap fontHeap;
static dHeap HBMHeap;
public:
EGG::ExpHeap *init(const char *name, size_t size, EGG::Heap *parent);
static void createWork1Heap(size_t size, EGG::Heap *parent);
static void createWork2Heap(size_t size, EGG::Heap *parent);
static void createWorkExHeap(size_t size, EGG::Heap *parent);
static void createLayoutHeap(size_t size, EGG::Heap *parent);
static void createLayoutExHeap(size_t size, EGG::Heap *parent);
static void createLayoutEx2Heap(size_t size, EGG::Heap *parent);
static void createLayoutResHeap(size_t size, EGG::Heap *parent);
static void createFontHeap(size_t size, EGG::Heap *parent);
static void createHBMHeap(size_t size, EGG::Heap *parent);
};
+1
View File
@@ -0,0 +1 @@
#pragma once
+1
View File
@@ -0,0 +1 @@
#pragma once
+1 -2
View File
@@ -3,7 +3,6 @@
#include "egg/core/eggHeap.h"
#include <common.h>
namespace EGG {
class ExpHeap : public Heap {
@@ -22,7 +21,7 @@ public:
public:
/* 80495ab0 */ ExpHeap(MEMiHeapHead *heapHead);
/* 80495b70 */ static ExpHeap *create(void *block, u32 size, u16 attr);
/* 80495c30 */ static ExpHeap *create(u32 size, Heap *heap, u16 attr);
/* 80495c30 */ static ExpHeap *create(size_t size, Heap *heap, u16 attr);
/* 80495d00 */ void setGroupID(u16 groupId);
/* 80495f80 */ u32 getSizeForMBlock(const void *block);
};
+4 -1
View File
@@ -65,6 +65,9 @@ public:
/* vt 0x28 | 00000000 */ virtual u32 adjust() = 0;
public:
void setName(const char *name) {
mName = name;
}
inline bool isExpHeap() {
return getHeapKind() == HEAP_KIND_EXPANDED;
}
@@ -94,7 +97,7 @@ public:
/* 80495690 */ static Heap *findHeap(MEMiHeapHead *heapHandle);
/* 80495730 */ Heap *findParentHeap();
/* 80495780 */ static Heap *findContainHeap(const void *memBlock);
/* 80495560 */ static void *alloc(u32 size, int align, Heap *heap);
/* 80495560 */ static void *alloc(size_t size, int align, Heap *heap);
/* 804957c0 */ static void free(void *memBlock, Heap *heap);
/* 80495830 */ void dispose();
/* 804958a0 */ void dump();
+43 -14
View File
@@ -4,6 +4,7 @@
// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_base.hpp and the Skyward Sword
// Ghidra database. Comments and docs can be seen above. stripped in this file for easier looking
#include "egg/core/eggExpHeap.h"
#include "egg/core/eggFrmHeap.h"
#include "f/f_base_id.h"
#include "f/f_helper_unk.h"
@@ -12,28 +13,36 @@
#include "f/f_profile.h"
#include <common.h>
// Ghidra: fBase
// size: 0x64
// official name
class fBase_c {
public:
/* 0x00 */ fBaseID_e unique_ID;
/* 0x04 */ u32 params1; // params1
/* 0x04 */ u32 params; // params1
/* 0x08 */ ProfileName profile_name; // Actor Id
/* 0x0A */ u8 lifecycle_state;
/* 0x0B */ bool delete_request;
/* 0x0C */ bool update_request;
/* 0x0D */ bool retry_create;
/* 0x0C */ s8 update_request;
/* 0x0D */ bool create_request;
/* 0x0E */ u8 group_type;
/* 0x0F */ u8 proc_control;
/* 0x10 */ fManager_c manager;
/* 0x50 */ fBaHelper_c *p_unused_helper;
/* 0x54 */ fLiMgBa_c unused_list;
/* 0x50 */ fBaHelper_c *p_helper;
/* 0x54 */ fLiMgBa_c actor_list;
/* 0x5C */ EGG::FrmHeap *p_heap;
/* 0x60 */ // vtable
public:
enum LIFECYCLE_e { WAITING_FOR_CREATE, ACTIVE, TO_BE_DELETED };
enum UPDATE_STATUS_e {
UPDATING,
UPDATE_REQUEST,
UPDATE_FORCE,
};
enum LIFECYCLE_e {
WAITING_FOR_CREATE,
ACTIVE,
TO_BE_DELETED,
};
enum GROUP_TYPE_e {
OTHER,
SCENE,
@@ -59,6 +68,17 @@ public:
proc_control &= ~flag;
}
fManager_c *getManager() {
return &manager;
}
void setParams() {
unique_ID = m_rootUniqueID;
params = m_tmpCtData.params;
profile_name = m_tmpCtData.prof_name;
group_type = m_tmpCtData.group_type;
}
public:
/* 802e12f0 */ fBase_c();
/* 802e23b0 */ static void *operator new(size_t);
@@ -78,8 +98,8 @@ public: // vtable 0x60
/* 0x30 | 802E1AA0 */ virtual int preDraw();
/* 0x34 | 802E1AD0 */ virtual void postDraw(MAIN_STATE_e state);
/* 0x38 | 802E1B90 */ virtual void deleteReady();
/* 0x3C | 802E20E0 */ virtual bool entryFrmHeap(unsigned long size, EGG::Heap *parentHeap);
/* 0x40 | 802E22E0 */ virtual bool entryFrmHeapNonAdjust(unsigned long size, EGG::Heap *parentHeap);
/* 0x3C | 802E20E0 */ virtual bool entryFrmHeap(size_t size, EGG::Heap *parentHeap);
/* 0x40 | 802E22E0 */ virtual bool entryFrmHeapNonAdjust(size_t size, EGG::Heap *parentHeap);
/* 0x44 | 802E23A0 */ virtual bool createHeap();
/* 0x48 | 802E1480 */ virtual ~fBase_c();
@@ -92,9 +112,13 @@ public:
/* 802e1ae0 */ int drawPack();
/* 802e1ba0 */ int connectProc();
/* 802e1e00 */ void deleteRequest();
/* 802e1e80 */ void forceUpdate();
/* 802e1f90 */ static fBase_c *getConnectRoot();
/* 802e1f90 */ static fBase_c *getConnectTreeNext(fBase_c *);
/* 802e1f90 */ fBase_c *getConnectParent() const;
/* 802e1fb0 */ fBase_c *getConnectChild() const;
/* 802e1fd0 */ fBase_c *getConnectBrNext() const;
/* 802e1ff0 */ void updateExecutePriority(u16 priority);
/* 802e2090 */ bool setConnectChild(fBase_c *child);
/* 802e2420 */ void runCreate();
/* 802e24a0 */ fBase_c *getChildProcessCreateState() const;
@@ -110,16 +134,21 @@ public:
u8 groupType);
public:
/* 80575ba8 */ static fLiMgBa_c m_additional_actors;
/* 80575ba8 */ static fLiMgBa_c m_forceExecuteList;
/* 80575bb0 */ static int (*sLoadAsyncCallback)();
/* 80575bb4 */ static void (*sUnloadCallback)();
private:
/* 80573fb8 */ static fBaseID_e m_rootUniqueID;
/* 805b84c8 */ static ProfileName m_tmpCtProfName;
/* 805b84cc */ static fTrNdBa_c *m_tmpCtConnectParent;
/* 805b84d0 */ static u32 m_tmpCtParam;
/* 805b84d4 */ static u8 m_tmpCtGroupType;
struct ConstructData {
/* 805b84c8 */ ProfileName prof_name;
/* 805b84cc */ fTrNdBa_c *connect_parent;
/* 805b84d0 */ u32 params;
/* 805b84d4 */ u8 group_type;
};
static ConstructData m_tmpCtData;
friend class fManager_c;
friend class fLiNdBa_c;
+1 -4
View File
@@ -9,7 +9,6 @@
#include "f/f_profile.h"
#include <common.h>
class fBase_c;
/// @brief A list of fLiNdBa_c nodes.
@@ -24,9 +23,7 @@ public:
int countNodeByProfName(ProfileName profName) const;
/* 802e2760 */ const fLiNdBa_c *searchNodeByID(fBaseID_e id) const;
/* 802e2790 */ const fLiNdBa_c *searchNodeByID(fBaseID_e id, fLiMgBa_c *start) const;
/* 802e27d0 */ void link(fLiNdBa_c &, fBase_c *);
/* 802e2830 */ void unlink(fLiNdBa_c &);
/* 802e2790 */ const fLiNdBa_c *searchNodeByProfName(ProfileName name, fLiNdBa_c *start) const;
inline fLiNdBa_c *getFirst() const {
return (fLiNdBa_c *)cListMg_c::getFirst();
+1 -1
View File
@@ -15,7 +15,7 @@ class fBase_c;
class fLiMgPTMF_c : public fLiMgBa_c {
public:
fLiMgPTMF_c(int (fBase_c::*procFunc)()) : mpProcFunc(procFunc) {}
/* 802e2680 */ bool addNode(fLiNdPrio_c *node);
/* 802e2680 */ void addNode(fLiNdPrio_c *node);
/* 802e26e0 */ bool walkPack();
fLiNdPrio_c *getFirst() const {
+3 -2
View File
@@ -6,12 +6,10 @@
#include "c/c_list.h"
#include <common.h>
class fBase_c;
class fLiNdBa_c : public cListNd_c {
public:
fLiNdBa_c() : p_owner(nullptr) {}
fLiNdBa_c(fBase_c *owner) : p_owner(owner) {}
inline fLiNdBa_c *getPrev() const {
@@ -22,5 +20,8 @@ public:
return (fLiNdBa_c *)cListNd_c::getNext();
}
/* 802e27d0 */ void link(fBase_c *);
/* 802e2830 */ void unlink();
fBase_c *p_owner;
};
+24 -6
View File
@@ -7,14 +7,19 @@
#include "f/f_profile.h"
#include <common.h>
/// @brief A list node with priority fields for an order in a list.
/// @note Unofficial name.
class fLiNdPrio_c : public fLiNdBa_c {
public:
/// @brief Constructs a new list node.
/// @param owner The node's owner.
fLiNdPrio_c(fBase_c *owner) : fLiNdBa_c(owner), mOrder(0), mNewOrder(0) {}
fLiNdPrio_c(fBase_c *owner) : fLiNdBa_c(owner), m_order(0), m_new_order(0) {}
void Initialize(fBase_c *owner) {
p_owner = owner;
m_order = 0;
m_new_order = 0;
}
fLiNdPrio_c *getPrev() const {
return (fLiNdPrio_c *)fLiNdBa_c::getPrev();
@@ -25,13 +30,26 @@ public:
}
u16 getOrder() const {
return mOrder;
return m_order;
}
u16 getNewOrder() const {
return mNewOrder;
return m_new_order;
}
u16 mOrder; ///< The priority of this node.
u16 mNewOrder; ///< The priority the node should change to if it differs from ::mOrder.
bool isPriorityChange() {
return m_new_order != m_order;
}
void updatePriority() {
m_order = m_new_order;
}
void setOrder(u16 order) {
m_order = order;
m_new_order = order;
}
u16 m_order; ///< The priority of this node.
u16 m_new_order; ///< The priority the node should change to if it differs from ::mOrder.
};
+14 -22
View File
@@ -1,15 +1,16 @@
#pragma once
// this file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_manager.hpp
// this file was ported from
// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_manager.hpp
#include "f/f_base_id.h"
#include "f/f_list_mg_ptmf.h"
#include "f/f_list_mg.h"
#include "f/f_list_mg_ptmf.h"
#include "f/f_list_nd.h"
#include "f/f_list_nd_prio.h"
#include "f/f_profile.h"
#include "f/f_tree_mg_ptmf.h"
#include "f/f_tree_nd.h"
#include "f/f_profile.h"
#define GET_PROC_FLAG(proc) (1 << (proc - 1))
@@ -17,10 +18,7 @@ class fBase_c;
class fManager_c {
public:
enum LOOP_PROC_e {
NOTHING, CONNECT, CREATE, EXECUTE, DELETE, DRAW
};
enum LOOP_PROC_e { NOTHING, CONNECT, CREATE, EXECUTE, DELETE, DRAW };
enum PROC_FLAGS {
PROC_FLAG_CONNECT = GET_PROC_FLAG(CONNECT),
@@ -29,13 +27,7 @@ public:
PROC_FLAG_DELETE = GET_PROC_FLAG(DELETE),
PROC_FLAG_DRAW = GET_PROC_FLAG(DRAW)
};
fManager_c(fBase_c *owner) :
connect_node(owner),
execute_node(owner),
draw_node(owner),
search_node(owner) {}
fManager_c(fBase_c *owner) : connect_node(owner), execute_node(owner), draw_node(owner), search_node(owner) {}
/* 802e28c0 */ int getSearchTableNum();
/* 802e28d0 */ static fBase_c *searchBaseByID(fBaseID_e id);
/* 802e2920 */ static fBase_c *searchBaseByProfName(ProfileName profID, const fBase_c *parent);
@@ -43,21 +35,21 @@ public:
/* 802e29e0 */ static void mainLoop();
private:
fTrNdBa_c connect_node; ///< The node in ::m_connectManage.
fTrNdBa_c connect_node; ///< The node in ::m_connectManage.
fLiNdPrio_c execute_node; ///< The node in ::m_executeManage.
fLiNdPrio_c draw_node; ///< The node in ::m_drawManage.
fLiNdBa_c search_node; ///< The node in ::m_searchManage.
fLiNdPrio_c draw_node; ///< The node in ::m_drawManage.
fLiNdBa_c search_node; ///< The node in ::m_searchManage.
/* 805b84d8 */ static fTrMgPTMF_c m_connectManage; ///< A tree that connects all loaded bases.
/* 805b84e8 */ static fLiMgPTMF_c m_createManage; ///< A list of all the bases scheduled for creation.
/* 805b84e8 */ static fLiMgPTMF_c m_createManage; ///< A list of all the bases scheduled for creation.
/* 805b84fc */ static fLiMgPTMF_c m_executeManage; ///< A list of all the bases scheduled for execution.
/* 805b8510 */ static fLiMgPTMF_c m_drawManage; ///< A list of all the bases scheduled for drawing.
/* 805b8524 */ static fLiMgPTMF_c m_deleteManage; ///< A list of all the bases scheduled for deletion.
/* 805b8510 */ static fLiMgPTMF_c m_drawManage; ///< A list of all the bases scheduled for drawing.
/* 805b8524 */ static fLiMgPTMF_c m_deleteManage; ///< A list of all the bases scheduled for deletion.
/* 805b8548 */ static fLiMgBa_c m_searchManage[8];
/* 80575bb8 */ static u32 m_StopProcInf; ///< Which processes should be executed this frame.
/* 80575bb8 */ static u32 m_StopProcInf; ///< Which processes should be executed this frame.
/* 80573fc0 */ static LOOP_PROC_e m_nowLoopProc; ///< The process ::mainLoop is currently in.
friend class fBase_c;
};
};
+35 -25
View File
@@ -4,20 +4,30 @@
#include "f/f_profile_name.h"
/// @brief Creates a profile of a base with given values for execute and draw order.
#define SPECIAL_BASE_PROFILE(profName, className, executeOrder, drawOrder, baseProperties) void *className##_classInit() { return new className(); } \
fProfile::fBaseProfile_c g_profile_##profName = { &className##_classInit, executeOrder, drawOrder, baseProperties }
#define SPECIAL_BASE_PROFILE(profName, className, executeOrder, drawOrder, baseProperties) \
void *className##_classInit() { \
return new className(); \
} \
fProfile::fBaseProfile_c g_profile_##profName = {&className##_classInit, executeOrder, drawOrder, baseProperties}
/// @brief Creates a profile of an actor with given values for execute and draw order and the actor properties. @see SPECIAL_BASE_PROFILE
#define SPECIAL_ACTOR_PROFILE(profName, className, executeOrder, drawOrder, baseProperties, properties) void *className##_classInit() { return new className(); } \
const fProfile::fActorProfile_c g_profile_##profName = { &className##_classInit, executeOrder, drawOrder, baseProperties, properties }
/// @brief Creates a profile of an actor with given values for execute and draw order and the actor properties. @see
/// SPECIAL_BASE_PROFILE
#define SPECIAL_ACTOR_PROFILE(profName, className, executeOrder, drawOrder, baseProperties, properties) \
void *className##_classInit() { \
return new className(); \
} \
const fProfile::fActorProfile_c g_profile_##profName = {&className##_classInit, executeOrder, drawOrder, \
baseProperties, properties}
/// @brief Creates a profile for a base, with the profile number as the priority for both the draw and execute order. @see SPECIAL_BASE_PROFILE
#define DEFAULT_BASE_PROFILE(profName, className) SPECIAL_BASE_PROFILE(profName, className, fProfile::profName, fProfile::profName);
/// @brief Creates a profile for a base, with the profile number as the priority for both the draw and execute order.
/// @see SPECIAL_BASE_PROFILE
#define DEFAULT_BASE_PROFILE(profName, className) \
SPECIAL_BASE_PROFILE(profName, className, fProfile::profName, fProfile::profName);
/// @brief Creates a profile of an actor with default values. @see DEFAULT_BASE_PROFILE
#define DEFAULT_ACTOR_PROFILE(profName, className, baseProperties, properties) SPECIAL_ACTOR_PROFILE(profName, className, fProfile::profName, fProfile::profName, baseProperties, properties);
#define DEFAULT_ACTOR_PROFILE(profName, className, baseProperties, properties) \
SPECIAL_ACTOR_PROFILE(profName, className, fProfile::profName, fProfile::profName, baseProperties, properties);
/*
fProfile::fActorProfile_c g_profile_NAME = {
@@ -46,22 +56,22 @@ char *dProf_getName(ProfileName profName);
/// @note Unofficial name.
namespace fProfile {
/// @brief A set of basic information needed to construct a base.
/// @details A profile consists of a pointer to a constructor function
/// and a priority value for execution and drawing order.
struct fBaseProfile_c {
void *(*mpClassInit)(); ///< The constructor function.
u16 mExecuteOrder; ///< The execution priority of the base.
u16 mDrawOrder; ///< The draw priority of the base.
u32 mBaseProperties;
};
/// @brief A set of basic information needed to construct a base.
/// @details A profile consists of a pointer to a constructor function
/// and a priority value for execution and drawing order.
struct fBaseProfile_c {
void *(*mpClassInit)(); ///< The constructor function.
u16 m_execute_order; ///< The execution priority of the base.
u16 m_draw_order; ///< The draw priority of the base.
u32 mBaseProperties;
};
/// @brief A set of basic information needed to construct an actor.
/// @details In addition to the fields in fBaseProfile_c, it also contains some properties about the actor.
struct fActorProfile_c : fBaseProfile_c {
u32 mActorProperties; ///< Some actor-related properties. @todo Document the bitfield.
};
/// @brief A set of basic information needed to construct an actor.
/// @details In addition to the fields in fBaseProfile_c, it also contains some properties about the actor.
struct fActorProfile_c : fBaseProfile_c {
u32 mActorProperties; ///< Some actor-related properties. @todo Document the bitfield.
};
extern fBaseProfile_c *(*sProfileList)[NUMBER_OF_ACTORS]; ///< A list of all profiles.
extern fBaseProfile_c *(*sProfileList)[NUMBER_OF_ACTORS]; ///< A list of all profiles.
} // namespace fProfile
} // namespace fProfile
+4 -1
View File
@@ -7,7 +7,6 @@
#include "f/f_profile.h"
#include <common.h>
class fTrNdBa_c;
/// @brief A container for a tree of fTrNdBa_c nodes.
@@ -29,4 +28,8 @@ public:
* @return The found node, or @p nullptr if none was found.
*/
const fTrNdBa_c *searchNodeByGroupType(u8 groupType, const fTrNdBa_c *parent) const;
const fTrNdBa_c *getRoot() const {
return (fTrNdBa_c *)cTreeMg_c::getRoot();
}
};
-1
View File
@@ -7,7 +7,6 @@
#include "f/f_tree_mg.h"
#include <common.h>
class fBase_c;
/// @brief A container for a tree of fTrNdBa_c nodes with a reference to a process function.
-1
View File
@@ -7,7 +7,6 @@
#include "f/f_profile.h"
#include <common.h>
class fBase_c;
class fTrNdBa_c : public cTreeNd_c {
+36 -28
View File
@@ -1,37 +1,45 @@
#pragma once
#include "egg/core/eggHeap.h"
#include "egg/core/eggFrmHeap.h"
#include "egg/core/eggHeap.h"
// #include "egg/core/eggExpHeap.h"
// #include "egg/core/eggAssertHeap.h"
namespace EGG {
class ExpHeap;
class AssertHeap;
}
class ExpHeap;
class AssertHeap;
} // namespace EGG
// TODO: Doc symbols and func locations
namespace mHeap {
/* 802f0f00 */ u8 copyAttribute(u32);
/* 802f0f40 */ EGG::Heap* setCurrentHeap(EGG::Heap*);
/* 802f0f50 */ EGG::ExpHeap* createExpHeap(s32 size, EGG::Heap* parentHeap, char* name, s32 align, u32 unk);
/* 802f1060 */ void adjustExpHeap(EGG::Heap* heap);
/* 802f10d0 */ s32 expHeapCost(s32 start, s32 size);
/* 802f10f0 */ EGG::FrmHeap* createFrmHeap(s32 size, EGG::Heap* parentHeap, char* name, s32 align, u32 unk);
/* 802f1200 */ void destroyFrmHeap(EGG::Heap* heap);
/* 802f1220 */ void adjustFrmHeap(EGG::Heap* heap);
/* 802f1290 */ s32 frmHeapCost(s32 start, s32 size);
/* 802f12b0 */ void setTempHeap(EGG::Heap** prevHeap, EGG::Heap* tempNewHeap);
/* 802f12f0 */ void restoreTempHeap(EGG::Heap** prevHeap);
/* 802f1350 */ void createHeap(s32 size, EGG::Heap*, char* name);
/* 802f13d0 */ void saveCurrentHeap();
/* 802f13e0 */ void restoreCurrentHeap();
/* 802f1410 */ EGG::Heap* makeFrmHeapAndSet(s32 size, EGG::Heap* parentHeap, char* name, s32 align, u32 unk);
/* 802f1450 */ int getGameHeapNum();
/* 802f1460 */ EGG::Heap* createGameHeap(s32 heapNum, s32 size, EGG::Heap* parentHeap);
/* 802f1510 */ EGG::Heap* createGameHeap1(s32 size, EGG::Heap* parentHeap);
/* 802f1560 */ void createArchiveHeap(s32 size, EGG::Heap* parentHeap);
/* 802f1590 */ void createCommandHeap(s32 size, EGG::Heap* parentHeap);
/* 802f15c0 */ void createDylinkHeap(s32 size, EGG::Heap* parentHeap);
/* 802f15f0 */ void createAssertHeap(EGG::Heap* parentHeap);
/* 802f1640 */ EGG::Heap* makeHeapOnCurrentGameHeap(s32 size, char* name, s32 align, u32 unk);
};
/* 802f0f00 */ u8 copyAttribute(u32);
/* 802f0f40 */ EGG::Heap *setCurrentHeap(EGG::Heap *);
/* 802f0f50 */ EGG::ExpHeap *createExpHeap(size_t size, EGG::Heap *parentHeap, char *name, s32 align, u32 unk);
/* 802f1060 */ void adjustExpHeap(EGG::Heap *heap);
/* 802f10d0 */ s32 expHeapCost(size_t start, size_t size);
/* 802f10f0 */ EGG::FrmHeap *createFrmHeap(size_t size, EGG::Heap *parentHeap, char *name, s32 align, u32 unk);
/* 802f1200 */ void destroyFrmHeap(EGG::FrmHeap *heap);
/* 802f1220 */ size_t adjustFrmHeap(EGG::FrmHeap *heap);
/* 802f1290 */ s32 frmHeapCost(size_t start, size_t size);
/* 802f12b0 */ void setTempHeap(EGG::Heap **prevHeap, EGG::Heap *tempNewHeap);
/* 802f12f0 */ void restoreTempHeap(EGG::Heap **prevHeap);
/* 802f1350 */ void createHeap(size_t size, EGG::Heap *, char *name);
/* 802f13d0 */ void saveCurrentHeap();
/* 802f13e0 */ void restoreCurrentHeap();
/* 802f1410 */ EGG::FrmHeap *makeFrmHeapAndUpdate(size_t size, EGG::Heap *parentHeap, const char *name, s32 align,
u32 unk);
/* 802f1450 */ int getGameHeapNum();
/* 802f1460 */ EGG::Heap *createGameHeap(s32 heapNum, size_t size, EGG::Heap *parentHeap);
/* 802f1510 */ EGG::Heap *createGameHeap1(s32 size, EGG::Heap *parentHeap);
/* 802f1560 */ void createArchiveHeap(size_t size, EGG::Heap *parentHeap);
/* 802f1590 */ void createCommandHeap(size_t size, EGG::Heap *parentHeap);
/* 802f15c0 */ void createDylinkHeap(size_t size, EGG::Heap *parentHeap);
/* 802f15f0 */ void createAssertHeap(EGG::Heap *parentHeap);
/* 802f1640 */ EGG::Heap *makeHeapOnCurrentGameHeap(size_t size, char *name, s32 align, u32 unk);
extern EGG::ExpHeap *g_gameHeaps[4];
extern EGG::ExpHeap *s_SavedCurrentHeap;
extern EGG::ExpHeap *g_archiveHeap;
extern EGG::ExpHeap *g_commandHeap;
extern EGG::ExpHeap *g_dylinkHeap;
extern EGG::AssertHeap *g_assertHeap;
}; // namespace mHeap
+60 -86
View File
@@ -6,49 +6,35 @@
u32 dAcBase_c::s_Create_RoomId = -1;
u32 dAcBase_c::s_Create_Params2 = -1;
u16 dAcBase_c::s_Create_UnkFlags = -1;
u8 dAcBase_c::s_Create_ViewClipIdx = -1;
u8 dAcBase_c::s_Create_ViewClipIdx = -1;
// .sbss
mVec3_c* dAcBase_c::s_Create_Position;
mAng3_c* dAcBase_c::s_Create_Rotation;
mVec3_c* dAcBase_c::s_Create_Scale;
dAcBase_c* dAcBase_c::s_Create_Parent;
ObjInfo* dAcBase_c::s_Create_ObjInfo;
mVec3_c *dAcBase_c::s_Create_Position;
mAng3_c *dAcBase_c::s_Create_Rotation;
mVec3_c *dAcBase_c::s_Create_Scale;
dAcBase_c *dAcBase_c::s_Create_Parent;
ObjInfo *dAcBase_c::s_Create_ObjInfo;
u8 dAcBase_c::s_Create_Subtype;
extern "C" ObjInfo* getObjByActorIdAndSubtype_unkNamespace(ProfileName, u8);
extern "C" char* getObjectName_8006a730(ObjInfo*);
extern "C" void* soundForActorInitRelated_803889c0(s8, fBase_c*, char*, u8);
extern "C" ObjInfo *getObjByActorIdAndSubtype_unkNamespace(ProfileName, u8);
extern "C" char *getObjectName_8006a730(ObjInfo *);
extern "C" void *soundForActorInitRelated_803889c0(s8, fBase_c *, char *, u8);
bool dAcBase_c::createHeap() {
return true;
}
// Doesnt Match Yet
dAcBase_c::dAcBase_c() :
heap_allocator() ,
obj_info(s_Create_ObjInfo),
sound_info_tail(&heap_allocator.mHeap),
sound_info_next(&heap_allocator.mHeap),
count(0),
obj_sound(nullptr),
obj_pos(&position),
params2(s_Create_Params2),
obj_id(s_Create_UnkFlags),
viewclip_index(s_Create_ViewClipIdx),
actor_node(),
roomid(s_Create_RoomId),
actor_subtype(s_Create_Subtype)
{
dAcBase_c::dAcBase_c()
: heap_allocator(), obj_info(s_Create_ObjInfo), sound_info_tail(&heap_allocator.mHeap),
sound_info_next(&heap_allocator.mHeap), count(0), obj_sound(nullptr), obj_pos(&position),
params2(s_Create_Params2), obj_id(s_Create_UnkFlags), viewclip_index(s_Create_ViewClipIdx), actor_node(),
roomid(s_Create_RoomId), actor_subtype(s_Create_Subtype) {
JStudio_actor = 0;
someStr[0] = 0;
if (s_Create_Position != nullptr) {
// void set(f32 fx, f32 fy, f32 fz) { x = fx; y = fy; z = fz; }
position.set(
s_Create_Position->x,
s_Create_Position->y,
s_Create_Position->z
);
position.set(s_Create_Position->x, s_Create_Position->y, s_Create_Position->z);
// position = *s_Create_Position;
}
if (s_Create_Rotation != 0) {
@@ -59,27 +45,23 @@ dAcBase_c::dAcBase_c() :
} else {
setScale(1.0, 1.0, 1.0);
}
if (s_Create_Parent != 0){
if (s_Create_Parent != 0) {
setActorRef(s_Create_Parent);
}
fProfile::fActorProfile_c* profile = (fProfile::fActorProfile_c*)((*fProfile::sProfileList)[profile_name]);
fProfile::fActorProfile_c *profile = (fProfile::fActorProfile_c *)((*fProfile::sProfileList)[profile_name]);
actor_properties = profile->mActorProperties;
if (obj_info == nullptr) {
obj_info = getObjByActorIdAndSubtype_unkNamespace(profile_name, actor_subtype);
}
someStr[0] = '\0';
}
}
/* 8002c530 */ dBase_c::~dBase_c() {}
dAcBase_c::~dAcBase_c() {}
void dAcBase_c::setTempCreateParams( \
mVec3_c* pos, mAng3_c* rot, mVec3_c* scale, \
s32 roomId, u32 params2, dAcBase_c* parent, \
u8 subtype, s16 unkFlag, u8 viewClipIdx,\
ObjInfo* objInfo )
{
void dAcBase_c::setTempCreateParams(mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2,
dAcBase_c *parent, u8 subtype, s16 unkFlag, u8 viewClipIdx, ObjInfo *objInfo) {
s_Create_Position = pos;
s_Create_Rotation = rot;
s_Create_Scale = scale;
@@ -93,25 +75,25 @@ void dAcBase_c::setTempCreateParams( \
}
// has regswap
void* dAcBase_c::FUN_8002c690() {
void *dAcBase_c::FUN_8002c690() {
if (obj_info == nullptr) {
return nullptr;
}
s8 unk_val = obj_info->unk_0xA;
if ( unk_val == -1) {
if (unk_val == -1) {
return nullptr;
}
char* objName = getObjectName_8006a730(obj_info);
char *objName = getObjectName_8006a730(obj_info);
return soundForActorInitRelated_803889c0(unk_val, this, objName, subtype);
}
int dAcBase_c::initAllocatorWork1Heap(int size, char* name, int align) {
initAllocator(size, name, dHeap::work1Heap, align);
int dAcBase_c::initAllocatorWork1Heap(int size, char *name, int align) {
return initAllocator(size, name, dHeap::work1Heap.heap, align);
}
extern "C" int fn_802EE510(mAllocator_c*, int size, EGG::Heap* heap, char* name, int align, int unk);
int dAcBase_c::initAllocator(int size, char* name, EGG::Heap* heap, int align) {
if (fn_802EE510(&heap_allocator, size, heap, name, 0x20, 0) == 0){
extern "C" int fn_802EE510(mAllocator_c *, int size, EGG::Heap *heap, char *name, int align, int unk);
int dAcBase_c::initAllocator(int size, char *name, EGG::Heap *heap, int align) {
if (fn_802EE510(&heap_allocator, size, heap, name, 0x20, 0) == 0) {
return 0;
}
obj_sound = FUN_8002c690();
@@ -121,11 +103,11 @@ int dAcBase_c::initAllocator(int size, char* name, EGG::Heap* heap, int align) {
}
bool dAcBase_c::addActorToRoom(s32 roomId) {
dBase_c* room = RoomManager::getRoom(roomId);
dBase_c *room = RoomManager::getRoom(roomId);
if (room == nullptr) {
return false;
}
if (setConnectChild(room)){
if (setConnectChild(room)) {
if (roomId == -1) {
this->roomid = RoomManager::m_Instance->curr_room_id;
} else {
@@ -149,7 +131,7 @@ int dAcBase_c::create() {
return actorPostCreate();
}
int success = actorCreate();
if (success == SUCCEEDED){
if (success == SUCCEEDED) {
success = NOT_READY;
actor_properties |= 0x8000000;
}
@@ -159,15 +141,13 @@ int dAcBase_c::create() {
void dAcBase_c::postCreate(fBase_c::MAIN_STATE_e state) {
if (state == SUCCESS) {
pos_copy = position;
rot_copy = rotation;
rot_copy = rotation;
room_id_copy = roomid;
}
dBase_c::postCreate(state);
}
int dAcBase_c::preDelete() {
}
int dAcBase_c::preDelete() {}
int dAcBase_c::preExecute() {
if (dBase_c::preExecute() == NOT_READY) {
@@ -185,10 +165,14 @@ int dAcBase_c::execute() {}
int dAcBase_c::actorExecute() {}
int dAcBase_c::actorExecuteInEvent() {}
void dAcBase_c::postExecute(fBase_c::MAIN_STATE_e state) {}
void dAcBase_c::unkVirtFunc_0x5C() { return; }
void dAcBase_c::unkVirtFunc_0x60() { return; }
void dAcBase_c::unkVirtFunc_0x5C() {
return;
}
void dAcBase_c::unkVirtFunc_0x60() {
return;
}
bool dAcBase_c::restorePosRotFromCopy() {}
u32 dAcBase_c::itemDroppingAndGivingRelated(Vec3f* spawnPos, int subtype) {}
u32 dAcBase_c::itemDroppingAndGivingRelated(Vec3f *spawnPos, int subtype) {}
void dAcBase_c::fillUpperParams2Byte() {}
u32 dAcBase_c::getParams2_ignoreLower() {}
void dAcBase_c::setParams2Upper_ignoreLower(u32 val) {}
@@ -196,29 +180,23 @@ u8 dAcBase_c::getParams2UpperByte() {}
void dAcBase_c::setParams2UpperByte(u32 val) {}
u32 dAcBase_c::buildParams2(u32 lower, u8 upper) {}
u32 dAcBase_c::getParams2Lower() {}
dAcBase_c* dAcBase_c::findActor(char* objName, dAcBase_c* parent) {}
dAcBase_c *dAcBase_c::findActor(char *objName, dAcBase_c *parent) {}
// searches for actor based on groupType
dAcBase_c* dAcBase_c::searchActor(dAcBase_c& optionalParent) {}
dAcBase_c *dAcBase_c::searchActor(dAcBase_c &optionalParent) {}
void dAcBase_c::forEachActor(void*, dAcBase_c&) {}
void dAcBase_c::forEachActor(void *, dAcBase_c &) {}
mAng dAcBase_c::getXZAngleToPlayer() {}
bool dAcBase_c::getDistanceToActor(dAcBase_c& actor, f32 distThresh, f32* outDist) {}
bool dAcBase_c::getDistanceAndAngleToActor( \
dAcBase_c& actor, f32 distThresh, s16 yAngle, s16 xAngle, \
f32* outDist, s16* outDiffAngleY, s16* outDiffAngleX)
{
}
bool dAcBase_c::getDistanceToActor(dAcBase_c &actor, f32 distThresh, f32 *outDist) {}
bool dAcBase_c::getDistanceAndAngleToActor(dAcBase_c &actor, f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist,
s16 *outDiffAngleY, s16 *outDiffAngleX) {}
bool dAcBase_c::isWithinPlayerRadius(f32 radius) {}
bool dAcBase_c::getDistanceAndAngleToPlayer( \
f32 distThresh, s16 yAngle, s16 xAngle, \
f32* outDist, s16* outDiffAngleY, s16* outDiffAngleX)
{
bool dAcBase_c::getDistanceAndAngleToPlayer(f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY,
s16 *outDiffAngleX) {
// return getDistanceAndAngleToActor(PLAYER, distThresh, yAngle, xAngle, outDist, outDiffAngleY, outDiffAngleX);
}
f32 dAcBase_c::getDistToPlayer() {}
f32 dAcBase_c::getSquareDistToPlayer() {}
f32 dAcBase_c::getSquareDistToPlayer() {}
void dAcBase_c::updateRoomId(f32 yOffs) {}
bool dAcBase_c::isRoomFlags_0x6_Set() {}
void dAcBase_c::FUN_8002d590() {}
@@ -238,34 +216,30 @@ void dAcBase_c::FUN_8002d810() {}
void dAcBase_c::FUN_8002d830() {}
void dAcBase_c::FUN_8002d860() {}
void dAcBase_c::FUN_8002d880() {}
// first param is not dAcBase_c
// first param is not dAcBase_c
void dAcBase_c::FUN_8002d890() {}
// current name is Global__setActorRef
void dAcBase_c::setActorRef(dBase_c*) {}
// May not be only purpose
// current name is Global__setActorRef
void dAcBase_c::setActorRef(dBase_c *) {}
// May not be only purpose
void dAcBase_c::setUnkFlag() {}
void dAcBase_c::FUN_8002d940() {}
void dAcBase_c::FUN_8002d960() {}
// spawns GroupType2 (ACTOR)
dAcBase_c dAcBase_c::createActor( \
ProfileName actorId, u32 params1, \
Vec3f* pos, Vec3s* rot, Vec3f* scale, \
u32 params2, s32 roomId, dBase_c* ref) {}
dAcBase_c dAcBase_c::createActor(ProfileName actorId, u32 params1, Vec3f *pos, Vec3s *rot, Vec3f *scale, u32 params2,
s32 roomId, dBase_c *ref) {}
dAcBase_c dAcBase_c::createActorUnkGroup3( \
ProfileName actorId, u32 params1, \
Vec3f* pos, Vec3s* rot, Vec3f* scale, \
u32 params2, s32 roomId, dBase_c* ref) {}
dAcBase_c dAcBase_c::createActorUnkGroup3(ProfileName actorId, u32 params1, Vec3f *pos, Vec3s *rot, Vec3f *scale,
u32 params2, s32 roomId, dBase_c *ref) {}
void* dAcBase_c::getCurrentEventActor() {}
void *dAcBase_c::getCurrentEventActor() {}
void dAcBase_c::unkVirtFunc_0x6C() {}
void dAcBase_c::doInteraction(s32) {}
void dAcBase_c::FUN_8002dc20(s16*, s16*) {}
void dAcBase_c::FUN_8002dc20(s16 *, s16 *) {}
void dAcBase_c::incrementKillCounter() {}
void dAcBase_c::FUN_8002dcd0() {}
void dAcBase_c::FUN_8002dd10() {}
void dAcBase_c::FUN_8002dd50() {}
void dAcBase_c::FUN_8002dd90() {}
void dAcBase_c::FUN_8002ddd0() {}
void dAcBase_c::FUN_8002de30() {}
void dAcBase_c::FUN_8002de30() {}
+47
View File
@@ -0,0 +1,47 @@
#include <d/d_heap.h>
dHeap dHeap::work1Heap;
dHeap dHeap::work2Heap;
dHeap dHeap::workExHeap;
dHeap dHeap::layoutHeap;
dHeap dHeap::layoutExHeap;
dHeap dHeap::layoutEx2Heap;
dHeap dHeap::layoutResHeap;
dHeap dHeap::fontHeap;
dHeap dHeap::HBMHeap;
EGG::ExpHeap *dHeap::init(const char *name, size_t size, EGG::Heap *parent) {
heap = EGG::ExpHeap::create(size, parent, 4);
if (heap != nullptr) {
heap->setGroupID(0);
heap->mName = name;
}
return heap;
}
void dHeap::createWork1Heap(size_t size, EGG::Heap *parent) {
work1Heap.init("ゲーム用作業用ヒープ(dHeap::work1Heap)", size, parent);
}
void dHeap::createWork2Heap(size_t size, EGG::Heap *parent) {
work2Heap.init("ゲーム用作業用ヒープ(dHeap::work2Heap)", size, parent);
}
void dHeap::createWorkExHeap(size_t size, EGG::Heap *parent) {
workExHeap.init("ゲーム用拡張作業用ヒープ(dHeap::workExHeap)", size, parent);
}
void dHeap::createLayoutHeap(size_t size, EGG::Heap *parent) {
layoutHeap.init("レイアウト作業用ヒープ(dHeap::layoutHeap)", size, parent);
}
void dHeap::createLayoutExHeap(size_t size, EGG::Heap *parent) {
layoutExHeap.init("レイアウト拡張作業用ヒープ(dHeap::layoutExHeap)", size, parent);
}
void dHeap::createLayoutEx2Heap(size_t size, EGG::Heap *parent) {
layoutEx2Heap.init("レイアウト拡張作業用ヒープ2(dHeap::layoutEx2Heap)", size, parent);
}
void dHeap::createLayoutResHeap(size_t size, EGG::Heap *parent) {
layoutResHeap.init("レイアウトリソース用ヒープ(dHeap::layoutResHeap)", size, parent);
}
void dHeap::createFontHeap(size_t size, EGG::Heap *parent) {
fontHeap.init("フォント用ヒープ(dHeap::fontHeap)", size, parent);
}
void dHeap::createHBMHeap(size_t size, EGG::Heap *parent) {
HBMHeap.init("HBM用ヒープ(dHeap::HBMHeap)", size, parent);
}
View File
View File
+526 -47
View File
@@ -1,31 +1,92 @@
#include "f/f_base.h"
#include "MSL_C/string.h"
#include "m/m_heap.h"
/*
.text File Range:
[802e12f0 - 802e2680]
*/
// This file will be ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/source/dol/framework/f_base.cpp
// This file will be ported from
// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/source/dol/framework/f_base.cpp
fBaseID_e fBase_c::m_rootUniqueID = FIRST_ID;
ProfileName fBase_c::m_tmpCtProfName;
u32 fBase_c::m_tmpCtParam;
u8 fBase_c::m_tmpCtGroupType;
fTrNdBa_c *fBase_c::m_tmpCtConnectParent;
// 0x80575bb0: sLoadAsyncCallback__7fBase_c
// 0x80575bb4: sUnloadCallback__7fBase_c
fBase_c::ConstructData fBase_c::m_tmpCtData;
// 0x80575bb0: sLoadAsyncCallback__7fBase_c
// 0x80575bb4: sUnloadCallback__7fBase_c
fLiMgBa_c fBase_c::m_forceExecuteList;
int (*fBase_c::sLoadAsyncCallback)();
void (*fBase_c::sUnloadCallback)();
/* 802e12f0 */
fBase_c::fBase_c() : manager(this) {}
fBase_c::fBase_c()
: unique_ID(m_rootUniqueID), params(m_tmpCtData.params), profile_name(m_tmpCtData.prof_name),
group_type(m_tmpCtData.group_type), manager(this) {
fManager_c *mgr = &manager;
m_rootUniqueID = (fBaseID_e)(m_rootUniqueID + 1);
if (m_rootUniqueID == INVALID) {
for (;;) {
continue;
}
}
fManager_c::m_connectManage.addTreeNode(&mgr->connect_node, m_tmpCtData.connect_parent);
int searchTableIdx = mgr->getSearchTableNum();
fManager_c::m_searchManage[searchTableIdx].prepend(&manager.search_node);
const fProfile::fBaseProfile_c *profile = (*fProfile::sProfileList)[profile_name];
if (profile != nullptr) {
manager.execute_node.setOrder(profile->m_execute_order);
manager.draw_node.setOrder(profile->m_draw_order);
}
fBase_c *parent = getConnectParent();
if (parent != nullptr) {
if (parent->isProcControlFlag(ROOT_DISABLE_EXECUTE) || parent->isProcControlFlag(DISABLE_EXECUTE)) {
setProcControlFlag(DISABLE_EXECUTE);
}
if (parent->isProcControlFlag(ROOT_DISABLE_DRAW) || parent->isProcControlFlag(DISABLE_DRAW)) {
setProcControlFlag(DISABLE_DRAW);
}
}
}
/* 802e1480 */
fBase_c::~fBase_c() {}
fBase_c::~fBase_c() {
fLiNdBa_c *node = actor_list.getFirst();
while (node != nullptr) {
node->unlink();
node = actor_list.getFirst();
}
}
/* 802e1500 */
int fBase_c::commonPack(int (fBase_c::*doFunc)(), int (fBase_c::*preFunc)(), void (fBase_c::*postFunc)(MAIN_STATE_e)) {}
int fBase_c::commonPack(int (fBase_c::*doFunc)(), int (fBase_c::*preFunc)(), void (fBase_c::*postFunc)(MAIN_STATE_e)) {
MAIN_STATE_e state;
// Pre Function to setup
int result = (this->*preFunc)();
if (result) {
// Do function to handle current
result = (this->*doFunc)();
if (result == NOT_READY) {
state = WAITING;
} else if (result == SUCCEEDED) {
state = SUCCESS;
} else {
state = ERROR;
}
} else {
state = CANCELED;
}
// Post Function to handle after effects (Allows for retry after waiting)
(this->*postFunc)(state);
return result;
}
/* 802e15c0 */
int fBase_c::create() {
@@ -33,115 +94,533 @@ int fBase_c::create() {
}
/* 802e15d0 */
int fBase_c::preCreate() {}
int fBase_c::preCreate() {
return SUCCEEDED;
}
/* 802e15e0 */
void fBase_c::postCreate(MAIN_STATE_e state) {}
void fBase_c::postCreate(MAIN_STATE_e state) {
if (state == SUCCESS) {
fManager_c::m_createManage.remove(&manager.execute_node);
if (fManager_c::m_nowLoopProc == fManager_c::EXECUTE) {
update_request = true;
} else {
fManager_c::m_executeManage.addNode(&manager.execute_node);
fManager_c::m_drawManage.addNode(&manager.draw_node);
lifecycle_state = ACTIVE;
}
} else if (state == ERROR) {
deleteRequest();
}
}
/* 802e1670 */
int fBase_c::doDelete() {}
int fBase_c::doDelete() {
return 1;
}
/* 802e1680 */
int fBase_c::createPack() {}
int fBase_c::createPack() {
// Returns PACK_RESULT_e
return commonPack(&create, &preCreate, &postCreate);
}
/* 802e1730 */
int fBase_c::preDelete() {}
int fBase_c::preDelete() {
if (p_helper != nullptr && !p_helper->LoadOnlyOne()) {
return NOT_READY;
}
// Not ready for delete if it has children (children need deletion to process first)
fBase_c *child = getConnectChild();
if (child != nullptr) {
return NOT_READY;
}
return SUCCEEDED;
}
/* 802e17a0 */
void fBase_c::postDelete(MAIN_STATE_e state) {}
void fBase_c::postDelete(MAIN_STATE_e state) {
// If the Actor is ready for deletion, make sure that it is:
// - Removed from the connection tree
// - Removed form the search tree
// - Removed from the execute node from delete list (is being processed now)
// - Remove the Healp Allocation
// Helper Delete I guess
// - Finally Destroy the Object and ppoof it goes
if (state == SUCCESS) {
fManager_c::m_connectManage.removeTreeNode(&manager.connect_node);
int searchTableIdx = manager.getSearchTableNum();
fManager_c::m_searchManage[searchTableIdx].remove(&manager.search_node);
fManager_c::m_deleteManage.remove(&manager.execute_node);
if (p_heap != nullptr) {
p_heap->destroy();
}
if (p_helper != nullptr) {
p_helper->Delete();
}
delete this;
}
}
/* 802e15d0 */
int fBase_c::deletePack() {}
int fBase_c::deletePack() {
// Returns PACK_RESULT_e
return commonPack(&doDelete, &preDelete, &postDelete);
}
/* 802e1910 */
int fBase_c::execute() {}
int fBase_c::execute() {
return SUCCEEDED;
}
/* 802e1920 */
int fBase_c::preExecute() {}
int fBase_c::preExecute() {
// Do not execute if it has been flagged for deletion or marked as non-execute
if (delete_request || isProcControlFlag(DISABLE_EXECUTE)) {
return NOT_READY;
}
return SUCCEEDED;
}
/* 802e1950 */
void fBase_c::postExecute(MAIN_STATE_e state) {}
void fBase_c::postExecute(MAIN_STATE_e state) {
// Implemented per Actor
return;
}
/* 802e1960 */
int fBase_c::executePack() {}
int fBase_c::executePack() {
// Returns PACK_RESULT_e
int result = commonPack(&execute, &preExecute, &postExecute);
// Check force update list (bamboo cut to force a cut type of thing)
fLiNdBa_c *node = m_forceExecuteList.getFirst();
while (node != nullptr) {
node->p_owner->commonPack(&execute, &preExecute, &postExecute);
fLiNdBa_c *tempNode = node->getNext();
m_forceExecuteList.remove(node);
node = tempNode;
}
return result;
}
/* 802e1a90 */
int fBase_c::draw() {}
int fBase_c::draw() {
return SUCCEEDED;
}
/* 802e1aa0 */
int fBase_c::preDraw() {}
int fBase_c::preDraw() {
// Do not draw if it has been flagged for deletion or marked as non-draw
if (delete_request || isProcControlFlag(DISABLE_DRAW)) {
return NOT_READY;
}
return SUCCEEDED;
}
/* 802e1ad0 */
void fBase_c::postDraw(MAIN_STATE_e state) {}
void fBase_c::postDraw(MAIN_STATE_e state) {
// Per Actor imple
return;
}
/* 802e1ae0 */
int fBase_c::drawPack() {}
int fBase_c::drawPack() {
// Returns PACK_RESULT_e
return commonPack(&draw, &preDraw, &postDraw);
}
/* 802e1b90 */
void fBase_c::deleteReady() {}
/* 802e1ba0 */
int fBase_c::connectProc() {}
int fBase_c::connectProc() {
if (delete_request) {
delete_request = false;
if (lifecycle_state == ACTIVE) {
if (update_request != UPDATE_FORCE) {
fManager_c::m_executeManage.remove(&manager.execute_node);
update_request = UPDATING;
}
fManager_c::m_drawManage.remove(&manager.draw_node);
} else {
fManager_c::m_createManage.remove(&manager.execute_node);
}
// Add to Deletion list and flag as to be deleted
fManager_c::m_deleteManage.prepend(&manager.execute_node);
lifecycle_state = TO_BE_DELETED;
// Add all children to be marked as ready to delete
for (fTrNdBa_c *node = manager.connect_node.getChild(); node != nullptr; node = node->getBrNext()) {
node->p_owner->deleteRequest();
}
} else {
fBase_c *conn_parent = getConnectParent();
if (conn_parent != nullptr) {
if (conn_parent->isProcControlFlag(ROOT_DISABLE_EXECUTE) ||
conn_parent->isProcControlFlag(DISABLE_EXECUTE)) {
setProcControlFlag(DISABLE_EXECUTE);
} else if (isProcControlFlag(DISABLE_EXECUTE)) {
clearProcControlFlag(DISABLE_EXECUTE);
}
if (conn_parent->isProcControlFlag(ROOT_DISABLE_DRAW) || conn_parent->isProcControlFlag(DISABLE_DRAW)) {
setProcControlFlag(DISABLE_DRAW);
} else if (isProcControlFlag(DISABLE_DRAW)) {
clearProcControlFlag(DISABLE_DRAW);
}
}
// If Actor is already Active
if (lifecycle_state == ACTIVE) {
// If flaged for update, add to the global execute list
if (update_request == UPDATE_FORCE) {
fManager_c::m_executeManage.addNode(&manager.execute_node);
update_request = UPDATING;
}
// Change the priority nodes if order has changed
fLiNdPrio_c *ex = &manager.execute_node;
if (ex->isPriorityChange()) {
fManager_c::m_executeManage.remove(ex);
fLiNdPrio_c *t = &manager.execute_node;
t->updatePriority();
fManager_c::m_executeManage.addNode(t);
}
fLiNdPrio_c *draw = &manager.draw_node;
if (draw->isPriorityChange()) {
fManager_c::m_drawManage.remove(draw);
fLiNdPrio_c *t = &manager.draw_node;
t->updatePriority();
fManager_c::m_drawManage.addNode(t);
}
}
// If Actor Is Waiting for Creation
else if (lifecycle_state != TO_BE_DELETED) {
if (create_request) {
create_request = false;
fManager_c::m_createManage.append(&manager.execute_node);
} else {
if ((u8)update_request != UPDATING) {
update_request = UPDATING;
fManager_c::m_executeManage.addNode(&manager.execute_node);
fManager_c::m_drawManage.addNode(&manager.draw_node);
lifecycle_state = ACTIVE;
}
}
}
}
return SUCCEEDED;
}
/* 802e1e00 */
void fBase_c::deleteRequest() {}
void fBase_c::deleteRequest() {
if (!delete_request && lifecycle_state != TO_BE_DELETED) {
delete_request = true;
deleteReady();
// Add all children to be marked as ready to delete
for (fTrNdBa_c *node = manager.connect_node.getChild(); node != nullptr; node = node->getBrNext()) {
node->p_owner->deleteRequest();
}
}
}
/* 802e1e80 */
// addNewActorToDrawList
void fBase_c::forceUpdate() {
// There is probably an inline active here
if (((!delete_request && lifecycle_state != TO_BE_DELETED) && lifecycle_state != ACTIVE) &&
(update_request == UPDATE_REQUEST && fManager_c::m_nowLoopProc == fManager_c::EXECUTE)) {
update_request = UPDATE_FORCE;
fManager_c::m_drawManage.addNode(&manager.draw_node);
lifecycle_state = ACTIVE;
m_forceExecuteList.append(&manager.execute_node);
}
}
/* 802e1f10 */
// getFirstActor
fBase_c *fBase_c::getConnectRoot() {
if (fManager_c::m_connectManage.getRoot() != nullptr) {
return fManager_c::m_connectManage.getRoot()->p_owner;
}
return nullptr;
}
/* 802e1f30 */
// getNextActor
fBase_c *fBase_c::getConnectTreeNext(fBase_c *actor) {
fBase_c *ret = nullptr;
if (actor == nullptr) {
ret = getConnectRoot();
} else {
fTrNdBa_c *node = actor->manager.connect_node.getTreeNext();
if (node != nullptr) {
ret = node->p_owner;
}
}
return ret;
}
/* 802e1f90 */
fBase_c* fBase_c::getConnectParent() const {}
fBase_c *fBase_c::getConnectParent() const {
fTrNdBa_c *node = manager.connect_node.getParent();
if (node != nullptr) {
return node->p_owner;
}
return nullptr;
}
/* 802e1fb0 */
fBase_c* fBase_c::getConnectChild() const {}
fBase_c *fBase_c::getConnectChild() const {
fTrNdBa_c *node = manager.connect_node.getChild();
if (node != nullptr) {
return node->p_owner;
}
return nullptr;
}
/* 802e1fd0 */
fBase_c* fBase_c::getConnectBrNext() const {}
fBase_c *fBase_c::getConnectBrNext() const {
fTrNdBa_c *node = manager.connect_node.getBrNext();
if (node != nullptr) {
return node->p_owner;
}
return nullptr;
}
/* 802e1ff0 */
// FUN_802e1ff0
void fBase_c::updateExecutePriority(u16 order) {
if (lifecycle_state == ACTIVE && update_request != UPDATE_FORCE) {
if (fManager_c::m_nowLoopProc == fManager_c::EXECUTE) {
manager.execute_node.m_new_order = order;
} else {
fManager_c::m_executeManage.remove(&manager.execute_node);
fLiNdPrio_c *node = &manager.execute_node;
node->setOrder(order);
fManager_c::m_executeManage.addNode(node);
}
} else {
manager.execute_node.setOrder(order);
}
}
/* 802e2090 */
bool fBase_c::setConnectChild(fBase_c* child) {}
bool fBase_c::setConnectChild(fBase_c *child) {
if (child == nullptr || child->lifecycle_state == TO_BE_DELETED) {
return false;
}
if (fManager_c::m_nowLoopProc == fManager_c::CONNECT) {
return false;
}
return fManager_c::m_connectManage.addTreeNode(&manager.connect_node, &child->manager.connect_node);
}
/* 802e20e0 */
bool fBase_c::entryFrmHeap(unsigned long size, EGG::Heap *parentHeap) {}
bool fBase_c::entryFrmHeap(size_t size, EGG::Heap *parentHeap) {
if (p_heap != nullptr) {
return true;
}
size_t heap_size = 0;
EGG::FrmHeap *new_heap = nullptr;
if (size != 0) {
new_heap = mHeap::makeFrmHeapAndUpdate(size, parentHeap, "各プロセスが個別で持てるヒープ(fBase_c::mHeap)", 0x20,
0);
if (new_heap != nullptr) {
bool create_sucess = createHeap();
mHeap::restoreCurrentHeap();
if (!create_sucess) {
mHeap::destroyFrmHeap(new_heap);
new_heap = nullptr;
} else {
heap_size = mHeap::adjustFrmHeap(new_heap);
if (size == heap_size) {
p_heap = new_heap;
return true;
}
}
}
}
if (new_heap == nullptr) {
new_heap =
mHeap::makeFrmHeapAndUpdate(-1, parentHeap, "各プロセスが個別で持てるヒープ(fBase_c::mHeap)", 0x20, 0);
if (new_heap != nullptr) {
bool create_sucess = createHeap();
mHeap::restoreCurrentHeap();
if (!create_sucess) {
mHeap::destroyFrmHeap(new_heap);
new_heap = nullptr;
} else {
heap_size = mHeap::adjustFrmHeap(new_heap);
}
}
}
if (new_heap != nullptr) {
EGG::FrmHeap *larger_heap = mHeap::makeFrmHeapAndUpdate(heap_size, parentHeap,
"各プロセスが個別で持てるヒープ(fBase_c::mHeap)", 0x20, 0);
if (larger_heap != nullptr) {
if (larger_heap < new_heap) {
mHeap::destroyFrmHeap(new_heap);
new_heap = nullptr;
bool create_sucess = createHeap();
mHeap::restoreCurrentHeap();
if (!create_sucess) {
mHeap::destroyFrmHeap(larger_heap);
larger_heap = nullptr;
} else {
heap_size = mHeap::adjustFrmHeap(larger_heap);
p_heap = larger_heap;
return true;
}
} else {
mHeap::restoreCurrentHeap();
mHeap::destroyFrmHeap(larger_heap);
}
}
}
if (new_heap != nullptr) {
p_heap = new_heap;
return true;
}
deleteRequest();
return false;
}
/* 802e22e0 */
bool fBase_c::entryFrmHeapNonAdjust(unsigned long size, EGG::Heap *parentHeap) {}
bool fBase_c::entryFrmHeapNonAdjust(size_t size, EGG::Heap *parentHeap) {
if (p_heap != nullptr) {
return true;
}
EGG::FrmHeap *new_heap =
mHeap::makeFrmHeapAndUpdate(size, parentHeap, "各プロセスが個別で持てるヒープ(fBase_c::mHeap)", 0x20, 0);
if (new_heap != nullptr) {
bool create_sucess = createHeap();
mHeap::restoreCurrentHeap();
if (!create_sucess) {
mHeap::destroyFrmHeap(new_heap);
} else {
p_heap = new_heap;
return true;
}
}
deleteRequest();
return false;
}
/* 802e23a0 */
bool fBase_c::createHeap() {}
bool fBase_c::createHeap() {
return true;
}
/* 802e23b0 */
void* fBase_c::operator new(size_t) {}
void *fBase_c::operator new(size_t size) {
void *mem = EGG::Heap::alloc(size, -4, mHeap::g_gameHeaps[0]);
if (mem != nullptr) {
memset(mem, 0, size);
}
return mem;
}
/* 802e2410 */
void fBase_c::operator delete(void*) {}
void fBase_c::operator delete(void *block) {
EGG::Heap::free(block, mHeap::g_gameHeaps[0]);
}
/* 802e2420 */
void fBase_c::runCreate() {}
void fBase_c::runCreate() {
createPack();
if ((!delete_request && (u8)update_request == UPDATING) && lifecycle_state == WAITING_FOR_CREATE) {
if (fManager_c::m_nowLoopProc == fManager_c::CREATE) {
create_request = true;
} else {
fManager_c::m_createManage.append(&manager.execute_node);
}
}
}
/* 802e24a0 */
fBase_c* fBase_c::getChildProcessCreateState() const {}
fBase_c *fBase_c::getChildProcessCreateState() const {
const fTrNdBa_c *connect_node = &manager.connect_node;
fTrNdBa_c *end = connect_node->getTreeNextNotChild();
fTrNdBa_c *curr = connect_node->getChild();
while (curr != nullptr && curr != end) {
if (curr->p_owner->lifecycle_state == WAITING_FOR_CREATE) {
return curr->p_owner;
}
curr = curr->getTreeNext();
}
return nullptr;
}
/* 802e2510 */
bool fBase_c::checkChildProcessCreateState() const {}
bool fBase_c::checkChildProcessCreateState() const {
return getChildProcessCreateState() != nullptr;
}
/* 802e2540 */
void fBase_c::setTmpCtData(ProfileName profName, fTrNdBa_c *connectParent, unsigned long param, u8 groupType) {}
void fBase_c::setTmpCtData(ProfileName profile_name, fTrNdBa_c *connect_parent, unsigned long param, u8 group_type) {
m_tmpCtData.prof_name = profile_name;
m_tmpCtData.connect_parent = connect_parent;
m_tmpCtData.params = param;
m_tmpCtData.group_type = group_type;
}
/* 802e2560 */
fBase_c* fBase_c::fBase_make(ProfileName profName, fTrNdBa_c *connectParent, unsigned long param, u8 groupType) {}
fBase_c *fBase_c::fBase_make(ProfileName profile_name, fTrNdBa_c *connect_parent, unsigned long param, u8 group_type) {
if ((*fProfile::sProfileList)[profile_name] == nullptr) {
return nullptr;
}
if (fManager_c::m_nowLoopProc == fManager_c::DRAW) {
return nullptr;
}
setTmpCtData(profile_name, connect_parent, param, group_type);
fBase_c *actor = (fBase_c *)((*fProfile::sProfileList)[profile_name]->mpClassInit)();
setTmpCtData(0, nullptr, 0, 0);
if (actor != nullptr) {
actor->runCreate();
}
return actor;
}
/* 802e2600 */
fBase_c* fBase_c::createChild(ProfileName profName, fBase_c *parent, unsigned long param, u8 groupType) {}
fBase_c *fBase_c::createChild(ProfileName profile_name, fBase_c *parent, unsigned long param, u8 group_type) {
if (parent == nullptr) {
return nullptr;
}
if (parent->delete_request || parent->lifecycle_state == TO_BE_DELETED) {
return nullptr;
}
return fBase_make(profile_name, &parent->manager.connect_node, param, group_type);
}
/* 802e2640 */
fBase_c* fBase_c::createRoot(ProfileName profName, unsigned long param, u8 groupType) {}
fBase_c *fBase_c::createRoot(ProfileName profile_name, unsigned long param, u8 group_type) {
return fBase_make(profile_name, nullptr, param, group_type);
}
+87
View File
@@ -0,0 +1,87 @@
#include <f/f_base.h>
#include <f/f_list_mg.h>
#include <f/f_list_mg_ptmf.h>
/* 802e2680 */
void fLiMgPTMF_c::addNode(fLiNdPrio_c *add) {
fLiNdPrio_c *node = getFirst();
if (add == nullptr) {
return;
}
if (node == nullptr) {
append(add);
return;
}
if (node->getOrder() > add->getOrder()) {
insertAfter(add, nullptr);
return;
}
while (node->getNext() != nullptr && node->getNext()->getOrder() <= add->getOrder()) {
node = node->getNext();
}
insertAfter(add, node);
}
/* 802e26e0 */
bool fLiMgPTMF_c::walkPack() {
if (mpProcFunc == nullptr) {
return true;
}
fLiNdBa_c *node = getFirst();
while (node != nullptr) {
fLiNdBa_c *next_node = node->getNext();
(node->p_owner->*mpProcFunc)();
node = next_node;
}
return true;
}
/* 802e2760 */
const fLiNdBa_c *fLiMgBa_c::searchNodeByID(fBaseID_e id) const {
fLiNdBa_c *node = getFirst();
while (node != nullptr) {
if (node->p_owner->unique_ID == id) {
return node;
}
node = node->getNext();
}
return nullptr;
}
/* 802e2790 */
const fLiNdBa_c *fLiMgBa_c::searchNodeByProfName(ProfileName name, fLiNdBa_c *start) const {
fLiNdBa_c *node = start != nullptr ? start->getNext() : getFirst();
while (node != nullptr) {
if (node->p_owner->profile_name == name) {
return node;
}
node = node->getNext();
}
return nullptr;
}
/* 802e27d0 */
void fLiNdBa_c::link(fBase_c *link) {
if (p_owner != nullptr) {
unlink();
}
if (link != nullptr) {
p_owner = link;
link->actor_list.append(this);
}
}
/* 802e2830 */
void fLiNdBa_c::unlink() {
if (p_owner != nullptr) {
reinterpret_cast<fBase_c *>(p_owner)->actor_list.remove(this);
p_owner = nullptr;
}
}
+83
View File
@@ -0,0 +1,83 @@
#include <f/f_base.h>
#include <f/f_manager.h>
fTrMgPTMF_c fManager_c::m_connectManage(&fBase_c::connectProc);
fLiMgPTMF_c fManager_c::m_createManage(&fBase_c::createPack);
fLiMgPTMF_c fManager_c::m_executeManage(&fBase_c::executePack);
fLiMgPTMF_c fManager_c::m_drawManage(&fBase_c::drawPack);
fLiMgPTMF_c fManager_c::m_deleteManage(&fBase_c::deletePack);
fLiMgBa_c fManager_c::m_searchManage[8];
u32 fManager_c::m_StopProcInf;
fManager_c::LOOP_PROC_e fManager_c::m_nowLoopProc = CONNECT;
/* 802e28c0 */
int fManager_c::getSearchTableNum() {
return reinterpret_cast<fBase_c *>(search_node.p_owner)->unique_ID & 7;
}
/* 802e28d0 */
fBase_c *fManager_c::searchBaseByID(fBaseID_e id) {
const fLiNdBa_c *res = m_searchManage[id & 7].searchNodeByID(id);
if (res != nullptr) {
return res->p_owner;
}
return nullptr;
}
/* 802e2920 */
fBase_c *fManager_c::searchBaseByProfName(ProfileName profID, const fBase_c *parent) {
const fTrNdBa_c *connect_node = parent != nullptr ? &parent->manager.connect_node : nullptr;
const fTrNdBa_c *node = m_connectManage.searchNodeByProfName(profID, connect_node);
if (node != nullptr) {
return node->p_owner;
}
return nullptr;
}
/* 802e2980 */
fBase_c *fManager_c::searchBaseByGroupType(unsigned char groupType, const fBase_c *parent) {
const fTrNdBa_c *connect_node = parent != nullptr ? &parent->manager.connect_node : nullptr;
const fTrNdBa_c *node = m_connectManage.searchNodeByGroupType(groupType, connect_node);
if (node != nullptr) {
return node->p_owner;
}
return nullptr;
}
/* 802e29e0 */
void fManager_c::mainLoop() {
if ((m_StopProcInf & PROC_FLAG_DELETE) == 0) {
m_nowLoopProc = DELETE;
m_deleteManage.walkPack();
}
if ((m_StopProcInf & PROC_FLAG_CREATE) == 0) {
m_nowLoopProc = CREATE;
m_createManage.walkPack();
}
if ((m_StopProcInf & PROC_FLAG_EXECUTE) == 0) {
m_nowLoopProc = EXECUTE;
m_executeManage.walkPack();
}
if ((m_StopProcInf & PROC_FLAG_DRAW) == 0) {
m_nowLoopProc = DRAW;
m_drawManage.walkPack();
}
if ((m_StopProcInf & PROC_FLAG_CONNECT) == 0) {
m_nowLoopProc = CONNECT;
m_connectManage.walkPack();
}
m_nowLoopProc = NOTHING;
}
+75
View File
@@ -0,0 +1,75 @@
#include <egg/core/eggAssertHeap.h>
#include <egg/core/eggExpHeap.h>
#include <egg/core/eggFrmHeap.h>
namespace mHeap {
u8 g_DefaultGameHeapId = 1;
static const char *s_GameHeapNames[4] = {
0,
"ゲーム用汎用ヒープ1(mHeap::gameHeaps[1])",
"ゲーム用汎用ヒープ2(mHeap::gameHeaps[2])",
0,
};
EGG::ExpHeap *g_gameHeaps[4];
EGG::ExpHeap *s_SavedCurrentHeap;
EGG::ExpHeap *g_archiveHeap;
EGG::ExpHeap *g_commandHeap;
EGG::ExpHeap *g_dylinkHeap;
EGG::AssertHeap *g_assertHeap;
u32 getHeapAttribute(u32) {}
EGG::Heap *setCurrentHeap(EGG::Heap *heap) {
return heap->becomeCurrentHeap();
}
EGG::ExpHeap *createExpHeap(size_t, EGG::Heap *parent, const char *name, unsigned long, unsigned long) {}
void adjustExpHeap(EGG::ExpHeap *) {}
size_t expHeapCost(unsigned long, unsigned long) {}
EGG::FrmHeap *createFrmHeap(unsigned long, EGG::Heap *, const char *, unsigned long, unsigned long) {}
void destroyFrmHeap(EGG::FrmHeap *) {}
size_t adjustFrmHeap(EGG::FrmHeap *) {}
size_t frmHeapCost(unsigned long, unsigned long) {}
EGG::ExpHeap *createHeap(unsigned long, EGG::Heap *, const char *) {}
void saveCurrentHeap() {}
void restoreCurrentHeap() {}
int getDefaultGameHeapId() {
return g_DefaultGameHeapId;
}
inline bool isValidHeapId(u32 id) {
return id >= 1 && id <= 2;
}
EGG::ExpHeap *createGameHeap(int heapId, size_t size, EGG::Heap *parent) {
if (!isValidHeapId(heapId)) {
return nullptr;
}
g_gameHeaps[heapId] = createHeap(size, parent, s_GameHeapNames[heapId]);
if (heapId == g_DefaultGameHeapId) {
g_gameHeaps[0] = g_gameHeaps[heapId];
}
return g_gameHeaps[heapId];
}
EGG::ExpHeap *createGameHeap1(size_t size, EGG::Heap *parent) {
return createGameHeap(getDefaultGameHeapId(), size, parent);
}
EGG::ExpHeap *createArchiveHeap(size_t size, EGG::Heap *parent) {
g_archiveHeap = createHeap(size, parent, "");
}
EGG::ExpHeap *createCommandHeap(size_t size, EGG::Heap *parent) {
g_commandHeap = createHeap(size, parent, "DVD読み込みコマンド用ヒープ(mHeap::commandHeap)");
}
EGG::ExpHeap *createDylinkHeap(size_t size, EGG::Heap *parent) {
g_dylinkHeap = createHeap(size, parent, "ダイナミックリンク用ヒープ(mHeap::dylinkHeap)");
}
EGG::ExpHeap *createAssertHeap(EGG::Heap *parent) {
g_assertHeap = EGG::AssertHeap::create(EGG::AssertHeap::getSize(), parent);
g_assertHeap->mName = "アサートヒープ(mHeap::assertHeap)";
}
} // namespace mHeap