Returned mouse_reset() to where it was and split off the call to mouse_close() to pc_reset_hard_close().
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
* in alpha mode, but in highres ("ECD350") mode, it displays
|
||||
* some semi-random junk. Video-memory pointer maybe?
|
||||
*
|
||||
* Version: @(#)m_amstrad.c 1.0.7 2018/01/28
|
||||
* Version: @(#)m_amstrad.c 1.0.9 2018/01/29
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -1266,6 +1266,7 @@ machine_amstrad_init(machine_t *model)
|
||||
keyboard_send = kbd_adddata_ex;
|
||||
keyboard_scan = 1;
|
||||
|
||||
/* Tell mouse driver about our internal mouse. */
|
||||
mouse_reset();
|
||||
mouse_set_poll(ms_poll, ams);
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Emulation of the Olivetti M24.
|
||||
*
|
||||
* Version: @(#)m_olivetti_m24.c 1.0.9 2018/01/16
|
||||
* Version: @(#)m_olivetti_m24.c 1.0.10 2018/01/29
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -842,6 +842,7 @@ machine_olim24_init(machine_t *model)
|
||||
timer_add(kbd_poll, &keyboard_delay, TIMER_ALWAYS_ENABLED, m24);
|
||||
|
||||
/* Tell mouse driver about our internal mouse. */
|
||||
mouse_reset();
|
||||
mouse_set_poll(ms_poll, m24);
|
||||
|
||||
if (joystick_type != 7)
|
||||
|
@@ -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.20 2018/01/26
|
||||
* Version: @(#)mouse.c 1.0.21 2018/01/29
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -106,12 +106,12 @@ mouse_close(void)
|
||||
void
|
||||
mouse_reset(void)
|
||||
{
|
||||
if (mouse_curr != NULL)
|
||||
return; /* Mouse already initialized. */
|
||||
|
||||
pclog("MOUSE: reset(type=%d, '%s')\n",
|
||||
mouse_type, mouse_devices[mouse_type].device->name);
|
||||
|
||||
/* Close previous mouse, if open. */
|
||||
mouse_close();
|
||||
|
||||
/* Clear local data. */
|
||||
mouse_x = mouse_y = mouse_z = 0;
|
||||
mouse_buttons = 0x00;
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Definitions for the mouse driver.
|
||||
*
|
||||
* Version: @(#)mouse.h 1.0.13 2018/01/26
|
||||
* Version: @(#)mouse.h 1.0.14 2018/01/29
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -58,6 +58,7 @@ extern device_t mouse_ps2_device;
|
||||
#endif
|
||||
|
||||
extern void mouse_init(void);
|
||||
extern void mouse_close(void);
|
||||
extern void mouse_reset(void);
|
||||
extern void mouse_set_buttons(int buttons);
|
||||
extern void mouse_process(void);
|
||||
|
16
src/pc.c
16
src/pc.c
@@ -749,6 +749,8 @@ pc_reset_hard_close(void)
|
||||
|
||||
machine_close();
|
||||
|
||||
mouse_close();
|
||||
|
||||
device_close_all();
|
||||
|
||||
midi_close();
|
||||
@@ -791,13 +793,6 @@ pc_reset_hard_init(void)
|
||||
serial_init();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This has to be after the serial initialization so that
|
||||
* serial_init() doesn't break the serial mouse by resetting
|
||||
* the RCR callback to NULL.
|
||||
*/
|
||||
mouse_reset();
|
||||
|
||||
/* Initialize the actual machine and its basic modules. */
|
||||
machine_init();
|
||||
|
||||
@@ -822,6 +817,13 @@ pc_reset_hard_init(void)
|
||||
shadowbios = 0;
|
||||
keyboard_at_reset();
|
||||
|
||||
/*
|
||||
* This has to be after the serial initialization so that
|
||||
* serial_init() doesn't break the serial mouse by resetting
|
||||
* the RCR callback to NULL.
|
||||
*/
|
||||
mouse_reset();
|
||||
|
||||
/* Reset the video card. */
|
||||
video_reset(gfxcard);
|
||||
|
||||
|
Reference in New Issue
Block a user