summaryrefslogtreecommitdiff
path: root/include/JSystem/JUtility/JUTGraphFifo.h
blob: e0205a9fcdbde1728eaf257973cb1b3439ed12dd (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
#ifndef JUTGRAPHFIFO_H
#define JUTGRAPHFIFO_H

#include "dolphin/gx/GX.h"

class JUTGraphFifo {
public:
    JUTGraphFifo(u32);
    virtual ~JUTGraphFifo();

    void getGpStatus() {
        GXGetGPStatus((GXBool*)&mGpStatus[0], (GXBool*)&mGpStatus[1], (GXBool*)&mGpStatus[2],
                      (GXBool*)&mGpStatus[3], (GXBool*)&mGpStatus[4]);
    }

    bool isGPActive() {
        getGpStatus();
        return mGpStatus[2] == false;
    }

    void save() { GXSaveCPUFifo(this->mFifo); }

    static bool sInitiated;
    static JUTGraphFifo* sCurrentFifo;
    static bool mGpStatus[5];

private:
    /* 0x04 */ GXFifoObj* mFifo;
    /* 0x08 */ void* mBase;
    /* 0x0C */ u32 mSize;
    /* 0x10 */ u8 field_0x10[0xC];
};

inline JUTGraphFifo* JUTCreateFifo(u32 bufSize) {
    return new JUTGraphFifo(bufSize);
}

#endif /* JUTGRAPHFIFO_H */