From: Toni Wilen Date: Fri, 5 Sep 2008 12:36:58 +0000 (+0300) Subject: imported winuaesrc1520.zip X-Git-Tag: 2100~121 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=4adca5fac1ebac23c9d9b9fbbb7a76b8ca7064b8;p=francis%2Fwinuae.git imported winuaesrc1520.zip --- diff --git a/include/blkdev.h b/include/blkdev.h index 57d5712c..994ca54f 100755 --- a/include/blkdev.h +++ b/include/blkdev.h @@ -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 { diff --git a/od-win32/WinUAE_Install.nsi b/od-win32/WinUAE_Install.nsi index ed3c1a3c..64b6d095 100755 --- a/od-win32/WinUAE_Install.nsi +++ b/od-win32/WinUAE_Install.nsi @@ -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" diff --git a/od-win32/blkdev_win32_aspi.c b/od-win32/blkdev_win32_aspi.c index 38baac99..42c0fe9d 100755 --- a/od-win32/blkdev_win32_aspi.c +++ b/od-win32/blkdev_win32_aspi.c @@ -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); diff --git a/od-win32/blkdev_win32_ioctl.c b/od-win32/blkdev_win32_ioctl.c index ab56d7fb..32cff493 100755 --- a/od-win32/blkdev_win32_ioctl.c +++ b/od-win32/blkdev_win32_ioctl.c @@ -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; } diff --git a/od-win32/blkdev_win32_spti.c b/od-win32/blkdev_win32_spti.c index 658d68b8..caae6164 100755 --- a/od-win32/blkdev_win32_spti.c +++ b/od-win32/blkdev_win32_spti.c @@ -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; diff --git a/od-win32/registry.c b/od-win32/registry.c index 402baf77..791ef190 100755 --- a/od-win32/registry.c +++ b/od-win32/registry.c @@ -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 diff --git a/od-win32/registry.h b/od-win32/registry.h index ac2845ac..58d67c88 100755 --- a/od-win32/registry.h +++ b/od-win32/registry.h @@ -5,6 +5,7 @@ typedef struct UAEREG { char *inipath; } UAEREG; +extern int getregmode (void); extern int reginitializeinit (const char *path); extern void regstatus (void); diff --git a/od-win32/win32.c b/od-win32/win32.c index 97f4df8d..e027bb74 100755 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -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); } } } diff --git a/od-win32/win32.h b/od-win32/win32.h index 121300de..d12ad0ee 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,9 +15,10 @@ #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 "" diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index b90ae473..ccb03af3 100755 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -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; diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index c0707b98..d4e0fa1b 100755 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -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; } diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 7832c7ab..c3fee835 100755 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -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: diff --git a/scsiemul.c b/scsiemul.c index e7956113..5c9dff61 100755 --- a/scsiemul.c +++ b/scsiemul.c @@ -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; } }