TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.21k stars 385 forks source link

BSNESv115+ SNES Mouse out of sync #4119

Open Ragowit opened 6 days ago

Ragowit commented 6 days ago

Summary

Tried to enable the SNES Mouse in BSNESv115+, but it doesn't follow the computer mouse cursor. Render it kinda useless.

Repro

  1. Load Civilization (U) [!] game into BizHawk
  2. Make sure you're using BSNESv115+ core (haven't tried any other)
  3. Setup Mouse support (SNES --> Controller Configuration)
  4. Continue setup mouse support (Config --> Controllers...)
  5. (Optional) Disable double-click (Config --> Display.... -> Window --> uncheck "Allow Double-Click Fullscreen...")
  6. (Optional) Disable right-click (Config --> Customize --> uncheck "Enable Context Menu")

Host env.

https://github.com/user-attachments/assets/fd287f9f-8d80-48f4-9567-650fc4cfaed9

CasualPokePlayer commented 6 days ago

This is somewhat an architectural issue within BizHawk, but you wouldn't really get what you want regardless even if the "correct thing" was done (only really working if the mouse cursor is hidden, and you'd probably need the mouse cursor captured into the window).

Mouse inputs on actual hardware do not report absolute positions, rather they report relative positions. Absolute positions of a mouse is something resolved at a higher level by software (on the host side this is something resolved by the OS, for the emulated side this is something resolved by the game's code). BizHawk sends in the absolute positions of the mouse as for axis inputs, but since the axis inputs just represent relative inputs, you end up getting desynchrony with the host and emulated mouse.

Of course, this also just means even if you do send in the relative host mouse positions, you still would likely have desynchrony against the emulated mouse and host mouse with their absolute coordinates, although they should be relatively in sync with each other. As such, you wouldn't want the mouse cursor actually visible (since that won't be in sync at all with the emulated mouse) and you would want the mouse cursor "captured" into the window since you will likely need to move your host mouse cursor "outside" of the window to get the wanted emulated mouse position, without the host mouse cursor actually leaving the window.

Also, fwiw, "Allow Double-Click Fullscreen..." and "Enable Context Menu" are normally supressed if you have Mouse L or R respectively bound to an emulated input (overridden if you hold Shift at the same time as the double click or right click).

Ragowit commented 6 days ago

Ah, okay. Thanks for the detailed answer.

I also found that there's a LUA script that seems to fix it for Shadowrun (https://github.com/Gamachara/SNES-Shadowrun-Mouse-Script/), and BizHawk port of LUA code (https://gamefaqs.gamespot.com/boards/588651-shadowrun/79691759).

So I guess one can do game specific LUA scripts for mouse support?

YoshiRulz commented 6 days ago

Duplicate of #1925?

CasualPokePlayer commented 6 days ago

That is some issue with the virtual pad, which is unrelated to how BizHawk translates host mouse inputs to emulated inputs for casual usage.