]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1520.zip
authorToni Wilen <twilen@winuae.net>
Fri, 5 Sep 2008 12:36:58 +0000 (15:36 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:42:58 +0000 (21:42 +0200)
13 files changed:
include/blkdev.h
od-win32/WinUAE_Install.nsi
od-win32/blkdev_win32_aspi.c
od-win32/blkdev_win32_ioctl.c
od-win32/blkdev_win32_spti.c
od-win32/registry.c
od-win32/registry.h
od-win32/win32.c
od-win32/win32.h
od-win32/win32gfx.c
od-win32/win32gui.c
od-win32/winuaechangelog.txt
scsiemul.c

index 57d5712c9e29c97c6e369421614f181edab2de68..994ca54f75543c4db8883d4fdeb71e5bf2c58469 100755 (executable)
@@ -40,7 +40,7 @@ struct device_info {
     int bytespersector;
     int bus, target, lun;
     int id;
-    char *label;
+    char label[MAX_DPATH];
 };
 
 struct device_scsi_info {
index ed3c1a3cf955f3c5845648c6d3f58a4b75d24d05..64b6d095a01e1464f9d43c1634135463474b6c09 100755 (executable)
@@ -1,5 +1,5 @@
 !define PRODUCT_NAME "WinUAE"
-!define PRODUCT_VERSION "1.5.1"
+!define PRODUCT_VERSION "1.5.2"
 !define PRODUCT_PUBLISHER "Arabuusimiehet"
 !define PRODUCT_WEB_SITE "http://www.winuae.net/"
 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\winuae.exe"
index 38baac99bf84198a7bf5e6073d5efaa0f75ed71b..42c0fe9d0677812f476565be61b84acdb2287197 100755 (executable)
@@ -949,7 +949,7 @@ static struct device_info *info_device (int unitnum, struct device_info *di)
     mediacheck_full (unitnum, di);
     di->id = unitnum + 1;
     di->removable = sif->removable;
-    di->label = my_strdup (sif->label);
+    strcpy (di->label, sif->label);
     if (log_scsi) {
        write_log ("MI=%d TP=%d WP=%d CY=%d BK=%d '%s'\n",
            di->media_inserted, di->type, di->write_protected, di->cylinders, di->bytespersector, di->label);
index ab56d7fb87e9816bbfd996d206919480a52a0b4c..32cff49329dc515bdaf4e5a27dde67edb3403605 100755 (executable)
@@ -895,7 +895,6 @@ static struct device_info *info_device (int unitnum, struct device_info *di)
     di->write_protected = ciw32[unitnum].type == DRIVE_CDROM ? 1 : 0;
     di->type = ciw32[unitnum].type == DRIVE_CDROM ? INQ_ROMD : INQ_DASD;
     di->id = ciw32[unitnum].drvletter;
-    di->label = xmalloc(16);
     sprintf (di->label, "Drive %c:", ciw32[unitnum].drvletter);
     return di;
 }
index 658d68b82c0eab1f372e0e318e144162e9e754ed..caae6164e95cadf9ea927cbe4d78bfdbe6a8dccf 100755 (executable)
@@ -362,6 +362,8 @@ static int mediacheck_full (int unitnum, struct device_info *di)
            di->write_protected = (p[3] & 0x80) ? 1 : 0;
        }
     }
+//    write_log ("mediacheck_full(%d,%d,%d,%d,%d)\n",
+//     di->bytespersector, di->sectorspertrack, di->trackspercylinder, di->cylinders, di->write_protected);
     return 1;
 }
 
