Skip to content

Conversation

alekmaul
Copy link
Owner

@alekmaul alekmaul commented Mar 8, 2025

No description provided.

undisbeliever and others added 30 commits June 16, 2024 22:05
The Hyperkin mouse always outputs a sensitivity of 0, which
will cause the mouseSpeedChange loop to always timeout.

Decreasing the maximum number of loops will reduce CPU usage when using
a Hyperkin mouse.
Also removes the unread private `mouse_sp` variable
and into mouseSpeedChange, since mouseConnect is always true when
speed_change is called by the VBlank ISR.
if a non-standard controller is connected to the other controller port.
If the developer was unaware `snes_mouse` was cleared by the VBlank ISR
then the player could lock the game if the mouse was ever disconnected.

`snes_mouse` can no-longer be used to detect if the mouse has been
disconnected from the console.  The developer will have to check the
`mouseConnect[]` variable instead.
Fixes a typo in the `mouseSpeedSet` mask.
Add compile instructions for ChromeOS
… API)

The old `mouseSpeedChange(u8 port)` function has a timing conflict with
the auto-joypad-read.  The automatic joypad read must not start while
the CPU is in the middle of the `mouseSpeedChange()` function.

Delaying all mouse sensitivity changes to the VBlank ISR will remove
this timing conflict and ensure the mouse sensitivity is cycled at the
correct time.

This commit removes the old `mouseSpeedSet` variable and the
`mouseSpeedChange()` function, replacing them with a
`mouseRequestChangeSensitivity` variable that will signal to
`_MouseData` that the MainLoop wants to either:
 * Cycle the mouse sensitivity once.
 * Cycle the mouse sensitivity twice (decrementing the sensitivity).
 * Setting the mouse sensitivity to a specific value.

This commit also adds a `mouseSensitivity` variable that serves three
purposes:
 1. Allows the developer to read the reported mouse sensitivity.
 2. Allows the developer to set the initial mouse sensitivity.
 3. Restore the mouse sensitivity when the mouse is disconnected, then
    reconnected.

Three helper functions have been added to simplify the
`mouseRequestChangeSensitivity` writes:
 * void mouseCycleSensitivity(u16 port)
 * void mouseCycleSensitivityTwice(u16 port)
 * void mouseSetSensitivity(u16 port, u16 sensitivity)

The two mouse examples have been modified to use the new mouse
sensitivity functions and to display the reported mouse sensitivity.
not matching the mouseSetSensitivity comment in
`pvsneslib/source/input.asm`.
Also added a few notes about the mouse buttons and mouse sensitivity
I added tada.wav and tada code in Makefile
CHange upload artifact from v3 to v4
@alekmaul alekmaul merged commit a3b165d into master Mar 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants