Window Plan

SGDK only sub forum

Moderator: Stef

Post Reply
dub
Very interested
Posts: 101
Joined: Thu Mar 19, 2015 1:26 pm

Window Plan

Post by dub » Tue May 24, 2016 1:31 pm

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

cero
Very interested
Posts: 338
Joined: Mon Nov 30, 2015 1:55 pm

Re: Window Plan

Post by cero » Tue May 24, 2016 3:09 pm

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.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Window Plan

Post by Stef » Tue May 24, 2016 6:30 pm

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 :)

dub
Very interested
Posts: 101
Joined: Thu Mar 19, 2015 1:26 pm

Re: Window Plan

Post by dub » Wed May 25, 2016 8:57 am

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.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Window Plan

Post by Stef » Wed May 25, 2016 1:08 pm

So given your window registers the window is not visible, you have to set value != 0 if you want to make the window visible.

dub
Very interested
Posts: 101
Joined: Thu Mar 19, 2015 1:26 pm

Re: Window Plan

Post by dub » Wed May 25, 2016 3:38 pm

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.

Post Reply