Page 1 of 1

Window Plan

Posted: Tue May 24, 2016 1:31 pm
by dub
Hi, I try to use the Window Plan like a HUD.

I wish to keep a full scrolling PlanA (horizontal / vertical). I load all the tiles in PlanA for the scrolling and I want to show a HUD in top or bottom of the screen :

Code: Select all

u16 i,j;
	
	for(i=0;i<32;i++)
	{
		for(j=0;j<64;j++)
		{
			VDP_setTileMapXY(VDP_PLAN_B, TILE_ATTR_FULL(PAL0, 0, 0, 0, 1 ), j, i);	//fond
			VDP_setTileMapXY(VDP_PLAN_A, TILE_ATTR_FULL(PAL0, 0, 0, 0, 80 ), j, i);  //devant
		}
	}
	
	VDP_setWindowAddress(0xB000);
	
	for(i=0;i<4;i++)
	{
		for(j=0;j<40;j++)
		{
			
			VDP_setTileMapXY(VDP_WINDOW   , TILE_ATTR_FULL(PAL0, 0, 0, 0, 2 ), j, i);
		}
	}
The B and A plan are ok, but I can't see the Window Plan ?
I look the source and find the 0xB000 default value for Window Plan but maybe the vdp_setTileMap is not the good way to use it.

The values of my tiles are good and upload in vram.
Image

Re: Window Plan

Posted: Tue May 24, 2016 3:09 pm
by cero
The various functions, including XY, are not set up to work with the window plane. I think there's a github issue, though Stef closed it. So to write tiles to the window plane, you have to use the more primitive functions and calculate the index yourself.

Re: Window Plan

Posted: Tue May 24, 2016 6:30 pm
by Stef
Did you verified you correctly setup the window on the VDP ?
You need to modify VDP registers $11 and $12 for that :
http://md.squee.co/VDP#.2411_-_Window_P ... l_Position

But there is also the problem of some methods not supporting the window plan... but it will be fixed soon :)

Re: Window Plan

Posted: Wed May 25, 2016 8:57 am
by dub
Yes, I've check the register and I have 0 for vertical / horizontal.

Image

Can you give me the name of a function who can work for the window plan. Otherwise, I could always add some asm code.

Re: Window Plan

Posted: Wed May 25, 2016 1:08 pm
by Stef
So given your window registers the window is not visible, you have to set value != 0 if you want to make the window visible.

Re: Window Plan

Posted: Wed May 25, 2016 3:38 pm
by dub
Thanks, I was thinking it was only for the position. So I now can change my register in real time :mrgreen:

I have an another problem now.
Well not really a problem, I have the limitation of the address of the Window Plan (B000 to B800) for H40 resolution. Of course, I want to show my window on the downside of the screen but I'll use a H32 now and I'll looking for the memory later.