Calculate full-screen scale using borderless dimensions & allow more than 2x scale

This commit is contained in:
tomcw 2016-07-25 21:19:00 +01:00
parent 02b0d7419a
commit 3cf54e6fa3
4 changed files with 15 additions and 12 deletions

View File

@ -253,7 +253,6 @@ void ContinueExecution(void)
if (g_bFullSpeed)
{
// For IBIZA.DSK
VideoRedrawScreenDuringFullSpeed(g_dwCyclesThisFrame);
}

View File

@ -68,7 +68,7 @@ static const int kDEFAULT_VIEWPORT_SCALE = 2;
int g_nViewportCX = FRAMEBUFFER_BORDERLESS_W * kDEFAULT_VIEWPORT_SCALE;
int g_nViewportCY = FRAMEBUFFER_BORDERLESS_H * kDEFAULT_VIEWPORT_SCALE;
static int g_nViewportScale = kDEFAULT_VIEWPORT_SCALE; // saved REGSAVE
static int g_nMaxViewportScale = kDEFAULT_VIEWPORT_SCALE;
static int g_nMaxViewportScale = kDEFAULT_VIEWPORT_SCALE; // Max scale in Windowed mode with borders, buttons etc (full-screen may be +1)
#define BUTTONX (g_nViewportCX + VIEWPORTX*2)
#define BUTTONY 0
@ -2106,9 +2106,10 @@ void SetFullScreenMode ()
MONITORINFO monitor_info;
FULLSCREEN_SCALE_TYPE width, height, scalex, scaley;
int top, left, A2_WINDOW_WIDTH, A2_WINDOW_HEIGHT;
int top, left;
GetWidthHeight(A2_WINDOW_WIDTH, A2_WINDOW_HEIGHT);
const int A2_WINDOW_WIDTH = FRAMEBUFFER_BORDERLESS_W;
const int A2_WINDOW_HEIGHT = FRAMEBUFFER_BORDERLESS_H;
buttonover = -1;
#if 0
@ -2141,7 +2142,7 @@ void SetFullScreenMode ()
#if 1
// FS: desktop
SetViewportScale(g_win_fullscreen_scale);
SetViewportScale(g_win_fullscreen_scale, true);
buttonx = g_win_fullscreen_offsetx + g_nViewportCX + VIEWPORTX*2;
buttony = g_win_fullscreen_offsety;
@ -2261,9 +2262,9 @@ int GetViewportScale(void)
return g_nViewportScale;
}
int SetViewportScale(int nNewScale)
int SetViewportScale(int nNewScale, bool bForce /*=false*/)
{
if (nNewScale > g_nMaxViewportScale)
if (!bForce && nNewScale > g_nMaxViewportScale)
nNewScale = g_nMaxViewportScale;
g_nViewportScale = nNewScale;

View File

@ -74,7 +74,7 @@ extern int g_win_fullscreen_offsety;
void FrameReleaseVideoDC ();
void FrameSetCursorPosByMousePos();
int GetViewportScale(void);
int SetViewportScale(int nNewScale);
int SetViewportScale(int nNewScale, bool bForce = false);
void GetViewportCXCY(int& nViewportCX, int& nViewportCY);
bool GetFullScreen32Bit(void);
void SetFullScreen32Bit(bool b32Bit);

View File

@ -1103,10 +1103,6 @@ void VideoDisplayLogo ()
void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInvalidate /*=false*/)
{
static bool bValid = false;
static BYTE text_main[1024*2] = {0}; // page1 & 2
static BYTE text_aux[1024*2] = {0}; // page1 & 2
static BYTE hgr_main[8192*2] = {0}; // page1 & 2
static BYTE hgr_aux[8192*2] = {0}; // page1 & 2
if (bInvalidate)
{
@ -1114,6 +1110,13 @@ void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInvalidate
return;
}
//
static BYTE text_main[1024*2] = {0}; // page1 & 2
static BYTE text_aux[1024*2] = {0}; // page1 & 2
static BYTE hgr_main[8192*2] = {0}; // page1 & 2
static BYTE hgr_aux[8192*2] = {0}; // page1 & 2
bool bRedraw = true; // Always redraw for bValid==false (ie. just entered full-speed mode)
if (bValid)