The host mouse is now polled at 3600 Hz (the individual guest mouse types then run at their own rates), making the mouse consideraly smoother.
This commit is contained in:
@@ -1263,9 +1263,9 @@ pc_run(void)
|
|||||||
startblit();
|
startblit();
|
||||||
cpu_exec(cpu_s->rspeed / 100);
|
cpu_exec(cpu_s->rspeed / 100);
|
||||||
#ifdef USE_GDBSTUB /* avoid a KBC FIFO overflow when CPU emulation is stalled */
|
#ifdef USE_GDBSTUB /* avoid a KBC FIFO overflow when CPU emulation is stalled */
|
||||||
if (gdbstub_step == GDBSTUB_EXEC)
|
// if (gdbstub_step == GDBSTUB_EXEC)
|
||||||
#endif
|
#endif
|
||||||
mouse_process();
|
// mouse_process();
|
||||||
joystick_process();
|
joystick_process();
|
||||||
endblit();
|
endblit();
|
||||||
|
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
#define HAVE_STDARG_H
|
#define HAVE_STDARG_H
|
||||||
#include <86box/86box.h>
|
#include <86box/86box.h>
|
||||||
#include <86box/device.h>
|
#include <86box/device.h>
|
||||||
|
#include <86box/timer.h>
|
||||||
|
#include <86box/gdbstub.h>
|
||||||
#include <86box/mouse.h>
|
#include <86box/mouse.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -45,6 +47,8 @@ int mouse_x,
|
|||||||
double mouse_x_abs,
|
double mouse_x_abs,
|
||||||
mouse_y_abs;
|
mouse_y_abs;
|
||||||
|
|
||||||
|
pc_timer_t mouse_timer; /* mouse event timer */
|
||||||
|
|
||||||
static const device_t mouse_none_device = {
|
static const device_t mouse_none_device = {
|
||||||
.name = "None",
|
.name = "None",
|
||||||
.internal_name = "none",
|
.internal_name = "none",
|
||||||
@@ -141,6 +145,20 @@ mouse_close(void)
|
|||||||
mouse_priv = NULL;
|
mouse_priv = NULL;
|
||||||
mouse_nbut = 0;
|
mouse_nbut = 0;
|
||||||
mouse_dev_poll = NULL;
|
mouse_dev_poll = NULL;
|
||||||
|
|
||||||
|
timer_stop(&mouse_timer);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mouse_timer_poll(void *priv)
|
||||||
|
{
|
||||||
|
/* Poll at 3600 Hz. */
|
||||||
|
timer_on_auto(&mouse_timer, 277.0 + (7.0 / 9.0));
|
||||||
|
|
||||||
|
#ifdef USE_GDBSTUB /* avoid a KBC FIFO overflow when CPU emulation is stalled */
|
||||||
|
if (gdbstub_step == GDBSTUB_EXEC)
|
||||||
|
#endif
|
||||||
|
mouse_process();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -165,6 +183,11 @@ mouse_reset(void)
|
|||||||
|
|
||||||
if (mouse_curr != NULL)
|
if (mouse_curr != NULL)
|
||||||
mouse_priv = device_add(mouse_curr);
|
mouse_priv = device_add(mouse_curr);
|
||||||
|
|
||||||
|
timer_add(&mouse_timer, mouse_timer_poll, NULL, 0);
|
||||||
|
|
||||||
|
/* Poll at 3600 Hz. */
|
||||||
|
timer_on_auto(&mouse_timer, 277.0 + (7.0 / 9.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Callback from the hardware driver. */
|
/* Callback from the hardware driver. */
|
||||||
|
Reference in New Issue
Block a user