diff --git a/src/GPU.cpp b/src/GPU.cpp index 959129ea..a7ea2a4d 100644 --- a/src/GPU.cpp +++ b/src/GPU.cpp @@ -151,12 +151,15 @@ void Reset() VRAMMap_ARM7[0] = 0; VRAMMap_ARM7[1] = 0; - for (int i = 0; i < (256*192); i++) + int fbsize; + if (Accelerated) fbsize = (256*3 + 2) * 192; + else fbsize = 256 * 192; + for (int i = 0; i < fbsize; i++) { Framebuffer[0][0][i] = 0xFFFFFFFF; Framebuffer[1][0][i] = 0xFFFFFFFF; } - for (int i = 0; i < (256*192); i++) + for (int i = 0; i < fbsize; i++) { Framebuffer[0][1][i] = 0xFFFFFFFF; Framebuffer[1][1][i] = 0xFFFFFFFF; @@ -173,10 +176,13 @@ void Reset() void Stop() { - memset(Framebuffer[0][0], 0, 256*192); - memset(Framebuffer[0][1], 0, 256*192); - memset(Framebuffer[1][0], 0, 256*192); - memset(Framebuffer[1][1], 0, 256*192); + int fbsize; + if (Accelerated) fbsize = (256*3 + 2) * 192; + else fbsize = 256 * 192; + memset(Framebuffer[0][0], 0, fbsize*4); + memset(Framebuffer[0][1], 0, fbsize*4); + memset(Framebuffer[1][0], 0, fbsize*4); + memset(Framebuffer[1][1], 0, fbsize*4); } void DoSavestate(Savestate* file) diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp index 115b31fb..770c8749 100644 --- a/src/GPU3D.cpp +++ b/src/GPU3D.cpp @@ -624,6 +624,7 @@ int InitRenderer(bool hasGL) if (renderer == 0) SoftRenderer::Init(); Renderer = renderer; + GPU::SetDisplaySettings(Renderer != 0); return renderer; } diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index efebc8df..e17827d9 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -374,14 +374,24 @@ void GLScreen_DrawScreen() int frontbuf = GPU::FrontBuffer; glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, GL_ScreenTexture); - /*glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 256<Context, 256, 192); ScreenBitmap[1] = uiDrawNewBitmap(params->Context, 256, 192); - printf("D2D bitmaps inited\n"); } -if (!ScreenBitmap[0] || !ScreenBitmap[1]) printf("draw but no bitmaps :(\n"); + + int frontbuf = GPU::FrontBuffer; if (!ScreenBitmap[0] || !ScreenBitmap[1]) return; - if (!GPU::Framebuffer[0][0]) return; + if (!GPU::Framebuffer[frontbuf][1]) return; uiRect top = {0, 0, 256, 192}; uiRect bot = {0, 0, 256, 192}; - int frontbuf = GPU::FrontBuffer; uiDrawBitmapUpdate(ScreenBitmap[0], GPU::Framebuffer[frontbuf][0]); uiDrawBitmapUpdate(ScreenBitmap[1], GPU::Framebuffer[frontbuf][1]);