Page 1 of 2

VIC 20 mouse, trackball, ...

Posted: Sun Jul 04, 2010 1:54 pm
by rhurst
I am guessing there is no such thing as mouse / trackball capability on VIC 20 -- except perhaps using that Atari trackball with the joystick emulation switch on -- and that is not what I am looking for.

And if that is true, even those nice PS/2 adapters to emulate a 1350 / 1351 mouse on a C64 and Amiga won't help any either, eh? Just wondering, because I was playing with VICE emulation with paddle support, and of course, POT X/Y works nicely with a PC mouse, but I have not gotten any real hardware to work on VIC 20 with a mouse / trackball device.

Any ideas, or am I chasing a red herring? Thanks.

Posted: Mon Jul 05, 2010 3:11 am
by Jeff-20
I know this doesn't answer your question, but have you ever tried the Wico trackballs?

Re: VIC 20 mouse, trackball, ...

Posted: Mon Jul 05, 2010 3:42 am
by Kananga
rhurst wrote:I am guessing there is no such thing as mouse / trackball capability on VIC 20 -- except perhaps using that Atari trackball with the joystick emulation switch on -- and that is not what I am looking for.
I assume you know about the 1350 mouse and compatibles (1351 in 1350 mode)?
Perhaps also not what you are looking for, because 1350 mode uses joystick emulation, too.

Posted: Mon Jul 05, 2010 4:49 am
by rhurst
I have one of those Wico trackballs, but it serves no meaningful purpose that I have observed when connected to VIC 20. Is there a related driver or example program that exploits that controller?


I know nothing about 1350, except it was an early model #, and only have a 1351 mouse. I will scour the 'net about this joystick emulation mode for the mouse, thanks.

VICE with paddle emulation enabled plays the POT x/y from the PC mouse so nicely, ala my sprite/cursor crosshair for a missile command game. I'd like to see that translated to real hardware, but I have a sneaking feeling I am asking too much of it.

Posted: Mon Jul 05, 2010 6:45 am
by Kananga
rhurst wrote:I know nothing about 1350, except it was an early model #, and only have a 1351 mouse. I will scour the 'net about this joystick emulation mode for the mouse, thanks.
From http://personalpages.tds.net/~rcarlsen/cbm/ctrlport.txt:
"If a 1351 is connected and the right mouse button is held down as the computer is powered up, the mouse switches to "joystick" mode and operates exactly as a 1350."
rhurst wrote:VICE with paddle emulation enabled plays the POT x/y from the PC mouse so nicely, ala my sprite/cursor crosshair for a missile command game. I'd like to see that translated to real hardware, but I have a sneaking feeling I am asking too much of it.
I'd like to see that, too. It should be possible with a modified PS/2-to-C-64 converter, i.e. one that uses the correct timing for the VIC, but I lack the hardware knowledge to do that. Besides, there is no software utilizing a proportional mouse for the VIC-20, yet.

Posted: Mon Jul 05, 2010 11:07 am
by Zagon
Why not use the 1351 in proportional mode? Unless there's some hardware incompatibility I'm unaware of, it should be quite straight forward to port a driver for the vic. The vic can read paddles right?

Here's a link to a good 1351 c64/c128 driver with sourcecode for inspiration.
http://www.esw-heim.tu-clausthal.de/~ma ... DuoDriver/

It should also be possible to use other proportional devices like an Atari trakball, Atari ST or Amiga-mouse as well. But these need polling every tenth scanline or so to be responsive which may not be what you want.

(edit: forgot to include the link)

Posted: Mon Jul 05, 2010 11:48 am
by tokra
Unfortunately the 1351 mouse in proportional mode doesn't work on the VIC. While it's true it uses the paddle x- and y-values on the C64, it just doesn't register those on the VIC. There must be some hardware incompatibility.

Technically it should be possible to construct a mouse that is suited to the VIC's paddle timing, but as there is no software for it, the demand would be nearly zero.

Posted: Mon Jul 05, 2010 1:31 pm
by rhurst
Thanks for that info on holding down the right-mouse button -- I'll check that out for quackers.

I read (somewhere) that the 1351 and its driver on the C64 was also dependent on SID to operate properly. If that is true, I don't see how 1351 mode will work on VIC. I will check out the C64 driver to see if it offers that inspiration. If it does, I can see a crosshair shooter game coming soon to a VIC near you. :P

