diff --git a/mist.ini b/mist.ini index c0203f1..78c85b6 100644 --- a/mist.ini +++ b/mist.ini @@ -4,6 +4,7 @@ csync_disable=0 ; set to 1 to output separate hsync and vsync in joystick_disable_shortcuts=0 ; set to 1 to remove joystick -> keyboard commands joystick_ignore_hat=0 ; set to 1 if having issues on gamepads with 'POV hat' mouse_boot_mode=0 ; set to 1 if a mouse does not work well +mouse_speed=100 ; set to scale mouse speed (in percentage, default is 100%) joystick_emu_fixed_index=0 ; set to 1 for always emulating the first two joystick via keyboard joystick_remap=0583,2060,1,2,4,8,10,20,20,8,400,800,40,80 key_menu_as_rgui=0 ; set to 1 to make the MENU key map to RGUI in Minimig (e.g. for Right Amiga) diff --git a/mist_cfg.c b/mist_cfg.c index 39e5742..63dd8f7 100644 --- a/mist_cfg.c +++ b/mist_cfg.c @@ -34,6 +34,7 @@ void mist_ini_parse() joy_key_map_init(); data_io_rom_upload(NULL, 0); // prepare upload memset(&mist_cfg, 0, sizeof(mist_cfg)); + mist_cfg.mouse_speed = 100; minimig_cfg.kick1x_memory_detection_patch = 1; ini_parse(&mist_ini_cfg, user_io_get_core_name()); data_io_rom_upload(NULL, 2); // upload done @@ -46,7 +47,8 @@ void mist_ini_parse() mist_cfg_t mist_cfg = { .scandoubler_disable = 0, .csync_disable = 0, - .mouse_boot_mode = 0, + .mouse_boot_mode = 0, + .mouse_speed = 100, .joystick_ignore_hat = 0, .joystick_ignore_osd = 0, .joystick_disable_shortcuts = 0, @@ -89,6 +91,7 @@ const ini_var_t mist_ini_vars[] = { {"SCANDOUBLER_DISABLE", (void*)(&(mist_cfg.scandoubler_disable)), UINT8, 0, 1, 1}, {"CSYNC_DISABLE", (void*)(&(mist_cfg.csync_disable)), UINT8, 0, 1, 1}, {"MOUSE_BOOT_MODE", (void*)(&(mist_cfg.mouse_boot_mode)), UINT8, 0, 1, 1}, + {"MOUSE_SPEED", (void*)(&(mist_cfg.mouse_speed)), UINT8, 10, 200, 1}, {"JOYSTICK_IGNORE_HAT", (void*)(&(mist_cfg.joystick_ignore_hat)), UINT8, 0, 1, 1}, {"JOYSTICK_DISABLE_SHORTCUTS", (void*)(&(mist_cfg.joystick_disable_shortcuts)), UINT8, 0, 1, 1}, {"JOYSTICK_IGNORE_OSD", (void*)(&(mist_cfg.joystick_ignore_osd)), UINT8, 0, 1, 1}, diff --git a/mist_cfg.h b/mist_cfg.h index 8caa466..6400f2a 100644 --- a/mist_cfg.h +++ b/mist_cfg.h @@ -18,6 +18,7 @@ typedef struct { uint8_t scandoubler_disable; uint8_t csync_disable; uint8_t mouse_boot_mode; + uint8_t mouse_speed; uint8_t joystick_ignore_hat; uint8_t joystick_ignore_osd; uint8_t joystick_disable_shortcuts; diff --git a/usb/hid.c b/usb/hid.c index e6f0e25..dff05a2 100644 --- a/usb/hid.c +++ b/usb/hid.c @@ -705,6 +705,7 @@ static void usb_process_iface (usb_hid_iface_info_t *iface, // iprintf("mouse %d %d %x\n", (int16_t)a[0], (int16_t)a[1], btn); // limit mouse movement to +/- 128 for(i=0;i<3;i++) { + if (i<2) a[i] = a[i]*mist_cfg.mouse_speed/100; if((int16_t)a[i] > 127) a[i] = 127; if((int16_t)a[i] < -128) a[i] = -128; }