getting somewhere??

This commit is contained in:
Arisotura 2019-05-24 02:29:16 +02:00
parent 79ea104931
commit 0bb3321262
3 changed files with 34 additions and 19 deletions

View File

@ -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)

View File

@ -624,6 +624,7 @@ int InitRenderer(bool hasGL)
if (renderer == 0) SoftRenderer::Init();
Renderer = renderer;
GPU::SetDisplaySettings(Renderer != 0);
return renderer;
}

View File

@ -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<<ScreenScale[0], 192<<ScreenScale[0], GL_RGBA_INTEGER,
GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][0]);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 768, 256<<ScreenScale[1], 192<<ScreenScale[1], GL_RGBA_INTEGER,
GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][1]);*/
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 256*3 + 2, 192, GL_RGBA_INTEGER,
GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][0]);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 768, 256*3 + 2, 192, GL_RGBA_INTEGER,
GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][1]);
if (GPU::Framebuffer[frontbuf][1])
{
if (GPU3D::Renderer == 0)
{
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 256, 192, GL_RGBA_INTEGER,
GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][0]);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 768, 256, 192, GL_RGBA_INTEGER,
GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][1]);
}
else
{
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 256*3 + 2, 192, GL_RGBA_INTEGER,
GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][0]);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 768, 256*3 + 2, 192, GL_RGBA_INTEGER,
GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][1]);
}
}
glActiveTexture(GL_TEXTURE1);
if (GPU3D::Renderer != 0)
@ -661,7 +671,6 @@ int EmuThreadFunc(void* burp)
{
uiGLMakeContextCurrent(GLContext);
GPU3D::InitRenderer(true);
GPU::SetDisplaySettings(GPU3D::Renderer != 0);
uiGLMakeContextCurrent(NULL);
}
else
@ -909,16 +918,15 @@ void OnAreaDraw(uiAreaHandler* handler, uiArea* area, uiAreaDrawParams* params)
ScreenDrawInited = true;
ScreenBitmap[0] = uiDrawNewBitmap(params->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]);