It is currently Tue Oct 17, 2017 1:35 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Sprite Noob Question
PostPosted: Wed Apr 15, 2015 4:45 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
Im rewriting my sprites engine since i was using the old "brad taylor" method as we know is outdated.
I find a problem when sprites have X=255 or 0xFF. When a sprite has this coordinate value is it visible?, since im getting errors.

Thanks in advance.

_________________
ANes


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Wed Apr 15, 2015 5:14 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6276
Location: Seattle
Sprite 0 hits don't trigger on sprites with X=255, even if there are visible pixels. Otherwise I think it's normal?


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Wed Apr 15, 2015 5:28 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
I know it doesn't trigger when its 255, but my question is if X is set intentionally at 255, is the the sprite pixel shown??

_________________
ANes


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Wed Apr 15, 2015 6:43 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
mean this:
I have 8 output units wich this unit is a C struct:

Code:
typedef struct
{
   unsigned char Y, TileIndex, Attr, PT0, PT1, pre_spr_zero, spr_zero;
   int X;
} SPRBUFFER, * PSPRBUFFER;


"X" is copied from "sprite temp" memory in sprite fetches phase.

When rendering each ppu cc i decrese this "X", when X == 0 the unit is "active" and check if the sprite is not transparent.

What i got is this:


Image

_________________
ANes


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Wed Apr 15, 2015 7:03 pm 
Offline

Joined: Mon May 30, 2011 9:01 pm
Posts: 179
The game should not set 255 to the left sprite when Mario moves to the left edge of the screen so I think it is a bug with the CPU, not PPU.


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Wed Apr 15, 2015 8:30 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Maybe it just assumes that Mario can never be off-screen horizontally? Especially since it'd be impossible to see on a TV anyway (due to overscan).


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Wed Apr 15, 2015 8:37 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
I solved it!! it was an sprite logic problem anyway I tested it in a real NES and it doesn't produce that effect.

_________________
ANes


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Thu Apr 16, 2015 5:46 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
Now I'm curious. :oops: :oops: :oops:

Is this a bug? Isn't Mario sprite supposed to wrap?


Attachments:
Super Mario Bros. (JU) (PRG1) 000.bmp
Super Mario Bros. (JU) (PRG1) 000.bmp [ 720.05 KiB | Viewed 1739 times ]
Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Thu Apr 16, 2015 7:13 am 
Offline

Joined: Mon May 30, 2011 9:01 pm
Posts: 179
Zepper wrote:
Now I'm curious. :oops: :oops: :oops:

Is this a bug? Isn't Mario sprite supposed to wrap?


You are right, somehow that glitch didn't cross my mind when I saw the first picture.


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Thu Apr 16, 2015 8:23 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
Anes wrote:
I solved it!! it was an sprite logic problem anyway I tested it in a real NES and it doesn't produce that effect.


What was your fix?? I'd like to know in details to fix my emu too.


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Thu Apr 16, 2015 11:28 am 
Offline

Joined: Tue Aug 12, 2014 11:25 pm
Posts: 9
Location: Sonora, Mexico
I've tested it in my Sony Triniton using service menu and it happends on real hardware(sorry by the image).


Attachments:
IMG0231A.jpg
IMG0231A.jpg [ 30.44 KiB | Viewed 1683 times ]
Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Thu Apr 16, 2015 12:13 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10046
Location: Rio de Janeiro - Brazil
IIRC, SMB calculates sprite positions in a strange way, it doesn't surprise me that this bug is actually in the game.


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Thu Apr 16, 2015 1:07 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19087
Location: NE Indiana, USA (NTSC)
Is this along the glitches that ShaneM fixed?


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Thu Apr 16, 2015 3:28 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
Yeah it happens in real hardware.

I have a real NES and a PAL Dendy. The thing that i couldn't test it in the real NES yestarday becouse my current transformer was broken and i tought that Dendy was the same, but not.

I have just bought one for the NES and IT DO HAPPEN.

_________________
ANes


Top
 Profile  
 
 Post subject: Re: Sprite Noob Question
PostPosted: Thu Apr 16, 2015 3:57 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
This sprite wrapping occurs in Nintendulator, but not on puNES. If Anes "has fixed it", it just took ppu_cycle MINUS sprite_xpos > 0 (should be >= 0).

So, that's it. No panic - it's not an emulator glitch.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google [Bot] and 8 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