aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2019-05-12 16:47:34 +0200
committerArisotura <thetotalworm@gmail.com>2019-05-12 16:47:34 +0200
commitf5ba35ca9f42974f250c0241ccf18a3f36da79c4 (patch)
tree1e5ea5c102bd7bb6cc9aa2eb95be3231cc1c5807
parent0a464c504de43bbcd4a0bedf982e8f0e16cf0f32 (diff)
don't scale the screen gap
-rw-r--r--src/GPU.cpp11
-rw-r--r--src/libui_sdl/DlgVideoSettings.cpp8
-rw-r--r--src/libui_sdl/main.cpp27
3 files changed, 30 insertions, 16 deletions
diff --git a/src/GPU.cpp b/src/GPU.cpp
index a904a90..f4e9fd4 100644
--- a/src/GPU.cpp
+++ b/src/GPU.cpp
@@ -92,11 +92,6 @@ bool Init()
//SetFramebufferScale(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;
}
@@ -264,6 +259,9 @@ void SetFramebufferScale(int top, int bottom)
Framebuffer[0][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;
if (NDS::PowerControl9 & (1<<15))
{
@@ -288,6 +286,9 @@ void SetFramebufferScale(int top, int bottom)
Framebuffer[0][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;
if (NDS::PowerControl9 & (1<<15))
{
diff --git a/src/libui_sdl/DlgVideoSettings.cpp b/src/libui_sdl/DlgVideoSettings.cpp
index b6544ed..4d5de71 100644
--- a/src/libui_sdl/DlgVideoSettings.cpp
+++ b/src/libui_sdl/DlgVideoSettings.cpp
@@ -46,7 +46,12 @@ int OnCloseWindow(uiWindow* window, void* blarg)
return 1;
}
-//
+void OnResolutionChanged(uiRadioButtons* rb, void* blarg)
+{
+ int id = uiRadioButtonsSelected(rb);
+
+ printf("res=%d\n", id);
+}
void OnCancel(uiButton* btn, void* blarg)
{
@@ -144,6 +149,7 @@ void Open()
uiBoxAppend(in_ctrl, uiControl(lbl), 0);
uiRadioButtons* rbResolution = uiNewRadioButtons();
+ uiRadioButtonsOnSelected(rbResolution, OnResolutionChanged, NULL);
uiRadioButtonsAppend(rbResolution, "1x");
uiRadioButtonsAppend(rbResolution, "2x");
uiRadioButtonsAppend(rbResolution, "4x");
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index 2853a90..b79853e 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -834,7 +834,6 @@ void SetupScreenRects(int width, int height)
screenW *= ScreenScale;
screenH *= ScreenScale;
- gap *= ScreenScale;
uiRect *topscreen, *bottomscreen;
if (ScreenRotation == 1 || ScreenRotation == 2)
@@ -1029,9 +1028,6 @@ void SetMinSize(int w, int h)
int cw, ch;
uiWindowContentSize(MainWindow, &cw, &ch);
- w *= ScreenScale;
- h *= ScreenScale;
-
uiControlSetMinSize(uiControl(MainDrawArea), w, h);
if ((cw < w) || (ch < h))
{
@@ -1534,26 +1530,31 @@ void EnsureProperMinSize()
{
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 (isHori)
- SetMinSize(384+ScreenGap, 256);
+ SetMinSize(h0+ScreenGap+h1, std::max(w0,w1));
else
- SetMinSize(256, 384+ScreenGap);
+ SetMinSize(std::max(w0,w1), h0+ScreenGap+h1);
}
else if (ScreenLayout == 1) // vertical
{
if (isHori)
- SetMinSize(192, 512+ScreenGap);
+ SetMinSize(std::max(h0,h1), w0+ScreenGap+w1);
else
- SetMinSize(256, 384+ScreenGap);
+ SetMinSize(std::max(w0,w1), h0+ScreenGap+h1);
}
else // horizontal
{
if (isHori)
- SetMinSize(384+ScreenGap, 256);
+ SetMinSize(h0+ScreenGap+h1, std::max(w0,w1));
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 h = 192*factor * ScreenScale;
+ // FIXME
+
if (ScreenLayout == 0) // natural
{
if (isHori)
@@ -1696,6 +1699,10 @@ void ApplyNewSettings(int type)
Platform::LAN_DeInit();
Platform::LAN_Init();
}
+ else if (type == 2) // upscaling/video settings
+ {
+ //
+ }
EmuRunning = prevstatus;
}