Jump to content

Photo

New mouse project!


69 replies to this topic

#26 sh3-rg OFFLINE  

sh3-rg

    River Patroller

  • 2,106 posts
  • absent
  • Location:elsewhere

Posted Mon Aug 9, 2010 8:43 AM

Okay, while it may be possible to make a mouse for the Jaguar, one would also need to make software to utilize said mouse. Heck, that applies to ANY new hardware made for a video game console.


Matthias has mouse-supporting routines & infos. Check about 1/2 way down the page: M D GAMES.

His next release will support it :)

#27 Tyrant OFFLINE  

Tyrant

    Stargunner

  • 1,611 posts
  • Location:London, UK

Posted Mon Aug 9, 2010 8:52 AM


Okay, while it may be possible to make a mouse for the Jaguar, one would also need to make software to utilize said mouse. Heck, that applies to ANY new hardware made for a video game console.


Matthias has mouse-supporting routines & infos. Check about 1/2 way down the page: M D GAMES.

His next release will support it :)

Like I said earlier, I just hope he polls the mouse fast enough to keep up with an 800dpi monster.

#28 sh3-rg OFFLINE  

sh3-rg

    River Patroller

  • 2,106 posts
  • absent
  • Location:elsewhere

Posted Mon Aug 9, 2010 9:03 AM



Okay, while it may be possible to make a mouse for the Jaguar, one would also need to make software to utilize said mouse. Heck, that applies to ANY new hardware made for a video game console.


Matthias has mouse-supporting routines & infos. Check about 1/2 way down the page: M D GAMES.

His next release will support it :)

Like I said earlier, I just hope he polls the mouse fast enough to keep up with an 800dpi monster.


Yea, that's true. The exact model of mouse isn't chosen yet so he can experiment a bit. If he could make one up as an adaptor I'd be happy to go test all the different flavours I have here & buy a half dozen or so more to test with... I'm pretty hard on my mice & I have to say these Logitech optical mice are great value, if I can have the same type of mouse on my PC, Falcon & Jaguar I'll be happy :)

#29 Tyrant OFFLINE  

Tyrant

    Stargunner

  • 1,611 posts
  • Location:London, UK

Posted Mon Aug 9, 2010 9:30 AM




Okay, while it may be possible to make a mouse for the Jaguar, one would also need to make software to utilize said mouse. Heck, that applies to ANY new hardware made for a video game console.


Matthias has mouse-supporting routines & infos. Check about 1/2 way down the page: M D GAMES.

His next release will support it :)

Like I said earlier, I just hope he polls the mouse fast enough to keep up with an 800dpi monster.


Yea, that's true. The exact model of mouse isn't chosen yet so he can experiment a bit. If he could make one up as an adaptor I'd be happy to go test all the different flavours I have here & buy a half dozen or so more to test with... I'm pretty hard on my mice & I have to say these Logitech optical mice are great value, if I can have the same type of mouse on my PC, Falcon & Jaguar I'll be happy :)

Talk with him about it. It should be possible. As I once suggested, there should be enough time to poll for changes (and write them into a buffer) inside the sound-rendering interrupt, and I'm pretty sure that runs often enough to keep up with... about 27 inches per second mouse movement at 800dpi from a 22khz sample rate.

#30 jaguar_fan OFFLINE  

jaguar_fan

    Dragonstomper

  • 552 posts
  • Location:Germany

Posted Mon Aug 9, 2010 9:34 AM

Depending on price I would go for one each ST and Jaguar.

Thanks.

#31 Zerosquare OFFLINE  

Zerosquare

    Stargunner

  • 1,804 posts
  • Location:France

Posted Mon Aug 9, 2010 2:51 PM

sh3 : if you use my firmware, DPI won't be a problem ; it limits the pulse rate to the maximum the ST keyboard processor can accept (I think it's 2000 pulses/second, but it's been a while, I'd have to check.). It can be changed if necessary.

#32 Matthias OFFLINE  

Matthias

    Stargunner

  • 1,121 posts
  • Location:Germany

Posted Mon Aug 9, 2010 2:52 PM

