I managed to draw a fullscreen background using SGDK on Plane B.
However, i'm trying to draw a logo on Plane A, using the same method, which doesn't really work.
It does load, but it's on the bottom of Plane B (i checked in Gens KMOD's Plane explorer).
MintyTheCat already said something about priorities, but i'm not sure where to look for those.
2. without thinking too much about it I would say that you need to check your Priority settings. In the MD all Tiles are positioned according to each Tile's Tile-Map Entry found in the Tile-Map so if you are not sure you can interrogate that to make sure that you end up with the correct settings for the Tiles and indeed the Planes. There are rules but if A:Pri=1 and B:Pri=1 then A 'wins'. So check that B:Priority is set and see that A's is not.
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
#define TILE2 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);
VDP_loadTileData(logo.tiles, TILE2, logo.width*logo.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_fillTileMapRectInc(APLAN, TILE_ATTR_FULL(PAL1, 0, 0, 0, TILE2), 0, -4, logo.width, logo.height);
VDP_drawText("SCORE:", 0,0);
VDP_drawText("00", 38, 0);
while(1)
{
VDP_waitVSync();
}
return 0;
}
Thanks in advance!
-Steve