I think one is overriding another in memory, but not sure. This is what is happening on screen.
titlebg_tiles in BPLAN is corrupted.
The titlelogo_tiles in APLAN is displaying correctly.
sjaris_sprite is displaying correctly.
fcitizen_sprite is displaying with a green colors, rather then its own red colors in its palette.
Here is the code.
u16 palette[96];
VDP_setPaletteColors(0, palette_black, 96);
titlebgmap = unpackMap(titlebg_tiles.map, NULL);
indb = TILE_USERINDEX;
VDP_loadTileSet(titlebg_tiles.tileset, indb, TRUE);
VDP_setMapEx(BPLAN, titlebgmap, TILE_ATTR_FULL(PAL0, FALSE, FALSE, FALSE, indb), PlanXPosInTile, PlanYPosInTile, MapXPosInTile, MapYPosInTile, MapWidthInTile, MapHeightInTile);
indb += titlebg_tiles.tileset->numTile;
titlelogomap = unpackMap(titlelogo_tiles.map, NULL);
inda = TILE_USERINDEX;
VDP_loadTileSet(titlelogo_tiles.tileset, inda, TRUE);
VDP_setMapEx(APLAN, titlelogomap, TILE_ATTR_FULL(PAL1, FALSE, FALSE, FALSE, inda), 9, 1, 0, 0, 20, 17);
inda += titlelogo_tiles.tileset->numTile;
memcpy(&palette[0], titlebg_tiles.palette->data, 16 * 2);
memcpy(&palette[16], titlelogo_tiles.palette->data, 16 * 2);
memcpy(&palette[32], sjaris_sprite.palette->data, 16 * 2);
memcpy(&palette[64], fcitizen_sprite.palette->data, 16 * 2);
VDP_fadeIn(0, (3 * 16) - 1, palette, 20, FALSE);
Displaying the titlescreen corruption
Moderator: Stef
Re: Displaying the titlescreen corruption
Apparently using TILEUSERINDEX to load the next tilemap is what was causing that problem. i just use indb = 0; for one map and it works.
But now i need to fix why the fcitizen sprite is not showing its colors right.
But now i need to fix why the fcitizen sprite is not showing its colors right.
Re: Displaying the titlescreen corruption
So i stop using the fade in with the palette array, since apparently i do not know how to use it yet.
Now i just use VDP_setPalette(PAL(0,1,2...), sprite.palette->data); for each tilemap and sprite. That works fine.
I'll leave this post unsolved for now, but if you want to tell me how to use it go ahead and post, and i'll redo it.
moving onto the next thing for now.
Now i just use VDP_setPalette(PAL(0,1,2...), sprite.palette->data); for each tilemap and sprite. That works fine.
I'll leave this post unsolved for now, but if you want to tell me how to use it go ahead and post, and i'll redo it.
moving onto the next thing for now.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Displaying the titlescreen corruption
You should not have separate indb and inda, background plan share the same memory for their tiles.
So basically here by doing that :
you are overriding tiles from plan B by the tiles from plan A.
Just use :
You just need to save in separate variable position of indb and inda for future reference in the setMapEx(..) methods but definitely you should keep tiles of both plan in different VRAM area.
So basically here by doing that :
Code: Select all
inda = TILE_USERINDEX;
VDP_loadTileSet(titlelogo_tiles.tileset, inda, TRUE);
Just use :
Code: Select all
VDP_loadTileSet(titlelogo_tiles.tileset, ind, TRUE);
Re: Displaying the titlescreen corruption
Ah i see. I have corrected it now, and now using one var.Stef wrote:You should not have separate indb and inda, background plan share the same memory for their tiles.
So basically here by doing that :you are overriding tiles from plan B by the tiles from plan A.Code: Select all
inda = TILE_USERINDEX; VDP_loadTileSet(titlelogo_tiles.tileset, inda, TRUE);
Just use :You just need to save in separate variable position of indb and inda for future reference in the setMapEx(..) methods but definitely you should keep tiles of both plan in different VRAM area.Code: Select all
VDP_loadTileSet(titlelogo_tiles.tileset, ind, TRUE);