It is currently Sun Nov 19, 2017 3:43 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Dec 21, 2012 3:33 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 11:46 am
Posts: 78
Location: Stockholm, Sweden
Hello

I just got an NTSC NES to test beside my PAL one. I just noticed that the sprite limit is 7 on this specific system. I am wondering if it is a broken PPU, or maybe a common bug among powerpak users?

I have no way to test this on a real cart, since all my carts are PAL. So only powerpak here.

It took me a while to see what it was, but I saw that something wasn't right. Sprites flickering were not as "nice" as it usually is. When I finally tried my own game Mineshaft, it was very obvious. The platforms are 5 sprites wide, and the score is 3. That should be ok unless the player sprite is on the same line. But on this particular system, one sprite of the platform edge gets invisible every time they are on the same line as the score.

I did some more tests, and found other games where the same issue is visible. This does not happen on my PAL NES.

Is this common? Anyone else seen this?


Top
 Profile  
 
PostPosted: Fri Dec 21, 2012 4:13 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
If you give me a ROM of your game, I can test it on a PowerPak with the latest code, as well as an NTSC NES and NTSC top-loader NES, using an NTSC TV (I see you're in Sweden; hejsan svejsan), although I'm not familiar enough to know what it should normally look like (any emulator you'd recommend for confirming correct behaviour?)


Top
 Profile  
 
PostPosted: Fri Dec 21, 2012 4:23 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 11:46 am
Posts: 78
Location: Stockholm, Sweden
Hejsan svejsan!

Sure. If you play this rom, then the combined number of sprites on a line of a platform and the three digits of the score will add up to eight. No flickering is implemented in this game, so that's a good way to test it. I might write a test rom tomorrow if none is available.


Attachments:
MineShaft.rar [5.46 KiB]
Downloaded 144 times
Top
 Profile  
 
PostPosted: Fri Dec 21, 2012 4:24 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19227
Location: NE Indiana, USA (NTSC)
The only time I saw unexpected sprite flicker in one of my projects was when I was turning off rendering early. Doing so at any time other than near the end of a visible scanline appears to interfere with refreshing the DRAM used for OAM, as sprites 0 and 1 get copied over some other even-odd pair of sprites.

koitsu: The game is MineShaft, and it works fine on my PowerPak + NTSC NES, up to at least score 189.

Download MineShaft alone (reupload due to 403 error from fileden)
Download MineShaft as part of Action 53 (#34, oversize BNROM)
Download Streemerz bundle beta 3 (requires mapper 28 plug-in)


Top
 Profile  
 
PostPosted: Fri Dec 21, 2012 4:29 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6442
Location: UK (temporarily)
Attached is a trivial test rom that just displays 64 non-moving 8x16 sprites, with 8 sprites together. (Unfortunately I'm too lazy to fix the tiles such that it counts LTR instead of RTL) You mean the rightmost column (00,08, &c) doesn't show up?


Attachments:
64sprite.zip [971 Bytes]
Downloaded 97 times


Last edited by lidnariq on Fri Dec 21, 2012 4:33 pm, edited 1 time in total.
Top
 Profile  
 
PostPosted: Fri Dec 21, 2012 4:32 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
Thanks guys -- no sense in me testing it if it works okay on tepples' stuff. :-) Nioreh, give the test ROM that lidnariq provided a shot, see what the results are there.


Top
 Profile  
 
PostPosted: Sat Dec 22, 2012 4:37 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 11:46 am
Posts: 78
Location: Stockholm, Sweden
Ok, here are the results from my two nes units. The same powerpak was used on both systems. So, can it really be possible for the PPU to break like this? Or can it be some bad component on the motherboard?


Attachments:
File comment: NES PAL
PAL.jpg
PAL.jpg [ 27.59 KiB | Viewed 2110 times ]
File comment: NES NTSC
ntsc.jpg
ntsc.jpg [ 27.26 KiB | Viewed 2110 times ]
Top
 Profile  
 
PostPosted: Sat Dec 22, 2012 6:57 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19227
Location: NE Indiana, USA (NTSC)
I get a couple sprites missing from the screen too, but not nearly a whole column missing like you appear to be getting. The pair moves after every reset, and occasionally they're all bunched up at the top or at the left. It might have something to do with what I discovered while making Concentration Room: OAM refresh isn't in a defined state immediately after reset; you have to let one frame finish rendering before OAM refresh becomes stable. The best practice is to copy OAM after one complete frame has been displayed. This happens automatically in an actual game such as MineShaft, where OAM is copied during each vblank.

I'll make a test ROM for this exact bad practice, where the user can manually force OAM to be recopied.


EDIT: Here's the test. It's bigger than lidnariq's because it includes full source code.

EDIT 2: It's not waiting for vblank before uploading the display list to OAM for the first time, but rainwarrior fixed that.


Attachments:
File comment: Result on NTSC NES + PowerPak, after one reset
oam_reset_result.jpg
oam_reset_result.jpg [ 68.92 KiB | Viewed 2087 times ]
oam_reset-0.01.zip [13.37 KiB]
Downloaded 105 times
Top
 Profile  
 
PostPosted: Sat Dec 22, 2012 9:55 am 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Why aren't these tests made to display all 64 sprites properly? Is it this hard to avoid PPU quirks?


Top
 Profile  
 
PostPosted: Sat Dec 22, 2012 10:00 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19227
Location: NE Indiana, USA (NTSC)
My test was specifically to demonstrate this PPU quirk. Press Select and everything clears up.


Top
 Profile  
 
PostPosted: Sat Dec 22, 2012 5:10 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6442
Location: UK (temporarily)
tepples wrote:
My test was specifically to demonstrate this PPU quirk. Press Select and everything clears up.

The pertinent bit of my code was
Code:
        lda #>spritefixed
        sta PPU_OAM_DMA

        lda #PPU_CTRL_SPR_8X16
        sta PPU_CTRL
       
        lda #PPU_MASK_LEFT_SPR_SHOW|PPU_MASK_SPR_ENA
        sta PPU_MASK    ; enable rendering

spin:
        jmp spin


I have really no idea why things are changing; I never write to $4014 after the first round.


Top
 Profile  
 
PostPosted: Sat Dec 22, 2012 6:00 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1311
I suppose it is entirely possible for Sprite #7 to break in hardware, but it would be extremely strange for a specific are of the die to be damaged / defective while the rest is okay.


Top
 Profile  
 
PostPosted: Sat Dec 22, 2012 9:19 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6442
Location: UK (temporarily)
tepples wrote:
The pair moves after every reset, and occasionally they're all bunched up at the top or at the left.
I'm so bad at actually reading
That's really interesting, because "all bunched up" either implies OAMADDR isn't a multiple of 4, or that some of the reads from ROM / writes to OAM are being trashed. I never wrote OAMADDR, because I thought we believed it wasn't necessary


Top
 Profile  
 
PostPosted: Sat Dec 22, 2012 9:33 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2981
Location: Tampere, Finland
lidnariq wrote:
tepples wrote:
The pair moves after every reset, and occasionally they're all bunched up at the top or at the left.
I'm so bad at actually reading
That's really interesting, because "all bunched up" either implies OAMADDR isn't a multiple of 4, or that some of the reads from ROM / writes to OAM are being trashed. I never wrote OAMADDR, because I thought we believed it wasn't necessary

There's at least one case which would make it necessary despite the (somewhat) known power up state: if user resets the console in the middle of a sprite DMA, the OAM address would be left in an unknown state.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Sat Dec 22, 2012 9:57 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
There's no justification for assuming the power-up state of the NES, since it's trivial to initialize it all to a known state. It's just asking for obscure problems to skip initialization.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Tomy and 9 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