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

Bugs in Mouse Command #8

Closed
lydon42 opened this issue May 29, 2022 · 3 comments
Closed

Bugs in Mouse Command #8

lydon42 opened this issue May 29, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@lydon42
Copy link
Member

lydon42 commented May 29, 2022

@ruesch repoted this as MEGA65/mega65-core#563

IMG_20220528_193727

The following bugs have been noticed (80Column Mode). I used the original 1351 Mouse and a USB Mouse with Micromys V5.

The results are the same:

  • If i use the "MOUSE ON,1" Command in Basic Programs, its impossible to abort with RUNSTOP, only RUNSTOP/RESTORE works.
  • The Sprite jumps over some pixels in all directions. its difficult to reach a special position.
  • The x and y coordinates in RMOUSE seems not correct. If i move exact 64 pixels in x-coordinate RMOUSE shows only a difference about 31 pixels.

the x,y parameter in MOUSE ON doesn't work.

in direct mode i can reactivate the machine only with RUNSTOP/RESTORE.

See also: https://www.forum64.de/index.php?thread/126476-bugs-in-mouse-command/

@Edilbert
Copy link
Collaborator

Edilbert commented May 30, 2022

I attached a 1531 mouse to port 1 and did some tests with MOUSE ON,1 and then reading the position with
MOUSE X,Y.
I can confirm, that the mouse jumps and the X and Y coordinates too.
Then I tracked the readout of the sprite 0 (default mouse sprite) register ($D000 and $D001) and found the same jumps there. These are set from the kernal mouse driver, which reads the POTX and POTY register at $D419/$D41A.
These seem to cause the issue. They are jumping often, even while moving the mouse smoothly.

So I think it's a VHDL issue: The POTX/Y registers are not set accordingly to the mouse movement.
The mouse driver work smoothly in the emulator XEMU, another hint, that this is not a ROM issue.

@lgblgblgb
Copy link
Collaborator

lgblgblgb commented May 31, 2022

@Edilbert I should also investigate on this more in Xemu, to be honest. How I emulated the mouse is from the manual of an original Commodore mouse specification with notions like "special noise bit" ;) and things like that. I guess there is a bigger - even multi level - problem here: first, we should make sure (ideally ...) that MEGA65 implements mouse query at the "hardware level" close to a C64, if it's a requirement at all. Then, I should make sure, Xemu matches that (MEGA65). Third, there can be ROM problems then if it works well enough, let it be running the ROM on a real MEGA65 and Xemu (at this point this last fact should not count if we're sure Xemu matches MEGA65's behaviour at "hardware" or "emulated hardware" level).

Xemu's implementation is more about seeing what MOUSE ON does and I simply tried to "tune" my code (by 'feeling') to be similar on Xemu. However other programs using mouse (not via BASIC) seems to result in quite different behaviour on Xemu and real MEGA65 already.

lgblgblgb/xemu#321

@dansanderson
Copy link
Collaborator

As of ROM 920383 and core 20221012.18,93d55f0, I'm not noticing any issues with a Commodore 1351 mouse or an Amiga mouse, with MEGA65 Configuration set appropriately. I vaguely recall reproducing jitter with 1351 mice months ago, but I don't know if a specific change addressed this issue.

I can exit a BASIC program with the mouse active using RUN/STOP. RMOUSE reports the mouse position precisely: X coordinates in range 24-343 and Y coordinates in range 50-249, in 80x25 mode. (That's an unusual range, but it works, and I'm reluctant to change it because it would break existing software.)

I'm closing this as fixed. Please re-open if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants