Fixed the window resizes function in win_video.c, fixes window resizes with non-resizable window (ie. the main window is no longer stuck in 640x480);

Fixed the Force 4:3, Enable EGA/(S)VGA overscan, and Scale options;
Fixed a bug regarding register 0 of the SMC FDC37C665 Super I/O chip;
Commented out some excess logging.
This commit is contained in:
OBattler
2017-10-20 07:00:48 +02:00
parent 2f490728ca
commit 2be1c21c8a
22 changed files with 139 additions and 148 deletions

View File

@@ -420,11 +420,13 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
scale = LOWORD(wParam) - IDM_VID_SCALE_1X;
CheckMenuItem(hmenu, IDM_VID_SCALE_1X + scale, MF_CHECKED);
device_force_redraw();
video_force_resize_set(1);
config_save();
break;
case IDM_VID_FORCE43:
video_toggle_option(hmenu, &force_43, IDM_VID_FORCE43);
video_force_resize_set(1);
break;
case IDM_VID_INVERT:
@@ -434,6 +436,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case IDM_VID_OVERSCAN:
update_overscan = 1;
video_toggle_option(hmenu, &enable_overscan, IDM_VID_OVERSCAN);
video_force_resize_set(1);
break;
case IDM_VID_CGACON:

View File

@@ -18,6 +18,7 @@
#define BITMAP WINDOWS_BITMAP
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#undef BITMAP
#include <stdio.h>
#include <stdint.h>
@@ -277,17 +278,31 @@ endblit(void)
void
plat_resize(int x, int y)
{
int sb_borders[3];
RECT r;
#if 0
pclog("PLAT: VID[%d,%d] resizing to %dx%d\n", video_fullscreen, vid_api, x, y);
#endif
/* First, see if we should resize the UI window. */
if (vid_resize) {
/* Move the main window. */
if (!vid_resize) {
SendMessage(hwndSBAR, SB_GETBORDERS, 0, (LPARAM) sb_borders);
GetWindowRect(hwndMain, &r);
MoveWindow(hwndRender, 0, 0, x, y, TRUE);
GetWindowRect(hwndRender, &r);
MoveWindow(hwndSBAR,
0, r.bottom + GetSystemMetrics(SM_CYEDGE),
x, 17, TRUE);
GetWindowRect(hwndMain, &r);
/* Move the status bar with it. */
MoveWindow(hwndSBAR, 0, y+6, x, 17, TRUE);
MoveWindow(hwndMain, r.left, r.top,
x + (GetSystemMetrics(vid_resize ? SM_CXSIZEFRAME : SM_CXFIXEDFRAME) * 2),
y + (GetSystemMetrics(SM_CYEDGE) * 2) + (GetSystemMetrics(vid_resize ? SM_CYSIZEFRAME : SM_CYFIXEDFRAME) * 2) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 17 + sb_borders[1] + 1,
TRUE);
/* Move the render window if we have one. */
if (vid_apis[0][vid_api].local && (hwndRender != NULL)) {
MoveWindow(hwndRender, 0, 0, x, y, TRUE);
if (mousecapture) {
GetWindowRect(hwndRender, &r);
ClipCursor(&r);
}
}