Page 3 of 8

Posted: Tue 21 Feb, 2006 1:03 pm
by tr1p1ea
Wow, great stuff Ben ... keyboard AND mouse with no need for usb! Thats extraordinary! :). You have any other input deviced laying around ... any megadrive controllers? :twisted:.

Posted: Tue 21 Feb, 2006 1:25 pm
by benryves
tr1p1ea wrote:Wow, great stuff Ben ... keyboard AND mouse with no need for usb! Thats extraordinary! :). You have any other input deviced laying around ... any megadrive controllers? :twisted:.
Heh, thanks. The mouse routines are significantly smaller than the keyboard routines, as the keyboard needs tables to translate multibyte codes into single byte codes. All the mouse needs is a call to a function to reset and initialise, and then a call every so often to update the mouse_x and mouse_y counters (both 16-bit).

Posted: Tue 21 Feb, 2006 1:38 pm
by kv83
I'm really intrested in how this would work with a game or application. Mineswepper or Paint or something like that would be a good "test" candidate.

Does it already "read" the buttons aswell?

Is it difficult to make such a controller to connect a mouse to it? I would like to try it. A mouse can be bought with 3euro already. It can connect to the 83, can't it?

Posted: Tue 21 Feb, 2006 1:47 pm
by benryves
kv83 wrote:Does it already "read" the buttons aswell?
It reads them, but doesn't do anything with them. Ultimately, I'll shift all the bits along for all 5 buttons into a single byte you can read and mask out the buttons you want to test.
Is it difficult to make such a controller to connect a mouse to it?
Not at all. Mine is held together with sticky-tape and Blu-Tak :roll:

You just need to connect the keyboard/mouse to 5V (battery pack or something) and the two leads from the calculator's data port go straight to the data or clock lines of the connected mouse or keyboard. Both use the same wiring. The diagram at the bottom here: http://www.psikan.com/keyboard.php is the way to do it.
I would like to try it. A mouse can be bought with 3euro already. It can connect to the 83, can't it?
No. It crashes on the 83, I assume because of the way bport is shared with something else (ROM paging?) There's no reason it can't be fixed, though -- I'll give it a try tonight, and see where it's breaking.

Posted: Tue 21 Feb, 2006 1:58 pm
by CoBB
For the 83 always set the high nibble to %1101 when sending to the link port. More precisely, bit 4 is the culprit that's connected to bit 3 of the ROM page swapped in.

Posted: Tue 21 Feb, 2006 2:07 pm
by benryves
CoBB wrote:For the 83 always set the high nibble to %1101 when sending to the link port. More precisely, bit 4 is the culprit that's connected to bit 3 of the ROM page swapped in.
Thank you. :) Would this value affect the 83+ in any way? I assume I'm always outputting %000000xy at the moment.

Posted: Tue 21 Feb, 2006 4:08 pm
by CoBB
No, only bit 2 has to be kept 0, so the values for the 83 shouldn't interfere with anything.

Posted: Tue 21 Feb, 2006 5:19 pm
by kalan_vod
Great work Ben, it is amazingly fast and I hope to try it soon if I can find the time :D.

Posted: Wed 22 Feb, 2006 1:49 am
by Timendus
Good to see this project back to life :)
Ultimately, these routines are rather useless until they become widely adopted. Ideally, they could/would be added to a shell, and form part of the standard routines. For example, the shell could provide a "get key" function, which would also transparently return keyboard keys as if they were keys on the keypad, or return four "left" keys if the mouse was moved 4 mm left -- that sort of thing.

Chances of this happening are, sadly, nil.
I'd still love to see it in the API though :) Perhaps that's not as widespread as some shells are, but it's a step in the proper direction, I suppose...

Do you eat properly, Ben? Your hand is still skinny as ever :P You really should take good care of yourself ;)

Oh, and this could be useful for porting it to Ti-83:
http://wikiti.denglend.net/index.php?title=83:Ports:00
(Last edit by Timendus, April 28th 2005? What the hell..? Is the WikiTi dead or something?)

Posted: Wed 22 Feb, 2006 10:21 am
by tr1p1ea
lol, i would expect his hand to be all muscley because of all that programming!

I cant help but think how funny it would be to walk into a class, whip out your calc, a PC keyboard and a mouse, sit down and start messing around ... i bet you would get some funny looks :).

Posted: Wed 22 Feb, 2006 10:56 am
by benryves
Timendus wrote:I'd still love to see it in the API though :) Perhaps that's not as widespread as some shells are, but it's a step in the proper direction, I suppose...
That would be great... though the routines are quite large, adding 600-odd bytes just for the mouse.

http://benryves.com/bin/emerson/demo/mouse_demo_2.zip <- here's a better mouse demo, TI-83 friendly. It also displays the button status and supports Intellimouse extensions (scroll wheel).

Posted: Wed 22 Feb, 2006 3:13 pm
by Timendus
Cool stuff :) Could I mod a USB->PS/2 connector to a link cable, or would that use a different protocol? I only have USB mouses lying around here... Oh, wait, that's not entirely true. But it would be easier to use that connector, since I could permanently modify it and still use my mouse on my computer :)

Posted: Wed 22 Feb, 2006 3:27 pm
by benryves
Timendus wrote:Cool stuff :) Could I mod a USB->PS/2 connector to a link cable, or would that use a different protocol? I only have USB mouses lying around here... Oh, wait, that's not entirely true. But it would be easier to use that connector, since I could permanently modify it and still use my mouse on my computer :)
A USB mouse will normally support the PS/2 protocol - if it came with a USB -> PS/2 adapter, then it does. Of course, the pinout is different, but using a multimeter (or something) you should be able to work out which USB pin is used for data and which for clock, as well as VCC/GND.
I'm currently using a USB mouse. I assume the controller in the mouse defaults to PS/2 mode, and if it receives a USB-style signal switches to USB mode.

Posted: Wed 22 Feb, 2006 3:37 pm
by Timendus
Yes, now all I need is a link cable plug... I've always had a shortage of those...
*sigh*
*goes to browse through his electro shite*

Posted: Wed 22 Feb, 2006 3:42 pm
by benryves
Timendus wrote:Yes, now all I need is a link cable plug... I've always had a shortage of those...
*sigh*
*goes to browse through his electro shite*
Buying those as plugs or sockets (in stereo) is rather difficult, as well... nobody seems to stock them. Stereo 3.5mm minijacks? No problem. Mono 2.5mm minijacks? No problem. Stereo 2.5mm minijacks are a no-go area, though :(