summaryrefslogtreecommitdiff
path: root/include/egg/core/eggDisplay.h
blob: 986cfcda773eb9a9f319ce84254bad62c7cd4fbe (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef EGG_DISPLAY_H
#define EGG_DISPLAY_H

#include "common.h"
#include "egg/core/eggSystem.h" // for BaseSystem config
#include "egg/core/eggVideo.h"
#include "egg/prim/eggBitFlag.h"
#include "nw4r/ut/ut_Color.h"
#include "nw4r/ut.h" // IWYU pragma: export
#include "rvl/VI.h"  // IWYU pragma: export


namespace EGG {

class Display {
public:
    enum EFlagBits {
        mFlag_SetClear,
        mFlag_WaitForRetrace
    };
    /* 0x00*/ TBitFlag<u8> mFlag;
    enum EScreenStateBits {
        mScreenStateFlag_SetBlack
    };

public:
    // vtable at 0x04
    /* vt 0x08 */ virtual void beginFrame();
    /* vt 0x0C */ virtual void beginRender();
    /* vt 0x10 */ virtual void endRender();
    /* vt 0x14 */ virtual void endFrame();
    /* vt 0x18 */ virtual u32 getTickPerFrame();
    /* vt 0x1C */ virtual void preVRetrace();

public:
    /* 0x08 */ u8 mMaxRetraces;
    /* 0x09 */ TBitFlag<u8> mScreenStateFlag;
    /* 0x0C */ u32 mRetraceCount;
    /* 0x10 */ u32 mFrameCount;
    /* 0x14 */ nw4r::ut::Color mClearColor;
    /* 0x18 */ u32 mClearZ;
    /* 0x1C */ s32 mBeginTick;
    /* 0x20 */ s32 mLastTick; // new
    /* 0x24 */ s32 mDeltaTick;
    /* 0x28 */ f32 mFrequency;

public:
    Display(u8 maxRetrace);
    void copyEFBtoXFB();
    void calcFrequency();
    void setBlack(bool b) {}

    nw4r::ut::Color getClearColor() const {
        return mClearColor;
    }

    void setClearColor(nw4r::ut::Color color) {
        mClearColor = color;
    }

    u32 getClearZ() {
        return mClearZ;
    }

public:
    static u32 sTickPeriod;
};

} // namespace EGG

#endif