Update to remove excess logging from device.c

Update to remove excess logging from mouse_bus.c
Update to fix logitech busmouse for OS/2.
Update to add named NVR files.
This commit is contained in:
waltje
2019-04-21 20:15:47 -05:00
parent 1fb863a0e7
commit c94a4b2fc6
4 changed files with 68 additions and 23 deletions

View File

@@ -11,7 +11,7 @@
*
* **TODO** Merge the various 'add' variants, its getting too messy.
*
* Version: @(#)device.c 1.0.21 2019/04/20
* Version: @(#)device.c 1.0.22 2019/04/21
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -99,9 +99,8 @@ device_dump(void)
for (c = 0; c < DEVICE_MAX; c++) {
if (devices[c] == NULL) continue;
INFO("DEVICE [%3i] = '%s' flags=%08lx local=%08lx priv=%08lx\n",
c, devices[c]->name,
devices[c]->flags, devices[c]->local, device_priv[c]);
INFO("DEVICE [%3i] = '%s' flags=%08lx local=%08lx\n",
c, devices[c]->name, devices[c]->flags, devices[c]->local);
}
}
#endif

View File

@@ -14,7 +14,7 @@
* Devices currently implemented are hard disk, CD-ROM and
* ZIP IDE/ATAPI devices.
*
* Version: @(#)hdc_ide_ata.c 1.0.31 2019/04/11
* Version: @(#)hdc_ide_ata.c 1.0.32 2019/04/21
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk>
@@ -163,7 +163,8 @@ static void ide_callback(void *priv);
uint8_t
getstat(ide_t *ide) {
getstat(ide_t *ide)
{
return ide->atastat;
}
@@ -247,6 +248,7 @@ ide_get_period(ide_t *ide, int size)
period = 1000000.0 / period;
period *= (double) TIMER_USEC;
period *= (double) size;
return (int64_t) period;
}
@@ -871,13 +873,11 @@ ide_allocate_buffer(ide_t *dev)
uint32_t sz = 65536 * sizeof(uint16_t);
if (dev->buffer) {
INFO("IDE: buffer already present @%08lx\n", dev->buffer);
return;
}
dev->buffer = (uint16_t *)mem_alloc(sz);
memset(dev->buffer, 0x00, sz);
INFO("IDE: buffer allocated @%08lx\n", dev->buffer);
}

View File

@@ -53,7 +53,7 @@
* Microsoft Windows NT 3.1
* Microsoft Windows 98 SE
*
* Version: @(#)mouse_bus.c 1.1.5 2019/04/11
* Version: @(#)mouse_bus.c 1.1.6 2019/04/21
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -553,7 +553,7 @@ bm_poll(int x, int y, int z, int b, void *priv)
}
}
return(0);
return(1);
}
@@ -660,6 +660,7 @@ static void *
bm_init(const device_t *info, UNUSED(void *parent))
{
mouse_t *dev;
int hz;
dev = (mouse_t *)mem_alloc(sizeof(mouse_t));
memset(dev, 0x00, sizeof(mouse_t));
@@ -716,10 +717,14 @@ bm_init(const device_t *info, UNUSED(void *parent))
dev->conf = 0x9b; /* the config port value - 0x9b is the
default state of the 8255: all ports
are set to input */
dev->period = 1000000.0 / ((double) device_get_config_int("hz"));
dev->timer = ((int64_t) dev->period) * TIMER_USEC;
dev->timer_enabled = 1LL;
hz = device_get_config_int("hz");
if (hz > 0) {
dev->period = 1000000.0 / (double)hz;
dev->timer = ((int64_t) dev->period) * TIMER_USEC;
dev->timer_enabled = 1LL;
}
io_sethandler(dev->base, 4,
lt_read,NULL,NULL, lt_write,NULL,NULL, dev);
@@ -777,11 +782,14 @@ static const device_config_t lt_config[] = {
{
"hz", "Hz", CONFIG_SELECTION, "", 45, {
{
"30 Hz (JMP2 = 1)", 30
"Original Mode", 0
},
{
"45 Hz (JMP2 not populated)", 45
},
{
"30 Hz (JMP2 = 1)", 30
},
{
"60 Hz (JMP 2 = 2)", 60
},

View File

@@ -8,7 +8,7 @@
*
* Implement a generic NVRAM/CMOS/RTC device.
*
* Version: @(#)nvr.c 1.0.14 2019/01/03
* Version: @(#)nvr.c 1.0.15 2019/04/21
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -140,21 +140,59 @@ onesec_timer(void *priv)
void
nvr_init(nvr_t *nvr)
{
wchar_t tempw[256];
char temp[64];
struct tm *tm;
wchar_t *sp;
time_t now;
FILE *fp;
int c;
/* Set up the NVR file's name. */
if (nvr->fn != NULL)
/* Set up the NVR file's name unless we already have one. */
if (nvr->fn == NULL) {
/*
* First, let us try if a file exists with the name of
* the current configuration file in it. Such a 'named
* NVR' is sometimes needed in situations where multiple
* configurations share a single machine.
*
* Get the filename part of the configuration file path.
*/
sp = wcsrchr(cfg_path, L'/');
if (sp != NULL)
wcscpy(tempw, ++sp);
else
wcscpy(tempw, cfg_path);
/* Drop the suffix. */
sp = wcsrchr(tempw, L'.');
if (sp != NULL)
*sp = L'\0';
/* Add our suffix. */
wcscat(tempw, NVR_FILE_EXT);
/* Try to open this file. */
if ((fp = plat_fopen(nvr_path(tempw), L"rb")) != NULL) {
/* It exists, use it. */
(void)fclose(fp);
} else {
/* Does not exist, use the default name. */
strcpy(temp, machine_get_internal_name());
mbstowcs(tempw, temp, sizeof_w(tempw));
wcscat(tempw, NVR_FILE_EXT);
}
} else {
/* Already have a name, use that. */
strcpy(temp, (const char *)nvr->fn);
else
strcpy(temp, machine_get_internal_name());
c = (int)strlen(temp) + 1;
sp = (wchar_t *)mem_alloc((c+10) * sizeof(wchar_t));
mbstowcs(sp, temp, c);
wcscat(sp, NVR_FILE_EXT);
mbstowcs(tempw, temp, sizeof_w(tempw));
wcscat(tempw, NVR_FILE_EXT);
}
/* Either way, we now have a usable filename. */
c = (int)wcslen(tempw) + 1;
sp = (wchar_t *)mem_alloc(c * sizeof(wchar_t));
wcscpy(sp, tempw);
nvr->fn = (const wchar_t *)sp;
/* Initialize the internal clock as needed. */