summaryrefslogtreecommitdiff
path: root/include/nw4r/db/db_directPrint.h
blob: 8c956f99159eaebf77e86cb202b0d5926e619bf9 (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
#ifndef NW4R_DB_DIRECT_PRINT_H
#define NW4R_DB_DIRECT_PRINT_H

#include "common.h"

#include "rvl/GX.h" // IWYU pragma: export

#include <cstdarg>

namespace nw4r {

namespace db {

struct FrameBufferInfo {
    /* 0x00 */ u8 *frameMemory;
    /* 0x04 */ u32 frameSize;
    /* 0x08 */ u16 frameWidth;
    /* 0x0A */ u16 frameHeight;
    /* 0x0C */ u16 frameRow;
    /* 0x0E */ u16 reserved;
};

struct YUVColorInfo {
    /* 0x00 */ GXColor colorRGBA;
    /* 0x04 */ u16 colorY256;
    /* 0x06 */ u16 colorU;
    /* 0x08 */ u16 colorU2;
    /* 0x0A */ u16 colorU4;
    /* 0x0C */ u16 colorV;
    /* 0x0E */ u16 colorV2;
    /* 0x10 */ u16 colorV4;
    /* 0x12 */ u16 reserved;
};

void DirectPrint_Init();
bool DirectPrint_IsActive();
void DirectPrint_EraseXfb(int posh, int posv, int sizeh, int sizev);
void DirectPrint_ChangeXfb(void *framBuf);
void DirectPrint_ChangeXfb(void *framBuf, u16 width, u16 height);
void DirectPrint_StoreCache();
void DirectPrint_Printf(int posh, int posv, const char *format, ...);
void DirectPrint_printfsub(
    int posh, int posv, const char *format,
    __va_list_struct *args
); // ????? Not from a symbol, needs the arg?
void DirectPrint_Printf(int posh, int posv, bool turnOver, const char *format, ...);
void DirectPrint_DrawString(int posh, int posv, const char *format, ...);
void DirectPrint_DrawString(int posh, int posv, bool turnOver, const char *format, ...);
void DirectPrint_SetColor(GXColor color);
void DirectPrint_SetColor(u8 r, u8 g, u8 b);
GXColor DirectPrint_GetColor();
namespace detail {
void DirectPrint_DrawStringToXfb(
    int posh, int posv, const char *format, __va_list_struct *args, bool turnover, bool backErase
);

void WaitVIRetrace_();

void *CreateFB_(const _GXRenderModeObj *rmode);
void *DirectPrint_SetupFB(const _GXRenderModeObj *rmode);

} // namespace detail

} // namespace db

} // namespace nw4r
#endif