1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-01-13 15:17:43 +00:00

Add mouse_speed setting

This commit is contained in:
Gyorgy Szombathelyi 2020-10-11 14:21:51 +02:00
parent df46a75c37
commit 9df896cc4d
4 changed files with 7 additions and 1 deletions

View File

@ -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)

View File

@ -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},

View File

@ -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;

View File

@ -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;
}