Skip to content

Commit 8f10f68

Browse files
authored
Merge pull request bfbbdecomp#13 from LivewireCB/dev
Finished porting the bfbb code to the xWad files in core/x
2 parents 16cf3c3 + 37e9c79 commit 8f10f68

File tree

11 files changed

+7566
-107
lines changed

11 files changed

+7566
-107
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"files.associations": {
1818
"*.inc": "c",
1919
".clangd": "yaml",
20-
"cstring": "cpp"
20+
"cstring": "cpp",
21+
"cmath": "cpp"
2122
},
2223
// Disable C/C++ IntelliSense, use clangd instead
2324
"C_Cpp.intelliSenseEngine": "default",

src/SB/Core/x/xMemMgr.h

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,43 @@ struct xMemBlkInfo_tag
3131
U32 total;
3232
};
3333

34+
struct xMemFreeLink
35+
{
36+
xMemFreeLink* next;
37+
void (*func)(void*);
38+
void* param;
39+
};
40+
41+
struct xHeapState
42+
{
43+
U32 curr;
44+
U16 blk_ct;
45+
U16 pad;
46+
U32 used;
47+
U32 wasted;
48+
xMemFreeLink* free_funcs;
49+
};
50+
51+
struct xMemBlock
52+
{
53+
U32 addr;
54+
U32 size;
55+
S32 align;
56+
};
57+
58+
struct xMemHeap
59+
{
60+
U32 flags;
61+
U32 hard_base;
62+
U32 size;
63+
S16 opp_heap[2];
64+
xHeapState state[12];
65+
U16 state_idx;
66+
U16 max_blks;
67+
xMemBlock* blk;
68+
xMemBlock* lastblk;
69+
};
70+
3471
struct xMemHeap_tag
3572
{
3673
U32 flags;
@@ -102,8 +139,8 @@ S32 xMemGetBase(U32 heapID);
102139
void xMemRegisterBaseNotifyFunc(void (*func)());
103140
S32 xMemGetBase();
104141
void xMemPoolAddElements(xMemPool* pool, void* buffer, U32 count);
105-
void xMemPoolSetup(xMemPool* pool, void* buffer, U32 nextOffset, U32 flags,
106-
xMemPoolInitCB initCB, U32 size, U32 count, U32 numRealloc);
142+
void xMemPoolSetup(xMemPool* pool, void* buffer, U32 nextOffset, U32 flags, xMemPoolInitCB initCB,
143+
U32 size, U32 count, U32 numRealloc);
107144
void* xMemPoolAlloc(xMemPool* pool);
108145
void xMemPoolFree(xMemPool* pool, void* data);
109146

0 commit comments

Comments
 (0)