mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-04-25 19:19:02 +00:00
Support VidHD in slot 3 (via Config GUI or '-s3 vidhd') for SHR video modes only. - AppleWin window is slightly enlarged when VidHD card is inserted. Support IIgs 320x200 (and fill mode) and 640x200 video modes. Debugger: add 'shr' command to view video CUI: Allow user to specify width & height (for full-screen); and allow separate x,y scaling in full-screen mode.
This commit is contained in:
@@ -33,16 +33,12 @@ Win32Frame::Win32Frame()
|
||||
g_bFrameActive = false;
|
||||
g_windowMinimized = false;
|
||||
g_bFullScreen_ShowSubunitStatus = true;
|
||||
g_win_fullscreen_scale = 1;
|
||||
g_win_fullscreen_offsetx = 0;
|
||||
g_win_fullscreen_offsety = 0;
|
||||
m_bestWidthForFullScreen = 0;
|
||||
m_bestHeightForFullScreen = 0;
|
||||
m_changedDisplaySettings = false;
|
||||
|
||||
g_nViewportCX = GetVideo().GetFrameBufferBorderlessWidth() * kDEFAULT_VIEWPORT_SCALE;
|
||||
g_nViewportCY = GetVideo().GetFrameBufferBorderlessHeight() * kDEFAULT_VIEWPORT_SCALE;
|
||||
g_nViewportScale = kDEFAULT_VIEWPORT_SCALE; // saved REGSAVE
|
||||
g_nMaxViewportScale = kDEFAULT_VIEWPORT_SCALE; // Max scale in Windowed mode with borders, buttons etc (full-screen may be +1)
|
||||
|
||||
btnfacebrush = (HBRUSH)0;
|
||||
@@ -52,8 +48,6 @@ Win32Frame::Win32Frame()
|
||||
buttonactive = -1;
|
||||
buttondown = -1;
|
||||
buttonover = -1;
|
||||
buttonx = BUTTONX; // NB. macro uses g_nViewportCX
|
||||
buttony = BUTTONY;
|
||||
g_hFrameDC = (HDC)0;
|
||||
memset(&framerect, 0, sizeof(framerect));
|
||||
|
||||
@@ -76,9 +70,12 @@ Win32Frame::Win32Frame()
|
||||
|
||||
g_eStatusDrive1 = DISK_STATUS_OFF;
|
||||
g_eStatusDrive2 = DISK_STATUS_OFF;
|
||||
|
||||
// Set g_nViewportScale, g_nViewportCX, g_nViewportCY & buttonx, buttony
|
||||
SetViewportScale(kDEFAULT_VIEWPORT_SCALE, true);
|
||||
}
|
||||
|
||||
void Win32Frame::videoCreateDIBSection(Video & video)
|
||||
void Win32Frame::VideoCreateDIBSection(bool resetVideoState)
|
||||
{
|
||||
// CREATE THE DEVICE CONTEXT
|
||||
HWND window = GetDesktopWindow();
|
||||
@@ -91,7 +88,10 @@ void Win32Frame::videoCreateDIBSection(Video & video)
|
||||
|
||||
// CREATE THE FRAME BUFFER DIB SECTION
|
||||
if (g_hDeviceBitmap)
|
||||
{
|
||||
DeleteObject(g_hDeviceBitmap);
|
||||
GetVideo().Destroy();
|
||||
}
|
||||
|
||||
uint8_t* pFramebufferbits;
|
||||
|
||||
@@ -102,29 +102,33 @@ void Win32Frame::videoCreateDIBSection(Video & video)
|
||||
(LPVOID*)&pFramebufferbits, 0, 0
|
||||
);
|
||||
SelectObject(g_hDeviceDC, g_hDeviceBitmap);
|
||||
video.Initialize(pFramebufferbits);
|
||||
GetVideo().Initialize(pFramebufferbits, resetVideoState);
|
||||
}
|
||||
|
||||
void Win32Frame::Initialize(void)
|
||||
void Win32Frame::Initialize(bool resetVideoState)
|
||||
{
|
||||
// LOAD THE LOGO
|
||||
g_hLogoBitmap = LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_APPLEWIN));
|
||||
if (g_hLogoBitmap == NULL)
|
||||
{
|
||||
// LOAD THE LOGO
|
||||
g_hLogoBitmap = LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_APPLEWIN));
|
||||
}
|
||||
|
||||
if (g_pFramebufferinfo)
|
||||
delete[] g_pFramebufferinfo;
|
||||
|
||||
// CREATE A BITMAPINFO STRUCTURE FOR THE FRAME BUFFER
|
||||
g_pFramebufferinfo = (LPBITMAPINFO) new BYTE[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)];
|
||||
|
||||
Video & video = GetVideo();
|
||||
|
||||
memset(g_pFramebufferinfo, 0, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
|
||||
g_pFramebufferinfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
g_pFramebufferinfo->bmiHeader.biWidth = video.GetFrameBufferWidth();
|
||||
g_pFramebufferinfo->bmiHeader.biHeight = video.GetFrameBufferHeight();
|
||||
g_pFramebufferinfo->bmiHeader.biWidth = GetVideo().GetFrameBufferWidth();
|
||||
g_pFramebufferinfo->bmiHeader.biHeight = GetVideo().GetFrameBufferHeight();
|
||||
g_pFramebufferinfo->bmiHeader.biPlanes = 1;
|
||||
g_pFramebufferinfo->bmiHeader.biBitCount = 32;
|
||||
g_pFramebufferinfo->bmiHeader.biCompression = BI_RGB;
|
||||
g_pFramebufferinfo->bmiHeader.biClrUsed = 0;
|
||||
|
||||
videoCreateDIBSection(video);
|
||||
VideoCreateDIBSection(resetVideoState);
|
||||
|
||||
#if 0
|
||||
DDInit(); // For WaitForVerticalBlank()
|
||||
|
||||
Reference in New Issue
Block a user