]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1500b12b.zip
authorToni Wilen <twilen@winuae.net>
Sat, 5 Apr 2008 09:04:46 +0000 (12:04 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:39:44 +0000 (21:39 +0200)
od-win32/rp.c
od-win32/win32gui.c

index 4687ca4d639ace6f1aeade13d47d8e8a7555a37c..424c8306ac0a194bbbf829cb259dd9e60ef91865 100755 (executable)
@@ -193,6 +193,7 @@ static void get_screenmode (struct RPScreenMode *sm)
     int res = currprefs.gfx_resolution;
     int m = RP_SCREENMODE_1X;
     int full = 0;
+    int dbl = 0;
 
     if (WIN32GFX_IsPicassoScreen ()) {
        full = currprefs.gfx_pfullscreen;
@@ -206,10 +207,16 @@ static void get_screenmode (struct RPScreenMode *sm)
            m = RP_SCREENMODE_2X;
        if (res == 2)
            m = RP_SCREENMODE_4X;
+       dbl = res >= 1 ? 1 : 0;
        sm->lClipLeft = currprefs.gfx_xcenter_pos;
        sm->lClipTop = currprefs.gfx_ycenter_pos;
-       sm->lClipWidth = LORES_WIDTH << currprefs.gfx_resolution;
-       sm->lClipHeight = LORES_HEIGHT << (currprefs.gfx_linedbl ? 1 : 0);
+       if (full) {
+           sm->lClipWidth = LORES_WIDTH << currprefs.gfx_resolution;
+           sm->lClipHeight = LORES_HEIGHT << (currprefs.gfx_linedbl ? 1 : 0);
+       } else {
+           sm->lClipWidth = currprefs.gfx_size_win.width << (RES_MAX - res);
+           sm->lClipHeight = currprefs.gfx_size_win.height << (1 - dbl);
+       }
     }
     if (full) {
        int d = (currprefs.gfx_display + 1) << 8;
@@ -223,6 +230,7 @@ static void set_screenmode (struct RPScreenMode *sm)
 {
     int res = RP_SCREENMODE_MODE (sm->dwScreenMode);
     int fs = RP_SCREENMODE_DISPLAY (sm->dwScreenMode);
+    int dbl = 1;
 
     minimized = 0;
     if (fs)
@@ -233,13 +241,24 @@ static void set_screenmode (struct RPScreenMode *sm)
        changed_prefs.gfx_afullscreen = fs;
        changed_prefs.gfx_resolution = res;
        if (res == 0)
-           changed_prefs.gfx_linedbl = 0;
+           dbl = changed_prefs.gfx_linedbl = 0;
+       else
+           dbl = changed_prefs.gfx_linedbl = 1;
+       if (sm->lClipWidth <= 0)
+           changed_prefs.gfx_size_win.width = LORES_WIDTH << res;
        else
-           changed_prefs.gfx_linedbl = 1;
-       res = 1 << res;
-       changed_prefs.gfx_size_win.width = default_width * res;
-       changed_prefs.gfx_size_win.height = default_height * res;
+           changed_prefs.gfx_size_win.width = sm->lClipWidth >> (RES_MAX - res);
+       if (sm->lClipHeight <= 0)
+           changed_prefs.gfx_size_win.height = LORES_HEIGHT << dbl;
+       else
+           changed_prefs.gfx_size_win.height = sm->lClipHeight >> (1 - dbl);
+       if (fs) {
+           changed_prefs.gfx_size_fs.width = changed_prefs.gfx_size_win.width;
+           changed_prefs.gfx_size_fs.height = changed_prefs.gfx_size_win.height;
+       }
     }
+    changed_prefs.gfx_xcenter_pos = sm->lClipLeft;
+    changed_prefs.gfx_ycenter_pos = sm->lClipTop;
     updatewinfsmode (&changed_prefs);
     WIN32GFX_DisplayChangeRequested ();
     hwndset = 0;
index a0c597007b468c3e09d50c913c404ed27107e31d..a5603cfb3945dd0699015256ad11fdf214866efc 100755 (executable)
@@ -1685,23 +1685,16 @@ static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, char *dostype, char *newpat
     sparse = 0;
     hfsize = (uae_u64)hfsizem * 1024 * 1024;
     if (IsDlgButtonChecked (hDlg, IDC_HF_SPARSE) == BST_CHECKED)
-       sparse = -1;
+       sparse = 1;
     if (!DiskSelection (hDlg, IDC_PATH_NAME, 3, &workprefs, newpath))
        return FALSE;
     GetDlgItemText (hDlg, IDC_PATH_NAME, init_path, MAX_DPATH);
     if (*init_path && hfsize) {
        SetCursor (LoadCursor(NULL, IDC_WAIT));
-       if ((hf = CreateFile (init_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL) ) != INVALID_HANDLE_VALUE) {
-           DWORD mcl, fsf;
-           if (GetVolumeInformationByHandleW (hf, NULL, 0, NULL, &mcl, &fsf, NULL, 0)) {
-               if ((fsf & FILE_SUPPORTS_SPARSE_FILES) && sparse < 0)
-                   sparse = 1;
-           }
-           if (sparse > 0) {
+       if ((hf = CreateFile (init_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) {
+           if (sparse) {
                DWORD ret;
-               int ok = 0;
-               if (DeviceIoControl (hf, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &ret, NULL))
-                   result = 1;
+               DeviceIoControl (hf, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &ret, NULL);
            }
            if (hfsize >= 0x80000000) {
                highword = (DWORD)(hfsize >> 32);