Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MEGA65: clean up mose/joystick port selection/emulation #415

Open
lgblgblgb opened this issue Sep 24, 2024 · 1 comment
Open

MEGA65: clean up mose/joystick port selection/emulation #415

lgblgblgb opened this issue Sep 24, 2024 · 1 comment

Comments

@lgblgblgb
Copy link
Owner

lgblgblgb commented Sep 24, 2024

Some problems:

  1. Till now, the default joystick port was always 2. Let's make joystick port selection configurable from CLI or config file, allow config to be saved.
  2. For some reason (forgot why ...) I did something strange: I always forced to switch to port 1 when mouse grab was activated. This is totally not OK! Let's remove that code.
  3. Add code that mouse movements are routed to SID (and the right D620..D623 register) corresponding to the selected joystick port, and not both which is the current situation.

Issue 2. was discovered by @gurcei thanks for the report and the help to clarify this topic a bit in my head.

New(er) problem

Deeper issue as well: newer ROMs incorporated the idea of "joystick with multiple fire buttons" utilizing the POT lines. Xemu always tries to use those for mouse events, thus now even JOY() returns with some strange value!

Discord thread: https://discord.com/channels/719326990221574164/781481205639020554/1337526744747343934

Discovered by shad0wfax, ROM change confirmed/described by dddaaannn. Thanks!

Future

Connected to the previous newer issue: it would be nice if Xemu can emulate multiple-fire joystick. However this leads too far, as USB gamepad/joystick driven emulation by Xemu does not no anything about the layout of the gamepad used and all buttons can be only handled at once without more knowledge. This is scope of a bigger topic, configurable gamepad layout for emulation.

@lgblgblgb lgblgblgb self-assigned this Sep 24, 2024
@lgblgblgb lgblgblgb moved this to In Progress in MEGA65 emulator project Sep 24, 2024
lgblgblgb added a commit that referenced this issue Sep 24, 2024
Also adding an config option '-joyport N' (N can be 1 or 2) as a CLI
option to select the default emulated port. Also, now the configuration
can be saved which preserves the "swap state" of ports.

The original problem was discovered by @gurcei when he noticed that
using the UI menu's "swap port" functionalty does nothing. It was
because for some reason I wrote code to force port-1 when in mouse grab
mode. Which is bad ...
@lgblgblgb lgblgblgb changed the title MEGA65: clean up emulated joystick port selection MEGA65: clean up emulated mose/joystick port selection/emulation Feb 8, 2025
@lgblgblgb lgblgblgb changed the title MEGA65: clean up emulated mose/joystick port selection/emulation MEGA65: clean up mose/joystick port selection/emulation Feb 8, 2025
@lgblgblgb
Copy link
Owner Author

Commit 7394989 is also related somewhat ....

lgblgblgb referenced this issue Feb 8, 2025
The problem: Xemu user may leave mouse grab mode to do something with
their mouse. To avoid bothering the mouse-aware MEGA65 program running,
I returned zero for relative mouse position change in this case. However
that can cause problems with certain programs which are not mouse based
and expecting $FF if mouse is not there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

1 participant