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 driver
2010-05-30 17:23
TWW

Registered: Jul 2009
Posts: 545
Mouse driver

right. I had one of these made a while ago but now i wanted to implement it in my "universal joy/mouse/keyb-routine".

to my great horror I discover that CCS64 and Vice handles mouse emulation differently.

VICE: Bits 1->6 (which I believe it should be)
CCS64: Bits 2->7


WTF?
 
... 12 posts hidden. Click here to view all posts....
 
2012-06-13 13:27
andym00

Registered: Jun 2009
Posts: 45
I grabbed Win32 version of 2.3.17.. That's changed the behaviour a fair bit :)

The rapid jittering has gone, but there's still this weird once per second movement happening.. Both in my code, and in TWW's test program..

I move the mouse, but once per second (or so) it gets a mind of it's own and moves in the opposite direction (it appears), regardless of the speed, so moving very slow or very fast gives the same result, and regardless of the amount of time I keep it moving.. And the amount it moves back seems proportional to the amount it's just moved..

My mouse stuff, which is basically the Codebase64 code, which is TWW's anyway)
- It has the Kernel keyboard stuff switched off..
- I scan the keyboard myself (I even took my keyboard stuff out to ensure it wasn't that screwing things up)
- I do select which mouse port I want to sample correctly, and leave > 512 cycles between selecting the port and reading the sampled value.. Actually more like 150 raster lines, but I don't think that's an issue..

Here's what I'm running, with all the keyboard reading taken out, if you want to see the weird 'per second' moving back behaviour thing going on, since it's slightly different behaviour to TWW's test program.. And is fixed to 1351 only on Port 2..
sites.google.com/site/andym00/files/mouse_test.prg
2012-06-13 14:36
soci

Registered: Sep 2003
Posts: 480
Actually there's a kind of keyboard scanner in your main loop at $111a which makes the trouble.

Sure you select port B in the first interrupt around line 50, but then in the main loop this routine is switching the mouse port to port A, and it also enables both ports sometime later.

Now comes the second interrupt around 250 where the mouse is either on port B, maybe port A, or more likely on both. No wonder it jumps around.

Why not put this scanning in the first interrupt, set some flags based on the key presses, then select port B at the end and don't fiddle with $dc00 it in the main loop at all?
2012-06-13 15:14
andym00

Registered: Jun 2009
Posts: 45
Bah, I forgot about the specific checks for the function keys and space bar.. Bugger...

The whole ordering for sampling the mouse was just a quick try to get this thing running.. The master plan was to sample several times per frame, say 4 or so..

That said, it's not made any difference to what I see in Vice 2.3.17 at all.. I still get exactly the same behaviour of move the mouse, then it moves back in the opposite direction..

This is the same as before, but with the left over keyboard stuff not being called..
sites.google.com/site/andym00/files/mouse_test2.prg

Simple test I'm doing.. Start Vice up, mouse events not grabbed.. Autostart this.. Grab mouse events..
Immediately the mouse will dive down/right diagonally..
From then on all movements I make, are seemingly replayed, but inverted at 1 second ish intervals.. I move the mouse sharp right (without it overflowing), then 1 second after the move begins, it moves back left..

Okay, now I know I'm not going totally mad..
I've just tested it in the latest build of Micro64 (1.00.2012.06.13 Build 685) the one that came out today (I can't speak for earlier versions), but it works absolutely perfectly in there! Also TWW's mouse test program functions perfectly in there as well..

The only issue with Micro64 is in windowed mode, but in full-screen mode it's perfect.. And that I can't seem to configure which joystick port the 1351 appears on, and apparently the answer is both, simultaneously :)

I'm really confused now :)
2012-06-14 02:51
soci

Registered: Sep 2003
Posts: 480
This version works without jumps for me, and there's no filtering issue like with the TWW driver. Unfortunately I can't test or debug the windows version of VICE. Please open a bug tracker entry with this version attached, maybe someone else could have a look.

The jump on grab is more or less normal. It's like a plug in, the position changes suddenly from 255 to the real one. Same on ungrab, but the opposite way.
2012-06-14 08:41
andym00

Registered: Jun 2009
Posts: 45
Quote: This version works without jumps for me, and there's no filtering issue like with the TWW driver. Unfortunately I can't test or debug the windows version of VICE. Please open a bug tracker entry with this version attached, maybe someone else could have a look.

The jump on grab is more or less normal. It's like a plug in, the position changes suddenly from 255 to the real one. Same on ungrab, but the opposite way.


Okay, so it's only the Windows build that's doing this then.. I'll make a bug report about it..

Thanks for clearing that up anyway :)

But regards the Windows behaviour, a little voice is saying that it feels like it's attempting to move the (hidden) windows cursor to keep it centered in the window, with some delay on it, but inadvertently sending the compensation moves to the 64 mouse.. At least that would explain the behaviour I see, but I somehow doubt it's trying to do it like that, the delay doesn't add up.. Anyway.. We'll see I guess :)
2012-06-14 09:12
andym00

Registered: Jun 2009
Posts: 45
Quoting TWW
I have also tested an enhanced version of the driver containing self calibration (but still based on the C= driver) and it also rocks.


Care to explain what you mean about the self-calibration ?
I mean, what exactly is there that needs calibrating given the simple means of reading the mouse on the 64 ?
2012-06-14 12:52
soci

Registered: Sep 2003
Posts: 480
Magic, after wasting tons of time on trying different ways I could finally cross compile VICE for win32. It's almost 25813, except I've matched the mouse speed with what I normally see on other platforms. Unfortunately the resolution is so low that the LSB will be always 0, but that is normally filtered out anyway.

http://singularcrew.hu/temp/x64_Eisoh5ee.zip

It's the x64.exe only, copy it to your VICE installation with a different name for testing. Actually I don't see any strange behaviour with your test program, and it's exactly how it works for me on Linux too. No jumps and automatic movement at all.

Self calibration is that it measures and uses the actual value range which is not exactly 64-191 on real hardware. It depends on PAL/NTSC clock frequency, mouse type (real 1351 or type of ps2 to 1351 converter), and other hardware tolerances.
2012-06-14 15:36
andym00

Registered: Jun 2009
Posts: 45
lol, you're going to hate me now :)

It does exactly the same thing as it did before.. Everything good, apart from the mirrored playback of the mouse moves, with the same weird delay..

I'm uploading a video of it.. I've been through all the mouse settings here in the windows control panel, and no speed options make any difference, nor do the enhanced precision stuff..

http://www.youtube.com/watch?v=uIVpaQ0o_eg

All I do in the video is..
2. Autostart the .prg
3. Enable grab events
4. Move mouse right.. And wait.. <magic happens>
5. Mouse mouse down.. And wait.. <magic happens>
6. And then move the mouse right in small steps..

You can see after the right move, and also the down move the mouse just heads back to it's start position.. And during the slower long move right it starts to move backwards after the same kind of time delay..
2012-06-15 01:36
vedos
Account closed

Registered: Jul 2003
Posts: 33
Is there a test program for Neos Cheese Mouse? it seems easier to find at fleamarkets than C1351. Also does any games support it (eg. Maniac Mansion Gold)?

Edit: Here's list of some supported games -> "The neos mouse is also supported in these programs: Arkanoid , Arkanoid II - Revenge of Doh, Operation Wolf(these is the ones i know of so far)"
2012-06-15 07:53
andym00

Registered: Jun 2009
Posts: 45
Soci: It's working now.. No idea why, or how, except I experimented with NEOS mouse mode out of curiousity, then I changed the settings back to 1351 and now 1351 emulation is working as it should be.. I know that sounds highly implausible.. But I also have rebooted the machine in the mean time, so not entirely sure which of these events made any actual change to this weirdness..

It's also now strangely working in the 2.3 build I had, the 2.3.17 build and your 2.3.18..

I appreciate the effort you put in, and sorry that it appears to have been some wild goose chase!! Unless it really is related to selecting the NEOS option at some point..

Anyway that said, your version you uploaded is quite a lot nicer in the speed of the mouse than the previous versions :)

Right, full steam ahead then :)

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
Brittle/Dentifrice^(?)
Guests online: 73
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

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