SGDK
A free and open development kit for the Sega Mega Drive
Loading...
Searching...
No Matches
vdp_bg.h
Go to the documentation of this file.
1
12
13#ifndef _VDP_BG_H_
14#define _VDP_BG_H_
15
16#include "bmp.h"
17#include "vdp.h"
18#include "vdp_tile.h"
19
20
33typedef struct
34{
35 Palette *palette;
36 TileSet *tileset;
37 TileMap *tilemap;
38} Image;
39
40
47extern u16 curTileInd;
48
70void VDP_setHorizontalScroll(VDPPlane plane, s16 value);
119void VDP_setHorizontalScrollTile(VDPPlane plane, u16 tile, s16* values, u16 len, TransferMethod tm);
150void VDP_setHorizontalScrollLine(VDPPlane plane, u16 line, s16* values, u16 len, TransferMethod tm);
151
170void VDP_setVerticalScroll(VDPPlane plane, s16 value);
186void VDP_setVerticalScrollVSync(VDPPlane plane, s16 value);
216void VDP_setVerticalScrollTile(VDPPlane plane, u16 tile, s16* values, u16 len, TransferMethod tm);
217
232void VDP_clearPlane(VDPPlane plane, bool wait);
233
260
275void VDP_setTextPlane(VDPPlane plane);
286void VDP_setTextPalette(u16 palette);
299void VDP_setTextPriority(u16 prio);
300
332void VDP_drawTextEx(VDPPlane plane, const char* str, u16 basetile, u16 x, u16 y, TransferMethod tm);
363void VDP_clearTextEx(VDPPlane plane, u16 basetile, u16 x, u16 y, u16 w, TransferMethod tm);
395void VDP_clearTextAreaEx(VDPPlane plane, u16 basetile, u16 x, u16 y, u16 w, u16 h, TransferMethod tm);
396
420void VDP_drawTextBG(VDPPlane plane, const char* str, u16 x, u16 y);
443void VDP_clearTextBG(VDPPlane plane, u16 x, u16 y, u16 w);
468void VDP_clearTextAreaBG(VDPPlane plane, u16 x, u16 y, u16 w, u16 h);
486void VDP_clearTextLineBG(VDPPlane plane, u16 y);
487
504void VDP_drawText(const char* str, u16 x, u16 y);
505
534void VDP_drawTextBGFill(VDPPlane plane, const char* str, u16 x, u16 y, u16 len);
535
558void VDP_drawTextFill(const char* str, u16 x, u16 y, u16 len);
574void VDP_clearText(u16 x, u16 y, u16 w);
592void VDP_clearTextArea(u16 x, u16 y, u16 w, u16 h);
604void VDP_clearTextLine(u16 y);
605
632bool VDP_drawBitmap(VDPPlane plane, const Bitmap *bitmap, u16 x, u16 y);
663bool VDP_drawBitmapEx(VDPPlane plane, const Bitmap *bitmap, u16 basetile, u16 x, u16 y, bool loadpal);
664
689bool VDP_drawImage(VDPPlane plane, const Image *image, u16 x, u16 y);
720bool VDP_drawImageEx(VDPPlane plane, const Image *image, u16 basetile, u16 x, u16 y, bool loadpal, bool dma);
721
722
723#endif // _VDP_BG_H_
Software bitmap engine.
TransferMethod
VRAM transfer method.
Definition dma.h:52
Genesis 4bpp Bitmap structure definition. Use the unpackBitmap() method to unpack if compression is ...
Definition bmp.h:161
Image structure which contains all data to define an image in a background plane. Use the unpackImag...
Definition vdp_bg.h:34
Palette structure contains color data.
Definition pal.h:73
TileMap structure which contains tilemap background definition. Use the unpackTileMap() method to un...
Definition vdp_tile.h:137
Tile set structure which contains tiles definition. Use the unpackTileSet() method to unpack if comp...
Definition vdp_tile.h:114
short s16
Definition types.h:84
unsigned short u16
Definition types.h:100
VDP main.
VDPPlane
Type used to define on which plane to work (used by some methods).
Definition vdp.h:519
bool VDP_drawBitmapEx(VDPPlane plane, const Bitmap *bitmap, u16 basetile, u16 x, u16 y, bool loadpal)
Draw Bitmap in specified background plane and at given position.
Definition vdp_bg.c:449
void VDP_clearTextBG(VDPPlane plane, u16 x, u16 y, u16 w)
Clear a single line portion of text.
Definition vdp_bg.c:326
void VDP_setHorizontalScrollTile(VDPPlane plane, u16 tile, s16 *values, u16 len, TransferMethod tm)
Set plane horizontal scroll (tile scroll mode). 3 horizontal scroll modes are supported:
Definition vdp_bg.c:68
bool VDP_drawImageEx(VDPPlane plane, const Image *image, u16 basetile, u16 x, u16 y, bool loadpal, bool dma)
Draw Image in specified background plane and at given position.
Definition vdp_bg.c:495
u16 VDP_getTextPalette(void)
Returns the palette number used to display text.
Definition vdp_bg.c:200
void VDP_setHorizontalScrollVSync(VDPPlane plane, s16 value)
Same as VDP_setHorizontalScroll(..) except that it will delay scroll update on VSync.
Definition vdp_bg.c:51
bool VDP_drawBitmap(VDPPlane plane, const Bitmap *bitmap, u16 x, u16 y)
Draw Bitmap in specified background plane and at given position.
Definition vdp_bg.c:432
void VDP_clearTextAreaBG(VDPPlane plane, u16 x, u16 y, u16 w, u16 h)
Clear a specific area of text.
Definition vdp_bg.c:349
void VDP_setVerticalScroll(VDPPlane plane, s16 value)
Set plane vertical scroll (plain scroll mode). 2 vertical scroll modes are supported:
Definition vdp_bg.c:88
void VDP_clearTextAreaEx(VDPPlane plane, u16 basetile, u16 x, u16 y, u16 w, u16 h, TransferMethod tm)
Clear a specific area of text (advanced method).
Definition vdp_bg.c:285
void VDP_setVerticalScrollTile(VDPPlane plane, u16 tile, s16 *values, u16 len, TransferMethod tm)
Set plane vertical scroll (2-Tiles scroll mode). 2 vertical scroll modes are supported:
Definition vdp_bg.c:122
bool VDP_drawImage(VDPPlane plane, const Image *image, u16 x, u16 y)
Draw Image (using DMA) in specified background plane and at given position.
Definition vdp_bg.c:478
void VDP_setTextPriority(u16 prio)
Define the priority to use to display text.
Definition vdp_bg.c:221
void VDP_clearTextLineBG(VDPPlane plane, u16 y)
Clear a complete line of text.
Definition vdp_bg.c:375
void VDP_drawTextFill(const char *str, u16 x, u16 y, u16 len)
Draw text and clear remaining unused space. If the new line is shorter than the one previously drawn...
Definition vdp_bg.c:411
void VDP_setVerticalScrollVSync(VDPPlane plane, s16 value)
Same as VDP_setVerticalScroll(..) except that it will delay scroll update on VSync.
Definition vdp_bg.c:105
void VDP_clearPlane(VDPPlane plane, bool wait)
Clear specified plane (using DMA).
Definition vdp_bg.c:177
u16 VDP_getTextPriority(void)
Returns the priority used to display text.
Definition vdp_bg.c:205
void VDP_clearTextLine(u16 y)
Clear a complete line of text.
Definition vdp_bg.c:426
void VDP_drawTextBGFill(VDPPlane plane, const char *str, u16 x, u16 y, u16 len)
Draw text in specified plane and clear remaining unused space. If the new line is shorter than the o...
Definition vdp_bg.c:385
void VDP_setTextPlane(VDPPlane plane)
Define the plane to use to display text.
Definition vdp_bg.c:210
void VDP_setHorizontalScrollLine(VDPPlane plane, u16 line, s16 *values, u16 len, TransferMethod tm)
Set plane horizontal scroll (line scroll mode). 3 horizontal scroll modes are supported:
Definition vdp_bg.c:78
void VDP_drawText(const char *str, u16 x, u16 y)
Draw text.
Definition vdp_bg.c:380
void VDP_clearTextArea(u16 x, u16 y, u16 w, u16 h)
Clear a specific area of text.
Definition vdp_bg.c:421
void VDP_setTextPalette(u16 palette)
Define the palette to use to display text.
Definition vdp_bg.c:215
void VDP_drawTextBG(VDPPlane plane, const char *str, u16 x, u16 y)
Draw text in specified plane.
Definition vdp_bg.c:321
VDPPlane VDP_getTextPlane(void)
Returns the plane used to display text.
Definition vdp_bg.c:195
void VDP_drawTextEx(VDPPlane plane, const char *str, u16 basetile, u16 x, u16 y, TransferMethod tm)
Draw text in specified plane (advanced method).
Definition vdp_bg.c:227
void VDP_setHorizontalScroll(VDPPlane plane, s16 value)
Set plane horizontal scroll (plain scroll mode). 3 horizontal scroll modes are supported:
Definition vdp_bg.c:34
void VDP_clearText(u16 x, u16 y, u16 w)
Clear a single line portion of text.
Definition vdp_bg.c:416
void VDP_clearTextEx(VDPPlane plane, u16 basetile, u16 x, u16 y, u16 w, TransferMethod tm)
Clear a single line portion of text (advanced method).
Definition vdp_bg.c:259
VDP General Tile / Tilemap operations.