]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1530b1.zip
authorToni Wilen <twilen@winuae.net>
Tue, 30 Sep 2008 15:08:23 +0000 (18:08 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:43:08 +0000 (21:43 +0200)
od-win32/dxwrap.c
od-win32/dxwrap.h
od-win32/mman.c
od-win32/picasso96_win.c
od-win32/win32.h
od-win32/win32gfx.c
od-win32/win32gfx.h
od-win32/win32gui.c
od-win32/winuaechangelog.txt

index 64ac76ea1b9ec967a0c6ffaddeb46291415faa7e..b6a97629366487be34b75cce67dd4d9983303588 100755 (executable)
@@ -590,10 +590,10 @@ RGBFTYPE DirectDraw_GetSurfacePixelFormat (LPDDSURFACEDESC2 surface)
     return RGBFB_NONE;
 }
 
-HRESULT DirectDraw_EnumDisplayModes (DWORD flags, LPDDENUMMODESCALLBACK2 callback)
+HRESULT DirectDraw_EnumDisplayModes (DWORD flags, LPDDENUMMODESCALLBACK2 callback, void *context)
 {
     HRESULT result;
-    result = IDirectDraw7_EnumDisplayModes (dxdata.maindd, flags, NULL, NULL, callback);
+    result = IDirectDraw7_EnumDisplayModes (dxdata.maindd, flags, NULL, context, callback);
     return result;
 }
 
index 598c0ad08c5c4050e259b34c8a2cbd3f952ba055..348ad72f11714c6a5dc408e4ab25fad5d70af4e2 100755 (executable)
@@ -63,7 +63,6 @@ struct PicassoResolution
     /* Bit mask of RGBFF_xxx values.  */
     uae_u32 colormodes;
 };
-extern struct PicassoResolution *DisplayModes;
 extern GUID *displayGUID;
 
 #define MAX_DISPLAYS 10
@@ -105,7 +104,7 @@ HRESULT DirectDraw_SetCooperativeLevel (HWND window, int fullscreen, int doset);
 HRESULT DirectDraw_CreateClipper (void);
 HRESULT DirectDraw_SetClipper(HWND hWnd);
 RGBFTYPE DirectDraw_GetSurfacePixelFormat(LPDDSURFACEDESC2 surface);
-HRESULT DirectDraw_EnumDisplayModes(DWORD flags, LPDDENUMMODESCALLBACK2 callback);
+HRESULT DirectDraw_EnumDisplayModes(DWORD flags, LPDDENUMMODESCALLBACK2 callback, void *context);
 HRESULT DirectDraw_EnumDisplays(LPDDENUMCALLBACKEX callback);
 DWORD DirectDraw_CurrentWidth (void);
 DWORD DirectDraw_CurrentHeight (void);
index 0456a1b5eeadb42d476f81380cfc9ce85cd04451..76dc49deba2f712c6c7abac44355631d8d89e5cb 100755 (executable)
@@ -538,7 +538,10 @@ void *shmat (int shmid, void *shmaddr, int shmflg)
                size += BARRIER;
        }
        if(!strcmp(shmids[shmid].name,"filesys")) {
-           result = xcalloc (size, 1);
+           static uae_u8 *filesysptr;
+           if (filesysptr == NULL)
+               filesysptr = xcalloc (size, 1);
+           result = filesysptr;
            shmids[shmid].attached = result;
            return result;
        }
index 9cc048bbabe93af6aac12e64eebd59beca17faa1..7ddf230dc5ddee431a0950fe8969bc3b692320cd 100755 (executable)
@@ -30,6 +30,7 @@
 *   programs started from a Picasso workbench.
 */
 
+#define MULTIDISPLAY 0
 #define P96DX 0
 
 #include "sysconfig.h"
@@ -1870,6 +1871,8 @@ void picasso96_alloc (TrapContext *ctx)
 {
     int i, j, size, cnt;
     int misscnt, depths;
+    struct MultiDisplay *md = getdisplay (&currprefs);
+    struct PicassoResolution *DisplayModes = md->DisplayModes;
 
     uaegfx_resname = ds ("uaegfx.card");
     xfree (newmodes);
@@ -1935,8 +1938,12 @@ void picasso96_alloc (TrapContext *ctx)
            && DisplayModes[i].res.height == DisplayModes[j].res.height)
                i++;
     }
