Deformed sprite attribute on real NES

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
Cortes48
Posts: 7
Joined: Sun Mar 01, 2015 4:40 pm

Deformed sprite attribute on real NES

Post by Cortes48 »

Hi everyone,

I tested a simple sprite test on my NES but the sprite looked very ugly, it seems that the attribute pattern is confused. On emulators the sprite looks perfectly good. I precise my NES is a PAL one and I tested on an LCD TV that usually doesn't cause sprite trouble like this.

I took some pictures
Image
Image

Any idea ?
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Deformed sprite attribute on real NES

Post by lidnariq »

I'm not entirely sure what's going on, but just as a random guess... try testing using only shades of grey rather than colors, and see if it's still screwed up.
ccovell
Posts: 1041
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: Deformed sprite attribute on real NES

Post by ccovell »

Yes, it looks like your typical composite interference pattern (PAL video in this case)... and the LCD TV isn't helping either, in this regard.

You'll need to 1) keep your sprite entirely grey (and the background colour grey/white/black as well) or 2) move your sprite around so the effect is minimized.
Cortes48
Posts: 7
Joined: Sun Mar 01, 2015 4:40 pm

Re: Deformed sprite attribute on real NES

Post by Cortes48 »

Thanks for your replies

I've tested with grey shade but nothing more.
When I move the sprite, the pattern is good.

Maybe the issue is from the NMI ( I do a simple DMA) :

Code: Select all

NMI:
  LDA #$00
  STA $2003       
  LDA #$02
  STA $4014       
  jsr react_to_input

User avatar
koitsu
Posts: 4203
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Deformed sprite attribute on real NES

Post by koitsu »

Possibly related?

http://wiki.nesdev.com/w/index.php/PPU_ ... of_OAMADDR
On the 2C02, writes to OAMADDR reliably corrupt OAM. This can then be worked around by writing all 256 bytes of OAM. It is also the case that if OAMADDR is not less than eight when rendering starts, the eight bytes starting at OAMADDR & 0xF8 are copied to the first eight bytes of OAM; it seems likely that this is related. The former bug is known to have been fixed in the 2C07; the latter is believed to be.
The 2C02 vs. 2C07 are revisions of NES PPU. AFAIK there is no way to know which revision you have outside of looking at silk screening. Are you using a real NES or a pirated console or a Dendy or what? Is it NTSC or PAL (it matters)?

You can try ruling this out by dedicating 256 bytes of RAM (or ROM!) for your DMA, and then transfer all 256 bytes to OAM, and see if that fixes your issue.
Cortes48
Posts: 7
Joined: Sun Mar 01, 2015 4:40 pm

Re: Deformed sprite attribute on real NES

Post by Cortes48 »

koitsu wrote:Possibly related?

http://wiki.nesdev.com/w/index.php/PPU_ ... of_OAMADDR
On the 2C02, writes to OAMADDR reliably corrupt OAM. This can then be worked around by writing all 256 bytes of OAM. It is also the case that if OAMADDR is not less than eight when rendering starts, the eight bytes starting at OAMADDR & 0xF8 are copied to the first eight bytes of OAM; it seems likely that this is related. The former bug is known to have been fixed in the 2C07; the latter is believed to be.
The 2C02 vs. 2C07 are revisions of NES PPU. AFAIK there is no way to know which revision you have outside of looking at silk screening. Are you using a real NES or a pirated console or a Dendy or what? Is it NTSC or PAL (it matters)?

You can try ruling this out by dedicating 256 bytes of RAM (or ROM!) for your DMA, and then transfer all 256 bytes to OAM, and see if that fixes your issue.
I have a real PAL NES.

I already transfer the 256 byte of RAM from $0200 but nothing better happens.
Another detail, some pixels of the sprite disappear and reappear around the sprite every 10-15 seconds.

EDIT: Depending to the sprite coordinate, the sprite looks correct, it guess if it's definitely an LCD TV trouble
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Deformed sprite attribute on real NES

Post by tepples »

Do you know anyone else who has a CRT TV or a different brand of LCD TV?
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Deformed sprite attribute on real NES

Post by rainwarrior »

What is this running on? Is this a PowerPak, Everdrive, or some development cart of your own?
Cortes48
Posts: 7
Joined: Sun Mar 01, 2015 4:40 pm

Re: Deformed sprite attribute on real NES

Post by Cortes48 »

lidnariq wrote:I'm not entirely sure what's going on, but just as a random guess... try testing using only shades of grey rather than colors, and see if it's still screwed up.
ccovell wrote:Yes, it looks like your typical composite interference pattern (PAL video in this case)... and the LCD TV isn't helping either, in this regard.
It works great on grey mode, I didnt know it exists, I was trying in modifying my palette. Thanks


rainwarrior wrote: What is this running on? Is this a PowerPak, Everdrive, or some development cart of your own?
I'm on a TLROM from infiniteneslive.
tepples wrote: Do you know anyone else who has a CRT TV or a different brand of LCD TV?
I didnt test on a CRT TV, but if it works with grey mode on, the issue com definitely from my TV however on the same TV the Mario sprite from SMB3 is not screwed up, but on SMB1 the sprite it is. I didnt found the grey mode tips for LCD on the wiki, i will add it.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Deformed sprite attribute on real NES

Post by tepples »

What palette values are you using? There are four rows of colors in the palette: dark, medium, light, and pale.

Image
Nowhere near fifty shades of grey


Don't use two dark colors, two medium colors, two light colors, or two pale colors right next to each other. The TV won't be able to tell them apart. Dark with medium and pale with light can occasionally cause problems as well, especially when using fine details with colors 5-7 hues apart. The goal is contrast in the lightness.
Cortes48
Posts: 7
Joined: Sun Mar 01, 2015 4:40 pm

Re: Deformed sprite attribute on real NES

Post by Cortes48 »

tepples wrote:What palette values are you using? There are four rows of colors in the palette: dark, medium, light, and pale.

Image
Nowhere near fifty shades of grey


Don't use two dark colors, two medium colors, two light colors, or two pale colors right next to each other. The TV won't be able to tell them apart. Dark with medium and pale with light are iffy as well.
I was using $22,$1C,$16,$0F. I will test with one color of each row ($22,$32,$16,$0D)
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Deformed sprite attribute on real NES

Post by tepples »

$0D may cause problems with some TVs because its level is actually slightly less than black.

Also, when you're starting out, avoid mixing gray $00 with medium colors $11-$1C or light gray $10 with light colors $21-$2C if you want things to be distinct.
Post Reply