@@ -428,12 +430,12 @@ static int adddrive (char *drvpath, int bus, int pathid, int targetid, int lunid
        return 0;
     for (i = 0; i < total_devices; i++) {
        di = &dev_info[i];
-       if (!strcmp(drvpath, di->drvpath))
+       if (!strcmp (drvpath, di->drvpath))
            return 0;
     }
     write_log ("SPTI: unit %d '%s' added\n", total_devices, drvpath);
     di = &dev_info[total_devices];
-    di->drvpath = my_strdup(drvpath);
+    di->drvpath = my_strdup (drvpath);
     di->type = 0;
     di->bus = bus;
     di->path = pathid;
@@ -443,18 +445,18 @@ static int adddrive (char *drvpath, int bus, int pathid, int targetid, int lunid
     total_devices++;
     if (open_scsi_device (cnt)) {
        for (i = 0; i < cnt; i++) {
-           if (!memcmp(di->inquirydata, dev_info[i].inquirydata, INQUIRY_SIZE) && di->scanmode != dev_info[i].scanmode) {
+           if (!memcmp (di->inquirydata, dev_info[i].inquirydata, INQUIRY_SIZE) && di->scanmode != dev_info[i].scanmode) {
                write_log ("duplicate device, skipped..\n");
                break;
            }
        }
        if (i == cnt) {
            freeit = 0;
-           close_scsi_device(cnt);
+           close_scsi_device (cnt);
        }
     }
     if (freeit) {
-       free_scsi_device(cnt);
+       free_scsi_device (cnt);
        total_devices--;
     }
     return 1;
@@ -466,7 +468,7 @@ static struct device_info *info_device (int unitnum, struct device_info *di)
     if (unitnum >= MAX_TOTAL_DEVICES || dev_info[unitnum].handle == INVALID_HANDLE_VALUE)
        return 0;
     dispti = &dev_info[unitnum];
-    di->label = my_strdup(dispti->name);
+    strcpy (di->label, dispti->name);
     di->bus = 0;
     di->target = unitnum;
     di->lun = 0;
index 402baf77db49c301185fe3656f8b8fa7bcee3c53..791ef190ac9b46725f635b2c51718ede7c26739b 100755 (executable)
@@ -436,3 +436,8 @@ void regstatus (void)
     if (inimode)
        write_log ("WARNING: Unsupported '%s' enabled\n", inipath);
 }
+
+int getregmode (void)
+{
+    return inimode;
+}
\ No newline at end of file
index ac2845ac2337201339361903af758f638e15305d..58d67c8867ae2930b35344ebeb428cc33d9e161e 100755 (executable)
@@ -5,6 +5,7 @@ typedef struct UAEREG {
     char *inipath;
 } UAEREG;
 
+extern int getregmode (void);
 extern int reginitializeinit (const char *path);
 extern void regstatus (void);
 
index 97f4df8da0b93678e7609ab4d1bb6d40d2c3a745..e027bb745094ef48011c06126c3a5aee51e62343 100755 (executable)
@@ -652,10 +652,12 @@ void setmouseactivexy (int x, int y, int dir)
        x += (amigawin_rect.right - amigawin_rect.left) / 2;
        y += (amigawin_rect.bottom - amigawin_rect.top) / 2;
     }
-    disablecapture ();
-    SetCursorPos (x, y);
-    if (dir)
-       recapture = 1;
+    if (mouseactive) {
+       disablecapture ();
+       SetCursorPos (x, y);
+       if (dir)
+           recapture = 1;
+    }
 }
 
 static void handleXbutton (WPARAM wParam, int updown)
@@ -769,7 +771,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
     case WM_MOUSEWHEEL:
        if (dinput_winmouse () >= 0) {
            int val = ((short)HIWORD (wParam));
-           write_log ("dinput_winmouse=%d dinput_wheelbuttonstart=%d wheel=%d\n", dinput_winmouse(), dinput_wheelbuttonstart(), val);
+           //write_log ("dinput_winmouse=%d dinput_wheelbuttonstart=%d wheel=%d\n", dinput_winmouse(), dinput_wheelbuttonstart(), val);
            setmousestate (dinput_winmouse (), 2, val, 0);
            if (val < 0)
                setmousebuttonstate (dinput_winmouse (), dinput_wheelbuttonstart () + 0, -1);
@@ -2327,6 +2329,25 @@ static void initpath (char *name, char *path)
     set_path (name, NULL);
 }
 
+static void romlist_add2 (char *path, struct romdata *rd)
+{
+    if (getregmode ()) {
+       int ok = 0;
+       char tmp[MAX_DPATH];
+       if (path[0] == '/' || path[0] == '\\')
+           ok = 1;
+       if (strlen (path) > 1 && path[1] == ':')
+           ok = 1;
+       if (!ok) {
+           strcpy (tmp, start_path_exe);
+           strcat (tmp, path);
+           romlist_add (tmp, rd);
+           return;
+       }
+    }
+    romlist_add (path, rd);
+}
+
 extern int scan_roms (int);
 void read_rom_list (void)
 {
@@ -2369,10 +2390,10 @@ void read_rom_list (void)
                        s = strchr (s2, '\"');
                        if (s)
                            *s = 0;
-                       romlist_add (s2, rd);
+                       romlist_add2 (s2, rd);
                        xfree (s2);
                    } else {
-                       romlist_add (tmp2, rd);
+                       romlist_add2 (tmp2, rd);
                    }
                }
            }
