So i'm trying to write a little game right now, to get into some genny coding.
Now, as far as i understand, there's 2 "planes" which can be used to draw background graphics, along with a sprite layer.
I managed to draw a simple BMP background on plane B, but now i'd like to draw a little "logo" on plane A, in front of the background.
This is the code i currently have, which seems to work.
Code: Select all
#include <genesis.h>
struct genresTiles
{
u16 *pal; //pointer to pal data
u32 *tiles; //pointer to tiles data
u16 width; //width in tiles
u16 height; //height in tiles
u16 compressedSize; //0 in this demo, more coming soon
};
extern struct genresTiles citybg;
extern struct genresTiles logo;
#define TILE1 1
int main( )
{
VDP_setPalette(PAL1, citybg.pal);
// load tiles in VRAM
// arg0 = tiles data
// arg1 = index for first destination tile
// arg2 = number of tiles to load
// arg3 = use DMA (1) or not (0)
VDP_loadTileData(citybg.tiles, TILE1, citybg.width*citybg.height, 0);
// City background fill
VDP_fillTileMapRectInc(BPLAN, TILE_ATTR_FULL(PAL1, 0, 0, 0, TILE1), 0, -4, citybg.width, citybg.height);
VDP_fillTileMapRectInc(BPLAN, TILE_ATTR_FULL(PAL1, 0, 0, 0, TILE1), 16, -4, citybg.width, citybg.height);
VDP_fillTileMapRectInc(BPLAN, TILE_ATTR_FULL(PAL1, 0, 0, 0, TILE1), 32, -4, citybg.width, citybg.height);
VDP_drawText("SCORE:", 0,0);
VDP_drawText("00", 38, 0);
while(1)
{
VDP_waitVSync();
}
return 0;
}
Any pointers?
Thanks