]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1600b19.zip
authorToni Wilen <twilen@winuae.net>
Sat, 28 Mar 2009 15:05:19 +0000 (17:05 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:45:31 +0000 (21:45 +0200)
16 files changed:
drawing.c
filesys.c
include/fsdb.h
include/sysdeps.h
include/uae.h
main.c
od-win32/debug_win32.c
od-win32/dinput.c
od-win32/direct3d.c
od-win32/fsdb_win32.c
od-win32/posixemu.c
od-win32/sounddep/sound.c
od-win32/win32.c
od-win32/win32.h
od-win32/winuaechangelog.txt
savestate.c

index 0a0927c3e2beb1081521173a4824e0114f7bafbd..1edd21a35b57ca54742a133fabfa3c14c0dc0e2b 100644 (file)
--- a/drawing.c
+++ b/drawing.c
@@ -391,13 +391,17 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy)
        return 0;
 
     if (doublescan <= 0) {
-       if ((w >> currprefs.gfx_resolution) < MIN_DISPLAY_W)
+       if ((w >> currprefs.gfx_resolution) < MIN_DISPLAY_W) {
+           dx += (w - (MIN_DISPLAY_W << currprefs.gfx_resolution)) / 2;
            w = MIN_DISPLAY_W << currprefs.gfx_resolution;
+       }
        if ((h >> dbl1) < MIN_DISPLAY_H) {
-           if (gcloh > MIN_DISPLAY_H)
+           if (gcloh > MIN_DISPLAY_H) {
                h = gcloh;
-           else
+           } else {
+               dy += (h - (MIN_DISPLAY_H << dbl1)) / 2;
                h = MIN_DISPLAY_H << dbl1;
+           }
        }
        if ((w >> currprefs.gfx_resolution) > MAX_DISPLAY_W) {
            dx += (w - (MAX_DISPLAY_W << currprefs.gfx_resolution)) / 2;
index c7febfe8dbfe9f2b9204d8a1923f5f2f17e01a0c..d61c1ad70c29c070682eb6d9b0590bb91bc60ff5 100644 (file)
--- a/filesys.c
+++ b/filesys.c
@@ -2597,6 +2597,8 @@ get_time (time_t t, long* days, long* mins, long* ticks)
     /* ticks past minute @ 50Hz */
 
     t -= diff;
+    if (t < 0)
+       t = 0;
     *days = t / secs_per_day;
     t -= *days * secs_per_day;
     *mins = t / 60;
@@ -2608,9 +2610,19 @@ static time_t
 put_time (long days, long mins, long ticks)
 {
     time_t t;
+
+    if (days < 0)
+       days = 0;
+    if (days > 9900 * 365)
+       days = 9900 * 365; // in future far enough?
+    if (mins < 0 || mins >= 24 * 60)
+       mins = 0;
+    if (ticks < 0 || ticks >= 60 * 50)
+       ticks = 0;
+
     t = ticks / 50;
     t += mins * 60;
-    t += days * secs_per_day;
+    t += ((uae_u64)days) * secs_per_day;
     t += diff;
 
     return t;
@@ -3801,6 +3813,11 @@ static void action_set_comment (Unit * unit, dpacket packet)
 
     if (fsdb_cando (unit)) {
        commented = bstr (unit, comment);
+       if (_tcslen (commented) > 80) {
+           PUT_PCK_RES1 (packet, DOS_FALSE);
+           PUT_PCK_RES2 (packet, ERROR_COMMENT_TOO_BIG);
+           return;
+       }
        if (_tcslen (commented) > 0) {
            TCHAR *p = commented;
            commented = xmalloc (81 * sizeof (TCHAR));
@@ -4226,7 +4243,7 @@ action_set_date (Unit *unit, dpacket packet)
        return;
     }
 
-    ut.actime = ut.modtime = put_time(get_long (date), get_long (date + 4),
+    ut.actime = ut.modtime = put_time (get_long (date), get_long (date + 4),
                                      get_long (date + 8));
     a = find_aino (unit, lock, bstr (unit, name), &err);
     if (err == 0 && utime (a->nname, &ut) == -1)
@@ -4991,7 +5008,7 @@ void filesys_reset (void)
 static void filesys_prepare_reset2 (void)
 {
     UnitInfo *uip;
-    Unit *u;
+//    Unit *u;
     int i;
 
     uip = mountinfo.ui;
index 2182e3e5bd1477e91ca7da72fa2c9430a8e23eda..91dcd6cc79996d0ec6398459f9bb1db4274d34b6 100644 (file)
@@ -29,6 +29,7 @@
 #define ERROR_DIRECTORY_NOT_EMPTY      216
 #define ERROR_DEVICE_NOT_MOUNTED       218
 #define ERROR_SEEK_ERROR               219
+#define ERROR_COMMENT_TOO_BIG          220
 #define ERROR_DISK_IS_FULL             221
 #define ERROR_DELETE_PROTECTED         222
 #define ERROR_WRITE_PROTECTED          223
index 65ce6e7ce418fbd8c187c05940fe5d6948dfbf36..7538637bc0454dce5682fac8de36c5baeae55857 100644 (file)
@@ -336,7 +336,7 @@ struct direct
     TCHAR d_name[1];
 };
 #include <sys/utime.h>
-#define utimbuf _utimbuf
+#define utimbuf __utimbuf64
 #define USE_ZFILE
 
 #undef S_ISDIR
index 128ebf095a9dde30e1b6d8d1149cd9a0a613229f..4f1a47ca23409f80fef18afa3bc17f249444dfa4 100644 (file)
@@ -22,6 +22,7 @@ extern void uae_quit (void);
 extern void uae_restart (int, TCHAR*);
 extern void reset_all_systems (void);
 extern void target_reset (void);
+extern void target_addtorecent (const TCHAR*, int);
 
 extern int quit_program;
 
@@ -49,4 +50,4 @@ extern void fetch_configurationpath (TCHAR *out, int size);
 extern void fetch_screenshotpath (TCHAR *out, int size);
 extern void fetch_ripperpath (TCHAR *out, int size);
 extern void fetch_datapath (TCHAR *out, int size);
-extern int uaerand(void);
\ No newline at end of file
+extern int uaerand(void);
diff --git a/main.c b/main.c
index 448fb731edab0d3cf5a41ac20a55593816d94cff..212ea4a355b3fc1f5e485ad93f6520d88b4ac857 100644 (file)
--- a/main.c
+++ b/main.c
@@ -392,7 +392,7 @@ void fixup_prefs (struct uae_prefs *p)
 
 int quit_program = 0;
 static int restart_program;
-static TCHAR restart_config[256];
+static TCHAR restart_config[MAX_DPATH];
 
 void uae_reset (int hardreset)
 {
index 5420f47bcc5ef5960022b7c034dce60090d5c049..42c6b714d74af34fc8ce3f119b7f4f0cbc0f7408 100644 (file)
@@ -804,7 +804,7 @@ static LRESULT CALLBACK InputProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
 static LRESULT CALLBACK MemInputProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     HANDLE hdata;
-    LPTSTR lptstr;
+    LPWSTR lptstr;
     TCHAR allowed[] = L"1234567890abcdefABCDEF";
     int ok = 1;
     TCHAR addrstr[12];
@@ -828,7 +828,7 @@ static LRESULT CALLBACK MemInputProc (HWND hWnd, UINT message, WPARAM wParam, LP
        case WM_PASTE:
            if (!OpenClipboard(NULL))
                return TRUE;
-           hdata = GetClipboardData(CF_TEXT);
+           hdata = GetClipboardData(CF_UNICODETEXT);
            if (hdata) {
                lptstr = GlobalLock(hdata);
                if (lptstr) {
@@ -904,7 +904,7 @@ static INT_PTR CALLBACK AddrInputDialogProc(HWND hDlg, UINT msg, WPARAM wParam,
                        {
                                TCHAR addrstr[11] = { '0', 'x', '\0' };
 
-                               SendMessage(GetDlgItem(hDlg, IDC_DBG_MEMINPUT2), WM_GETTEXT, 9, (LPARAM)addrstr + 2);
+                               SendMessage(GetDlgItem(hDlg, IDC_DBG_MEMINPUT2), WM_GETTEXT, 9, (LPARAM)(addrstr + 2));
                                if (addrstr[2] != 0) {
                                        uae_u32 addr = _tcstoul(addrstr, NULL, 0);
                                        if (dbgpage[currpage].selection == IDC_DBG_MEM || dbgpage[currpage].selection == IDC_DBG_MEM2) {
@@ -933,7 +933,7 @@ static INT_PTR CALLBACK AddrInputDialogProc(HWND hDlg, UINT msg, WPARAM wParam,
 static void CopyListboxText(HWND hwnd, BOOL all)
 {
        HANDLE hdata;
-       LPTSTR lptstr;
+       LPWSTR lptstr;
        int i, count, start, end, size = 0;
 
        if (!OpenClipboard(hwnd))
@@ -953,7 +953,7 @@ static void CopyListboxText(HWND hwnd, BOOL all)
        for (i = start; i < end; i++)
                size += (SendMessage(hwnd, LB_GETTEXTLEN, i, 0) + 2);
        size++;
-       hdata = GlobalAlloc(GMEM_MOVEABLE, size);
+       hdata = GlobalAlloc(GMEM_MOVEABLE, size * sizeof (TCHAR));
        if (hdata) {
                int pos = 0;
                lptstr = GlobalLock(hdata);
@@ -966,7 +966,7 @@ static void CopyListboxText(HWND hwnd, BOOL all)
                        lptstr += (len + 2);
                }
         GlobalUnlock(hdata); 
-               SetClipboardData(CF_TEXT, hdata);
+               SetClipboardData(CF_UNICODETEXT, hdata);
        }
        CloseClipboard();
 }
@@ -1098,7 +1098,7 @@ static void ListboxEndEdit(HWND hwnd, BOOL acceptinput)
 static LRESULT CALLBACK ListboxEditProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     HANDLE hdata;
-    LPTSTR lptstr;
+    LPWSTR lptstr;
     TCHAR allowed[] = L"1234567890abcdefABCDEF ";
     int ok = 1, id;
     WNDPROC oldproc;
@@ -1147,7 +1147,7 @@ static LRESULT CALLBACK ListboxEditProc(HWND hWnd, UINT message, WPARAM wParam,
        case WM_PASTE:
            if (!OpenClipboard(NULL))
                return TRUE;
-           hdata = GetClipboardData(CF_TEXT);
+           hdata = GetClipboardData(CF_UNICODETEXT);
            if (hdata) {
                lptstr = GlobalLock(hdata);
                if (lptstr) {
index 5ed5854b7a30cf697fa836e580adf0092130c26d..f88412b860af23420b22bb28e2265376f22bf49a 100644 (file)
@@ -682,7 +682,7 @@ static void rawinputfriendlynames (void)
     }
 }
 
-static TCHAR *rawkeyboardlabels[] =
+static TCHAR *rawkeyboardlabels[256] =
 {
     L"ESCAPE",
     L"1",L"2",L"3",L"4",L"5",L"6",L"7",L"8",L"9",L"0",
@@ -697,7 +697,7 @@ static TCHAR *rawkeyboardlabels[] =
     L"NULOCK",L"SCROLL",L"NUMPAD7",L"NUMPAD8",L"NUMPAD9",L"SUBTRACT",
     L"NUMPAD4",L"NUMPAD5",L"NUMPAD6",L"ADD",L"NUMPAD1",L"NUMPAD2",L"NUMPAD3",L"NUMPAD0",
     L"DECIMAL",NULL,NULL,L"OEM_102",L"F11",L"F12",
-    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+    L"F13",L"F14",L"F15",L"F16",NULL,NULL,NULL,NULL,NULL,NULL,
     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
index 46abd7d6ec07315506a2637f9108a8651515becd..d78773dd1ebf1053349f053421cae5cbe4a60df8 100644 (file)
@@ -1,4 +1,3 @@
-
 #include <windows.h>
 #include "sysconfig.h"
 #include "sysdeps.h"
@@ -51,6 +50,7 @@ static int tin_w, tin_h, window_h, window_w;
 static int t_depth;
 static int required_sl_texture_w, required_sl_texture_h;
 static int vsync2, guimode;
+static int needclear;
 
 #define D3DFVF_TLVERTEX D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1
 struct TLVERTEX {
@@ -717,6 +717,7 @@ static void setupscenecoords (void)
     RECT sr, dr, zr;
     float w, h;
     float dw, dh;
+    static RECT sro, dro, zro;
 
 //    write_log (L"%dx%d %dx%d %dx%d\n", twidth, theight, tin_w, tin_h, window_w, window_h);
 
@@ -741,6 +742,13 @@ static void setupscenecoords (void)
        dw * tin_w / window_w,
        dh * tin_h / window_h,
        1.0f);
+
+    if (memcmp (&sr, &sro, sizeof (RECT)) || memcmp (&dr, &dro, sizeof (RECT)) || memcmp (&zr, &zro, sizeof (RECT))) {
+       needclear = 1;
+       sro = sr;
+       dro = dr;
+       zro = zr;
+    }
 }
 
 static void createvertex (void)
@@ -1212,8 +1220,12 @@ static void D3D_render2 (int clear)
     setupscenecoords ();
     settransform ();
     hr = IDirect3DDevice9_BeginScene (d3ddev);
-    if (clear)
-       hr = IDirect3DDevice9_Clear (d3ddev, 0L, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0L );
+    if (clear || needclear) {
+       hr = IDirect3DDevice9_Clear (d3ddev, 0L, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0L );
+       if (FAILED (hr))
+           write_log (L"IDirect3DDevice9_Clear() failed: %s\n", D3D_ErrorString (hr));
+       needclear = 0;
+    }
     if (psActive) {
         UINT uPasses, uPass;
        LPDIRECT3DSURFACE9 lpRenderTarget;
@@ -1294,8 +1306,8 @@ void D3D_unlocktexture (void)
     RECT r;
 
     hr = IDirect3DTexture9_UnlockRect (texture, 0);
-    r.left = 0; r.right = twidth;
-    r.top = 0; r.bottom = theight;
+    r.left = 0; r.right = window_w;
+    r.top = 0; r.bottom = window_h;
     hr = IDirect3DTexture9_AddDirtyRect (texture, &r);
 
     D3D_render2 (0);
index 71399ba00ed0b9f9a49d8f32250e3d6be868425e..6aa654a0cc16a850b9d90d651a6bf02fbde32f1e 100644 (file)
@@ -865,6 +865,7 @@ int dos_errno (void)
      case ERROR_FILE_NOT_FOUND:
      case ERROR_INVALID_DRIVE:
      case ERROR_INVALID_NAME:
+     case ERROR_PATH_NOT_FOUND:
        return ERROR_OBJECT_NOT_AROUND;
 
      case ERROR_HANDLE_DISK_FULL:
@@ -885,8 +886,6 @@ int dos_errno (void)
 
      default:
        {
-           uae_u8 *p = 0;
-           *p = 0;
            gui_message (L"Unimplemented error %d\nContact author!", e);
        }
        return ERROR_NOT_IMPLEMENTED;
index 0834386a4f5b2c396f1e69f7531cd773b279a116..459f162a688b582c2b3a9bb49bb99efe9e34015b 100644 (file)
@@ -143,23 +143,38 @@ static int setfiletime (const TCHAR *name, unsigned int days, int minute, int ti
 {
     FILETIME LocalFileTime, FileTime;
     HANDLE hFile;
-    int success;
+
     if ((hFile = CreateFile (name, GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL)) == INVALID_HANDLE_VALUE)
        return 0;
 
-    *(__int64 *)&LocalFileTime = (((__int64)(377*365+91+days)*(__int64)1440+(__int64)minute)*(__int64)(60*50)+(__int64)tick)*(__int64)200000;
+    for (;;) {
+       ULARGE_INTEGER lft;
 
-    if (tolocal) {
-       if (!LocalFileTimeToFileTime (&LocalFileTime,&FileTime))
+       lft.QuadPart = (((uae_u64)(377*365+91+days)*(uae_u64)1440+(uae_u64)minute)*(uae_u64)(60*50)+(uae_u64)tick)*(uae_u64)200000;
+       LocalFileTime.dwHighDateTime = lft.HighPart;
+       LocalFileTime.dwLowDateTime = lft.LowPart;
+        if (tolocal) {
+           if (!LocalFileTimeToFileTime (&LocalFileTime, &FileTime))
+               FileTime = LocalFileTime;
+       } else {
            FileTime = LocalFileTime;
-    } else {
-       FileTime = LocalFileTime;
+       }
+       if (!SetFileTime (hFile, &FileTime, &FileTime, &FileTime)) {
+           if (days > 47846) { // > 2108-12-31 (fat limit)
+               days = 47846;
+               continue;
+           }
+           if (days < 730) { // < 1980-01-01 (fat limit)
+               days = 730;
+               continue;
+           }
+       }
+       break;
     }
 
-    success = SetFileTime (hFile,&FileTime,&FileTime,&FileTime);
     CloseHandle (hFile);
 
-    return success;
+    return 1;
 }
 
 int posixemu_utime (const TCHAR *name, struct utimbuf *ttime)
@@ -180,7 +195,7 @@ int posixemu_utime (const TCHAR *name, struct utimbuf *ttime)
     if (setfiletime (name, days, mins, ticks, tolocal))
        result = 0;
 
-       return result;
+    return result;
 }
 
 void uae_sem_init (uae_sem_t * event, int manual_reset, int initial_state)
index 49b7d3f796d574e5a51788dd442652bb0432b170..63d342f8f00a305e11fe7aa3c29a0e238d2cd640 100644 (file)
@@ -1344,7 +1344,7 @@ static void PortAudioEnumerate (struct sound_device *sds)
     struct sound_device *sd;
     int num;
     int i, j;
-    TCHAR tmp[MAX_DPATH];
+    TCHAR tmp[MAX_DPATH], *s1, *s2;
 
     num = Pa_GetDeviceCount ();
     for (j = 0; j < num; j++) {
@@ -1365,7 +1365,11 @@ static void PortAudioEnumerate (struct sound_device *sds)
        }
        if (i >= MAX_SOUND_DEVICES)
            return;
-       _stprintf (tmp, L"[%s] %s", hai->name, di->name);
+       s1 = au (hai->name);
+       s2 = au (di->name);
+       _stprintf (tmp, L"[%s] %s", s1, s2);
+       xfree (s2);
+       xfree (s1);
        sd->type = SOUND_DEVICE_PA;
        sd->name = my_strdup (tmp);
        sd->cfgname = my_strdup (tmp);
@@ -1397,16 +1401,26 @@ int enumerate_sound_devices (void)
        {
            HMODULE hm = WIN32_LoadLibrary (L"portaudio_x86.dll");
            if (hm) {
+               TCHAR *s;
                PaError err;
                write_log (L"Enumerating PortAudio devices..\n");
-               write_log (L"%s (%d)\n", Pa_GetVersionText (), Pa_GetVersion ());
-               err = Pa_Initialize ();
-               if (err == paNoError) {
-                   PortAudioEnumerate (sound_devices);
+               s = au (Pa_GetVersionText ());
+               write_log (L"%s (%d)\n", s, Pa_GetVersion ());
+               xfree (s);
+               if (Pa_GetVersion () >= 1899) {
+                   err = Pa_Initialize ();
+                   if (err == paNoError) {
+                       PortAudioEnumerate (sound_devices);
+                   } else {
+                       s = au (Pa_GetErrorText (err));
+                       write_log (L"Portaudio initializiation failed: %d (%s)\n",
+                           err, s);
+                       xfree (s);
+                       FreeLibrary (hm);
+                   }
                } else {
-                   write_log (L"Portaudio initializiation failed: %d (%s)\n",
-                       err, Pa_GetErrorText (err));
-                   FreeLibrary (hm);
+                   write_log (L"Too old PortAudio library\n");
+                   FreeLibrary (hm);
                }
            }
        }
index 15152cc2bf9b7c106186e828f57a070fa38ba308..5be3248aadc39823f4f63a9f4dcdb6f445fcf4c3 100644 (file)
@@ -16,7 +16,7 @@
 #include "sysconfig.h"
 
 
-#define _WIN32_WINNT 0x600 /* XButtons + MOUSEHWHEEL */
+#define _WIN32_WINNT 0x700 /* XButtons + MOUSEHWHEEL=XP, Jump List=Win7 */
 
 #include <windows.h>
 #include <commctrl.h>
@@ -1840,7 +1840,7 @@ static int WIN32_InitLibraries (void)
     pSetCurrentProcessExplicitAppUserModelID = (SETCURRENTPROCESSEXPLICITAPPUSERMODEIDD)GetProcAddress (
        GetModuleHandle (L"shell32.dll"), "SetCurrentProcessExplicitAppUserModelID");
     if (pSetCurrentProcessExplicitAppUserModelID)
-       pSetCurrentProcessExplicitAppUserModelID (L"Arabuusimiehet.WinUAE");
+       pSetCurrentProcessExplicitAppUserModelID (WINUAEAPPNAME);
 
     hRichEdit = LoadLibrary (L"RICHED32.DLL");
     return 1;
@@ -2661,10 +2661,11 @@ static int shell_associate_2 (const TCHAR *extension, const TCHAR *shellcommand,
                              const TCHAR *description, const TCHAR *ext2)
 {
     TCHAR rpath1[MAX_DPATH], rpath2[MAX_DPATH], progid2[MAX_DPATH];
-    HKEY rkey, key1;
+    HKEY rkey, key1, key2;
     DWORD disposition;
     const TCHAR *progid = L"WinUAE";
     int def = !_tcscmp (extension, L".uae");
+    TCHAR *defprogid;
     UAEREG *fkey;
 
     _tcscpy (progid2, progid);
@@ -2673,13 +2674,14 @@ static int shell_associate_2 (const TCHAR *extension, const TCHAR *shellcommand,
         rkey = HKEY_LOCAL_MACHINE;
     else
         rkey = HKEY_CURRENT_USER;
+    defprogid = def ? progid : progid2;
 
     _tcscpy (rpath1, L"Software\\Classes\\");
     _tcscpy (rpath2, rpath1);
     _tcscat (rpath2, extension);
     if (RegCreateKeyEx (rkey, rpath2, 0, NULL, REG_OPTION_NON_VOLATILE,
        KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) {
-       RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)(def ? progid : progid2), (_tcslen (def ? progid : progid2) + 1) * sizeof (TCHAR));
+       RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)defprogid, (_tcslen (defprogid) + 1) * sizeof (TCHAR));
        if (perceivedtype)
            RegSetValueEx (key1, L"PerceivedType", 0, REG_SZ, (CONST BYTE *)perceivedtype, (_tcslen (perceivedtype) + 1) * sizeof (TCHAR));
        RegCloseKey (key1);
@@ -2689,9 +2691,23 @@ static int shell_associate_2 (const TCHAR *extension, const TCHAR *shellcommand,
     if (!def)
        _tcscat (rpath2, ext2 ? ext2 : extension);
     if (description) {
-       if (RegCreateKeyEx (rkey, rpath2, 0, NULL, REG_OPTION_NON_VOLATILE,
-           KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) {
+       if (RegCreateKeyEx (rkey, rpath2, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) {
+           TCHAR tmp[MAX_DPATH];
            RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)description, (_tcslen (description) + 1) * sizeof (TCHAR));
+           RegSetValueEx (key1, L"AppUserModelID", 0, REG_SZ, (CONST BYTE *)WINUAEAPPNAME, (_tcslen (WINUAEAPPNAME) + 1) * sizeof (TCHAR));
+           _tcscpy (tmp, rpath2);
+           _tcscat (tmp, L"\\CurVer");
+           if (RegCreateKeyEx (rkey, tmp, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key2, &disposition) == ERROR_SUCCESS) {
+               RegSetValueEx (key2, L"", 0, REG_SZ, (CONST BYTE *)defprogid, (_tcslen (defprogid) + 1) * sizeof (TCHAR));
+               RegCloseKey (key2);
+           }
+           _tcscpy (tmp, rpath2);
+           _tcscat (tmp, L"\\DefaultIcon");
+           if (RegCreateKeyEx (rkey, tmp, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key2, &disposition) == ERROR_SUCCESS) {
+               _stprintf (tmp, L"%s,-1", _wpgmptr);
+               RegSetValueEx (key2, L"", 0, REG_SZ, (CONST BYTE *)tmp, (_tcslen (tmp) + 1) * sizeof (TCHAR));
+               RegCloseKey (key2);
+           }
            RegCloseKey (key1);
        }
     }
@@ -3626,6 +3642,7 @@ static int process_arg (TCHAR *cmdline, TCHAR **xargv, TCHAR ***xargv3)
     TCHAR tmp[MAX_DPATH];
     int fd, ok, added;
 
+    *xargv3 = NULL;
     argv = parseargstring (cmdline);
     if (argv == NULL)
        return 0;
@@ -3741,6 +3758,7 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR
 #endif
 
     argv = xcalloc (sizeof (TCHAR*), 32);
+    argv3 = NULL;
     argc = process_arg (lpCmdLine, argv, &argv3);
 
     argv2 = WIN32_InitRegistry (argv);
@@ -3750,7 +3768,7 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR
     logging_init ();
     if (_tcslen (lpCmdLine) > 0)
        write_log (L"'%s'\n", lpCmdLine);
-    if (argv3[0]) {
+    if (argv3 && argv3[0]) {
        write_log (L"params:\n");
        for (i = 0; argv3[i]; i++)
            write_log (L"%d: '%s'\n", i + 1, argv3[i]);
@@ -4275,6 +4293,30 @@ int get_guid_target (uae_u8 *out)
     return 1;
 }
 
+typedef HRESULT (CALLBACK* SHCREATEITEMFROMPARSINGNAME)
+    (PCWSTR,IBindCtx*,REFIID,void**); // Vista+ only
+
+
+void target_addtorecent (const TCHAR *name, int t)
+{
+    if (os_win7) {
+       SHCREATEITEMFROMPARSINGNAME pSHCreateItemFromParsingName;
+       SHARDAPPIDINFO shard;
+       pSHCreateItemFromParsingName = (SHCREATEITEMFROMPARSINGNAME)GetProcAddress (
+           GetModuleHandle (L"shell32.dll"), "SHCreateItemFromParsingName");
+       if (!pSHCreateItemFromParsingName)
+           return;
+       shard.pszAppID = WINUAEAPPNAME;
+       if (SUCCEEDED (pSHCreateItemFromParsingName (name, NULL, &IID_IShellItem, &shard.psi))) {
+           SHAddToRecentDocs (SHARD_APPIDINFO, &shard);
+           IShellItem_Release (shard.psi);
+       }
+    } else {
+       SHAddToRecentDocs (SHARD_PATH, name);
+    }
+}
+
+
 void target_reset (void)
 {
     clipboard_reset ();
index 403c015792e3b5c9c339e597289b1a2ddf437121..ba9e893cac0bda5f0bafa8f8afbfaa6e711ac082 100644 (file)
 
 #define WINUAEPUBLICBETA 1
 
-#define WINUAEBETA L"18"
-#define WINUAEDATE MAKEBD(2009, 3, 25)
+#define WINUAEBETA L"19"
+#define WINUAEDATE MAKEBD(2009, 3, 28)
 #define WINUAEEXTRA L""
 #define WINUAEREV L""
 
 #define IHF_WINDOWHIDDEN 6
 #define NORMAL_WINDOW_STYLE (WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | WS_SIZEBOX)
 
+#define WINUAEAPPNAME L"Arabuusimiehet.WinUAE"
 extern HMODULE hUIDLL;
 extern HWND hAmigaWnd, hMainWnd, hHiddenWnd, hGUIWnd;
 extern RECT amigawin_rect;
index 1b7e9bc4dbe35b06759e750734b65f3755bc7e56..af4b3d11915b4067dfe54533aeee393528ccbb38 100644 (file)
@@ -6,13 +6,27 @@ Beta 19:
   <Paths> can be path to a configuration file, any supported floppy
   disk image file or statefile, multiple paths supported, path
   parsing stops when first parameter beginning with '-' or '/' is
-  detected. Now manually created Windows file extension mappings work
-  as expected. Automatically disables "show gui on startup".
+  detected. Automatically disables "show gui on startup".
 - improved configuration parsing, now for example something="path"
   and command line -something="path" works, previously " (or ')
-  were not accepted
-- clear dsound buffer when sound autodeactivates, there could have
-  been some old sound data left if buffer size is really big
+  was not parsed properly
+- clear dsound buffer when sound autodeactivates, it was possible to
+  have some old sound data left in buffer if buffer size is really big
+- gui debugger clipboard and enter address option fixed (b15)
+- autoscaled screen was off center if display size was too small
+- directory filesystem "unimplemented error 3" fix
+- directory filesystem "unimplemented error 87" when setting file/dir
+  datestamp and drive is in FAT partition (FAT date range is not as
+  large as Amiga supported date range, AmigaDOS minimum date is
+  1978-01-01, FAT minimum is 1980-01-01)
+- directory filesystem date underflow fixed, host-side date earlier
+  than 1978-01-01 caused underflow, result usually was date in
+  far future.. (bug since the beginning most likely)
+- updated directory filesystem date calculations to 64-bit
+- directory filesystem ERROR_COMMENT_TOO_BIG implemented
+- PortAudio works again, also accept only v1899 or newer library
+- clear D3D filter screen when autoscale settings change
+- added F13-F16 to rawkeyboard keycode array
 
 Beta 18:
 
index 6409be5dacae83a87f178404171d058d1c7ff675..a2bf51bcd763ee55bd2fda4b81fb2bf1139ef94c 100644 (file)
@@ -571,6 +571,7 @@ void restore_state (const TCHAR *filename)
     restore_blitter_finish ();
     restore_akiko_finish ();
     restore_p96_finish ();
+    target_addtorecent (filename, 0);
     return;
 
     error: