Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Mouse Issues
2005-01-04 11:51
DjS

Registered: Jul 2003
Posts: 47
Mouse Issues

Hi All!
I've got a question about some mouse issues I'm having. In my latest project I have integrated mouse control, I tested my code in Vice and all worked fine. Some days ago I wanted to test the same code in CCS V3.0 and noticed that the mouse acted different then it did in Vice. After doing some checks I noticed that both Vice aswell as CCS use 7 bits in the $d419 and $d41a registers, only Vice uses bits 1 to 7 and CCS uses bit 2 to 8 which explaned the difference in behaviour.
I thought that the real C64 used all 8 bits instead of the 7 that the emu's use so I wanted to check that. Since I've got no real C1351 mouse but thought I rememberd atari mouses work on Commodore aswell I tested it on my SX.
Result; Pluging the mouse in causes the keyboard to Jam. I unplugged the mouse and tried it in the other port which was just as bad as the first.
In port I the mouse did give some output when moved around, about the same as a joystick does when plugged in the same port.
I unplugged the mouse again and wrote some lines to print out the $d419 and $d41a registers, started the loop, plugged mouse back in and nothing...
Is it the Atari mouse? or am I doing something wrong? I want my program to be as compatible as possible but if I get 3 different read-outs on the real thing and 2 emu's I think I have a problem Houston.. ;)

Can anyone help me with this?

 
... 15 posts hidden. Click here to view all posts....
 
2005-01-05 18:17
Graham
Account closed

Registered: Dec 2002
Posts: 990
my 1351 seems to output values between $44 and $C1. remember it is analogue so it may be different for different mice.

mouse button can be polled at $DC01. bit 0 is right mouse button, bit 4 is left mouse button.
2005-01-06 13:51
DjS

Registered: Jul 2003
Posts: 47
Thanks for that info! I think I'll have to start over with a new approach.. Think the 4 bit value I want to control has to be made relative aswell I guess...

2005-01-13 21:39
wulong
Account closed

Registered: Jan 2004
Posts: 1
Hi "The Git"

If you like to code a mouse driver for the 1351 and compatibles, you have to take in count the complete range of 8bit ($d419, $d41a). Only Bit0 contains no information because of noise. This bit can be masked out or you do a logical right-shift. The absolute range of the analog values is totaly different for different mouse models. But the ABSOLUTE range is not the point of interest. The RELATIVE change of the values is the only important thing.
2005-01-13 23:49
DjS

Registered: Jul 2003
Posts: 47
Thanks for your reply :)
I know how to solve this problem now and I know Vice gives out wrong data (Only bit 0 to 6(lsr by itself)) and CCS masks bit0 by itself...
Now the next problem arises; how to make the mouse work the same on both emu's?

2005-01-14 08:20
Hoogo

Registered: Jun 2002
Posts: 102
I think you might enjoy a look at McBacons DouDriver :-) Not for using it to move a Sprite around the screen, but for the way he calculates the movement of the mouse.
2005-01-14 11:44
Krill

Registered: Apr 2002
Posts: 2839
Quote: Thanks for your reply :)
I know how to solve this problem now and I know Vice gives out wrong data (Only bit 0 to 6(lsr by itself)) and CCS masks bit0 by itself...
Now the next problem arises; how to make the mouse work the same on both emu's?



i coded several emulator check routines (you might want to check the emufuxx0r thread in here), and some of them failed only on ccs or only on vice, so this might be an option. but still, this is a vice BUG, so better tell the team or so.
2005-01-14 17:00
Graham
Account closed

Registered: Dec 2002
Posts: 990
i dont think its a bug. actually the range is the same as the real 1351: ~128. my mouse has ~$40 to ~$C0 but ~$00 to ~$80 is also valid.
2006-11-30 12:01
JackAsser

Registered: Jun 2002
Posts: 1989
In VICE the pot registers wrap several times before they stop, I guess they continue wrap as long as there are space left to move the invisible mousepointer on the real PC screen.

Question: Does the POTs wrap on a real C64, or are the values always bounded within 00-FF (different ranges for different mouses as mentioned earlier)? In orhter words actually, is the 1351 mouse a relative or absolute device on the real thing?


2006-11-30 12:35
Mace

Registered: May 2002
Posts: 1799
The pots can't wrap, as they contain the resistance-value between two pins on the joyports.
2006-11-30 12:36
Graham
Account closed

Registered: Dec 2002
Posts: 990
It's not that clear when they wrap on a real C64. The voltage range differs from mouse to mouse, so you have to deal with multiple ranges anyway.
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
zzarko
Apollyon/ALD
zbych
DjS/Silicon Ltd
Guests online: 134
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.055 sec.