X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=platform%2Fwin32%2FGenaDrive%2FDirect.cpp;h=38c2bd8c3a7e01f9e2b110f43517226cf063cda2;hb=8f7ed1b8e1ea3afbcee265c94e6e2aad789c4936;hp=a726acba19220fef1a7f925195fec625b664ab3c;hpb=1b0ac8adc97d65c686a48c4375c07907de86be24;p=picodrive.git diff --git a/platform/win32/GenaDrive/Direct.cpp b/platform/win32/GenaDrive/Direct.cpp index a726acb..38c2bd8 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; @@ -95,7 +95,7 @@ static int DirectScreenDDraw() ret = m_pddsBackBuffer->Lock(NULL, &sd, DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT|DDLOCK_WRITEONLY, NULL); if (ret) { LOGFAIL(); return 1; } - //dprintf2("w: %i h: %i pi: %i pf: %i\n", sd.dwWidth, sd.dwHeight, sd.lPitch, sd.ddpfPixelFormat.dwRGBBitCount); + //lprintf("w: %i h: %i pi: %i pf: %i\n", sd.dwWidth, sd.dwHeight, sd.lPitch, sd.ddpfPixelFormat.dwRGBBitCount); if (sd.ddpfPixelFormat.dwRGBBitCount == 32) { @@ -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; @@ -374,7 +388,7 @@ int DirectScreen() TexScreenSwizzle(); #else ret=TexScreenLinear(); - if (ret) dprintf2("TexScreenLinear failed\n"); + if (ret) lprintf("TexScreenLinear failed\n"); #endif SetupMatrices(); @@ -383,7 +397,7 @@ int DirectScreen() // Copy vertices in: VertexBuffer->Lock(0,sizeof(VertexList),&lock,0); - if (lock==NULL) { dprintf2("VertexBuffer->Lock failed\n"); return 1; } + if (lock==NULL) { lprintf("VertexBuffer->Lock failed\n"); return 1; } memcpy(lock,VertexList,sizeof(VertexList)); VertexBuffer->Unlock();