SDL port

John R. Hall overcode at lokigames.com
Wed Apr 18 20:32:12 UTC 2001


On Wednesday 18 April 2001 12:00, you wrote:
> "John R. Hall" <overcode at lokigames.com> is widely believed to have written:
> > This means that little endian systems (such as the x86) have to
> > perform byte swapping to properly display the data. This is a simple
> > operation (just swap the first and last bytes of each 32-bit word, as
> > well as the middle two),
> Not quite true. It's much more complicated than that, depending somewhat
> on the platform's exact spec for where the RGB & alpha bits go, and most
> particularly on the depth ofthe Squeak Display bitmap andthe machine
> screen. What you have to do is _pixel_ swapping, not byte swapping. In
> a few cases, that pixel swapping is just byte swapping but it's not the
> norm.

I was thinking of 8-bit modes, which I implemented first. I've now switched 
over to asking Squeak for a 32-bit framebuffer (RGB0, stored in big endian), 
then wrapping this in an SDL surface structure and having SDL do the 
necessary conversions. (This is no problem; SDL reads each pixel as a 32-bit 
block and uses provided shifts and masks to read the components. It's all in 
assembly, so it's pretty fast.) Once I can fix an annoying bug, it should be 
fast enough to use.

-John

-- 
Underfull \account (badness 10000) has occurred while \spend is active
John R. Hall  -  Student, Georgia Tech  -  Contractor, Loki Software





More information about the Squeak-dev mailing list