index 121300dee319b9ad57dc69b09c18baace0ed6bd4..d12ad0eeb12ebcd592e730df3b43d8b97df05e0e 100755 (executable)
 #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
 #define GETBDD(x) ((x) % 100)
 
-#define WINUAEBETA 4
-#define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2008, 8, 30)
+#define WINUAEPUBLICBETA 0
+
+#define WINUAEBETA 0
+#define WINUAEDATE MAKEBD(2008, 9, 5)
 #define WINUAEEXTRA ""
 #define WINUAEREV ""
 
index b90ae47327f2d2f62496b8c714e7ebbeda6ea1e6..ccb03af300e8b6590a31eeb5e5073ee145b5fe4d 100755 (executable)
@@ -1677,6 +1677,8 @@ static void createstatuswindow (void)
     int drive_width, hd_width, cd_width, power_width, fps_width, idle_width, snd_width;
     int num_parts = 11;
     double scaleX, scaleY;
+    WINDOWINFO wi;
+    int extra;
 
     if (hStatusWnd) {
        ShowWindow (hStatusWnd, SW_HIDE);
@@ -1687,6 +1689,9 @@ static void createstatuswindow (void)
        0, 0, 0, 0, hMainWnd, (HMENU) 1, hInst, NULL);
     if (!hStatusWnd)
        return;
+    wi.cbSize = sizeof wi;
+    GetWindowInfo (hMainWnd, &wi);
+    extra = wi.rcClient.top - wi.rcWindow.top;
 
     hdc = GetDC (hStatusWnd);
     scaleX = GetDeviceCaps (hdc, LOGPIXELSX) / 96.0;
@@ -1706,7 +1711,7 @@ static void createstatuswindow (void)
        lpParts = LocalLock (hloc);
        /* Calculate the right edge coordinate for each part, and copy the coords
         * to the array.  */
-       lpParts[0] = rc.right - (drive_width * 4) - power_width - idle_width - fps_width - cd_width - hd_width - snd_width - 16;
+       lpParts[0] = rc.right - (drive_width * 4) - power_width - idle_width - fps_width - cd_width - hd_width - snd_width - extra;
        lpParts[1] = lpParts[0] + snd_width;
        lpParts[2] = lpParts[1] + idle_width;
        lpParts[3] = lpParts[2] + fps_width;
index c0707b98d35ba26207ea4f31d08d7fb0da2e08a4..d4e0fa1b301e58085fb81a9e815a8dea1db8b78a 100755 (executable)
@@ -772,6 +772,12 @@ static struct romdata *scan_single_rom (char *path)
     return scan_single_rom_2 (z);
 }
 
