I have got to the stage where I want to start adding sprites. I believe the VDP handles the tiles for me and I don't have to allocate tile memory like I do with the backgrounds, right?
Anyway, the game works fine but when I add the car in, it seems part of the tileset on frame four of my road is being written over. How would I fix this? You can see in the bottom corners.
Here's the code for setting up the BG:
Code: Select all
// DRAW SKY
u16 iSkyTileSet;
iSkyTileSet = TILE_USERINDEX;
VDP_loadTileSet(sky_tropical.tileset, iSkyTileSet, FALSE);
Map *map = unpackMap(sky_tropical.map, NULL);
VDP_setMapEx(APLAN, map, TILE_ATTR_FULL(PAL1, FALSE, FALSE, FALSE, iSkyTileSet), 0, 0, 0, 0, 64, 12);
// DRAW ROAD
u16 iRoadTileSet;
iRoadTileSet = TILE_USERINDEX + sky_tropical.tileset->numTile;
VDP_loadTileSet(road_tropical.tileset, iRoadTileSet, FALSE);
Map *map2 = unpackMap(road_tropical.map, NULL);
VDP_setMapEx(BPLAN, map2, TILE_ATTR_FULL(PAL2, FALSE, FALSE, FALSE, iRoadTileSet), 0, 0, 0, 0, 64, 64);
Code: Select all
// Init buggy sprite
SPR_initSprite(&sprites[0], &sprite_buggy, 128, 170, TILE_ATTR(PAL3, TRUE, FALSE, FALSE));
SPR_update(sprites, 1);
EDIT: I have attached a screen print from GENS debug plane B