-    for (i = 0; Displays[i].name; i++)
+#if MULTIDISPLAY
+    for (i = 0; Displays[i].name; i++) {
+       size += PSSO_LibResolution_sizeof;
        size += PSSO_ModeInfo_sizeof * depths;
+    }
+#endif
     newmodes[cnt].depth = -1;
 
     for (i = 0; i < cnt; i++) {
@@ -2124,11 +2131,15 @@ static void inituaegfx (uaecptr ABI)
 #endif
 }
 
-static void addmode (uaecptr AmigaBoardInfo, uaecptr *amem, struct LibResolution *res, int w, int h, const char *name, int id, int *unkcnt)
+static void addmode (uaecptr AmigaBoardInfo, uaecptr *amem, struct LibResolution *res, int w, int h, const char *name, int display, int *unkcnt)
 {
     int depth;
 
-    res->DisplayID = id > 0 ? id : AssignModeID (w, h, unkcnt);
+    if (display > 0) {
+       res->DisplayID = 0x51000000 + display * 0x100000;
+    } else {
+        res->DisplayID = AssignModeID (w, h, unkcnt);
+    }
     res->BoardInfo = AmigaBoardInfo;
     res->Width = w;
     res->Height = h;
@@ -2179,7 +2190,7 @@ static uae_u32 REGPARAM2 picasso_InitCard (TrapContext *ctx)
     while (newmodes[i].depth >= 0) {
        struct LibResolution res = { 0 };
        j = i;
-       addmode (AmigaBoardInfo, &amem, &res, newmodes[i].res.width, newmodes[i].res.height, NULL, -1, &unkcnt);
+       addmode (AmigaBoardInfo, &amem, &res, newmodes[i].res.width, newmodes[i].res.height, NULL, 0, &unkcnt);
        write_log ("%08X %4dx%4d %s\n", res.DisplayID, res.Width, res.Height, res.Name);
        while (newmodes[i].depth >= 0
            && newmodes[i].res.width == newmodes[j].res.width
@@ -2194,19 +2205,19 @@ static uae_u32 REGPARAM2 picasso_InitCard (TrapContext *ctx)
        AmigaListAddTail (AmigaBoardInfo + PSSO_BoardInfo_ResolutionsList, amem);
        amem += PSSO_LibResolution_sizeof;
     }
-#if 0
+#if MULTIDISPLAY
     for (i = 0; Displays[i].name; i++) {
        struct LibResolution res = { 0 };
        struct MultiDisplay *md = &Displays[i];
        int w = md->rect.right - md->rect.left;
        int h = md->rect.bottom - md->rect.top;
-       int id = 0x50F00000 - i * 0x10000;
        char tmp[100];
        if (md->primary)
            strcpy (tmp, "UAE:Primary");
        else
-           sprintf (tmp, "UAE:Monitor#%d", i);
-       addmode (AmigaBoardInfo, &amem, &res, w + 16, h, md->name, id, &unkcnt);
+           sprintf (tmp, "UAE:Display#%d", i);
+       addmode (AmigaBoardInfo, &amem, &res, w, h, tmp, i + 1, &unkcnt);
+       write_log ("%08X %4dx%4d %s\n", res.DisplayID, res.Width + 16, res.Height, res.Name);
        LibResolutionStructureCount++;
        CopyLibResolutionStructureU2A (&res, amem);
 #if P96TRACING_ENABLED && P96TRACING_LEVEL > 1
index 9db090745c84d7f64a26a28ac8c6582598e88e66..32afa9a3dece0d8e5f9e8bcbc3d8cc46cd952a6b 100755 (executable)
@@ -17,8 +17,8 @@
 
 #define WINUAEPUBLICBETA 1
 
-#define WINUAEBETA "0.1"
-#define WINUAEDATE MAKEBD(2008, 9, 26)
+#define WINUAEBETA "1"
+#define WINUAEDATE MAKEBD(2008, 9, 30)
 #define WINUAEEXTRA ""
 #define WINUAEREV ""
 
index cf9c5d1b95180b08170cae908ee44498ef80bdac..d6bd285cb4723e99c671c8aa4118aec0e106a37c 100755 (executable)
@@ -90,7 +90,6 @@ struct winuae_currentmode {
     LPPALETTEENTRY pal;
 };
 
-struct PicassoResolution *DisplayModes;
 struct MultiDisplay Displays[MAX_DISPLAYS];
 static GUID *displayGUID;
 
@@ -256,7 +255,7 @@ static int set_ddraw_2 (void)
 
     DirectDraw_FreeMainSurface ();
 
-    if (!dd)
+    if (!dd && !dxfullscreen)
        return 1;
 
     ddrval = DirectDraw_SetCooperativeLevel (hAmigaWnd, dxfullscreen, TRUE);
@@ -328,6 +327,7 @@ static HRESULT CALLBACK modesCallback (LPDDSURFACEDESC2 modeDesc, LPVOID context
 {
     RGBFTYPE colortype;
     int i, j, ct, depth;
+    struct MultiDisplay *md = context;
 
     colortype = DirectDraw_GetSurfacePixelFormat (modeDesc);
     if (colortype == RGBFB_NONE)
@@ -347,34 +347,34 @@ static HRESULT CALLBACK modesCallback (LPDDSURFACEDESC2 modeDesc, LPVOID context
     if (depth == 0)
        return DDENUMRET_OK;
     i = 0;
-    while (DisplayModes[i].depth >= 0) {
-       if (DisplayModes[i].depth == depth && DisplayModes[i].res.width == modeDesc->dwWidth && DisplayModes[i].res.height == modeDesc->dwHeight) {
+    while (md->DisplayModes[i].depth >= 0) {
+       if (md->DisplayModes[i].depth == depth && md->DisplayModes[i].res.width == modeDesc->dwWidth && md->DisplayModes[i].res.height == modeDesc->dwHeight) {
            for (j = 0; j < MAX_REFRESH_RATES; j++) {
-               if (DisplayModes[i].refresh[j] == 0 || DisplayModes[i].refresh[j] == modeDesc->dwRefreshRate)
+               if (md->DisplayModes[i].refresh[j] == 0 || md->DisplayModes[i].refresh[j] == modeDesc->dwRefreshRate)
                    break;
            }
            if (j < MAX_REFRESH_RATES) {
-               DisplayModes[i].refresh[j] = modeDesc->dwRefreshRate;
-               DisplayModes[i].refresh[j + 1] = 0;
+               md->DisplayModes[i].refresh[j] = modeDesc->dwRefreshRate;
+               md->DisplayModes[i].refresh[j + 1] = 0;
                return DDENUMRET_OK;
            }
        }
        i++;
     }
     i = 0;
-    while (DisplayModes[i].depth >= 0)
+    while (md->DisplayModes[i].depth >= 0)
        i++;
     if (i >= MAX_PICASSO_MODES - 1)
        return DDENUMRET_OK;
-    DisplayModes[i].res.width = modeDesc->dwWidth;
-    DisplayModes[i].res.height = modeDesc->dwHeight;
-    DisplayModes[i].depth = depth;
-    DisplayModes[i].refresh[0] = modeDesc->dwRefreshRate;
-    DisplayModes[i].refresh[1] = 0;
-    DisplayModes[i].colormodes = ct;
-    DisplayModes[i + 1].depth = -1;
-    sprintf (DisplayModes[i].name, "%dx%d, %d-bit",
-       DisplayModes[i].res.width, DisplayModes[i].res.height, DisplayModes[i].depth * 8);
+    md->DisplayModes[i].res.width = modeDesc->dwWidth;
+    md->DisplayModes[i].res.height = modeDesc->dwHeight;
+    md->DisplayModes[i].depth = depth;
+    md->DisplayModes[i].refresh[0] = modeDesc->dwRefreshRate;
+    md->DisplayModes[i].refresh[1] = 0;
+    md->DisplayModes[i].colormodes = ct;
+    md->DisplayModes[i + 1].depth = -1;
+    sprintf (md->DisplayModes[i].name, "%dx%d, %d-bit",
+       md->DisplayModes[i].res.width, md->DisplayModes[i].res.height, md->DisplayModes[i].depth * 8);
     return DDENUMRET_OK;
 }
 
@@ -392,35 +392,35 @@ static int resolution_compare (const void *a, const void *b)
        return 1;
     return ma->depth - mb->depth;
 }
-static void sortmodes (void)
+static void sortmodes (struct MultiDisplay *md)
 {
     int        i = 0, idx = -1;
     int pw = -1, ph = -1;
-    while (DisplayModes[i].depth >= 0)
+    while (md->DisplayModes[i].depth >= 0)
        i++;
-    qsort (DisplayModes, i, sizeof (struct PicassoResolution), resolution_compare);
-    for (i = 0; DisplayModes[i].depth >= 0; i++) {
-       if (DisplayModes[i].res.height != ph || DisplayModes[i].res.width != pw) {
-           ph = DisplayModes[i].res.height;
-           pw = DisplayModes[i].res.width;
+    qsort (md->DisplayModes, i, sizeof (struct PicassoResolution), resolution_compare);
+    for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
+       if (md->DisplayModes[i].res.height != ph || md->DisplayModes[i].res.width != pw) {
+           ph = md->DisplayModes[i].res.height;
+           pw = md->DisplayModes[i].res.width;
            idx++;
        }
-       DisplayModes[i].residx = idx;
+       md->DisplayModes[i].residx = idx;
     }
 }
 
-static void modesList (void)
+static void modesList (struct MultiDisplay *md)
 {
     int i, j;
 
     i = 0;
-    while (DisplayModes[i].depth >= 0) {
-       write_log ("%d: %s (", i, DisplayModes[i].name);
+    while (md->DisplayModes[i].depth >= 0) {
+       write_log ("%d: %s (", i, md->DisplayModes[i].name);
        j = 0;
-       while (DisplayModes[i].refresh[j] > 0) {
+       while (md->DisplayModes[i].refresh[j] > 0) {
            if (j > 0)
                write_log (",");
-           write_log ("%d", DisplayModes[i].refresh[j]);
+           write_log ("%d", md->DisplayModes[i].refresh[j]);
            j++;
        }
        write_log (")\n");
@@ -459,7 +459,7 @@ BOOL CALLBACK displaysCallback (GUID *guid, LPSTR desc, LPSTR name, LPVOID ctx,
     return 1;
 }
 
-static BOOL CALLBACK monitorEnumProc(HMONITOR h, HDC hdc, LPRECT rect, LPARAM data)
+static BOOL CALLBACK monitorEnumProc (HMONITOR h, HDC hdc, LPRECT rect, LPARAM data)
 {
     MONITORINFOEX lpmi;
     int cnt = *((int*)data);
@@ -522,8 +522,8 @@ void sortdisplays (void)
 
     md1 = Displays;
     while (md1->name) {
-       DisplayModes = md1->DisplayModes = xmalloc (sizeof (struct PicassoResolution) * MAX_PICASSO_MODES);
-       DisplayModes[0].depth = -1;
+       md1->DisplayModes = xmalloc (sizeof (struct PicassoResolution) * MAX_PICASSO_MODES);
+       md1->DisplayModes[0].depth = -1;
        md1->disabled = 1;
        if (DirectDraw_Start (md1->primary ? NULL : &md1->guid)) {
            if (SUCCEEDED (DirectDraw_GetDisplayMode ())) {
@@ -532,29 +532,28 @@ void sortdisplays (void)
                int b = DirectDraw_GetCurrentDepth ();
                write_log ("Desktop: W=%d H=%d B=%d. CXVS=%d CYVS=%d\n", w, h, b,
                    GetSystemMetrics (SM_CXVIRTUALSCREEN), GetSystemMetrics (SM_CYVIRTUALSCREEN));
-               DirectDraw_EnumDisplayModes (DDEDM_REFRESHRATES , modesCallback);
+               DirectDraw_EnumDisplayModes (DDEDM_REFRESHRATES , modesCallback, md1);
                //dhack();
-               sortmodes ();
-               modesList ();
+               sortmodes (md1);
+               modesList (md1);
                DirectDraw_Release ();
-               if (DisplayModes[0].depth >= 0)
+               if (md1->DisplayModes[0].depth >= 0)
                    md1->disabled = 0;
            }
        }
        i = 0;
-       while (DisplayModes[i].depth > 0)
+       while (md1->DisplayModes[i].depth > 0)
            i++;
        write_log ("'%s', %d display modes (%s)\n", md1->name, i, md1->disabled ? "disabled" : "enabled");
        md1++;
     }
-    DisplayModes = Displays[0].DisplayModes;
     displayGUID = NULL;
 }
 
 /* DirectX will fail with "Mode not supported" if we try to switch to a full
  * screen mode that doesn't match one of the dimensions we got during enumeration.
  * So try to find a best match for the given resolution in our list.  */
-int WIN32GFX_AdjustScreenmode(uae_u32 *pwidth, uae_u32 *pheight, uae_u32 *ppixbits)
+int WIN32GFX_AdjustScreenmode (struct MultiDisplay *md, uae_u32 *pwidth, uae_u32 *pheight, uae_u32 *ppixbits)
 {
     struct PicassoResolution *best;
     uae_u32 selected_mask = (*ppixbits == 8 ? RGBMASK_8BIT
@@ -572,8 +571,8 @@ int WIN32GFX_AdjustScreenmode(uae_u32 *pwidth, uae_u32 *pheight, uae_u32 *ppixbi
        i = 0;
        index = 0;
 
-       best = &DisplayModes[0];
-       dm = &DisplayModes[1];
+       best = &md->DisplayModes[0];
+       dm = &md->DisplayModes[1];
 
        while (dm->depth >= 0)  {
 
@@ -1004,7 +1003,7 @@ int check_prefs_changed_gfx (void)
     c |= currprefs.gfx_size_win.x != changed_prefs.gfx_size_win.x ? 16 : 0;
     c |= currprefs.gfx_size_win.y != changed_prefs.gfx_size_win.y ? 16 : 0;
 #endif
-    c |= currprefs.color_mode != changed_prefs.color_mode ? 2 : 0;
+    c |= currprefs.color_mode != changed_prefs.color_mode ? 2 | 16 : 0;
     c |= currprefs.gfx_afullscreen != changed_prefs.gfx_afullscreen ? 16 : 0;
     c |= currprefs.gfx_pfullscreen != changed_prefs.gfx_pfullscreen ? 16 : 0;
     c |= currprefs.gfx_avsync != changed_prefs.gfx_avsync ? 2 | 16 : 0;
@@ -1762,23 +1761,24 @@ static int createnotification (HWND hwnd)
 static int getbestmode (int nextbest)
 {
     int i, disp;
+    struct MultiDisplay *md = getdisplay (&currprefs);
 
     disp = currprefs.gfx_display;
-    for (i = 0; DisplayModes[i].depth >= 0; i++) {
-        struct PicassoResolution *pr = &DisplayModes[i];
+    for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
+        struct PicassoResolution *pr = &md->DisplayModes[i];
         if (pr->res.width == currentmode->native_width && pr->res.height == currentmode->native_height)
            break;
     }
-    if (DisplayModes[i].depth >= 0) {
+    if (md->DisplayModes[i].depth >= 0) {
        if (!nextbest)
            return 1;
-       while (DisplayModes[i].res.width == currentmode->native_width && DisplayModes[i].res.height == currentmode->native_height)
+       while (md->DisplayModes[i].res.width == currentmode->native_width && md->DisplayModes[i].res.height == currentmode->native_height)
            i++;
     } else {
        i = 0;
     }
-    for (; DisplayModes[i].depth >= 0; i++) {
-       struct PicassoResolution *pr = &DisplayModes[i];
+    for (; md->DisplayModes[i].depth >= 0; i++) {
+       struct PicassoResolution *pr = &md->DisplayModes[i];
        if (pr->res.width >= currentmode->native_width && pr->res.height >= currentmode->native_height) {
            write_log ("FS: %dx%d -> %dx%d\n", currentmode->native_width, currentmode->native_height,
                pr->res.width, pr->res.height);
@@ -2204,6 +2204,10 @@ static BOOL doInit (void)
     picasso_vidinfo.depth = currentmode->current_depth;
 #endif
 
+    xfree (gfxvidinfo.realbufmem);
+    gfxvidinfo.realbufmem = NULL;
+    gfxvidinfo.bufmem = NULL;
+
     if ((currentmode->flags & DM_DDRAW) && !(currentmode->flags & (DM_D3D | DM_SWSCALE | DM_OPENGL))) {
 
        ;
index c96828f19a97f24a8421e7c46b4b683895074ee0..c70bc4c69860e63e4824d731015cd553e79a6924 100755 (executable)
@@ -21,7 +21,7 @@ void WIN32GFX_WindowMove (void);
 void WIN32GFX_WindowSize (void);;
 
 RGBFTYPE WIN32GFX_FigurePixelFormats (RGBFTYPE colortype);
-int WIN32GFX_AdjustScreenmode (uae_u32 *pwidth, uae_u32 *pheight, uae_u32 *ppixbits);
+int WIN32GFX_AdjustScreenmode (struct MultiDisplay *md, uae_u32 *pwidth, uae_u32 *pheight, uae_u32 *ppixbits);
 
 extern HWND hStatusWnd;
 extern uae_u32 default_freq;
index 492c0377764a95eacd8bf55b69f551c7fbb45b11..b18e13b6bb781fbbc0d5f7ffd8389cdfd2c6dc9c 100755 (executable)
@@ -4304,9 +4304,10 @@ static void init_frequency_combo (HWND hDlg, int dmode)
     int i, j, freq, tmp;
     char hz[20], hz2[20], txt[100];
     LRESULT index;
+    struct MultiDisplay *md = getdisplay (&workprefs);
 
     i = 0; index = 0;
-    while (dmode >= 0 && (freq = DisplayModes[dmode].refresh[i]) > 0 && index < MAX_REFRESH_RATES) {
+    while (dmode >= 0 && (freq = md->DisplayModes[dmode].refresh[i]) > 0 && index < MAX_REFRESH_RATES) {
        storedrefreshrates[index++] = freq;
        i++;
     }
@@ -4363,19 +4364,20 @@ static void init_frequency_combo (HWND hDlg, int dmode)
 #define MAX_FRAMERATE_LENGTH 40
 #define MAX_NTH_LENGTH 20
 
-static int display_mode_index(uae_u32 x, uae_u32 y, uae_u32 d)
+static int display_mode_index (uae_u32 x, uae_u32 y, uae_u32 d)
 {
     int i;
+    struct MultiDisplay *md = getdisplay (&workprefs);
 
     i = 0;
-    while (DisplayModes[i].depth >= 0) {
-       if (DisplayModes[i].res.width == x &&
-           DisplayModes[i].res.height == y &&
-           DisplayModes[i].depth == d)
+    while (md->DisplayModes[i].depth >= 0) {
+       if (md->DisplayModes[i].res.width == x &&
+           md->DisplayModes[i].res.height == y &&
+           md->DisplayModes[i].depth == d)
            break;
        i++;
     }
-    if(DisplayModes[i].depth < 0)
+    if(md->DisplayModes[i].depth < 0)
        i = -1;
     return i;
 }
@@ -4447,6 +4449,7 @@ static void init_display_mode (HWND hDlg)
 {
    int d, d2, index;
    int i, cnt;
+   struct MultiDisplay *md = getdisplay (&workprefs);
 
    switch (workprefs.color_mode)
     {
@@ -4461,7 +4464,7 @@ static void init_display_mode (HWND hDlg)
 
     if (workprefs.gfx_afullscreen) {
        d2 = d;
-       if ((index = WIN32GFX_AdjustScreenmode (&workprefs.gfx_size_fs.width, &workprefs.gfx_size_fs.height, &d2)) >= 0) {
+       if ((index = WIN32GFX_AdjustScreenmode (md, &workprefs.gfx_size_fs.width, &workprefs.gfx_size_fs.height, &d2)) >= 0) {
            switch (d2)
            {
            case 15:
@@ -4485,20 +4488,20 @@ static void init_display_mode (HWND hDlg)
 
     index = display_mode_index (workprefs.gfx_size_fs.width, workprefs.gfx_size_fs.height, d);
     if (index >= 0)
-       SendDlgItemMessage (hDlg, IDC_RESOLUTION, CB_SETCURSEL, DisplayModes[index].residx, 0);
+       SendDlgItemMessage (hDlg, IDC_RESOLUTION, CB_SETCURSEL, md->DisplayModes[index].residx, 0);
     else
        index = 0;
     SendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_RESETCONTENT, 0, 0);
     cnt = 0;
     gui_display_depths[0] = gui_display_depths[1] = gui_display_depths[2] = -1;
-    for (i = 0; DisplayModes[i].depth >= 0; i++) {
-        if (DisplayModes[i].depth > 1 && DisplayModes[i].residx == DisplayModes[index].residx) {
+    for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
+        if (md->DisplayModes[i].depth > 1 && md->DisplayModes[i].residx == md->DisplayModes[index].residx) {
            char tmp[64];
-           sprintf (tmp, "%d", DisplayModes[i].depth * 8);
+           sprintf (tmp, "%d", md->DisplayModes[i].depth * 8);
            SendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_ADDSTRING, 0, (LPARAM)tmp);
-           if (DisplayModes[i].depth == d)
+           if (md->DisplayModes[i].depth == d)
                SendDlgItemMessage (hDlg, IDC_RESOLUTIONDEPTH, CB_SETCURSEL, cnt, 0);
-           gui_display_depths[cnt] = DisplayModes[i].depth;
+           gui_display_depths[cnt] = md->DisplayModes[i].depth;
            cnt++;
        }
     }
@@ -4631,13 +4634,14 @@ static void init_resolution_combo (HWND hDlg)
 {
     int i = 0, idx = -1;
     char tmp[64];
+    struct MultiDisplay *md = getdisplay (&workprefs);
 
     SendDlgItemMessage(hDlg, IDC_RESOLUTION, CB_RESETCONTENT, 0, 0);
-    while (DisplayModes[i].depth >= 0) {
-       if (DisplayModes[i].depth > 1 && DisplayModes[i].residx != idx) {
-           sprintf (tmp, "%dx%d", DisplayModes[i].res.width, DisplayModes[i].res.height);
+    while (md->DisplayModes[i].depth >= 0) {
+       if (md->DisplayModes[i].depth > 1 && md->DisplayModes[i].residx != idx) {
+           sprintf (tmp, "%dx%d", md->DisplayModes[i].res.width, md->DisplayModes[i].res.height);
            SendDlgItemMessage(hDlg, IDC_RESOLUTION, CB_ADDSTRING, 0, (LPARAM)tmp);
-           idx = DisplayModes[i].residx;
+           idx = md->DisplayModes[i].residx;
        }
        i++;
     }
@@ -4718,7 +4722,6 @@ static void values_from_displaydlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
                if (Displays[posn].disabled)
                    posn = 0;
                workprefs.gfx_display = posn;
-               DisplayModes = Displays[workprefs.gfx_display].DisplayModes;
                init_resolution_combo (hDlg);
                init_display_mode (hDlg);
            }
@@ -4728,6 +4731,7 @@ static void values_from_displaydlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
            if (posn != CB_ERR)
                workprefs.gfx_resolution = posn;
        } else if (LOWORD (wParam) == IDC_RESOLUTION || LOWORD(wParam) == IDC_RESOLUTIONDEPTH) {
+           struct MultiDisplay *md = getdisplay (&workprefs);
            LRESULT posn1, posn2;
            posn1 = SendDlgItemMessage (hDlg, IDC_RESOLUTION, CB_GETCURSEL, 0, 0);
            if (posn1 == CB_ERR)
@@ -4735,23 +4739,23 @@ static void values_from_displaydlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
            posn2 = SendDlgItemMessage (hDlg, IDC_RESOLUTIONDEPTH, CB_GETCURSEL, 0, 0);
            if (posn2 == CB_ERR)
                return;
-           for (i = 0; DisplayModes[i].depth >= 0; i++) {
-               if (DisplayModes[i].residx == posn1)
+           for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
+               if (md->DisplayModes[i].residx == posn1)
                    break;
            }
-           if (DisplayModes[i].depth < 0)
+           if (md->DisplayModes[i].depth < 0)
                return;
            j = i;
-           while (DisplayModes[i].residx == posn1) {
-               if (DisplayModes[i].depth == gui_display_depths[posn2])
+           while (md->DisplayModes[i].residx == posn1) {
+               if (md->DisplayModes[i].depth == gui_display_depths[posn2])
                    break;
                i++;
            }
-           if (DisplayModes[i].residx != posn1)
+           if (md->DisplayModes[i].residx != posn1)
                i = j;
-           workprefs.gfx_size_fs.width  = DisplayModes[i].res.width;
-           workprefs.gfx_size_fs.height = DisplayModes[i].res.height;
-           switch(DisplayModes[i].depth)
+           workprefs.gfx_size_fs.width  = md->DisplayModes[i].res.width;
+           workprefs.gfx_size_fs.height = md->DisplayModes[i].res.height;
+           switch(md->DisplayModes[i].depth)
            {
            case 2:
                workprefs.color_mode = 2;
index ceb874a22a146c045e547681c2971729d23ff4d1..a15a5eec477e73619e3236085f40c3356b295507 100755 (executable)
@@ -1,4 +1,12 @@
 
+Beta 1:
+
+- huge memory leak fixed (display mode switch)
+- fullscreen color depth change didn't work on the fly
+- multi monitor resolution list may only have listed primary monitor's
+  resolutions
+- OpenGL fullscreen works again
+
 Beta 0.1:
 
 - "always on top" change works on the fly