How use PLAN_WINDOW for sgdk
Moderator: Stef
How use PLAN_WINDOW for sgdk
How use PLAN_WINDOW for sgdk?
VDP_drawTextBG (PLAN_WINDOW, "AAAAAA", 1, 1); - Does not work. Black screen.
VDP_drawTextBG (PLAN_B, "AAAAAA", 1, 1); Working. Displays an inscription "AAAAAA".
VDP_drawTextBG (PLAN_WINDOW, "AAAAAA", 1, 1); - Does not work. Black screen.
VDP_drawTextBG (PLAN_B, "AAAAAA", 1, 1); Working. Displays an inscription "AAAAAA".
-
- Very interested
- Posts: 117
- Joined: Sun Jan 02, 2011 9:14 pm
- Contact:
Re: How use PLAN_WINDOW for sgdk
First of all you have to define and place it anywhere on the screen
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: How use PLAN_WINDOW for sgdk
Indeed, you need to setup it first using these methods :
Also you need to be sure to allocate enough VRAM for the window tilemap (you can relocate tilemap).
Code: Select all
void VDP_setWindowHPos(u16 right, u16 pos);
void VDP_setWindowVPos(u16 down, u16 pos);
Re: How use PLAN_WINDOW for sgdk
You can show a simple example where you would simultaneously use PLAN_A, PLAN_B and PLAN_WINDOWS
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: How use PLAN_WINDOW for sgdk
PLAN_A and WINDOW are the same plan. See the window as a "fixed part" of the plan A with its own tilemap.
If you were expecting a third window plan, sorry but it is not the case :-/
If you were expecting a third window plan, sorry but it is not the case :-/
Re: How use PLAN_WINDOW for sgdk
Ok. Many thanks.
-
- Newbie
- Posts: 6
- Joined: Mon Jul 24, 2017 8:24 pm
Re: How use PLAN_WINDOW for sgdk
I found out something interesting with the window plane in SGDK when I was trying to get it to work.
I was trying to use the window plane to make a HUD at the bottom of my game screen. I spent an age trying to get it to work, looking through all the examples and tutorials I could find.
Tried one thing. Didn't work. Changed it a little. Still didn't work. For some unknown reason I just kept getting garbled tiles in the window plane.
Then I read somewhere that the game Quackshot used the window plane as a HUD in the same way. So I fired up an emulator, loaded Quackshot and checked the VDP registers. Whereas SGDK has the window plane address as 0xB000 by default, Quackshot had it set at 0xD000.
So at the beginning of my game, I added the following line:
Adding that line solved my window plane problems and didn't affect anything else. I'm not sure why it worked but it did.
Then the two lines I used to make setup the window plane along the bottom of the (NTSC) screen were:
I was trying to use the window plane to make a HUD at the bottom of my game screen. I spent an age trying to get it to work, looking through all the examples and tutorials I could find.
Tried one thing. Didn't work. Changed it a little. Still didn't work. For some unknown reason I just kept getting garbled tiles in the window plane.
Then I read somewhere that the game Quackshot used the window plane as a HUD in the same way. So I fired up an emulator, loaded Quackshot and checked the VDP registers. Whereas SGDK has the window plane address as 0xB000 by default, Quackshot had it set at 0xD000.
So at the beginning of my game, I added the following line:
Code: Select all
VDP_setWindowAddress(0xD000);
Then the two lines I used to make setup the window plane along the bottom of the (NTSC) screen were:
Code: Select all
VDP_setWindowHPos(0, 0);
VDP_setWindowVPos(1, 27);
Re: How use PLAN_WINDOW for sgdk
That happened because SGDK uses 0xB800 and 0xBC00 for the sprite list and horizontal scroll table by default, clobbering the bottom half of the PLAN_WINDOW.
If you are only using 64x32 plane size instead of 64x64 setting the window plane to 0xD000 should be fine. If you are using the default 64x64 size you are clobbering the bottom half of PLAN_B with PLAN_WINDOW now.
If you are only using 64x32 plane size instead of 64x64 setting the window plane to 0xD000 should be fine. If you are using the default 64x64 size you are clobbering the bottom half of PLAN_B with PLAN_WINDOW now.
-
- Newbie
- Posts: 6
- Joined: Mon Jul 24, 2017 8:24 pm
Re: How use PLAN_WINDOW for sgdk
That explains it, thanks.
I didn't know that memory sections were set up to overlap by default.
I didn't know that memory sections were set up to overlap by default.
-
- Interested
- Posts: 19
- Joined: Mon Jul 03, 2017 2:23 pm
- Location: Sao Paulo -Sp
- Contact:
Re: How use PLAN_WINDOW for sgdk
Hello guy,pitcrawler wrote: ↑Fri Sep 08, 2017 1:03 pmI found out something interesting with the window plane in SGDK when I was trying to get it to work.
I was trying to use the window plane to make a HUD at the bottom of my game screen. I spent an age trying to get it to work, looking through all the examples and tutorials I could find.
Tried one thing. Didn't work. Changed it a little. Still didn't work. For some unknown reason I just kept getting garbled tiles in the window plane.
Then I read somewhere that the game Quackshot used the window plane as a HUD in the same way. So I fired up an emulator, loaded Quackshot and checked the VDP registers. Whereas SGDK has the window plane address as 0xB000 by default, Quackshot had it set at 0xD000.
So at the beginning of my game, I added the following line:Adding that line solved my window plane problems and didn't affect anything else. I'm not sure why it worked but it did.Code: Select all
VDP_setWindowAddress(0xD000);
Then the two lines I used to make setup the window plane along the bottom of the (NTSC) screen were:Code: Select all
VDP_setWindowHPos(0, 0); VDP_setWindowVPos(1, 27);
I'm having a problem in the window plane, pq msm using VDP_setWindowAddress (0xD000);
still a lot of sprites are created in vram, and I can not clean with vdp_clearsprites, how can I solve it, I already tried several things and nothing
The Mega Drive Will Never Die In Our Hearts.
Project Leyria RPG for Sega Mega Drive / Genesis
https://gendev.spritesmind.net/forum/vi ... php?t=2728
Project Leyria RPG for Sega Mega Drive / Genesis
https://gendev.spritesmind.net/forum/vi ... php?t=2728