Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JAUStreamAramMgr.h
Go to the documentation of this file.
1#ifndef JAUSTREAMSTATICARAMMGR_H
2#define JAUSTREAMSTATICARAMMGR_H
3
8#include "bitset.h"
9
14template <size_t A0>
16public:
18 for (int i = 0; i < A0; i++) {
20 }
21 }
23 bool isStreamUsingAram() { return field_0x4.any(); }
26 for (int i = 0; i < A0; i++) {
27 if (mHeaps[i].isAllocated()) {
28 JASHeap* heap = &mHeaps[0]; // should probably be mHeaps[i] but that doesn't match
29 heap->free();
30 if (!heap) {
31 JUT_ASSERT(47, 0);
32 }
33 }
34 }
35 }
36
37protected:
40};
41
46template <size_t MAX_CHUNKS_>
48public:
50 virtual void* newStreamAram(u32* param_0) {
51 for (u32 i = 0; i < field_0x4c; i++) {
52 if (this->field_0x4.test(i)) {
53 continue;
54 }
55 this->field_0x4.set(i, true);
56 *param_0 = this->mHeaps[i].getSize();
57 return this->mHeaps[i].getBase();
58 }
59 return NULL;
60 }
61 // NONMATCHING regalloc
63 for (u32 i = 0; i < field_0x4c; i++) {
64 if (!this->field_0x4.test(i)) {
65 continue;
66 }
67 if ((u32)this->mHeaps[i].getBase() != param_0) {
68 continue;
69 }
70 this->field_0x4.reset(i);
71 return true;
72 }
73 return false;
74 }
75 bool isAramReserved() const { return field_0x4c; }
79 if (!heap) {
81 }
82 if (numReserve < 1) {
83 numReserve = 1;
84 }
87 for (int i = 0; i < numReserve; i++) {
88 if (!this->mHeaps[i].alloc(heap, r27)) {
89 break;
90 }
91 field_0x4c = i + 1;
92 }
93 }
94
95private:
96 static const size_t MAX_CHUNKS = MAX_CHUNKS_;
97
99};
100
101#endif /* JAUSTREAMSTATICARAMMGR_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
static u32 getBlockSize()
Definition JASAramStream.h:131
Definition JASHeapCtrl.h:17
u32 getSize()
Definition JASHeapCtrl.h:32
bool free()
Definition JASHeapCtrl.cpp:111
void * getBase()
Definition JASHeapCtrl.h:30
Definition JAUStreamAramMgr.h:15
JASHeap mHeaps[A0]
Definition JAUStreamAramMgr.h:39
bool isStreamUsingAram()
Definition JAUStreamAramMgr.h:23
JAUStreamAramMgrBase_()
Definition JAUStreamAramMgr.h:17
std::bitset< A0 > field_0x4
Definition JAUStreamAramMgr.h:38
void releaseAram_JAUStreamAramMgrBase_()
Definition JAUStreamAramMgr.h:24
~JAUStreamAramMgrBase_()
Definition JAUStreamAramMgr.h:22
Definition JAUStreamAramMgr.h:47
bool isAramReserved() const
Definition JAUStreamAramMgr.h:75
void reserveAram(JASHeap *heap, int numReserve, u32 param_2)
Definition JAUStreamAramMgr.h:76
virtual bool deleteStreamAram(u32 param_0)
Definition JAUStreamAramMgr.h:62
static const size_t MAX_CHUNKS
Definition JAUStreamAramMgr.h:96
int field_0x4c
Definition JAUStreamAramMgr.h:98
virtual void * newStreamAram(u32 *param_0)
Definition JAUStreamAramMgr.h:50
JAUStreamStaticAramMgr_()
Definition JAUStreamAramMgr.h:49
Definition bitset.h:65
bool any() const
bool test(size_t pos) const
Definition bitset.h:83
void set(size_t pos, bool val)
Definition bitset.h:71
void reset(size_t pos)
Definition bitset.h:77
int i
Definition e_pow.c:165
JASHeap * getAramHeap()
Definition JASHeapCtrl.cpp:295
Definition JAIStreamDataMgr.h:19
unsigned long u32
Definition types.h:10