mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-22 05:40:15 -06:00
don't scale the screen gap
This commit is contained in:
11
src/GPU.cpp
11
src/GPU.cpp
@ -92,11 +92,6 @@ bool Init()
|
|||||||
//SetFramebufferScale(1);
|
//SetFramebufferScale(1);
|
||||||
SetFramebufferScale(1, 1);
|
SetFramebufferScale(1, 1);
|
||||||
|
|
||||||
memset(Framebuffer[0][0], 0, (256*192)<<(FBScale[0]*2));
|
|
||||||
memset(Framebuffer[0][1], 0, (256*192)<<(FBScale[1]*2));
|
|
||||||
memset(Framebuffer[1][0], 0, (256*192)<<(FBScale[0]*2));
|
|
||||||
memset(Framebuffer[1][1], 0, (256*192)<<(FBScale[1]*2));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,6 +259,9 @@ void SetFramebufferScale(int top, int bottom)
|
|||||||
Framebuffer[0][0] = new u32[fbsize];
|
Framebuffer[0][0] = new u32[fbsize];
|
||||||
Framebuffer[1][0] = new u32[fbsize];
|
Framebuffer[1][0] = new u32[fbsize];
|
||||||
|
|
||||||
|
memset(Framebuffer[0][0], 0, fbsize*4);
|
||||||
|
memset(Framebuffer[1][0], 0, fbsize*4);
|
||||||
|
|
||||||
int backbuf = FrontBuffer ? 0 : 1;
|
int backbuf = FrontBuffer ? 0 : 1;
|
||||||
if (NDS::PowerControl9 & (1<<15))
|
if (NDS::PowerControl9 & (1<<15))
|
||||||
{
|
{
|
||||||
@ -288,6 +286,9 @@ void SetFramebufferScale(int top, int bottom)
|
|||||||
Framebuffer[0][1] = new u32[fbsize];
|
Framebuffer[0][1] = new u32[fbsize];
|
||||||
Framebuffer[1][1] = new u32[fbsize];
|
Framebuffer[1][1] = new u32[fbsize];
|
||||||
|
|
||||||
|
memset(Framebuffer[0][1], 0, fbsize*4);
|
||||||
|
memset(Framebuffer[1][1], 0, fbsize*4);
|
||||||
|
|
||||||
int backbuf = FrontBuffer ? 0 : 1;
|
int backbuf = FrontBuffer ? 0 : 1;
|
||||||
if (NDS::PowerControl9 & (1<<15))
|
if (NDS::PowerControl9 & (1<<15))
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,12 @@ int OnCloseWindow(uiWindow* window, void* blarg)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
void OnResolutionChanged(uiRadioButtons* rb, void* blarg)
|
||||||
|
{
|
||||||
|
int id = uiRadioButtonsSelected(rb);
|
||||||
|
|
||||||
|
printf("res=%d\n", id);
|
||||||
|
}
|
||||||
|
|
||||||
void OnCancel(uiButton* btn, void* blarg)
|
void OnCancel(uiButton* btn, void* blarg)
|
||||||
{
|
{
|
||||||
@ -144,6 +149,7 @@ void Open()
|
|||||||
uiBoxAppend(in_ctrl, uiControl(lbl), 0);
|
uiBoxAppend(in_ctrl, uiControl(lbl), 0);
|
||||||
|
|
||||||
uiRadioButtons* rbResolution = uiNewRadioButtons();
|
uiRadioButtons* rbResolution = uiNewRadioButtons();
|
||||||
|
uiRadioButtonsOnSelected(rbResolution, OnResolutionChanged, NULL);
|
||||||
uiRadioButtonsAppend(rbResolution, "1x");
|
uiRadioButtonsAppend(rbResolution, "1x");
|
||||||
uiRadioButtonsAppend(rbResolution, "2x");
|
uiRadioButtonsAppend(rbResolution, "2x");
|
||||||
uiRadioButtonsAppend(rbResolution, "4x");
|
uiRadioButtonsAppend(rbResolution, "4x");
|
||||||
|
@ -834,7 +834,6 @@ void SetupScreenRects(int width, int height)
|
|||||||
|
|
||||||
screenW *= ScreenScale;
|
screenW *= ScreenScale;
|
||||||
screenH *= ScreenScale;
|
screenH *= ScreenScale;
|
||||||
gap *= ScreenScale;
|
|
||||||
|
|
||||||
uiRect *topscreen, *bottomscreen;
|
uiRect *topscreen, *bottomscreen;
|
||||||
if (ScreenRotation == 1 || ScreenRotation == 2)
|
if (ScreenRotation == 1 || ScreenRotation == 2)
|
||||||
@ -1029,9 +1028,6 @@ void SetMinSize(int w, int h)
|
|||||||
int cw, ch;
|
int cw, ch;
|
||||||
uiWindowContentSize(MainWindow, &cw, &ch);
|
uiWindowContentSize(MainWindow, &cw, &ch);
|
||||||
|
|
||||||
w *= ScreenScale;
|
|
||||||
h *= ScreenScale;
|
|
||||||
|
|
||||||
uiControlSetMinSize(uiControl(MainDrawArea), w, h);
|
uiControlSetMinSize(uiControl(MainDrawArea), w, h);
|
||||||
if ((cw < w) || (ch < h))
|
if ((cw < w) || (ch < h))
|
||||||
{
|
{
|
||||||
@ -1534,26 +1530,31 @@ void EnsureProperMinSize()
|
|||||||
{
|
{
|
||||||
bool isHori = (ScreenRotation == 1 || ScreenRotation == 3);
|
bool isHori = (ScreenRotation == 1 || ScreenRotation == 3);
|
||||||
|
|
||||||
|
int w0 = 256 * ScreenScale;
|
||||||
|
int h0 = 192 * ScreenScale;
|
||||||
|
int w1 = 256 * ScreenScale;
|
||||||
|
int h1 = 192 * ScreenScale;
|
||||||
|
|
||||||
if (ScreenLayout == 0) // natural
|
if (ScreenLayout == 0) // natural
|
||||||
{
|
{
|
||||||
if (isHori)
|
if (isHori)
|
||||||
SetMinSize(384+ScreenGap, 256);
|
SetMinSize(h0+ScreenGap+h1, std::max(w0,w1));
|
||||||
else
|
else
|
||||||
SetMinSize(256, 384+ScreenGap);
|
SetMinSize(std::max(w0,w1), h0+ScreenGap+h1);
|
||||||
}
|
}
|
||||||
else if (ScreenLayout == 1) // vertical
|
else if (ScreenLayout == 1) // vertical
|
||||||
{
|
{
|
||||||
if (isHori)
|
if (isHori)
|
||||||
SetMinSize(192, 512+ScreenGap);
|
SetMinSize(std::max(h0,h1), w0+ScreenGap+w1);
|
||||||
else
|
else
|
||||||
SetMinSize(256, 384+ScreenGap);
|
SetMinSize(std::max(w0,w1), h0+ScreenGap+h1);
|
||||||
}
|
}
|
||||||
else // horizontal
|
else // horizontal
|
||||||
{
|
{
|
||||||
if (isHori)
|
if (isHori)
|
||||||
SetMinSize(384+ScreenGap, 256);
|
SetMinSize(h0+ScreenGap+h1, std::max(w0,w1));
|
||||||
else
|
else
|
||||||
SetMinSize(512+ScreenGap, 192);
|
SetMinSize(w0+ScreenGap+w1, std::max(h0,h1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1565,6 +1566,8 @@ void OnSetScreenSize(uiMenuItem* item, uiWindow* window, void* param)
|
|||||||
int w = 256*factor * ScreenScale;
|
int w = 256*factor * ScreenScale;
|
||||||
int h = 192*factor * ScreenScale;
|
int h = 192*factor * ScreenScale;
|
||||||
|
|
||||||
|
// FIXME
|
||||||
|
|
||||||
if (ScreenLayout == 0) // natural
|
if (ScreenLayout == 0) // natural
|
||||||
{
|
{
|
||||||
if (isHori)
|
if (isHori)
|
||||||
@ -1696,6 +1699,10 @@ void ApplyNewSettings(int type)
|
|||||||
Platform::LAN_DeInit();
|
Platform::LAN_DeInit();
|
||||||
Platform::LAN_Init();
|
Platform::LAN_Init();
|
||||||
}
|
}
|
||||||
|
else if (type == 2) // upscaling/video settings
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
EmuRunning = prevstatus;
|
EmuRunning = prevstatus;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user