Fixes to the fixes of the devconf module which were, um, messed up.

This commit is contained in:
waltje
2018-04-02 02:00:01 -04:00
parent 428747a5a5
commit dfda1677d7
5 changed files with 24 additions and 25 deletions

View File

@@ -8,7 +8,7 @@
* *
* Driver for the ESDI controller (WD1007-vse1) for PC/AT. * Driver for the ESDI controller (WD1007-vse1) for PC/AT.
* *
* Version: @(#)hdc_esdi_at.c 1.0.5 2018/03/31 * Version: @(#)hdc_esdi_at.c 1.0.6 2018/04/01
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -238,7 +238,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
{ {
esdi_t *esdi = (esdi_t *)priv; esdi_t *esdi = (esdi_t *)priv;
#ifdef ENABLE_HDD_LOG #if ENABLE_HDC_LOG > 1
pclog("WD1007 write(%04x, %02x)\n", port, val); pclog("WD1007 write(%04x, %02x)\n", port, val);
#endif #endif
@@ -282,7 +282,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
esdi->command = val; esdi->command = val;
esdi->error = 0; esdi->error = 0;
#ifdef ENABLE_HDD_LOG #if ENABLE_HDC_LOG
pclog("WD1007: command %02x\n", val & 0xf0); pclog("WD1007: command %02x\n", val & 0xf0);
#endif #endif
switch (val & 0xf0) { switch (val & 0xf0) {
@@ -478,7 +478,7 @@ esdi_read(uint16_t port, void *priv)
break; break;
} }
#ifdef ENABLE_HDD_LOG #if ENABLE_HDC_LOG > 1
pclog("WD1007 read(%04x) = %02x\n", port, temp); pclog("WD1007 read(%04x) = %02x\n", port, temp);
#endif #endif
@@ -508,7 +508,7 @@ esdi_callback(void *priv)
return; return;
} }
#ifdef ENABLE_HDD_LOG #if ENABLE_HDC_LOG
pclog("WD1007: command %02x\n", esdi->command); pclog("WD1007: command %02x\n", esdi->command);
#endif #endif
@@ -656,7 +656,7 @@ esdi_callback(void *priv)
drive->cfg_spt = esdi->secount; drive->cfg_spt = esdi->secount;
drive->cfg_hpc = esdi->head+1; drive->cfg_hpc = esdi->head+1;
#ifdef ENABLE_HDD_LOG #if ENABLE_HDC_LOG
pclog("WD1007: parameters: spt=%i hpc=%i\n", drive->cfg_spt,drive->cfg_hpc); pclog("WD1007: parameters: spt=%i hpc=%i\n", drive->cfg_spt,drive->cfg_hpc);
#endif #endif
if (! esdi->secount) if (! esdi->secount)

View File

@@ -52,7 +52,7 @@
* however, are auto-configured by the system software as * however, are auto-configured by the system software as
* shown above. * shown above.
* *
* Version: @(#)hdc_esdi_mca.c 1.0.4 2018/03/31 * Version: @(#)hdc_esdi_mca.c 1.0.5 2018/04/01
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk> * Sarah Walker, <tommowalker@tommowalker.co.uk>
@@ -757,7 +757,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
{ {
esdi_t *dev = (esdi_t *)priv; esdi_t *dev = (esdi_t *)priv;
#if 0 #if ENABLE_HDC_LOG > 1
pclog("ESDI: wr(%04x, %02x)\n", port-dev->base, val); pclog("ESDI: wr(%04x, %02x)\n", port-dev->base, val);
#endif #endif
switch (port-dev->base) { switch (port-dev->base) {
@@ -888,7 +888,7 @@ esdi_writew(uint16_t port, uint16_t val, void *priv)
{ {
esdi_t *dev = (esdi_t *)priv; esdi_t *dev = (esdi_t *)priv;
#if 0 #if ENABLE_HDC_LOG > 1
pclog("ESDI: wrw(%04x, %04x)\n", port-dev->base, val); pclog("ESDI: wrw(%04x, %04x)\n", port-dev->base, val);
#endif #endif
switch (port-dev->base) { switch (port-dev->base) {
@@ -922,7 +922,7 @@ esdi_mca_read(int port, void *priv)
{ {
esdi_t *dev = (esdi_t *)priv; esdi_t *dev = (esdi_t *)priv;
#if 0 #if ENABLE_HDC_LOG > 1
pclog("ESDI: mcard(%04x)\n", port); pclog("ESDI: mcard(%04x)\n", port);
#endif #endif
return(dev->pos_regs[port & 7]); return(dev->pos_regs[port & 7]);
@@ -934,7 +934,7 @@ esdi_mca_write(int port, uint8_t val, void *priv)
{ {
esdi_t *dev = (esdi_t *)priv; esdi_t *dev = (esdi_t *)priv;
#if 0 #if ENABLE_HDC_LOG > 1
pclog("ESDI: mcawr(%04x, %02x) pos[2]=%02x pos[3]=%02x\n", pclog("ESDI: mcawr(%04x, %02x) pos[2]=%02x pos[3]=%02x\n",
port, val, dev->pos_regs[2], dev->pos_regs[3]); port, val, dev->pos_regs[2], dev->pos_regs[3]);
#endif #endif

View File

@@ -12,7 +12,7 @@
* based design. Most cards were WD1003-WA2 or -WAH, where the * based design. Most cards were WD1003-WA2 or -WAH, where the
* -WA2 cards had a floppy controller as well (to save space.) * -WA2 cards had a floppy controller as well (to save space.)
* *
* Version: @(#)hdc_mfm_at.c 1.0.3 2018/03/27 * Version: @(#)hdc_mfm_at.c 1.0.4 2018/04/01
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk> * Sarah Walker, <tommowalker@tommowalker.co.uk>

View File

@@ -8,7 +8,7 @@
* *
* Define application version and build info. * Define application version and build info.
* *
* Version: @(#)version.h 1.0.3 2018/03/30 * Version: @(#)version.h 1.0.4 2018/04/01
* *
* Author: Fred N. van Kempen, <decwiz@yahoo.com> * Author: Fred N. van Kempen, <decwiz@yahoo.com>
* *
@@ -55,7 +55,7 @@
#define EMU_VER_MAJOR 0 #define EMU_VER_MAJOR 0
#define EMU_VER_MINOR 1 #define EMU_VER_MINOR 1
#define EMU_VER_REV 3 #define EMU_VER_REV 3
#define EMU_VER_PATCH 4 #define EMU_VER_PATCH 5
/* Standard C preprocessor macros. */ /* Standard C preprocessor macros. */

View File

@@ -12,7 +12,7 @@
* and builds a complete Win32 DIALOG resource block in a * and builds a complete Win32 DIALOG resource block in a
* buffer in memory, and then passes that to the API handler. * buffer in memory, and then passes that to the API handler.
* *
* Version: @(#)win_devconf.c 1.0.7 2018/03/31 * Version: @(#)win_devconf.c 1.0.8 2018/04/01
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -437,11 +437,13 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
} }
#define DATABLOCK_SIZE 16384
uint8_t uint8_t
deviceconfig_open(HWND hwnd, device_t *device) deviceconfig_open(HWND hwnd, device_t *device)
{ {
char temp[128];
const device_config_t *config = device->config; const device_config_t *config = device->config;
uint16_t *data_block = malloc(16384); uint16_t *data_block = malloc(DATABLOCK_SIZE);
uint16_t *data; uint16_t *data;
DLGTEMPLATE *dlg = (DLGTEMPLATE *)data_block; DLGTEMPLATE *dlg = (DLGTEMPLATE *)data_block;
DLGITEMTEMPLATE *item; DLGITEMTEMPLATE *item;
@@ -450,10 +452,9 @@ deviceconfig_open(HWND hwnd, device_t *device)
deviceconfig_changed = 0; deviceconfig_changed = 0;
memset(data_block, 0x00, sizeof(16384)); memset(data_block, 0x00, DATABLOCK_SIZE);
dlg->style = DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | \ dlg->style = DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU;
WS_POPUP | WS_CAPTION | WS_SYSMENU;
dlg->x = 10; dlg->x = 10;
dlg->y = 10; dlg->y = 10;
dlg->cx = 220; dlg->cx = 220;
@@ -463,8 +464,8 @@ deviceconfig_open(HWND hwnd, device_t *device)
*data++ = 0; /*no menu*/ *data++ = 0; /*no menu*/
*data++ = 0; /*predefined dialog box class*/ *data++ = 0; /*predefined dialog box class*/
data += MultiByteToWideChar(CP_ACP, 0, sprintf(temp, "%s Configuration", device->name);
"Device Configuration", -1, data, 50); data += MultiByteToWideChar(CP_ACP, 0, temp, -1, data, 50);
*data++ = 9; /*Point*/ *data++ = 9; /*Point*/
data += MultiByteToWideChar(CP_ACP, 0, "Segoe UI", -1, data, 50); data += MultiByteToWideChar(CP_ACP, 0, "Segoe UI", -1, data, 50);
@@ -509,8 +510,7 @@ deviceconfig_open(HWND hwnd, device_t *device)
item->cx = 140; item->cx = 140;
item->cy = 150; item->cy = 150;
item->style = WS_CHILD | WS_VISIBLE | \ item->style = WS_CHILD | WS_VISIBLE | CBS_DROPDOWN | WS_VSCROLL;
CBS_DROPDOWN | WS_VSCROLL;
data = (uint16_t *)(item + 1); data = (uint16_t *)(item + 1);
*data++ = 0xFFFF; *data++ = 0xFFFF;
@@ -558,8 +558,7 @@ deviceconfig_open(HWND hwnd, device_t *device)
item->cx = 140; item->cx = 140;
item->cy = 14; item->cy = 14;
item->style = WS_CHILD | WS_VISIBLE | \ item->style = WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | ES_NUMBER;
ES_AUTOHSCROLL | ES_NUMBER;
item->dwExtendedStyle = WS_EX_CLIENTEDGE; item->dwExtendedStyle = WS_EX_CLIENTEDGE;
data = (uint16_t *)(item + 1); data = (uint16_t *)(item + 1);