dborth / snes9xgx

Snes9x GX - Port of Snes9x for Wii
http://wiibrew.org/wiki/Snes9x_GX
Other
435 stars 64 forks source link

Cursor position not restricted to screen bounds #991

Closed amberdambey closed 2 years ago

amberdambey commented 2 years ago

FIXED Issue #758 - Cursor can now move off screen when using GC/Classic Pad Allow for Snes Mouse to move off screen

dborth commented 2 years ago

How is this better? The mouse is no use off screen. Also, this doesn't address #758 that issue wasn't about being about to move off screen it's that the mouse doesn't move to where the wiimote is pointing like the scope does

amberdambey commented 2 years ago

The intention of this was to get the GC/Classic Pad control stick to instantly update the mouse movement (velocity), not to instantly set the in-game pointer to an arbitrary position. The virtual cursor and in-game pointer are completely independent, meaning if the virtual cursor moves, the movement of it is updated to the emulator, then the game's pointer. However, the mouse isn't necessarily an absolute-position controller like the SuperScope/Justifier are. The game must manually update the cursor from the movement vector read from the mouse. However, the system which is set up appears to use the virtual cursor, which is responsible for the Wiimote IR pointer. But since it's optimized for the pointer, it doesn't allow for relative position. To fix this, I removed the clamping values so if a Classic Controller is connected, the cursor is not restricted to screen bounds, but can instead move anywhere. This SHOULD allow for continuous, non-restricted mouse movement with the Classic Controller. I am researching fixing the bug completely, although for right now this is the only solution that works when I compiled it and tested it with my Wii Classic Controller Pro. It appears to work fine with the SNES mouse controller, but it might glitch out a little when using the SuperScope/Justifier controller. I'll continue editing this solution until it doesn't affect anything but the SNES mouse controller, and works for all controllers except Wiimote IR.

Speaking of Wiimote IR, I was thinking about maybe using Wii MotionPlus to simulate an unrestricted cursor. I tried getting the input system to use Wii MotionPlus, but it seems to be a bit difficult because this. I was also thinking about a way to get absolute positioning working, could be possible to update memory addresses for specific games (i.e. Mario Paint and point-and-click games that use an on-screen cursor) reserved for the cursor position and set them to the Wiimote IR position, but it would ONLY work for THOSE games.