BEEP-8 Helper Lib 1.0.0
Loading...
Searching...
No Matches
bgprint.h
Go to the documentation of this file.
1
36#include <b8/ppu.h>
37#pragma once
38namespace bgprint {
39 enum EnCmd{
40 SET_SLOT_CONTEXT,
41 SET_UV_SCROLL,
42 EXPORT_PPU_CMD,
43 GET_INFO
44 };
45
46 enum EnCh {
47 CH0,
48 CH1,
49 CH2,
50 CH3,
51 CH4,
52 CH5,
53 CH6,
54 CH7,
55 /* --- */
56 CHMAX
57 };
58
59 struct UvScroll {
60 int _u = 0;
61 int _v = 0;
62 };
63
68 struct Context {
74 b8PpuBgTile* cpuaddr = nullptr;
75
80 u16 _w_pow2 = 4;
81
86 u16 _h_pow2 = 5;
87
95 u16 _h_disp = 30;
96
102 bool _scroll = true;
103 };
104
106 b8PpuCmd* _cmd = nullptr;
107 u32 _otz = 0;
108 };
109
110 void Reset();
111
130 FILE* Open(
131 EnCh ch_,
132 char* buff,
133 size_t buffsize,
135 );
136
137 void SetUvScroll(
138 FILE* fp_,
139 const bgprint::UvScroll& uv_
140 );
141
142 void Export(
143 FILE* fp_,
144 const bgprint::ExportPpuCmd& epc
145 );
146
147 void Locate(FILE* fp_ ,s16 lx_,s16 ly_ );
148 void Pal(FILE* fp_, u8 pal_ );
149 struct Info {
150 s16 _x_locate = 0;
151 s16 _y_locate = 0;
152 u8 _pal;
153 };
154 int GetInfo(FILE* fp_, Info& dest);
155}
FILE * Open(EnCh ch_, char *buff, size_t buffsize, bgprint::Context &ctx)
Open a specified channel, buffer it up to a specified size, and use the context provided.
Definition bgprint.cpp:215
This structure is used to manage the context of the buffer output.
Definition bgprint.h:68
u16 _h_disp
Specifies the display area height in decimal units.
Definition bgprint.h:95
u16 _w_pow2
Specify the width of the b8PpuBgTile array in powers of 2. For example, if you specify 4,...
Definition bgprint.h:80
u16 _h_pow2
Specify the height of the b8PpuBgTile array in powers of 2. For example, if you specify 5,...
Definition bgprint.h:86
b8PpuBgTile * cpuaddr
Please specify the beginning of the b8PpuBgTile array for text output.
Definition bgprint.h:74
bool _scroll
Indicates whether scrolling is enabled when the text exceeds the display height.
Definition bgprint.h:102
Definition bgprint.h:105
Definition bgprint.h:149
s16 _y_locate
Y location.
Definition bgprint.h:151
s16 _x_locate
X location.
Definition bgprint.h:150
Definition bgprint.h:59