mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-12-24 07:30:24 +00:00
Calculate full-screen scale using borderless dimensions & allow more than 2x scale
This commit is contained in:
parent
02b0d7419a
commit
3cf54e6fa3
@ -253,7 +253,6 @@ void ContinueExecution(void)
|
|||||||
|
|
||||||
if (g_bFullSpeed)
|
if (g_bFullSpeed)
|
||||||
{
|
{
|
||||||
// For IBIZA.DSK
|
|
||||||
VideoRedrawScreenDuringFullSpeed(g_dwCyclesThisFrame);
|
VideoRedrawScreenDuringFullSpeed(g_dwCyclesThisFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ static const int kDEFAULT_VIEWPORT_SCALE = 2;
|
|||||||
int g_nViewportCX = FRAMEBUFFER_BORDERLESS_W * kDEFAULT_VIEWPORT_SCALE;
|
int g_nViewportCX = FRAMEBUFFER_BORDERLESS_W * kDEFAULT_VIEWPORT_SCALE;
|
||||||
int g_nViewportCY = FRAMEBUFFER_BORDERLESS_H * kDEFAULT_VIEWPORT_SCALE;
|
int g_nViewportCY = FRAMEBUFFER_BORDERLESS_H * kDEFAULT_VIEWPORT_SCALE;
|
||||||
static int g_nViewportScale = kDEFAULT_VIEWPORT_SCALE; // saved REGSAVE
|
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 BUTTONX (g_nViewportCX + VIEWPORTX*2)
|
||||||
#define BUTTONY 0
|
#define BUTTONY 0
|
||||||
@ -2106,9 +2106,10 @@ void SetFullScreenMode ()
|
|||||||
|
|
||||||
MONITORINFO monitor_info;
|
MONITORINFO monitor_info;
|
||||||
FULLSCREEN_SCALE_TYPE width, height, scalex, scaley;
|
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;
|
buttonover = -1;
|
||||||
#if 0
|
#if 0
|
||||||
@ -2141,7 +2142,7 @@ void SetFullScreenMode ()
|
|||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
// FS: desktop
|
// FS: desktop
|
||||||
SetViewportScale(g_win_fullscreen_scale);
|
SetViewportScale(g_win_fullscreen_scale, true);
|
||||||
|
|
||||||
buttonx = g_win_fullscreen_offsetx + g_nViewportCX + VIEWPORTX*2;
|
buttonx = g_win_fullscreen_offsetx + g_nViewportCX + VIEWPORTX*2;
|
||||||
buttony = g_win_fullscreen_offsety;
|
buttony = g_win_fullscreen_offsety;
|
||||||
@ -2261,9 +2262,9 @@ int GetViewportScale(void)
|
|||||||
return g_nViewportScale;
|
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;
|
nNewScale = g_nMaxViewportScale;
|
||||||
|
|
||||||
g_nViewportScale = nNewScale;
|
g_nViewportScale = nNewScale;
|
||||||
|
@ -74,7 +74,7 @@ extern int g_win_fullscreen_offsety;
|
|||||||
void FrameReleaseVideoDC ();
|
void FrameReleaseVideoDC ();
|
||||||
void FrameSetCursorPosByMousePos();
|
void FrameSetCursorPosByMousePos();
|
||||||
int GetViewportScale(void);
|
int GetViewportScale(void);
|
||||||
int SetViewportScale(int nNewScale);
|
int SetViewportScale(int nNewScale, bool bForce = false);
|
||||||
void GetViewportCXCY(int& nViewportCX, int& nViewportCY);
|
void GetViewportCXCY(int& nViewportCX, int& nViewportCY);
|
||||||
bool GetFullScreen32Bit(void);
|
bool GetFullScreen32Bit(void);
|
||||||
void SetFullScreen32Bit(bool b32Bit);
|
void SetFullScreen32Bit(bool b32Bit);
|
||||||
|
@ -1103,10 +1103,6 @@ void VideoDisplayLogo ()
|
|||||||
void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInvalidate /*=false*/)
|
void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInvalidate /*=false*/)
|
||||||
{
|
{
|
||||||
static bool bValid = 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)
|
if (bInvalidate)
|
||||||
{
|
{
|
||||||
@ -1114,6 +1110,13 @@ void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInvalidate
|
|||||||
return;
|
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)
|
bool bRedraw = true; // Always redraw for bValid==false (ie. just entered full-speed mode)
|
||||||
|
|
||||||
if (bValid)
|
if (bValid)
|
||||||
|
Loading…
Reference in New Issue
Block a user