Hello!

... The exact model of mouse isn't chosen yet so he can experiment a bit. If he could make one up as an adaptor I'd be happy to go test all the different flavours I have here & buy a half dozen or so more to test with... I'm pretty hard on my mice & I have to say these Logitech optical mice are great value, if I can have the same type of mouse on my PC, Falcon & Jaguar I'll be happy :)


Here is why i never came up with (--> released ) a PS/2-mouse adapter or something integrated as you plan:
Atari says that the joyports are only good for 50mA, at the timeframe i looked into the topic the majority of ball-mice and all of the optical mice needed more than 50mA so it would have been necessary to add a secure power supply to the adapter.

Kind regards
Matthias

#33 Zerosquare OFFLINE  

Zerosquare

    Stargunner

  • 1,804 posts
  • Location:France

Posted Mon Aug 9, 2010 3:11 PM

That's true, but I think Atari was conservative with the 50 mA specification ; the +5 volt pin on the pads connectors is connected directly to the main power supply through an inductor. Assuming you don't have anything else connected to the other pad port, drawing 100 mA from a single pad port should probably be OK.

Anyways, most optical mice tend to require 100 mA, but I've seen a lot of ball mice which require less than 50 mA.
By the way, I'm working on a simple PS/2 adapter right now :)

#34 danny_galaga OFFLINE  

danny_galaga

    Moonsweeper

  • 250 posts
  • http://dannygalaga.com/shop.html
  • Location:Brisbane

Posted Tue Aug 10, 2010 6:47 AM

Okay, while it may be possible to make a mouse for the Jaguar, one would also need to make software to utilize said mouse. Heck, that applies to ANY new hardware made for a video game console.


I was wondering that myself. What can you use a Jaguar mouse on? I'd certainly buy one if there were any mouse games! If only Cannon Fodder had mouse support...

#35 Tyrant OFFLINE  

Tyrant

    Stargunner

  • 1,611 posts
  • Location:London, UK

Posted Tue Aug 10, 2010 7:27 AM


Okay, while it may be possible to make a mouse for the Jaguar, one would also need to make software to utilize said mouse. Heck, that applies to ANY new hardware made for a video game console.


I was wondering that myself. What can you use a Jaguar mouse on? I'd certainly buy one if there were any mouse games! If only Cannon Fodder had mouse support...

As has already been said, the upcoming Impulse X will support mouse input, as will Eerievale, when it is eventually released. Also I believe mice can be used on T2k as a poor-mans rotary.

#36 Sauron OFFLINE  

Sauron

    River Patroller

  • 4,701 posts
  • In the land of Mordor.
  • Location:North of the Black Sea

Posted Tue Aug 10, 2010 10:34 AM

I'd have to say that hacks for mouse support in Cannon Fodder and Syndicate would make both games far more playable. Cannon Fodder with just pad controls is quite playable as-is, but Syndicate would be an order or magnitude better.

#37 PeterG OFFLINE  

PeterG

    Dragonstomper

  • 584 posts
  • Location:Germany

Posted Tue Aug 10, 2010 11:57 AM

I'd have to say that hacks for mouse support in Cannon Fodder and Syndicate would make both games far more playable. Cannon Fodder with just pad controls is quite playable as-is, but Syndicate would be an order or magnitude better.

Mouse support would definitivly help a lot with these games. Unfortunatly aside from that Syndicate is also very very slow. I tried to play it again because I loved it back in the day and lost my patience. And it even gets worse in later levels from what I remember. This one sadly hasn't aged well for me. :-(

#38 BuddyBuddies OFFLINE  

BuddyBuddies

    River Patroller

  • 2,211 posts
  • Location:A Secret Place

Posted Tue Aug 10, 2010 1:05 PM

I'd have to say that hacks for mouse support in Cannon Fodder and Syndicate would make both games far more playable. Cannon Fodder with just pad controls is quite playable as-is, but Syndicate would be an order or magnitude better.


+1

#39 ovalbugmann OFFLINE  

ovalbugmann

    River Patroller

  • 2,109 posts
  • Location:Phoenix, Arizona