+static void abspathtorelative (char *name)
+{
+    if (!strnicmp (start_path_exe, name, strlen (start_path_exe)))
+       memmove (name, name + strlen (start_path_exe), strlen (name) - strlen (start_path_exe) + 1);
+}
+
 static int addrom (UAEREG *fkey, struct romdata *rd, char *name)
 {
     char tmp1[MAX_DPATH], tmp2[MAX_DPATH];
@@ -786,6 +792,8 @@ static int addrom (UAEREG *fkey, struct romdata *rd, char *name)
     getromname (rd, tmp2);
     if (name) {
        strcat (tmp2, " / \"");
+       if (getregmode ())
+           abspathtorelative (name);
        strcat (tmp2, name);
        strcat (tmp2, "\"");
     }
@@ -2578,7 +2586,6 @@ static int clicked_entry = -1;
 #define LV_DISK 4
 
 static int listview_num_columns;
-static int listview_column_width[HARDDISK_COLUMNS];
 
 void InitializeListView (HWND hDlg)
 {
@@ -2597,6 +2604,7 @@ void InitializeListView (HWND hDlg)
     int width = 0;
     int items = 0, result = 0, i, j, entry = 0, temp = 0;
     char tmp[10], tmp2[MAX_DPATH];
+    int listview_column_width[HARDDISK_COLUMNS];
 
     if (hDlg == pages[HARDDISK_ID]) {
        listview_num_columns = HARDDISK_COLUMNS;
@@ -2885,15 +2893,16 @@ static int listview_entry_from_click (HWND list, int *column)
                int i, x;
                UINT flag = LVIS_SELECTED | LVIS_FOCUSED;
 
-               ListView_GetItemPosition(list, entry, &ppt);
+               ListView_GetItemPosition (list, entry, &ppt);
                x = ppt.x;
                ListView_SetItemState (list, entry, flag, flag);
                for (i = 0; i < listview_num_columns && column; i++) {
-                   if (x < point.x && x + listview_column_width[i] > point.x) {
+                   int cw = ListView_GetColumnWidth (list, i);
+                   if (x < point.x && x + cw > point.x) {
                        *column = i;
                        break;
                    }
-                   x += listview_column_width[i];
+                   x += cw;
                }
                return entry;
            }
index 7832c7ab54d5ce6c8e4c290c2f1855eedb417f1d..c3fee835c7229db65b46e62f9ca111e07fcd32e5 100755 (executable)
@@ -1,4 +1,11 @@
 
+Final
+
+- uaescsi.device only updated CMD_GETGEOMETRY parameters when emulation
+  was started (and also broke CMD_READ if there was no CD in drive)
+- "Magic mouse" tried to uncapture mouse when it was already uncaptured
+- save relative rom paths in ini-mode
+
 Beta 4: (final beta)
 
 - check openal32.dll version before using
@@ -9,6 +16,7 @@ Beta 4: (final beta)
   drivers are released, if ever. Do not ask stupid questions.)
 - fixed D3D 8876086C error if display number in configuration file was
   bigger than current number of displays
+- display mode switching mouse cursor handling tweaks
 
 Beta 3:
 
index e79561136ad18a2289d500a2e15178b547c03ce7..5c9dff61c93cd19e79c3f2e9262041ad0577f65e 100755 (executable)
@@ -269,12 +269,17 @@ void scsi_do_disk_change (int device_id, int insert)
 
     uae_sem_wait (&change_sem);
     for (i = 0; i < MAX_TOTAL_DEVICES; i++) {
-       if (devst[i].di.id == device_id) {
-           devst[i].changenum++;
+       struct devstruct *dev = &devst[i];
+       if (dev->di.id == device_id) {
+           if (dev->aunit >= 0) {
+               struct priv_devstruct *pdev = &pdevst[dev->aunit];
+               devinfo (pdev->mode, dev->unitnum, &dev->di);
+           }
+           dev->changenum++;
            j = 0;
            while (j < MAX_ASYNC_REQUESTS) {
-               if (devst[i].d_request_type[j] == ASYNC_REQUEST_CHANGEINT) {
-                   uae_Cause (devst[i].d_request_data[j]);
+               if (dev->d_request_type[j] == ASYNC_REQUEST_CHANGEINT) {
+                   uae_Cause (dev->d_request_data[j]);
                }
                j++;
            }
@@ -393,12 +398,14 @@ static int command_write (int mode, struct devstruct *dev, uaecptr data, uae_u64
 static int command_cd_read (int mode, struct devstruct *dev, uaecptr data, uae_u64 offset, uae_u32 length, uae_u32 *io_actual)
 {
     uae_u8 *temp;
-    uae_u32 len, sector;
+    uae_u32 len, sector, startoffset;
 
-    uae_u32 startoffset = offset % dev->di.bytespersector;
+    *io_actual = 0;
+    if (dev->di.bytespersector == 0)
+       dev->di.bytespersector = 2048;
+    startoffset = offset % dev->di.bytespersector;
     offset -= startoffset;
     sector = offset / dev->di.bytespersector;
-    *io_actual = 0;
     while (length > 0) {
        temp = sys_command_cd_read (mode, dev->unitnum, sector);
        if (!temp)
@@ -448,14 +455,16 @@ static int dev_do_io (struct devstruct *dev, uaecptr request)
     switch (command)
     {
        case CMD_READ:
-       if ((io_offset & bmask) || bmask == 0 || io_data == 0)
-           goto bad_command;
-       if ((io_length & bmask) || io_length == 0)
-           goto bad_len;
-       if (dev->drivetype == INQ_ROMD)
+       //write_log ("CMD_READ %08x %d %d %08x\n", io_data, io_offset, io_length, bmask);
+       if (dev->drivetype == INQ_ROMD) {
            io_error = command_cd_read (pdev->mode, dev, io_data, io_offset, io_length, &io_actual);
-       else
+       } else {
+           if ((io_offset & bmask) || bmask == 0 || io_data == 0)
+               goto bad_command;
+           if ((io_length & bmask) || io_length == 0)
+               goto bad_len;
            io_error = command_read (pdev->mode, dev, io_data, io_offset, io_length, &io_actual);
+       }
        break;
        case TD_READ64:
        case NSCMD_TD_READ64:
@@ -788,8 +797,7 @@ static void dev_reset (void)
            }
            write_log ("%s:%d = '%s'\n", UAEDEV_SCSI, dev->aunit, dev->di.label);
        }
-       xfree(dev->di.label);
-       dev->di.label = NULL;
+       dev->di.label[0] = 0;
     }
 }