[Aranym-dev] NFVDI "soft" cursor redraw with 8bpp

Philipp Donzé philippdonze at gmx.ch
Thu Aug 27 23:37:44 CEST 2009


Hi Petr

>> Now I'm only wondering what is the problem with NFVDI and 24 bit true
>> color mode... I have to check this out too.
>
> Please do. I am about to release new version and I like these  
> fixes :-)

I didn't find the problem yet. I learned that it is possible to  
specify the bit format when creating the SDL surface: So I added the  
following in hostsurface.cpp, HostSurface::HostSurface:
-------------------------
	uint32 rmask=0, gmask=0, bmask=0;
	if (bpp == 24) {
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
		rmask = 0xff0000;
		gmask = 0x00ff00;
		bmask = 0x0000ff;
#else
		rmask = 0x0000ff;
		gmask = 0x00ff00;
		bmask = 0xff0000;
#endif
	}
	surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, bpp,
								   rmask, gmask, bmask, 0);
-------------------------

Then in nvfdi_soft.cpp the putBpp24Pixel is done independently of the  
endianness:
-------------------------
#define putBpp24Pixel( address, color ) \
{ \
     ((Uint8*)(address))[0] = (color) & 0xff; \
         ((Uint8*)(address))[1] = ((color) >> 8) & 0xff; \
         ((Uint8*)(address))[2] = ((color) >> 16) & 0xff; \
}

#define getBpp24Pixel( address ) \
     ( ((uint32)(address)[2] << 16) | ((uint32)(address)[1] << 8) |  
(uint32)(address)[0] )
-------------------------

But: if it's nearly correct with MagiC+fVDI it doesn't work with XaAes 
+fVDI at all...
And I didn't understand even after hours why...

I didn't find anywhere something where NFVDI tells the Atari FVDI what  
the bit ordering is....


Perhaps somebody else has some idea?

Regards
Philipp



More information about the cz-bobek-lists-aranym mailing list