Posted Tue Aug 10, 2010 3:32 PM

I think Lars' Ocean Depths CD with the EerieVale demo on it had a few special edition copies sold by him that included a mouse/adaptor for use on the Jag with the EerieVale demo on there. :) It might have been a ST ball mouse. :)

#40 BuddyBuddies OFFLINE  

BuddyBuddies

    River Patroller

  • 2,211 posts
  • Location:A Secret Place

Posted Tue Aug 10, 2010 3:57 PM

I think Lars' Ocean Depths CD with the EerieVale demo on it had a few special edition copies sold by him that included a mouse/adaptor for use on the Jag with the EerieVale demo on there. :) It might have been a ST ball mouse. :)


mine came with a mouse:)

#41 ovalbugmann OFFLINE  

ovalbugmann

    River Patroller

  • 2,109 posts
  • Location:Phoenix, Arizona

Posted Tue Aug 10, 2010 9:07 PM

You got the rare special edition copy with Jag Mouse/adaptor then! :D I saw one on ebay a year or two ago but was really low on funds/credit so I couldn't get it. Nice score. :)

#42 Stephen Moss OFFLINE  

Stephen Moss

    Dragonstomper

  • 733 posts
  • Location:Cambridge, United Kingdom

Posted Tue Aug 17, 2010 2:57 AM

Matthias has mouse-supporting routines & infos. Check about 1/2 way down the page: M D GAMES.

His next release will support it :)

I may be wrong but as far as I can see that method relies on the mouse outputs basically being two, 2 bit grey codes simlar to the rotary controllers (although they only use one) which is how older wheel mice worked. My understaning of modern optical (and particullay USB) mice is that they output 3 or 4 bytes of data depending on if it has a wheel button thingy or not so I don't think it is that simple.
I do however think the way modern mice output data is better for the Jag as it is scalable so programmers can multiply/devide the values to get the speed they want or even let users calibrate it to speed they prefer and save the scaling value to the cart, additionally that type of output lends it self more easily to the Bank Switching advanded controller type that Atari have mice listed as in the TechRef.

sh3 : if you use my firmware, DPI won't be a problem ; it limits the pulse rate to the maximum the ST keyboard processor can accept (I think it's 2000 pulses/second, but it's been a while, I'd have to check.). It can be changed if necessary.

I am quite prepaired to be proved wrong on this but don't modern optical mice basically take two images, compare them to work out how far the mouse has moved between images. If so then it may not be necessary to read the mouse at the rate it can sample the amount of movement, provided the byte values are internally updated regardless of if they are read or not you will always read a movement value out if the mouse if it is moveing. The fact that you only read say one in every 10 samples it is capable of outputting may not be an issue as...
1) The revieved value is scalable as I mentioned before so that can be compensated for
2) Concidering the resolution of the typical Jaguar game screen is about a quarter of that of a modern PC screen you I doubt you would need the same dergee of accuracy and there need less samples per second otherwise a small movement of the mouse would send the cursor right across the screen.

But I have not had time to look into a Jaguar mouse fully (it is on my to do list) so I am largely speculating at this point.

Here is why i never came up with (--> released ) a PS/2-mouse adapter or something integrated as you plan:
Atari says that the joyports are only good for 50mA, at the timeframe i looked into the topic the majority of ball-mice and all of the optical mice needed more than 50mA so it would have been necessary to add a secure power supply to the adapter.

That's true, but I think Atari was conservative with the 50 mA specification ; the +5 volt pin on the pads connectors is connected directly to the main power supply through an inductor. Assuming you don't have anything else connected to the other pad port, drawing 100 mA from a single pad port should probably be OK.

Anyways, most optical mice tend to require 100 mA, but I've seen a lot of ball mice which require less than 50 mA.
By the way, I'm working on a simple PS/2 adapter right now :)

I have done some testing on my Jag and I have to agree with current limits Atari place on the Jaguar I/O ports, if you absolutely have no other option you could go are far as 100mA per controller port but that is an absolute never to be exceeded value.
The one issue I have with anyone doing that espically for a single controller is that someone who may not be aware that it is taking that much current may later decide to write an 4 or 8 player game for that controller resulting in your Jag going up in smoke as you try and suck 400mA from each controller port as not everyone would think/be prepaired to buy 8 controllers to fully test it and thus blow up thier Jag first.

