[hatari-devel] Small bugs (fix before 1.4?)

Thomas H. th.huth at gmx.de
Wed Jun 2 22:33:58 CEST 2010


-------- Original-Nachricht --------
> Datum: Tue, 1 Jun 2010 21:17:08 +0200 (CEST)
> Von: Anders Eriksson <ae at dhs.nu>
> An: Mailing list for Hatari developers <hatari-devel at lists.berlios.de>
> Betreff: Re: [hatari-devel] Small bugs (fix before 1.4?)

> On Tue, 1 Jun 2010, Thomas Huth wrote:
> 
> > This sounds like an endianess issue again... could you please add some
> > #warnings to PixelConvert_32to24Bits_BGR() in pixel_convert.h so that it
> > looks like this:
> >
> > #if SDL_BYTEORDER == SDL_BIG_ENDIAN
> > #warning Compiling for big endian
> > 		*dst++ = src[3];	/* B */
> > 		*dst++ = src[2];	/* G */
> > 		*dst++ = src[1];	/* R */
> > #else
> > #warning Compiling for little endian
> > 		*dst++ = src[0];	/* B */
> > 		*dst++ = src[1];	/* G */
> > 		*dst++ = src[2];	/* R */
> > #endif
> >
> > Which warning do you then get when you recompile screenSnapShot.c ?
> 
> Hello,
> 
> the full warnings I get is pasted below.
[...] 
> In file included from /Users/ae/hatari/src/avi_record.c:76:
> /Users/ae/hatari/src/includes/pixel_convert.h:135:2: warning: #warning
> Compiling for little endian

Ok, so the endianess detection in the code worked correctly... so the bug must be something else...
Hmm, could you do me another favour and add the following three lines in screen.c somewhere after the SDL_SetVideoMode call?

		fprintf(stderr, "R: mask = 0x%08x, shift=%i, loss=%i\n", sdlscrn->format->Rmask, sdlscrn->format->Rshift, sdlscrn->format->Rloss);
		fprintf(stderr, "G: mask = 0x%08x, shift=%i, loss=%i\n", sdlscrn->format->Gmask, sdlscrn->format->Gshift, sdlscrn->format->Gloss);
		fprintf(stderr, "B: mask = 0x%08x, shift=%i, loss=%i\n", sdlscrn->format->Bmask, sdlscrn->format->Bshift, sdlscrn->format->Bloss);

The output of these three lines should give us some insides about the pixel format that Mac OS X uses ... if it is different to the normal PC format, then we've got to adjust pixel_convert.h accordingly.

 Thomas



More information about the hatari-devel mailing list