Sprite Noob Question
Moderator: Moderators
Sprite Noob Question
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.
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
Re: Sprite Noob Question
Sprite 0 hits don't trigger on sprites with X=255, even if there are visible pixels. Otherwise I think it's normal?
Re: Sprite Noob Question
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
Re: Sprite Noob Question
mean this:
I have 8 output units wich this unit is a C struct:
"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:
I have 8 output units wich this unit is a C struct:
Code: Select all
typedef struct
{
unsigned char Y, TileIndex, Attr, PT0, PT1, pre_spr_zero, spr_zero;
int X;
} SPRBUFFER, * PSPRBUFFER;
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:
ANes
Re: Sprite Noob Question
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.
Re: Sprite Noob Question
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).
Re: Sprite Noob Question
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
Re: Sprite Noob Question
Now I'm curious.
Is this a bug? Isn't Mario sprite supposed to wrap?
Is this a bug? Isn't Mario sprite supposed to wrap?
Re: Sprite Noob Question
You are right, somehow that glitch didn't cross my mind when I saw the first picture.Zepper wrote:Now I'm curious.
Is this a bug? Isn't Mario sprite supposed to wrap?
Re: Sprite Noob Question
What was your fix?? I'd like to know in details to fix my emu too.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.
Re: Sprite Noob Question
I've tested it in my Sony Triniton using service menu and it happends on real hardware(sorry by the image).
Re: Sprite Noob Question
IIRC, SMB calculates sprite positions in a strange way, it doesn't surprise me that this bug is actually in the game.
Re: Sprite Noob Question
Is this along the glitches that ShaneM fixed?
Re: Sprite Noob Question
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.
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
Re: Sprite Noob Question
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.
So, that's it. No panic - it's not an emulator glitch.