X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fwin32%2FGenaDrive%2FDirect.cpp;h=b8112d3be414b76865f02bd7b68438120b6bc2c5;hb=e91e5120094a2e8e1914c591453f8d49fcd89553;hp=a726acba19220fef1a7f925195fec625b664ab3c;hpb=1b0ac8adc97d65c686a48c4375c07907de86be24;p=picodrive.git diff --git a/platform/win32/GenaDrive/Direct.cpp b/platform/win32/GenaDrive/Direct.cpp index a726acb..b8112d3 100644 --- a/platform/win32/GenaDrive/Direct.cpp +++ b/platform/win32/GenaDrive/Direct.cpp @@ -58,7 +58,7 @@ static int DirectDrawInit() // Create the backbuffer surface ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; ddsd.dwWidth = EmuWidth; ddsd.dwHeight = EmuHeight; @@ -110,6 +110,20 @@ static int DirectScreenDDraw() dst = (int *)((char *)dst + sd.lPitch); } } + else if (sd.ddpfPixelFormat.dwRGBBitCount == 24) /* wine uses this for me */ + { + void *dst = sd.lpSurface; + for (y = 0; y < EmuHeight; y++) + { + unsigned char *dst1 = (unsigned char *) dst; + for (x = 0; x < EmuWidth; x++, dst1 += 3) + { + int s = *ps++; + dst1[2] = (s&0xf800)>>8; dst1[1] = (s&0x07e0)>>3; dst1[0] = s<<3; // BGR + } + dst = (void *)((char *)dst + sd.lPitch); + } + } else if (sd.ddpfPixelFormat.dwRGBBitCount == 16) { unsigned short *dst = (unsigned short *)sd.lpSurface;