Sprites emulation and how they work on Exodus
Moderators: BigEvilCorporation, Mask of Destiny
Sprites emulation and how they work on Exodus
Hi all !
Been waiting a lot to finally write in here, looks like the best place to post noob emulation questions.
So, Ive been coding my own emu for the last 6 months, as a learning exercise, using Exodus as a holy bible when in doubt, and stumbled upon some weird things.
Every doc I read, says that in the SAT, the vertical position of each sprite is byte 0-9 of the first word. However, Snow Bros sets its sprites using the whole word, for example, FF3A. Now using the incredible Exodus plane viewer, those sprites are way out of screen, cannot really be seen, and my emu doesnt show them logically. But, they should be rendered somehow, since they are the characters sprites.
Fiddling with it, I found out that if I discard the MSB bit (bit 9), the sprites go to their correct location. Is this something I'm missing like in H32 mode that bit is not read ? Why is Exodus plane viewer showing one thing, and rendering other ?
Thanks for your help !
Been waiting a lot to finally write in here, looks like the best place to post noob emulation questions.
So, Ive been coding my own emu for the last 6 months, as a learning exercise, using Exodus as a holy bible when in doubt, and stumbled upon some weird things.
Every doc I read, says that in the SAT, the vertical position of each sprite is byte 0-9 of the first word. However, Snow Bros sets its sprites using the whole word, for example, FF3A. Now using the incredible Exodus plane viewer, those sprites are way out of screen, cannot really be seen, and my emu doesnt show them logically. But, they should be rendered somehow, since they are the characters sprites.
Fiddling with it, I found out that if I discard the MSB bit (bit 9), the sprites go to their correct location. Is this something I'm missing like in H32 mode that bit is not read ? Why is Exodus plane viewer showing one thing, and rendering other ?
Thanks for your help !
-
- Very interested
- Posts: 616
- Joined: Thu Nov 30, 2006 6:30 am
Re: Sprites emulation and how they work on Exodus
So I can't speak to what's going on in Exodus, but I think your problem is that you're not subtracting 128 from the 9-bit coordinate. To make it easier to have sprites that are partially offscreen, the Genesis/MD VDP uses a 9-bit coordinate system in which the top left corner of the screen has the coordinates 128,128 and the bottom right is 448,352 in H40 and 384,352 in H32 (assuming V28 anyway). Once masked to a 9-bit value, $FF3A becomes $13A which is 314 decimal which corresponds to 186 in screen space.
Re: Sprites emulation and how they work on Exodus
Yes, I was already substracting 128, and sprites work in most other games.
The thing is, document:
http://md.squee.co/VDP#Sprite_Attribute_Table
Says that bits 0-9 are used for the position (10 bits), that would be (word1 & 0x3FF), meaning position FF3A is 33A = decimal 826 .. minus 128 = 698. So all my sprites (as well as Exodus debug plane viewer) end up outside the screen.
The thing is, document:
http://md.squee.co/VDP#Sprite_Attribute_Table
Says that bits 0-9 are used for the position (10 bits), that would be (word1 & 0x3FF), meaning position FF3A is 33A = decimal 826 .. minus 128 = 698. So all my sprites (as well as Exodus debug plane viewer) end up outside the screen.
Re: Sprites emulation and how they work on Exodus
In interlace mode 2, the range is & 0x3FF, but in interlace mode 0 or 1, its 0x1FF ![Razz :P](./images/smilies/icon_razz.gif)
The document doesn't say it properly, but its actually either 8 or 9 bits, depending on interlace mode.
![Razz :P](./images/smilies/icon_razz.gif)
The document doesn't say it properly, but its actually either 8 or 9 bits, depending on interlace mode.
Re: Sprites emulation and how they work on Exodus
That's it. Interlace mode, haha
So dumb, thank you !
So dumb, thank you !
-
- Very interested
- Posts: 616
- Joined: Thu Nov 30, 2006 6:30 am
Re: Sprites emulation and how they work on Exodus
Ah sorry, I got my bit counts and bit numbers crossed when reading your post originally.DarkMoe wrote:Says that bits 0-9 are used for the position (10 bits)
It's 9 or 10 bits, but yes. And it's worth noting that only the y-coordinate gets an extra bit in double resolution interlace mode, though I guess that might be already clear given that the linked doc only shows 9 bits for x.Natsumi wrote:In interlace mode 2, the range is & 0x3FF, but in interlace mode 0 or 1, its 0x1FF
The document doesn't say it properly, but its actually either 8 or 9 bits, depending on interlace mode.
Re: Sprites emulation and how they work on Exodus
Something to note is that it should be very common for a whole 16-bit worth of coordinate data to end up in the sprite table. The VDP ignores it, makes things easier on the 68000 and sprites off-screen should have been removed by the game anyway (how far off-screen, depends on the game).
In other words, if the upper bits of the sprite coordinates get set even though they normally go unused, just assume the game copied the coordinates as-is.
In other words, if the upper bits of the sprite coordinates get set even though they normally go unused, just assume the game copied the coordinates as-is.
Sik is pronounced as "seek", not as "sick".