Thanks to Stephane-D for first directing me.
I have some questions about sprites and sprites display area.
Sega Drive resolutions (from Wikipedia):
320 x 224 NTSC
320 x 240 PAL
This page (http://cgfm2.emuviews.com/txt/genvdp.txt) says that:
This page (http://md.squee.co/VDP#Sprites) says that:> "Sprites are positioned in a virtual 512x512 space. The display starts at
> coordinate 128, 128, and takes up a space equal to the size of the physical
> display. (usually 256x224 or 320x224) This system is convenient for
> programmers; unwanted sprites can easily be hidden off screen, and sprites
> can be shown partially at the top and left screen edges."
And I'm also referencing the sprite tutorial at (https://github.com/Stephane-D/SGDK/wiki ... -%28old%29)> The range X values is 0 through 551, but the displayable X values begins at 128, up to 383 or 447, depending on horizontal mode. The sprite's Y position values are from 0 through 551, but the displayable values start at 128 and go up to 351 or 367 depending on vertical mode.
What I don't understand:
- The second link says that the X and Y can change between 0 and 551, but the first and third link says that the sprite plane is "fixed size (512x512 in common case)". Is 551 a spelling mistake, should it be 511?
I'm writing a simple game of "Snake" using SGDK. I have a 8x8 px sprite, and every N frames the position is changed by 8 depending on his direction.
What I see on GensKmod is that when the Snake moves horizontally his X values go between 128 and 383. But when going vertically his Y values go between 0 and 1023.
The resolution displayed by the emulator is 320 x 224, sprite horizontal displayable width 383 - 128 is only 255 pixels, less than my screen resolution.
What I don't understand:
- Why is it that SGDK has defaulted to a displayable horizontal resolution of 128 to 383, how do I change it to be 128 to 447?
- Why is it that my sprites horizontal position is restricted to the sprite displayable area of 128 to 383, but that his vertical position uses the full 10 bits?
- How come the vertical position is not restricted to 128 to 351?
- How come the horizontal position cannot use the full 9 bit of 0 to 511?
If necessary I can try and make a short video explaining my questions.
Thank you,
Sam.