diff --git a/src/mouse.c b/src/mouse.c index 2cb6169..62397ae 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -11,7 +11,7 @@ * TODO: Add the Genius bus- and serial mouse. * Remove the '3-button' flag from mouse types. * - * Version: @(#)mouse.c 1.0.2 2018/03/15 + * Version: @(#)mouse.c 1.0.3 2018/03/18 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -124,19 +124,16 @@ mouse_init(void) void mouse_close(void) { - if (mouse_type == MOUSE_TYPE_NONE) return; - mouse_priv = NULL; mouse_nbut = 0; - mouse_type = MOUSE_TYPE_NONE; } void mouse_reset(void) { - /* Abort if already initialized by a machine with internal mouse. */ - if (mouse_type == MOUSE_TYPE_NONE) return; + /* Nothing to do if no mouse, or a machine-internal one. */ + if (mouse_type <= MOUSE_TYPE_INTERNAL) return; pclog("MOUSE: reset(type=%d, '%s')\n", mouse_type, mouse_devices[mouse_type].device->name); @@ -145,9 +142,6 @@ mouse_reset(void) mouse_x = mouse_y = mouse_z = 0; mouse_buttons = 0x00; - /* If no mouse configured, we're done. */ - if (mouse_type == 0) return; - /* Copy the (R/O) mouse info. */ if (mouse_devices[mouse_type].device != NULL) { memcpy(&mouse_dev, mouse_devices[mouse_type].device, @@ -217,9 +211,8 @@ mouse_get_from_internal_name(char *s) int c = 0; while (mouse_devices[c].internal_name != NULL) { - if (! strcmp((char *)mouse_devices[c].internal_name, s)) { + if (! strcmp((char *)mouse_devices[c].internal_name, s)) return(c); - } c++; } diff --git a/src/pc.c b/src/pc.c index 2f0a786..d3391c9 100644 --- a/src/pc.c +++ b/src/pc.c @@ -152,7 +152,6 @@ int network_card; /* (C) net interface num */ char network_host[512]; /* (C) host network intf */ - /* Statistics. */ extern int mmuflush, @@ -709,8 +708,8 @@ pc_init_modules(void) cdrom_global_reset(); zip_global_reset(); - device_init(); - + device_init(); + timer_reset(); sound_reset(); diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 4126047..e4e55b7 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -8,7 +8,7 @@ * * Implement the user Interface module. * - * Version: @(#)win_ui.c 1.0.5 2018/03/10 + * Version: @(#)win_ui.c 1.0.6 2018/03/18 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -1088,6 +1088,9 @@ plat_mouse_capture(int on) { RECT rect; + /* Do not try to capture the mouse if no mouse configured. */ + if (mouse_type == MOUSE_TYPE_NONE) return; + if (on && !mouse_capture) { /* Enable the in-app mouse. */ GetClipCursor(&oldclip);