From SnesLab
Jump to: navigation, search

(first draft, please point out any mistakes and ask any questions)

widescreen-specific code


Objects are up to 64 pixels wide.
For their x coordinates we have a 9 bit unsigned integer,
i.e. values from 0 to 511.
0 to 255 are the visible columns of the screen.
To be able to have objects start off the left side and extend into the screen, the values wrap,
i.e. 449 to 511 is treated as -63 to -1.
256 to 448 place objects outside of the visible area.

For widescreen 16:9 we add 64 pixels to each side.
So the visible columns of the (wide) screen are now -64 to 319,
or technically 448 to 511 and 0 to 319.
So with objects partially off screen to the left the minimal coordinate with visible content is -127 aka 385.

Using that coordinate space you can place objects in the widescreen area quite similar to placing them in the normal screen area.
It should also not break support on other emulators or hardware AFAIK.


(repo comming soon)