My advice to controller developers (for what it is worth) would be to stick with the 50mA per controller Port limit (12mA/Controller to allow for 4 players) but if exceeding that it can not be avioded do not exceed 100mA per controller port (24mA/Controller to allow for 4 players) and preferably provide your hardware with its own power supply.

#43 Tyrant OFFLINE  

Tyrant

    Stargunner

  • 1,611 posts
  • Location:London, UK

Posted Tue Aug 17, 2010 3:30 AM

I may be wrong but as far as I can see that method relies on the mouse outputs basically being two, 2 bit grey codes simlar to the rotary controllers (although they only use one) which is how older wheel mice worked. My understaning of modern optical (and particullay USB) mice is that they output 3 or 4 bytes of data depending on if it has a wheel button thingy or not so I don't think it is that simple.
I do however think the way modern mice output data is better for the Jag as it is scalable so programmers can multiply/devide the values to get the speed they want or even let users calibrate it to speed they prefer and save the scaling value to the cart, additionally that type of output lends it self more easily to the Bank Switching advanded controller type that Atari have mice listed as in the TechRef.

Basically there are two kinds of mice in the world, old Atari/Amoeba mice which, as you say, output the pulses directly as two pairs of square waves, and pc mice which output data serially. The first kind (technically called bus mice) basically they just hook the outputs from the sensor into the computer. They require the computer do all of the processing and basically watch the mouse like a hawk (watching a mouse), as any missed pulses will result in a loss of precision or seemingly random movement. On the ST there is a dedicated processor on the keyboard watching the mouse constantly. It is not left up to the CPU, the CPU just asks the mouse processor how far the mouse has moved since the last time it asked, and it gets told it. This is pretty much exactly how serial mice work, except that in a serial mouse, the dedicated processor is on the mouse itself, and it just reports (when asked), how far it has travelled since the last time it was asked (as well as button states, obv).