Posted: Mon Jul 05, 2010 2:30 pm
by Zagon
rhurst wrote:I read (somewhere) that the 1351 and its driver on the C64 was also dependent on SID to operate properly
This seems to be true. After some googling I stumbled upon this link:
http://www.zimmers.net/anonftp/pub/cbm/ ... Mouse.html
It seems that the 1351 expects the capacitor discharge phase to be about 256 cycles long (this is what the SID uses).
I also found an old topic here on denial that touches this subject:
http://www.sleepingelephant.com/v-web/b ... 9b1b43fee5

Posted: Mon Jul 05, 2010 4:22 pm
by rhurst
Thanks for those links -- they seem to confirm a lot of suspicions in a very convincing manner: no conventional means for a proportional mouse / trackball on VIC.

The right-mouse trick for 1351 on power-up does work -- and tests out pretty good in joystick mode (I played Quikman+ using a mouse). And at least you get two fire buttons out of the controller, even though it still is only 8-way directional input.

Posted: Tue Jul 06, 2010 2:56 am
by Mike
Hi, Robert,

when you have the 1351 in proportional mode on the VIC joystick port, what display does result, when you try out this small program with MINIGRAFIK commands, and move around the mouse a bit?

Code: Select all

1 @ON:@CLR:V=36864
2 @1,159*PEEK(V+8)/255+.5,191*PEEK(V+9)/255+.5:GOTO2
It reads out the 8-bit values in the POTX and POTY registers and scales them to the 160x192 resolution.

Posted: Tue Jul 06, 2010 3:00 pm
by dano
Is there any reason an Amiga mouse wouldn't work? They use the 4 joystick direction inputs for X and Y data, I would think all you'd need is a little software to read it. I would love to see a game or disk utility or something similar that had mouse support.

Posted: Tue Jul 06, 2010 3:38 pm
by tokra
Mike wrote: when you have the 1351 in proportional mode on the VIC joystick port, what display does result, when you try out this small program with MINIGRAFIK commands, and move around the mouse a bit?
[...]
It reads out the 8-bit values in the POTX and POTY registers and scales them to the 160x192 resolution.
I tried the POTX and POTY reading some days ago, but the 1351 mouse does not register at all. The POTX and POTY values stay fixed at 255. I pluuged in some original Commodore paddles afterwards and those register fine. The 1351 works fine on the C64. I also have a Micromys-adapter that allows using PS/2-mice on the C64 by emulating 1351. This doesn't work either on the VIC.

So neither the mouse nor the VIC are defective, it just does not work, sadly.

Posted: Wed Jul 07, 2010 8:30 am
by Mike
tokra wrote:I tried the POTX and POTY reading some days ago, but the 1351 mouse does not register at all. The POTX and POTY values stay fixed at 255.
Thank you for the info. This is a much more precise description than what have I've read thus far in other threads here in the forum (and elsewhere on the 'net), where there was stated, that the 1351 "just doesn't work". I had written a driver for the 1351 myself once, for the 128, and held the hope that it might have been merely a linear scale factor preventing the original algorithm to port easily 1:1 to the VIC-20.
dano wrote:Is there any reason an Amiga mouse wouldn't work? They use the 4 joystick direction inputs for X and Y data
From what I've found, an Amiga mouse sends the quadrature signal directly over the wires - which is then taken care about by two directional counters, which are built-in in Paula.

For the mouse to work on the VIC-20 it is necessary to poll the VIA registers at quite a high rate for not to lose a transition, preferably in the NMI, maybe at 1 kHz, or more. This poses a high load on the CPU, but should be doable. Provided the mouse does not otherwise "fritz" the VIC-20 just by being plugged in.

Posted: Wed Jul 07, 2010 2:42 pm
by Zagon
Some time ago, I've wrote prototype code for reading proportional devices like the Amiga mouse. Here it is (I have cleaned it up somewhat):
http://hem.bredband.net/magli143/vic20/prop.zip
Please note that it has only been tested on emulators so far so expect bugs. It supports the Amiga Mouse, the Atari ST mouse and the Atari CX80 and CX22 track balls. Included in the zip file are source code and precompiled test programs for the vic20. One for each input device. More info in the readme.txt file.

Hopefully this can inspire some more!