Merged in Nick's new native resolution full-screen

- old 640x480 full-screen deprecated

Fixes for:
. Logo & Debug window scaled/positioned correctly
. Buttons & disk activity (on RHS) drawn in correct position
. Crosshairs for mouse (and when using mouse as joystick)drawn in correct position
This commit is contained in:
tomcw
2016-07-12 22:43:31 +01:00
parent 42e5d4af47
commit 66e468db65
8 changed files with 227 additions and 98 deletions
+31 -24
View File
@@ -951,7 +951,7 @@ void VideoDestroy () {
//===========================================================================
void VideoDrawLogoBitmap(HDC hDstDC, int xoff, int yoff, int srcw, int srch, int scale)
static void VideoDrawLogoBitmap(HDC hDstDC, int xoff, int yoff, int srcw, int srch, int scale)
{
HDC hSrcDC = CreateCompatibleDC( hDstDC );
SelectObject( hSrcDC, g_hLogoBitmap );
@@ -968,15 +968,11 @@ void VideoDrawLogoBitmap(HDC hDstDC, int xoff, int yoff, int srcw, int srch, int
DeleteObject( hSrcDC );
}
int g_nLogoWidth = FRAMEBUFFER_W;
int g_nLogoX = 0;
int g_nLogoY = 0;
//===========================================================================
void VideoDisplayLogo ()
{
int xoff = 0, yoff = 0;
const int scale = GetViewportScale();
int nLogoX = 0, nLogoY = 0;
int scale = GetViewportScale();
HDC hFrameDC = FrameGetDC();
@@ -988,17 +984,21 @@ void VideoDisplayLogo ()
BITMAP bm;
if (GetObject(g_hLogoBitmap, sizeof(bm), &bm))
{
g_nLogoWidth = bm.bmWidth;
g_nLogoX = (g_nViewportCX - scale*g_nLogoWidth)/2;
g_nLogoY = (g_nViewportCY - scale*bm.bmHeight )/2;
nLogoX = (g_nViewportCX - scale*bm.bmWidth )/2;
nLogoY = (g_nViewportCY - scale*bm.bmHeight)/2;
// Draw Logo at top of screen so when the Apple display is refreshed it will automagically clear it
if( g_bIsFullScreen )
{
g_nLogoX = 0;
g_nLogoY = 0;
#if 0
// Draw Logo at top of screen so when the Apple display is refreshed it will automagically clear it
nLogoX = 0;
nLogoY = 0;
#else
nLogoX += g_win_fullscreen_offsetx;
nLogoY += g_win_fullscreen_offsety;
#endif
}
VideoDrawLogoBitmap( hFrameDC, g_nLogoX, g_nLogoY, bm.bmWidth, bm.bmHeight, scale );
VideoDrawLogoBitmap( hFrameDC, nLogoX, nLogoY, bm.bmWidth, bm.bmHeight, scale );
}
}
@@ -1014,6 +1014,7 @@ void VideoDisplayLogo ()
char szVersion[ 64 ] = "";
sprintf( szVersion, "Version %s", VERSIONSTRING );
int xoff = g_win_fullscreen_offsetx, yoff = g_win_fullscreen_offsety;
#define DRAWVERSION(x,y,c) \
SetTextColor(hFrameDC,c); \
@@ -1067,15 +1068,15 @@ void VideoDisplayLogo ()
// sprintf( szVersion, "NTSC Alpha v17 BMP Palette" );
sprintf( szVersion, "NTSC Alpha v18" );
xoff = -g_nViewportCX + g_nViewportCX/6;
yoff = -g_nViewportCY/16;
xoff = -g_nViewportCX + g_nViewportCX/6 + g_win_fullscreen_offsetx;
yoff = -g_nViewportCY/16 + g_win_fullscreen_offsety;
DRAWVERSION( 0, 0,RGB(0x00,0x00,0x00));
DRAWVERSION( 1, 1,RGB(0x00,0x00,0x00));
DRAWVERSION( 2, 2,RGB(0xFF,0x00,0xFF));
sprintf( szVersion, "Blurry 80-col Text" );
xoff = -g_nViewportCX + g_nViewportCX/6;
yoff = +g_nViewportCY/16;
xoff = -g_nViewportCX + g_nViewportCX/6 + g_win_fullscreen_offsetx;
yoff = +g_nViewportCY/16 + g_win_fullscreen_offsety;
DRAWVERSION( 0, 0,RGB(0x00,0x00,0x00));
DRAWVERSION( 1, 1,RGB(0x00,0x00,0x00));
DRAWVERSION( 2, 2,RGB(0xFF,0x00,0xFF));
@@ -1206,14 +1207,20 @@ void VideoRefreshScreen ( int bVideoModeFlags, UINT uDelayRefresh /* =0 */ )
ySrc -= 1;
}
FULLSCREEN_SCALE_TYPE xdest = g_win_fullscreen_offsetx;
FULLSCREEN_SCALE_TYPE ydest = g_win_fullscreen_offsety;
FULLSCREEN_SCALE_TYPE wdest = g_nViewportCX /** g_win_fullscreen_scale*/;
FULLSCREEN_SCALE_TYPE hdest = g_nViewportCY /** g_win_fullscreen_scale*/;
SetStretchBltMode(hFrameDC, COLORONCOLOR);
StretchBlt(
hFrameDC,
xDst, yDst, // xDst, yDst
W, H, // wDst, hDst
hFrameDC,
(int)xdest, (int)ydest,
(int)wdest, (int)hdest,
g_hDeviceDC,
xSrc, ySrc, // xSrc, ySrc
FRAMEBUFFER_BORDERLESS_W, FRAMEBUFFER_BORDERLESS_H, // wSrc, hSrc
SRCCOPY );
xSrc, ySrc,
FRAMEBUFFER_BORDERLESS_W, FRAMEBUFFER_BORDERLESS_H,
SRCCOPY);
}
}