On the Jaguar you *could* use Jerry to watch the mouse, but like I said you would have to do it on an extremely fast interrupt. A better idea would be to use a mouse with a dedicated processor, either on an adaptor or on the mouse itself. This could watch the mouse and output its data in the bank-switching arrangement atari suggested (look at analog joysticks, it's almost the same scheme). Another alternative would be to hook up a serial mouse to the Jaguar's serial port on the back. The adaptor would be relatively simple to build and it would, again, take the load off the Jag's processors.

The problem, however, is that there are currently two games in development which support bus mice (as well as a well known adaptor schematic for ST mice), and it does not seem likely that either Matthias or Lars would want to integrate support for yet another type of mouse which nobody has. What we need is for someone to come up with a really simple adaptor pcb and a simple drop-in bit of 68k code that reads it, and make both available.

I have done some testing on my Jag and I have to agree with current limits Atari place on the Jaguar I/O ports, if you absolutely have no other option you could go are far as 100mA per controller port but that is an absolute never to be exceeded value.
The one issue I have with anyone doing that espically for a single controller is that someone who may not be aware that it is taking that much current may later decide to write an 4 or 8 player game for that controller resulting in your Jag going up in smoke as you try and suck 400mA from each controller port as not everyone would think/be prepaired to buy 8 controllers to fully test it and thus blow up thier Jag first.

My advice to controller developers (for what it is worth) would be to stick with the 50mA per controller Port limit (12mA/Controller to allow for 4 players) but if exceeding that it can not be avioded do not exceed 100mA per controller port (24mA/Controller to allow for 4 players) and preferably provide your hardware with its own power supply.

I agree. It seems like a hard limit to me, and the Vcc and GND rails supplied to the controller do appear to be the main ones of the system (accidentally shorting them together causes the Jag to crash spectacularly). I've been trying to advise against using bus mice like this for years, but I hadn't considered the power problems.

#44 Zerosquare OFFLINE  

Zerosquare

    Stargunner

  • 1,804 posts
  • Location:France

Posted Tue Aug 17, 2010 6:29 AM

Stephen Moss : note that the mice ggn talks about would be modified ones, which would include a module to emulate the signals of a real bus (or Atari/Amiga) mouse. So while what you said about the internal workings is true, it would be irrelevent.

Regarding the power problems, what both of you said is true, but I think as long as we make it clear that only one mouse should be connected at the same time, and no other controller, things will be fine. I don't believe accidental short-circuiting is a real problem ; if we discover it is, we can include a self-resettable fuse in the mice or in the adapter.

Using the serial port on the DSP port would work, but if you want to use older serial-based mice, a JagLink (or similar device) would be required to convert the 5 volts CMOS signals to RS-232 levels. Additionally, remember that the Jaguar UART is buggy ; it can be worked around using a timer to poll the input pin, but it requires a frequently occuring interrupt.

I'm currently designing an adapter for PS/2 mice which is pretty simple to build ; it only requires two transistors and some wires. The hardware side is done, and I'm working on the software right now. If I'm not mistaken there's a way to make it work without needing any interrupt. I'll keep you updated :)

#45 Zerosquare OFFLINE  

Zerosquare

    Stargunner

  • 1,804 posts
  • Location:France

Posted Wed Aug 18, 2010 6:28 PM

Okay, I've just finished the first test software for the PS/2 to Jaguar adapter. There are a few potential problems to solve but the basic principle seems to works fine.

Here's a short video.

#46 the.golden.ax OFFLINE  

the.golden.ax

    Tear down this temple

  • 12,424 posts
  • I'll rebuild it in 3 days

Posted Wed Aug 18, 2010 6:30 PM

Very cool indeed. +1

AX

#47 sh3-rg OFFLINE  

sh3-rg

    River Patroller

  • 2,106 posts
  • absent
  • Location:elsewhere

Posted Wed Aug 18, 2010 6:58 PM

Great work zerosquare!

#48 Tyrant OFFLINE  

Tyrant

    Stargunner

  • 1,611 posts
  • Location:London, UK

Posted Thu Aug 19, 2010 3:21 AM

Okay, I've just finished the first test software for the PS/2 to Jaguar adapter. There are a few potential problems to solve but the basic principle seems to works fine.

Here's a short video.

Nice, but upon which principles is it working?

#49 Zerosquare OFFLINE  

Zerosquare

    Stargunner

  • 1,804 posts
  • Location:France

Posted Thu Aug 19, 2010 12:30 PM

Here's the schematic :
Posted Image
I've added an (optional) second PS/2 port in the case someone wants to do a mouse+keyboard game, or a two-player one with two mice :)

The principle is pretty simple : the PS/2 protocol uses serial communication, with one data line and one clock line (bits are sent one at a time). My code is just a straightforward implementation. Synaptics has made available a nice document with all the details.

One potentially troublesome thing : you can poll the device whenever you want, but the clock signal is generated by the device so you have to keep polling the inputs regularly until the communication is finished ; the high and low states can be as short as 30 µs. Also, the data bytes transmitted can be separated by "pauses" which waste time.

At the moment the code is 68k-based ; it works, but I'm not sure if it would be OK in a finished program where the 68k could lose arbitration to the GPU, DSP, Blitter or op. So it would probably be better to use the DSP, but I'm not sure if the code should run in a timer interrupt or just use standard loops.
So, one question for Jag developers : what would work best for you ?

Edited by Zerosquare, Thu Aug 19, 2010 12:32 PM.


#50 CyranoJ OFFLINE  

CyranoJ

    River Patroller

  • 2,002 posts
  • RAPTOR in LOCAL
  • Location:Adelaide, SA

Posted Thu Aug 19, 2010 2:44 PM

Ok, so you have to read the pulses.. but not in a timing exact way.

How much CPU does the actual pulse read take without all the boring delay bits? Because there are surely going to be places in a games main loop you could jump out to read the mouse.

EG, Kick off the GPU to do something, immediate return. Read the mouse. Wait for GPU to finish.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users