summaryrefslogtreecommitdiff
path: root/include/JSystem/JAudio/JAISequenceHeap.h
blob: d01496655362fbdff556ef0643d54a8fbb6c92b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef JAISEQUENCEHEAP_H
#define JAISEQUENCEHEAP_H

#include "dolphin/types.h"

namespace JAInter {
    class HeapBlock {
    public:
        HeapBlock();

        u8 getStatus() { return mStatus; }
        void setStatus(u8 status) { mStatus = status; }
        void* getPointer() { return mPointer; }
        void setPointer(void* pointer) { mPointer = pointer; }
        u32 getDataNumber() { return mDataNumber;}
        void setDataNumber(u32 number) { mDataNumber = number; }
        u32 getEndAddress() { return mEndAddress; }
        void setEndAddress(u32 address) { mEndAddress = address; }
        u32 getUseCounter() { return mUseCounter; }
        void setUseCounter(u32 counter) { mUseCounter = counter; }

        /* 0x00 */ u8 mStatus;
        /* 0x04 */ void* mPointer;
        /* 0x08 */ u32 mDataNumber;
        /* 0x0C */ u32 mEndAddress;
        /* 0x10 */ u32 mUseCounter;
    };

    namespace HeapMgr {
        void init(u8, u32, u8, u32);
        JAInter::HeapBlock* getAutoHeapPointer();
        void* checkOnMemory(u32, u8*);
        void releaseAutoHeapPointer(u8);
        u8 checkUsefulAutoHeapPosition();
        void* getFreeAutoHeapPointer(u8, u32);
        void* getFreeStayHeapPointer(u32, u32);
        void setAutoHeapLoadedFlag(u8, u8);

        extern HeapBlock* sAutoHeap;
        extern HeapBlock* sStayHeap;
        extern u32 sAutoHeapCount;
        extern u32 sStayHeapCount;
    }
}

#endif /* JAISEQUENCEHEAP_H */