Jo Engine  2020.06.22
Jo Sega Saturn Engine
vdp2.h
Go to the documentation of this file.
1 /*
2 ** Jo Sega Saturn Engine
3 ** Copyright (c) 2012-2020, Johannes Fetz (johannesfetz@gmail.com)
4 ** All rights reserved.
5 **
6 ** Redistribution and use in source and binary forms, with or without
7 ** modification, are permitted provided that the following conditions are met:
8 ** * Redistributions of source code must retain the above copyright
9 ** notice, this list of conditions and the following disclaimer.
10 ** * Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
13 ** * Neither the name of the Johannes Fetz nor the
14 ** names of its contributors may be used to endorse or promote products
15 ** derived from this software without specific prior written permission.
16 **
17 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 ** DISCLAIMED. IN NO EVENT SHALL Johannes Fetz BE LIABLE FOR ANY
21 ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
35 #ifndef __JO_VDP2_H__
36 # define __JO_VDP2_H__
37 
44 int sprintf(char* str, const char* format, ...);
45 
50 
54 void jo_set_displayed_screens(const jo_scroll_screen scroll_screen_flags);
55 
59 void jo_set_default_background_color(const jo_color background_color);
60 
61 /*
62 ███╗ ██╗██████╗ ██████╗ ██████╗ ██╗██████╗ ███████╗ ██████╗ ███╗ ██╗████████╗
63 ████╗ ██║██╔══██╗██╔════╝ ╚════██╗ ██╔╝╚════██╗ ██╔════╝██╔═══██╗████╗ ██║╚══██╔══╝
64 ██╔██╗ ██║██████╔╝██║ ███╗ █████╔╝ ██╔╝ █████╔╝ █████╗ ██║ ██║██╔██╗ ██║ ██║
65 ██║╚██╗██║██╔══██╗██║ ██║██╔═══╝ ██╔╝ ╚═══██╗ ██╔══╝ ██║ ██║██║╚██╗██║ ██║
66 ██║ ╚████║██████╔╝╚██████╔╝███████╗██╔╝ ██████╔╝ ██║ ╚██████╔╝██║ ╚████║ ██║
67 ╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝
68 */
69 
70 #ifndef JO_COMPILE_WITH_PRINTF_SUPPORT
71 
77 void jo_nbg2_print(int x, int y, char * str);
78 
84 # define jo_nbg2_printf(X, Y, ...) do {sprintf(__jo_sprintf_buf, __VA_ARGS__); jo_nbg2_print(X, Y, __jo_sprintf_buf); } while(0)
85 
94 void jo_vdp2_set_nbg2_8bits_font(jo_img_8bits *img, char *mapping, int palette_id, bool vertical_flip, bool enabled);
95 
98 void jo_nbg2_clear(void);
99 
105 void jo_nbg3_print(int x, int y, char * str);
106 
112 # define jo_nbg3_printf(X, Y, ...) do {sprintf(__jo_sprintf_buf, __VA_ARGS__); jo_nbg3_print(X, Y, __jo_sprintf_buf); } while(0)
113 
122 void jo_vdp2_set_nbg3_8bits_font(jo_img_8bits *img, char *mapping, int palette_id, bool vertical_flip, bool enabled);
123 
126 void jo_nbg3_clear(void);
127 
128 #endif
129 
130 /*
131 ██████╗ ██████╗ █████╗ ██╗ ██╗ ██╗███╗ ███╗ █████╗ ██████╗ ███████╗
132 ██╔══██╗██╔══██╗██╔══██╗██║ ██║ ██║████╗ ████║██╔══██╗██╔════╝ ██╔════╝
133 ██║ ██║██████╔╝███████║██║ █╗ ██║ ██║██╔████╔██║███████║██║ ███╗█████╗
134 ██║ ██║██╔══██╗██╔══██║██║███╗██║ ██║██║╚██╔╝██║██╔══██║██║ ██║██╔══╝
135 ██████╔╝██║ ██║██║ ██║╚███╔███╔╝ ██║██║ ╚═╝ ██║██║ ██║╚██████╔╝███████╗
136 ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
137 
138 */
139 
146 void jo_vdp2_set_nbg1_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip);
147 
148 #ifndef JO_COMPILE_WITH_PRINTF_SUPPORT
149 
156 void jo_vdp2_set_nbg0_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip, bool enabled);
157 #endif
158 
166 void jo_vdp2_set_nbg2_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip, bool enabled);
167 
175 void jo_vdp2_set_nbg3_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip, bool enabled);
176 
182 void jo_vdp2_set_nbg1_image(const jo_img * const img, const unsigned short left, const unsigned short top);
183 
188 
189 /*
190 ███╗ ███╗ ██████╗ ██╗ ██╗███████╗ ██╗ ███████╗ ██████╗ ██████╗ ███╗ ███╗
191 ████╗ ████║██╔═══██╗██║ ██║██╔════╝ ██║ ╚══███╔╝██╔═══██╗██╔═══██╗████╗ ████║
192 ██╔████╔██║██║ ██║██║ ██║█████╗ ████████╗ ███╔╝ ██║ ██║██║ ██║██╔████╔██║
193 ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██╔══╝ ██╔═██╔═╝ ███╔╝ ██║ ██║██║ ██║██║╚██╔╝██║
194 ██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ███████╗ ██████║ ███████╗╚██████╔╝╚██████╔╝██║ ╚═╝ ██║
195 ╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝
196 
197 */
198 
203 static __jo_force_inline void jo_vdp2_move_nbg1(const int x, const int y)
204 {
205 #if JO_COMPILE_USING_SGL
206  slScrPosNbg1(JO_MULT_BY_65536(x), JO_MULT_BY_65536(y));
207 #else
208  JO_VDP2_SCXIN1 = x;
209  JO_VDP2_SCYIN1 = y;
210 #endif
211 }
212 
217 static __jo_force_inline void jo_vdp2_zoom_nbg1f(const float width_factor, const float height_factor)
218 {
219 #if JO_COMPILE_USING_SGL
220  slZoomNbg1(toFIXED(width_factor), toFIXED(height_factor));
221 #else
222  int fixed_width = jo_float2fixed(width_factor);
223  int fixed_height = jo_float2fixed(height_factor);
224  JO_VDP2_ZMXIN1 = JO_DIV_BY_32768(fixed_width);
225  JO_VDP2_ZMYIN1 = JO_DIV_BY_32768(fixed_height);
226  JO_VDP2_ZMXDN1 = JO_MOD_POW2(fixed_width, 32768) * 2; /*TODO : fix x2 */
227  JO_VDP2_ZMYDN1 = JO_MOD_POW2(fixed_height, 32768) * 2;
228 #endif
229 }
230 
234 static __jo_force_inline void jo_vdp2_zoom_nbg1(const float factor)
235 {
236  jo_vdp2_zoom_nbg1f(factor, factor);
237 }
238 
243 static __jo_force_inline void jo_vdp2_move_nbg0(const int x, const int y)
244 {
245 #if JO_COMPILE_USING_SGL
246  slScrPosNbg0(JO_MULT_BY_65536(x), JO_MULT_BY_65536(y));
247 #else
248  JO_VDP2_SCXIN0 = x;
249  JO_VDP2_SCYIN0 = y;
250 #endif
251 }
252 
257 static __jo_force_inline void jo_vdp2_zoom_nbg0f(const float width_factor, const float height_factor)
258 {
259 #if JO_COMPILE_USING_SGL
260  slZoomNbg0(toFIXED(width_factor), toFIXED(height_factor));
261 #else
262  int fixed_width = jo_float2fixed(width_factor);
263  int fixed_height = jo_float2fixed(height_factor);
264  JO_VDP2_ZMXIN0 = JO_DIV_BY_32768(fixed_width);
265  JO_VDP2_ZMYIN0 = JO_DIV_BY_32768(fixed_height);
266  JO_VDP2_ZMXDN0 = JO_MOD_POW2(fixed_width, 32768) * 2; /*TODO : fix x2 */
267  JO_VDP2_ZMYDN0 = JO_MOD_POW2(fixed_height, 32768) * 2;
268 #endif
269 }
270 
274 static __jo_force_inline void jo_vdp2_zoom_nbg0(const float factor)
275 {
276  jo_vdp2_zoom_nbg0f(factor, factor);
277 }
278 
279 /*
280 ██████╗ █████╗ ███████╗██╗ ██████╗ ██████╗ ██████╗ █████╗ ██╗ ██╗██╗███╗ ██╗ ██████╗
281 ██╔══██╗██╔══██╗██╔════╝██║██╔════╝ ██╔══██╗██╔══██╗██╔══██╗██║ ██║██║████╗ ██║██╔════╝
282 ██████╔╝███████║███████╗██║██║ ██║ ██║██████╔╝███████║██║ █╗ ██║██║██╔██╗ ██║██║ ███╗
283 ██╔══██╗██╔══██║╚════██║██║██║ ██║ ██║██╔══██╗██╔══██║██║███╗██║██║██║╚██╗██║██║ ██║
284 ██████╔╝██║ ██║███████║██║╚██████╗ ██████╔╝██║ ██║██║ ██║╚███╔███╔╝██║██║ ╚████║╚██████╔╝
285 ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝
286 *
287 ** ▲ ONLY WORKS IN BITMAP MODE
288 */
289 
297 void jo_vdp2_draw_bitmap_nbg1_line(int x0, int y0, int x1, int y1, const jo_color color);
298 
306 static __jo_force_inline void jo_vdp2_draw_bitmap_nbg1_square(const int x, const int y, const short width, const short height, const jo_color color)
307 {
308  jo_vdp2_draw_bitmap_nbg1_line(x, y, x + width, y, color);
309  jo_vdp2_draw_bitmap_nbg1_line(x + width, y + height, x + width, y, color);
310  jo_vdp2_draw_bitmap_nbg1_line(x, y + height, x + width, y + height, color);
311  jo_vdp2_draw_bitmap_nbg1_line(x, y + height, x, y, color);
312 }
313 
319 static __jo_force_inline void jo_vdp2_put_pixel_bitmap_nbg1(const int x, const int y, const jo_color color)
320 {
321  *(((unsigned short *)VDP2_VRAM_A0) + x + y * JO_VDP2_WIDTH) = color;
322 }
323 
331 static __jo_force_inline void jo_vdp2_put_pixel_bitmap_nbg1_rgb(const int x, const int y, unsigned char r, unsigned char g, unsigned char b)
332 {
333  jo_vdp2_put_pixel_bitmap_nbg1(x, y, C_RGB(r, g, b));
334 }
335 
336 /*
337 ██████╗ ██████╗ ██████╗ ██╗ █████╗ ███╗ ██╗███████╗███████╗
338 ╚════██╗██╔══██╗ ██╔══██╗██║ ██╔══██╗████╗ ██║██╔════╝██╔════╝
339  █████╔╝██║ ██║ ██████╔╝██║ ███████║██╔██╗ ██║█████╗ ███████╗
340  ╚═══██╗██║ ██║ ██╔═══╝ ██║ ██╔══██║██║╚██╗██║██╔══╝ ╚════██║
341 ██████╔╝██████╔╝ ██║ ███████╗██║ ██║██║ ╚████║███████╗███████║
342 ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚══════╝
343 ** - Two planes are available: A and B
344 ** - Each plane is 512 x 512 size
345 */
346 
350 
354 
362 void jo_vdp2_set_rbg0_plane_a_8bits_image(jo_img_8bits *img, int palette_id, bool repeat, bool vertical_flip);
363 
371 void jo_vdp2_set_rbg0_plane_b_8bits_image(jo_img_8bits *img, int palette_id, bool repeat, bool vertical_flip);
372 
376 static __jo_force_inline void jo_vdp2_draw_rbg0_plane_a(const bool use_scroll_format_matrix)
377 {
378  slCurRpara(RA); if (use_scroll_format_matrix) slScrMatConv(); slScrMatSet();
379 }
380 
384 static __jo_force_inline void jo_vdp2_draw_rbg0_plane_b(const bool use_scroll_format_matrix)
385 {
386  slCurRpara(RB); if (use_scroll_format_matrix) slScrMatConv(); slScrMatSet();
387 }
388 
389 /*
390 ███╗ ███╗ ██████╗ ███████╗ █████╗ ██╗ ██████╗
391 ████╗ ████║██╔═══██╗╚══███╔╝██╔══██╗██║██╔════╝
392 ██╔████╔██║██║ ██║ ███╔╝ ███████║██║██║
393 ██║╚██╔╝██║██║ ██║ ███╔╝ ██╔══██║██║██║
394 ██║ ╚═╝ ██║╚██████╔╝███████╗██║ ██║██║╚██████╗
395 ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝
396 */
397 
404 static __jo_force_inline void jo_enable_screen_mozaic(const jo_scroll_screen screens, const short x, const short y)
405 {
406  slScrMosSize(x, y);
407  slScrMosaicOn(screens);
408 }
409 
413 {
414  slScrMosSize(1, 1);
415  slScrMosaicOn(0);
416 }
417 
418 /*
419 ██╗ ██╗ ██████╗ ██████╗ ██╗███████╗ ██████╗ ███╗ ██╗████████╗ █████╗ ██╗
420 ██║ ██║██╔═══██╗██╔══██╗██║╚══███╔╝██╔═══██╗████╗ ██║╚══██╔══╝██╔══██╗██║
421 ███████║██║ ██║██████╔╝██║ ███╔╝ ██║ ██║██╔██╗ ██║ ██║ ███████║██║
422 ██╔══██║██║ ██║██╔══██╗██║ ███╔╝ ██║ ██║██║╚██╗██║ ██║ ██╔══██║██║
423 ██║ ██║╚██████╔╝██║ ██║██║███████╗╚██████╔╝██║ ╚████║ ██║ ██║ ██║███████╗
424 ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝╚══════╝
425 
426 ██╗ ██╗███╗ ██╗███████╗ ███████╗ ██████╗██████╗ ██████╗ ██╗ ██╗
427 ██║ ██║████╗ ██║██╔════╝ ██╔════╝██╔════╝██╔══██╗██╔═══██╗██║ ██║
428 ██║ ██║██╔██╗ ██║█████╗ ███████╗██║ ██████╔╝██║ ██║██║ ██║
429 ██║ ██║██║╚██╗██║██╔══╝ ╚════██║██║ ██╔══██╗██║ ██║██║ ██║
430 ███████╗██║██║ ╚████║███████╗ ███████║╚██████╗██║ ██║╚██████╔╝███████╗███████╗
431 ╚══════╝╚═╝╚═╝ ╚═══╝╚══════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝
432 
433 ▲ ONLY WORKS IF BACKGROUND IMAGE IS LOADED THROUH jo_vdp2_set_nbg1_8bits_image() ▲
434  OTHERWISE IT MAY GLITCH
435 */
436 
439 # define JO_NBG1_SCROLL_TABLE_SIZE (512)
440 
446 
450 
454 void jo_vdp2_compute_nbg1_line_scroll(unsigned short offset);
455 
458 # define JO_NBG0_SCROLL_TABLE_SIZE (512)
459 
465 
469 
473 void jo_vdp2_compute_nbg0_line_scroll(unsigned short offset);
474 
475 /*
476 ████████╗██████╗ █████╗ ███╗ ██╗███████╗██████╗ █████╗ ██████╗ ███████╗███╗ ██╗ ██████╗██╗ ██╗
477 ╚══██╔══╝██╔══██╗██╔══██╗████╗ ██║██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝████╗ ██║██╔════╝╚██╗ ██╔╝
478  ██║ ██████╔╝███████║██╔██╗ ██║███████╗██████╔╝███████║██████╔╝█████╗ ██╔██╗ ██║██║ ╚████╔╝
479  ██║ ██╔══██╗██╔══██║██║╚██╗██║╚════██║██╔═══╝ ██╔══██║██╔══██╗██╔══╝ ██║╚██╗██║██║ ╚██╔╝
480  ██║ ██║ ██║██║ ██║██║ ╚████║███████║██║ ██║ ██║██║ ██║███████╗██║ ╚████║╚██████╗ ██║
481  ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝
482 
483 */
484 
488 
493 void jo_enable_screen_transparency(const jo_scroll_screen screen, const unsigned short transparency_level);
494 
495 #endif /* !__JO_VDP2_H__ */
496 
497 /*
498 ** END OF FILE
499 */
jo_vdp2_move_nbg0
static __jo_force_inline void jo_vdp2_move_nbg0(const int x, const int y)
Move NBG0 (scrolling)
Definition: vdp2.h:243
jo_enable_screen_transparency
void jo_enable_screen_transparency(const jo_scroll_screen screen, const unsigned short transparency_level)
Enable screen transparency.
JO_VDP2_ZMYIN0
#define JO_VDP2_ZMYIN0
Definition: sega_saturn.h:300
jo_vdp2_draw_bitmap_nbg1_square
static __jo_force_inline void jo_vdp2_draw_bitmap_nbg1_square(const int x, const int y, const short width, const short height, const jo_color color)
Draw a square on NBG1.
Definition: vdp2.h:306
jo_nbg2_clear
void jo_nbg2_clear(void)
Clear NBG2.
JO_VDP2_SCXIN1
#define JO_VDP2_SCXIN1
Definition: sega_saturn.h:303
jo_vdp2_zoom_nbg1f
static __jo_force_inline void jo_vdp2_zoom_nbg1f(const float width_factor, const float height_factor)
Zoom NBG1 width and height independently.
Definition: vdp2.h:217
jo_vdp2_set_nbg2_8bits_font
void jo_vdp2_set_nbg2_8bits_font(jo_img_8bits *img, char *mapping, int palette_id, bool vertical_flip, bool enabled)
Set 8 bits NBG2 font image.
jo_vdp2_zoom_nbg1
static __jo_force_inline void jo_vdp2_zoom_nbg1(const float factor)
Zoom NBG1.
Definition: vdp2.h:234
jo_set_displayed_screens
void jo_set_displayed_screens(const jo_scroll_screen scroll_screen_flags)
Set displayed screens.
jo_vdp2_enable_nbg1_line_scroll
int * jo_vdp2_enable_nbg1_line_scroll(void)
Enable NBG1 horizontal line scroll effect.
JO_VDP2_ZMXDN1
#define JO_VDP2_ZMXDN1
Definition: sega_saturn.h:308
sprintf
int sprintf(char *str, const char *format,...)
sprintf prototypes
__jo_force_inline
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition: conf.h:154
JO_MOD_POW2
#define JO_MOD_POW2(N, M)
Fast modulo of a power of 2.
Definition: math.h:220
jo_vdp2_set_nbg1_8bits_image
void jo_vdp2_set_nbg1_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip)
Add 8 bits NBG1 image.
JO_VDP2_ZMYIN1
#define JO_VDP2_ZMYIN1
Definition: sega_saturn.h:309
JO_VDP2_ZMYDN1
#define JO_VDP2_ZMYDN1
Definition: sega_saturn.h:310
JO_MULT_BY_65536
#define JO_MULT_BY_65536(X)
Multiply a variable by 65536.
Definition: math.h:138
jo_vdp2_draw_rbg0_plane_b
static __jo_force_inline void jo_vdp2_draw_rbg0_plane_b(const bool use_scroll_format_matrix)
Draw plane A.
Definition: vdp2.h:384
JO_VDP2_SCYIN1
#define JO_VDP2_SCYIN1
Definition: sega_saturn.h:305
jo_vdp2_enable_nbg0_line_scroll
int * jo_vdp2_enable_nbg0_line_scroll(void)
Enable NBG0 horizontal line scroll effect.
jo_vdp2_compute_nbg1_line_scroll
void jo_vdp2_compute_nbg1_line_scroll(unsigned short offset)
Compute NBG1 horizontal line scroll effect using specific offset.
jo_vdp2_disable_nbg1_line_scroll
void jo_vdp2_disable_nbg1_line_scroll(void)
Disable NBG1 horizontal line scroll effect.
jo_set_default_background_color
void jo_set_default_background_color(const jo_color background_color)
Set default background color.
jo_vdp2_set_nbg3_8bits_font
void jo_vdp2_set_nbg3_8bits_font(jo_img_8bits *img, char *mapping, int palette_id, bool vertical_flip, bool enabled)
Set 8 bits NBG3 font image.
__jo_sprintf_buf
char __jo_sprintf_buf[JO_PRINTF_BUF_SIZE]
Internal sprintf buffer.
jo_vdp2_draw_bitmap_nbg1_line
void jo_vdp2_draw_bitmap_nbg1_line(int x0, int y0, int x1, int y1, const jo_color color)
Draw a NBG1 line using Bresenham's line algorithm.
jo_vdp2_set_nbg3_8bits_image
void jo_vdp2_set_nbg3_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip, bool enabled)
Set 8 bits NBG3 image.
jo_vdp2_disable_rbg0
void jo_vdp2_disable_rbg0(void)
Disable 3D planes.
jo_color
unsigned short jo_color
15 bits color type
Definition: types.h:39
jo_vdp2_zoom_nbg0f
static __jo_force_inline void jo_vdp2_zoom_nbg0f(const float width_factor, const float height_factor)
Zoom NBG0 width and height independently.
Definition: vdp2.h:257
jo_vdp2_move_nbg1
static __jo_force_inline void jo_vdp2_move_nbg1(const int x, const int y)
Move NBG1 (scrolling)
Definition: vdp2.h:203
jo_vdp2_set_nbg0_8bits_image
void jo_vdp2_set_nbg0_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip, bool enabled)
Set 8 bits NBG0 image.
JO_DIV_BY_32768
#define JO_DIV_BY_32768(X)
Devide a variable by 32768.
Definition: math.h:186
JO_PRINTF_BUF_SIZE
#define JO_PRINTF_BUF_SIZE
Max character in available in jo_printf()
Definition: conf.h:147
jo_img_8bits
8 bits image struct
Definition: types.h:215
jo_nbg3_clear
void jo_nbg3_clear(void)
Clear NBG3.
JO_VDP2_ZMXIN1
#define JO_VDP2_ZMXIN1
Definition: sega_saturn.h:307
JO_VDP2_WIDTH
#define JO_VDP2_WIDTH
VDP2 Background bitmap width.
Definition: conf.h:141
jo_vdp2_draw_rbg0_plane_a
static __jo_force_inline void jo_vdp2_draw_rbg0_plane_a(const bool use_scroll_format_matrix)
Draw plane A.
Definition: vdp2.h:376
jo_vdp2_compute_nbg0_line_scroll
void jo_vdp2_compute_nbg0_line_scroll(unsigned short offset)
Compute NBG0 horizontal line scroll effect using specific offset.
jo_nbg2_print
void jo_nbg2_print(int x, int y, char *str)
NBG2 Print implementation.
JO_VDP2_SCXIN0
#define JO_VDP2_SCXIN0
Definition: sega_saturn.h:294
jo_vdp2_set_nbg1_image
void jo_vdp2_set_nbg1_image(const jo_img *const img, const unsigned short left, const unsigned short top)
Set NBG1 bitmap image.
JO_VDP2_ZMYDN0
#define JO_VDP2_ZMYDN0
Definition: sega_saturn.h:301
jo_disable_all_screens_transparency
void jo_disable_all_screens_transparency(void)
Disable all screens transparency.
jo_vdp2_set_rbg0_plane_a_8bits_image
void jo_vdp2_set_rbg0_plane_a_8bits_image(jo_img_8bits *img, int palette_id, bool repeat, bool vertical_flip)
Setup plane A.
jo_vdp2_set_nbg2_8bits_image
void jo_vdp2_set_nbg2_8bits_image(jo_img_8bits *img, int palette_id, bool vertical_flip, bool enabled)
Set 8 bits NBG2 image.
jo_vdp2_zoom_nbg0
static __jo_force_inline void jo_vdp2_zoom_nbg0(const float factor)
Zoom NBG0.
Definition: vdp2.h:274
jo_vdp2_put_pixel_bitmap_nbg1
static __jo_force_inline void jo_vdp2_put_pixel_bitmap_nbg1(const int x, const int y, const jo_color color)
Put pixel in NBG1 using color.
Definition: vdp2.h:319
jo_nbg3_print
void jo_nbg3_print(int x, int y, char *str)
NBG3 Print implementation.
jo_vdp2_clear_bitmap_nbg1
void jo_vdp2_clear_bitmap_nbg1(const jo_color color)
Clear NBG1 bitmap.
jo_vdp2_put_pixel_bitmap_nbg1_rgb
static __jo_force_inline void jo_vdp2_put_pixel_bitmap_nbg1_rgb(const int x, const int y, unsigned char r, unsigned char g, unsigned char b)
Put pixel in NBG1 using composite color.
Definition: vdp2.h:331
jo_enable_screen_mozaic
static __jo_force_inline void jo_enable_screen_mozaic(const jo_scroll_screen screens, const short x, const short y)
Enable mozaic effect for scroll screen.
Definition: vdp2.h:404
jo_disable_all_screen_mozaic
static __jo_force_inline void jo_disable_all_screen_mozaic(void)
Disable mozaic effect for all scroll screen.
Definition: vdp2.h:412
JO_VDP2_SCYIN0
#define JO_VDP2_SCYIN0
Definition: sega_saturn.h:296
jo_float2fixed
static __jo_force_inline jo_fixed jo_float2fixed(const float x)
Convert float to jo engine fixed (avoid usage of GCC Soft Float)
Definition: math.h:423
JO_VDP2_ZMXDN0
#define JO_VDP2_ZMXDN0
Definition: sega_saturn.h:299
jo_vdp2_enable_rbg0
void jo_vdp2_enable_rbg0(void)
Enable 3D planes.
jo_img
15 bits image struct
Definition: types.h:207
JO_VDP2_ZMXIN0
#define JO_VDP2_ZMXIN0
Definition: sega_saturn.h:298
jo_vdp2_disable_nbg0_line_scroll
void jo_vdp2_disable_nbg0_line_scroll(void)
Disable NBG0 horizontal line scroll effect.
jo_vdp2_set_rbg0_plane_b_8bits_image
void jo_vdp2_set_rbg0_plane_b_8bits_image(jo_img_8bits *img, int palette_id, bool repeat, bool vertical_flip)
Setup plane B.
jo_scroll_screen
jo_scroll_screen
Sega Saturn Scroll Screen Ids.
Definition: types.h:297