diff --git a/src/win/win.c b/src/win/win.c index f401009..82d6955 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -8,7 +8,7 @@ * * Platform main support module for Windows. * - * Version: @(#)win.c 1.0.5 2018/03/07 + * Version: @(#)win.c 1.0.6 2018/03/08 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -67,6 +67,9 @@ # include "win_ddraw.h" # include "win_d3d.h" #endif +#ifdef _MSC_VER +# include /* for _open_osfhandle() */ +#endif #include "win.h" diff --git a/src/win/win.h b/src/win/win.h index 9624744..700c336 100644 --- a/src/win/win.h +++ b/src/win/win.h @@ -8,7 +8,7 @@ * * Platform support defintions for Win32. * - * Version: @(#)win.h 1.0.4 2018/03/07 + * Version: @(#)win.h 1.0.5 2018/03/08 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -75,7 +75,7 @@ extern int status_is_open; extern char openfilestring[260]; extern WCHAR wopenfilestring[260]; -extern uint8_t filterindex; +extern DWORD filterindex; #ifdef USE_CRASHDUMP diff --git a/src/win/win_cdrom_ioctl.c b/src/win/win_cdrom_ioctl.c index 0499dba..b25ccd5 100644 --- a/src/win/win_cdrom_ioctl.c +++ b/src/win/win_cdrom_ioctl.c @@ -9,7 +9,7 @@ * Implementation of the CD-ROM host drive IOCTL interface for * Windows using SCSI Passthrough Direct. * - * Version: @(#)cdrom_ioctl.c 1.0.3 2018/03/07 + * Version: @(#)cdrom_ioctl.c 1.0.4 2018/03/08 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -359,7 +359,7 @@ static int ioctl_get_last_block(uint8_t id, unsigned char starttrack, int msf, i unsigned long size; int c, d = 0; CDROM_TOC lbtoc; - int lb = 0; + uint32_t lb = 0; if (!cdrom_drives[id].host_drive) { return 0; diff --git a/src/win/win_crashdump.c b/src/win/win_crashdump.c index f38dde1..6860408 100644 --- a/src/win/win_crashdump.c +++ b/src/win/win_crashdump.c @@ -8,7 +8,7 @@ * * Handle generation of crash-dump reports. * - * Version: @(#)win_crashdump.c 1.0.4 2018/03/07 + * Version: @(#)win_crashdump.c 1.0.5 2018/03/08 * * Authors: Fred N. van Kempen, * Riley (Rai-chan), @@ -61,7 +61,7 @@ MakeCrashDump(PEXCEPTION_POINTERS ExceptionInfo) SYSTEMTIME SystemTime; HANDLE hDumpFile; char *BufPtr; - int i; + DWORD i; /* * Win32-specific functions will be used wherever possible, diff --git a/src/win/win_d3d.cpp b/src/win/win_d3d.cpp index 6b9d13e..b6f925d 100644 --- a/src/win/win_d3d.cpp +++ b/src/win/win_d3d.cpp @@ -8,7 +8,7 @@ * * Rendering module for Microsoft Direct3D 9. * - * Version: @(#)win_d3d.cpp 1.0.4 2018/03/07 + * Version: @(#)win_d3d.cpp 1.0.5 2018/03/08 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -220,8 +220,8 @@ d3d_blit_fs(int x, int y, int y1, int y2, int w, int h) d3d_verts[0].tu = d3d_verts[2].tu = d3d_verts[3].tu = 0; d3d_verts[0].tv = d3d_verts[3].tv = d3d_verts[4].tv = 0; - d3d_verts[1].tu = d3d_verts[4].tu = d3d_verts[5].tu = (float)w / 2048.0; - d3d_verts[1].tv = d3d_verts[2].tv = d3d_verts[5].tv = (float)h / 2048.0; + d3d_verts[1].tu = d3d_verts[4].tu = d3d_verts[5].tu = (float)w / 2048.0f; + d3d_verts[1].tv = d3d_verts[2].tv = d3d_verts[5].tv = (float)h / 2048.0f; d3d_verts[0].color = d3d_verts[1].color = d3d_verts[2].color = d3d_verts[3].color = d3d_verts[4].color = d3d_verts[5].color = d3d_verts[6].color = d3d_verts[7].color = d3d_verts[8].color = @@ -230,22 +230,22 @@ d3d_blit_fs(int x, int y, int y1, int y2, int w, int h) GetClientRect(d3d_device_window, &w_rect); d3d_size(w_rect, &l, &t, &r, &b, w, h); - d3d_verts[0].x = l; - d3d_verts[0].y = t; - d3d_verts[1].x = r; - d3d_verts[1].y = b; - d3d_verts[2].x = l; - d3d_verts[2].y = b; - d3d_verts[3].x = l; - d3d_verts[3].y = t; - d3d_verts[4].x = r; - d3d_verts[4].y = t; - d3d_verts[5].x = r; - d3d_verts[5].y = b; - d3d_verts[6].x = d3d_verts[8].x = d3d_verts[9].x = r - 40.5; - d3d_verts[6].y = d3d_verts[9].y = d3d_verts[10].y = t + 8.5; - d3d_verts[7].x = d3d_verts[10].x = d3d_verts[11].x = r - 8.5; - d3d_verts[7].y = d3d_verts[8].y = d3d_verts[11].y = t + 14.5; + d3d_verts[0].x = (float)l; + d3d_verts[0].y = (float)t; + d3d_verts[1].x = (float)r; + d3d_verts[1].y = (float)b; + d3d_verts[2].x = (float)l; + d3d_verts[2].y = (float)b; + d3d_verts[3].x = (float)l; + d3d_verts[3].y = (float)t; + d3d_verts[4].x = (float)r; + d3d_verts[4].y = (float)t; + d3d_verts[5].x = (float)r; + d3d_verts[5].y = (float)b; + d3d_verts[6].x = d3d_verts[8].x = d3d_verts[9].x = (float)r - 40.5f; + d3d_verts[6].y = d3d_verts[9].y = d3d_verts[10].y = (float)t + 8.5f; + d3d_verts[7].x = d3d_verts[10].x = d3d_verts[11].x = (float)r - 8.5f; + d3d_verts[7].y = d3d_verts[8].y = d3d_verts[11].y = (float)t + 14.5f; if (hr == D3D_OK) hr = v_buffer->Lock(0, 0, (void**)&pVoid, 0); @@ -325,22 +325,22 @@ d3d_blit(int x, int y, int y1, int y2, int w, int h) d3d_verts[0].tu = d3d_verts[2].tu = d3d_verts[3].tu = 0;//0.5 / 2048.0; d3d_verts[0].tv = d3d_verts[3].tv = d3d_verts[4].tv = 0;//0.5 / 2048.0; - d3d_verts[1].tu = d3d_verts[4].tu = d3d_verts[5].tu = (float)w / 2048.0; - d3d_verts[1].tv = d3d_verts[2].tv = d3d_verts[5].tv = (float)h / 2048.0; + d3d_verts[1].tu = d3d_verts[4].tu = d3d_verts[5].tu = (float)w / 2048.0f; + d3d_verts[1].tv = d3d_verts[2].tv = d3d_verts[5].tv = (float)h / 2048.0f; d3d_verts[0].color = d3d_verts[1].color = d3d_verts[2].color = d3d_verts[3].color = d3d_verts[4].color = d3d_verts[5].color = d3d_verts[6].color = d3d_verts[7].color = d3d_verts[8].color = d3d_verts[9].color = d3d_verts[10].color = d3d_verts[11].color = 0xffffff; GetClientRect(d3d_hwnd, &r); - d3d_verts[0].x = d3d_verts[2].x = d3d_verts[3].x = -0.5; - d3d_verts[0].y = d3d_verts[3].y = d3d_verts[4].y = -0.5; - d3d_verts[1].x = d3d_verts[4].x = d3d_verts[5].x = (r.right-r.left)-0.5; - d3d_verts[1].y = d3d_verts[2].y = d3d_verts[5].y = (r.bottom-r.top)-0.5; - d3d_verts[6].x = d3d_verts[8].x = d3d_verts[9].x = (r.right-r.left)-40.5; - d3d_verts[6].y = d3d_verts[9].y = d3d_verts[10].y = 8.5; - d3d_verts[7].x = d3d_verts[10].x = d3d_verts[11].x = (r.right-r.left)-8.5; - d3d_verts[7].y = d3d_verts[8].y = d3d_verts[11].y = 14.5; + d3d_verts[0].x = d3d_verts[2].x = d3d_verts[3].x = -0.5f; + d3d_verts[0].y = d3d_verts[3].y = d3d_verts[4].y = -0.5f; + d3d_verts[1].x = d3d_verts[4].x = d3d_verts[5].x = (r.right-r.left)-0.5f; + d3d_verts[1].y = d3d_verts[2].y = d3d_verts[5].y = (r.bottom-r.top)-0.5f; + d3d_verts[6].x = d3d_verts[8].x = d3d_verts[9].x = (r.right-r.left)-40.5f; + d3d_verts[6].y = d3d_verts[9].y = d3d_verts[10].y = 8.5f; + d3d_verts[7].x = d3d_verts[10].x = d3d_verts[11].x = (r.right-r.left)-8.5f; + d3d_verts[7].y = d3d_verts[8].y = d3d_verts[11].y = 14.5f; if (hr == D3D_OK) hr = v_buffer->Lock(0, 0, (void**)&pVoid, 0); // lock the vertex buffer diff --git a/src/win/win_dialog.c b/src/win/win_dialog.c index 07ec1cf..87b38e7 100644 --- a/src/win/win_dialog.c +++ b/src/win/win_dialog.c @@ -8,7 +8,7 @@ * * Implementation of server several dialogs. * - * Version: @(#)win_dialog.c 1.0.3 2018/03/07 + * Version: @(#)win_dialog.c 1.0.4 2018/03/08 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -56,7 +56,7 @@ WCHAR path[MAX_PATH]; WCHAR wopenfilestring[260]; char openfilestring[260]; -uint8_t filterindex = 0; +DWORD filterindex = 0; static int CALLBACK diff --git a/src/win/win_joystick.cpp b/src/win/win_joystick.cpp index 015aa91..3120e03 100644 --- a/src/win/win_joystick.cpp +++ b/src/win/win_joystick.cpp @@ -11,7 +11,7 @@ * NOTE: Hacks currently needed to compile with MSVC; DX needs to * be updated to 11 or 12 or so. --FvK * - * Version: @(#)win_joystick.cpp 1.0.3 2018/03/07 + * Version: @(#)win_joystick.cpp 1.0.4 2018/03/08 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -227,7 +227,7 @@ static int joystick_get_axis(int joystick_nr, int mapping) if (LOWORD(pov) == 0xFFFF) return 0; else - return sin((2*M_PI * (double)pov) / 36000.0) * 32767; + return (int)sin((2*M_PI * (double)pov) / 36000.0) * 32767; } else if (mapping & POV_Y) { @@ -236,7 +236,7 @@ static int joystick_get_axis(int joystick_nr, int mapping) if (LOWORD(pov) == 0xFFFF) return 0; else - return -cos((2*M_PI * (double)pov) / 36000.0) * 32767; + return (int)-cos((2*M_PI * (double)pov) / 36000.0) * 32767; } else return plat_joystick_state[joystick_nr].a[plat_joystick_state[joystick_nr].axis[mapping].id]; diff --git a/src/win/win_new_floppy.c b/src/win/win_new_floppy.c index 5f2ea56..1b3076d 100644 --- a/src/win/win_new_floppy.c +++ b/src/win/win_new_floppy.c @@ -8,7 +8,7 @@ * * Implementation of the New Floppy Image dialog. * - * Version: @(#)win_new_floppy.c 1.0.5 2018/03/07 + * Version: @(#)win_new_floppy.c 1.0.6 2018/03/08 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -566,7 +566,7 @@ NewFloppyDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) int i = 0; int wcs_len, ext_offs; wchar_t *ext; - uint8_t disk_size, rpm_mode; + uint32_t disk_size, rpm_mode; int ret; FILE *f; int zip_types; diff --git a/src/win/win_png.c b/src/win/win_png.c index 04e7c18..8f31514 100644 --- a/src/win/win_png.c +++ b/src/win/win_png.c @@ -20,7 +20,7 @@ * TODO: Compression is currently not supported, until I figure out * how ZLIB works so I can interface with it here. * - * Version: @(#)win_png.c 1.0.1 2018/02/14 + * Version: @(#)win_png.c 1.0.2 2018/03/08 * * Author: Fred N. van Kempen, * @@ -375,7 +375,7 @@ png_write(png_t *png, uint8_t *bitmap, uint32_t pixels) /* See how many pixels we can write for this scanline. */ n = cnt; - if ((png->lwidth - png->col) < n) + if ((uint32_t)(png->lwidth - png->col) < n) n = (png->lwidth - png->col); if ((DEFL_MAX_BLKSZ - png->bufcnt) < n) n = (DEFL_MAX_BLKSZ - png->bufcnt); diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 8cd9fb6..f1a97b1 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings.c 1.0.6 2018/03/07 + * Version: @(#)win_settings.c 1.0.7 2018/03/08 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -220,19 +220,19 @@ settings_init(void) memcpy(temp_hdd, hdd, HDD_NUM * sizeof(hard_disk_t)); for (i=0; ibus = SendMessage(h, CB_GETCURSEL, 0, 0) + 1; + hdd_ptr->bus = (SendMessage(h, CB_GETCURSEL, 0, 0) + 1) & 0xff; } /* Make sure no file name is allowed with removable SCSI hard disks. */ @@ -2925,27 +2925,27 @@ hard_disks_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) { case HDD_BUS_MFM: h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL); - hdd_ptr->mfm_channel = SendMessage(h, CB_GETCURSEL, 0, 0); + hdd_ptr->mfm_channel = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; break; case HDD_BUS_ESDI: h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL); - hdd_ptr->esdi_channel = SendMessage(h, CB_GETCURSEL, 0, 0); + hdd_ptr->esdi_channel = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; break; case HDD_BUS_XTIDE: h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL); - hdd_ptr->xtide_channel = SendMessage(h, CB_GETCURSEL, 0, 0); + hdd_ptr->xtide_channel = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; break; case HDD_BUS_IDE_PIO_ONLY: case HDD_BUS_IDE_PIO_AND_DMA: h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL_IDE); - hdd_ptr->ide_channel = SendMessage(h, CB_GETCURSEL, 0, 0); + hdd_ptr->ide_channel = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; break; case HDD_BUS_SCSI: case HDD_BUS_SCSI_REMOVABLE: h = GetDlgItem(hdlg, IDC_COMBO_HD_ID); - hdd_ptr->scsi_id = SendMessage(h, CB_GETCURSEL, 0, 0); + hdd_ptr->scsi_id = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; h = GetDlgItem(hdlg, IDC_COMBO_HD_LUN); - hdd_ptr->scsi_lun = SendMessage(h, CB_GETCURSEL, 0, 0); + hdd_ptr->scsi_lun = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; break; } } @@ -3518,21 +3518,21 @@ static void hard_disk_track(uint8_t id) { switch(temp_hdd[id].bus) { case HDD_BUS_MFM: - mfm_tracking |= (1 << (temp_hdd[id].mfm_channel << 3)); + mfm_tracking |= (1ULL << (temp_hdd[id].mfm_channel << 3)); break; case HDD_BUS_ESDI: - esdi_tracking |= (1 << (temp_hdd[id].esdi_channel << 3)); + esdi_tracking |= (1ULL << (temp_hdd[id].esdi_channel << 3)); break; case HDD_BUS_XTIDE: - xtide_tracking |= (1 << (temp_hdd[id].xtide_channel << 3)); + xtide_tracking |= (1ULL << (temp_hdd[id].xtide_channel << 3)); break; case HDD_BUS_IDE_PIO_ONLY: case HDD_BUS_IDE_PIO_AND_DMA: - ide_tracking |= (1 << (temp_hdd[id].ide_channel << 3)); + ide_tracking |= (1ULL << (temp_hdd[id].ide_channel << 3)); break; case HDD_BUS_SCSI: case HDD_BUS_SCSI_REMOVABLE: - scsi_tracking[temp_hdd[id].scsi_id] |= (1 << (temp_hdd[id].scsi_lun << 3)); + scsi_tracking[temp_hdd[id].scsi_id] |= (1ULL << (temp_hdd[id].scsi_lun << 3)); break; } } @@ -3684,15 +3684,15 @@ hd_bus_skip: hard_disk_untrack(hdlv_current_sel); if (temp_hdd[hdlv_current_sel].bus == HDD_BUS_MFM) { - temp_hdd[hdlv_current_sel].mfm_channel = SendMessage(h, CB_GETCURSEL, 0, 0); + temp_hdd[hdlv_current_sel].mfm_channel = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; } else if (temp_hdd[hdlv_current_sel].bus == HDD_BUS_ESDI) { - temp_hdd[hdlv_current_sel].esdi_channel = SendMessage(h, CB_GETCURSEL, 0, 0); + temp_hdd[hdlv_current_sel].esdi_channel = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; } else if (temp_hdd[hdlv_current_sel].bus == HDD_BUS_XTIDE) { - temp_hdd[hdlv_current_sel].xtide_channel = SendMessage(h, CB_GETCURSEL, 0, 0); + temp_hdd[hdlv_current_sel].xtide_channel = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; } hard_disk_track(hdlv_current_sel); h = GetDlgItem(hdlg, IDC_LIST_HARD_DISKS); @@ -3709,7 +3709,7 @@ hd_bus_skip: ignore_change = 1; h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL_IDE); hard_disk_untrack(hdlv_current_sel); - temp_hdd[hdlv_current_sel].ide_channel = SendMessage(h, CB_GETCURSEL, 0, 0); + temp_hdd[hdlv_current_sel].ide_channel = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; hard_disk_track(hdlv_current_sel); h = GetDlgItem(hdlg, IDC_LIST_HARD_DISKS); win_settings_hard_disks_update_item(h, hdlv_current_sel, 0); @@ -3725,7 +3725,7 @@ hd_bus_skip: ignore_change = 1; h = GetDlgItem(hdlg, IDC_COMBO_HD_ID); hard_disk_untrack(hdlv_current_sel); - temp_hdd[hdlv_current_sel].scsi_id = SendMessage(h, CB_GETCURSEL, 0, 0); + temp_hdd[hdlv_current_sel].scsi_id = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; hard_disk_track(hdlv_current_sel); h = GetDlgItem(hdlg, IDC_LIST_HARD_DISKS); win_settings_hard_disks_update_item(h, hdlv_current_sel, 0); @@ -3741,7 +3741,7 @@ hd_bus_skip: ignore_change = 1; h = GetDlgItem(hdlg, IDC_COMBO_HD_LUN); hard_disk_untrack(hdlv_current_sel); - temp_hdd[hdlv_current_sel].scsi_lun = SendMessage(h, CB_GETCURSEL, 0, 0); + temp_hdd[hdlv_current_sel].scsi_lun = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; hard_disk_track(hdlv_current_sel); h = GetDlgItem(hdlg, IDC_LIST_HARD_DISKS); win_settings_hard_disks_update_item(h, hdlv_current_sel, 0); @@ -4562,7 +4562,7 @@ static void cdrom_track(uint8_t id) if ((temp_cdrom_drives[id].bus_type == CDROM_BUS_ATAPI_PIO_ONLY) || (temp_cdrom_drives[id].bus_type == CDROM_BUS_ATAPI_PIO_ONLY)) ide_tracking |= (2 << (temp_cdrom_drives[id].ide_channel << 3)); else if (temp_cdrom_drives[id].bus_type == CDROM_BUS_SCSI) - scsi_tracking[temp_cdrom_drives[id].scsi_device_id] |= (1 << temp_cdrom_drives[id].scsi_device_lun); + scsi_tracking[temp_cdrom_drives[id].scsi_device_id] |= (1ULL << temp_cdrom_drives[id].scsi_device_lun); } static void cdrom_untrack(uint8_t id) @@ -4570,7 +4570,7 @@ static void cdrom_untrack(uint8_t id) if ((temp_cdrom_drives[id].bus_type == CDROM_BUS_ATAPI_PIO_ONLY) || (temp_cdrom_drives[id].bus_type == CDROM_BUS_ATAPI_PIO_ONLY)) ide_tracking &= ~(2 << (temp_cdrom_drives[id].ide_channel << 3)); else if (temp_cdrom_drives[id].bus_type == CDROM_BUS_SCSI) - scsi_tracking[temp_cdrom_drives[id].scsi_device_id] &= ~(1 << temp_cdrom_drives[id].scsi_device_lun); + scsi_tracking[temp_cdrom_drives[id].scsi_device_id] &= ~(1ULL << temp_cdrom_drives[id].scsi_device_lun); } #if 0 @@ -4587,17 +4587,17 @@ static void cdrom_track_all(void) static void zip_track(uint8_t id) { if ((temp_zip_drives[id].bus_type == ZIP_BUS_ATAPI_PIO_ONLY) || (temp_zip_drives[id].bus_type == ZIP_BUS_ATAPI_PIO_ONLY)) - ide_tracking |= (1 << temp_zip_drives[id].ide_channel); + ide_tracking |= (1ULL << temp_zip_drives[id].ide_channel); else if (temp_zip_drives[id].bus_type == ZIP_BUS_SCSI) - scsi_tracking[temp_zip_drives[id].scsi_device_id] |= (1 << temp_zip_drives[id].scsi_device_lun); + scsi_tracking[temp_zip_drives[id].scsi_device_id] |= (1ULL << temp_zip_drives[id].scsi_device_lun); } static void zip_untrack(uint8_t id) { if ((temp_zip_drives[id].bus_type == ZIP_BUS_ATAPI_PIO_ONLY) || (temp_zip_drives[id].bus_type == ZIP_BUS_ATAPI_PIO_ONLY)) - ide_tracking &= ~(1 << temp_zip_drives[id].ide_channel); + ide_tracking &= ~(1ULL << temp_zip_drives[id].ide_channel); else if (temp_zip_drives[id].bus_type == ZIP_BUS_SCSI) - scsi_tracking[temp_zip_drives[id].scsi_device_id] &= ~(1 << temp_zip_drives[id].scsi_device_lun); + scsi_tracking[temp_zip_drives[id].scsi_device_id] &= ~(1ULL << temp_zip_drives[id].scsi_device_lun); } #if 0 @@ -5017,7 +5017,7 @@ cdrom_bus_skip: rd_ignore_change = 1; h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE); cdrom_untrack(cdlv_current_sel); - temp_cdrom_drives[cdlv_current_sel].ide_channel = SendMessage(h, CB_GETCURSEL, 0, 0); + temp_cdrom_drives[cdlv_current_sel].ide_channel = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; cdrom_track(cdlv_current_sel); h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES); win_settings_cdrom_drives_update_item(h, cdlv_current_sel); @@ -5108,7 +5108,7 @@ zip_bus_skip: rd_ignore_change = 1; h = GetDlgItem(hdlg, IDC_COMBO_ZIP_CHANNEL_IDE); zip_untrack(zdlv_current_sel); - temp_zip_drives[zdlv_current_sel].ide_channel = SendMessage(h, CB_GETCURSEL, 0, 0); + temp_zip_drives[zdlv_current_sel].ide_channel = SendMessage(h, CB_GETCURSEL, 0, 0) & 0xff; zip_track(zdlv_current_sel); h = GetDlgItem(hdlg, IDC_LIST_ZIP_DRIVES); win_settings_zip_drives_update_item(h, zdlv_current_sel);