It is currently Thu Nov 23, 2017 7:13 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Mon Oct 03, 2011 2:15 am 
Offline
User avatar

Joined: Mon Apr 25, 2005 12:28 pm
Posts: 73
Location: Umeå, Sweden
Hello all!

I'm working on a simple one-screen platforming game, which is actually coming along quite nicely. I have one small thing that annoys me though, if I turn on PAL emulation there is garbled graphics at the top of the screen (and bottom, but I know where that is coming from).

I'm guessing this has to do with the fact that I have set the Y scroll to 248 to make the top 8 pixels visable, that are hidden by the NTSC overscan if Y scroll is set to zero. However I'm living in PAL country so I really want it to look nice in PAL aswell.

Here is how it looks:
Image

I'm not really sure where the error graphics at the top is coming from, and hence my question. I was thinking of clearing the entire VRAM in my init section (right now it just clears Work RAM), I figured that might make the problem go away, but I'm still curious where the error at the top is coming from? If I look in FCEUX's NameTable viewer the error is not visible. The game currently doesn't use any mapper and is set to vertical mirroring if that makes any difference?

I tried blanking out most of VRAM in the RAM editor in FCEUX with no luck... soo, to sum it all up, where is the PPU picking up the garbled graphics at the top?


Top
 Profile  
 
PostPosted: Mon Oct 03, 2011 4:18 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1049
Location: Minneapolis, MN
jayminer wrote:
I'm guessing this has to do with the fact that I have set the Y scroll to 248 to make the top 8 pixels visable, that are hidden by the NTSC overscan if Y scroll is set to zero. However I'm living in PAL country so I really want it to look nice in PAL aswell.


You're rendering the attribute tables...there's only 240 scanlines NTSC or PAL.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 4:57 am 
Offline
User avatar

Joined: Mon Apr 25, 2005 12:28 pm
Posts: 73
Location: Umeå, Sweden
Okay, makes sense. But I kinda figured since there is mirroring (vertical) I would just get a mirrored copy of the current NameTable beneath the current screen. I think I need to read up on scrolling, even though I had sorta avoided it thus far in this project.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 5:33 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19254
Location: NE Indiana, USA (NTSC)
Set Y to 232 and tell me how well it works.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 5:47 am 
Offline
User avatar

Joined: Mon Apr 25, 2005 12:28 pm
Posts: 73
Location: Umeå, Sweden
It worked perfectly fine, thanks. I feel kind of stupid since now that you've you told me what's wrong, it seems so obvious. I'm so used to the PAL screen being 256 pixels high so I just took 256 and subtracted 8 and figured that would be fine.

Thanks a lot!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 5:53 am 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10118
Location: Rio de Janeiro - Brazil
If you set the vertical scroll to values between 240 and 255 you force the NES to render attribute table data as if it was name table data. If you do like tepples said instead and set the scroll to 232, the PPU will render 8 scanlines and automatically wrap from 239 to 0. That's normal PPU behavior.

As long as you write that diagonal pattern to the last 2 rows of the name table and use vertical mirroring, a scroll value of 232 should result in the effect you're going for.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 5:56 am 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10118
Location: Rio de Janeiro - Brazil
jayminer wrote:
I'm so used to the PAL screen being 256 pixels high

But the PAL screen is not 256 pixels high... Both PAL and NTSC consoles always have the same resolution, 256x240.

What happens is that some emulators are configured to hide the top and bottom 8 scanlines in NTSC mode (so only 224 are visible), which is not useful at all if you are a developer.

You should change the video setting so that all scanlines are visible in both modes.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 6:33 am 
Offline
User avatar

Joined: Mon Apr 25, 2005 12:28 pm
Posts: 73
Location: Umeå, Sweden
Yes, what I meant by being used to the PAL screen being 256 pixels high, is that I'm used to the Amiga, and there a normal screen is 320x256. So I blame my mistake on the Amiga :)

Yeah, I will make sure that I always show the entire 240 pixels from now on. Thanks for all the information, everything is a lot more clear now.

Now - onwards to implementing a mapper and bankswitching!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 9:47 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3951
Watch out for old TV clipping:
Image

Dark blue area is clipped on my old TV.
Notice that a lot of games try to avoid putting functional elements into the top and bottom 16 pixels. You can see it clearly in Super Mario Bros, Castlevania, etc.

So oddly enough, the "broken" screenshot would be better when clipped on an old TV than one where the top scroll is set to 0. Setting it to Y=232 avoids drawing the attribute tables. (If you are using horizontal mirroring, you can set it to Y=232 on the second nametable, and then it will wrap back to the main screen 8 pixels later.)

Now if this game is only intended to run on emulators, then you have a lot more leeway here, and don't need to constrain the game to run on old clip-happy TVs.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 10:56 am 
Offline
User avatar

Joined: Mon Apr 25, 2005 12:28 pm
Posts: 73
Location: Umeå, Sweden
I'm definitely going to make sure that the game (if ever finished) works on original hardware, so yeah, I'll have to take the overscan into consideration. Now when the bug is fixed it still looks like on the broken picture, except for the 8 pixels on the top and bottom are just black tiles instead of garbage-tiles.

So there will be 24 "not very important"-pixels at the top and bottom, and 16 "not very important"-pixels to the left and right. As long as you can see a few pixels of the walls, that will be fine.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 12:11 pm 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1049
Location: Minneapolis, MN
jayminer wrote:
I'm used to the Amiga


Obviously.
8)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 1:02 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2257
I think you'd be good with 16 pixels top and bottom and 8 pixels left and right, although that doesn't matter, you still show game play horizontally I believe, just don't put important stuff on the sides. :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2011 2:05 pm 
Offline

Joined: Wed Feb 17, 2010 5:42 pm
Posts: 359
Location: Denine's Devil Mansion
All was cleared so here's small offtop:
This graphics look very good, I wish to have half of your creativity.
I hope to see this game finished :D


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2011 8:24 am 
Offline
User avatar

Joined: Mon Apr 25, 2005 12:28 pm
Posts: 73
Location: Umeå, Sweden
Denine wrote:
All was cleared so here's small offtop:
This graphics look very good, I wish to have half of your creativity.
I hope to see this game finished :D


Thanks for the compliment about the graphics :) Glad you like it, this is still early stuff so I definitely hope to improve on it some more.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group