Omnimaga

General Discussion => Technology and Development => Other => Topic started by: Keoni29 on July 11, 2012, 05:33:30 pm

Title: TI83+ series compatible GAMEPAD!!!
Post by: Keoni29 on July 11, 2012, 05:33:30 pm


How it works:
There is a small microcontroller inside which converts signals sent from the calculator into control signals for a data selector (multiplexer). This selects which button to read. The output of this is fed back into the calculator. The calculator needs to run some code to be able to read the keystrokes. This code is easy to implement into existing games (hint hint)

How it works for technicians:
The calculator runs code to pull down the one line of the I/O port (1->port) then the AtTiny45 MCU @1MHz inside the gamepad increases the value of a counter. The binairy value is then used to control a multiplexer via a 3 bits wide control bus. All of the buttons are hooked up to the multiplexer. The output of the multiplexer is fed back into the calculator's I/O port. After a short delay the calculator reads the port value. This corresponds with a keypress or not.

At the moment there are some mechanical issues with the gamepad (bad contacts and bad solder connections). Also: it is very time consuming to fit everything inside the gamepad. I had to mod the plastic casing a bit to make everything fit. I might wanna make converter boxes of some sort instead.


This project was requested by stevon8er. Are there more omnimaga members interested in this product? If there is a larger user base it would be more feasable for software developers to make their programs compatible with their games (it is really easy to do so!)


Code to read keystrokes:
Code: [Select]
Lbl RKEYS
For(r1,0,7
1->port
Pause 1
If port=0
1->{GDB1+r1}
Else
0->{GDB1+r1}
End
2->port
Pause 2
End
After a delay of PAUSE 16 the microcontroller times out and resets the counter.


What do you think??
Title: Re: TI83+ series compatible GAMEPAD!!!
Post by: TIfanx1999 on July 11, 2012, 06:40:46 pm
I think the game pad is undeniably cool, however I don't think it is all that practical. Also, wouldn't reading the keypresses from the serial port be a bit slow for use in actual games?

I'd also mention if you haven't posted your hardware stuff at cemetech you really should. They do a lot more hardware related stuff there, and Kerm (who runs the place) is a bit of a hardware junkie himself. ;)
Title: Re: TI83+ series compatible GAMEPAD!!!
Post by: Juju on July 11, 2012, 07:07:20 pm
That's pretty cool :D
Title: Re: TI83+ series compatible GAMEPAD!!!
Post by: blue_bear_94 on July 11, 2012, 07:11:37 pm
I always thought of that. It would be possible on the TI-89 as well, right?
Title: Re: TI83+ series compatible GAMEPAD!!!
Post by: Keoni29 on July 11, 2012, 07:26:48 pm
Reading keypresses is as fast as the code example. You can also just leave out the action buttons and just check for the directional keypresses as they are mapped first on the multiplexer. After a PAUSE 16 the counter resets to zero, but you can just send in a few more clockpulses from the I/O port to reset it. It's not that slow at as you can use the stored keypresses multiple times instead of checking for keys all the time. It's a tiny sacrifice for GAMEPAD COMPATIBILITY o________O

If you want max speed you'd have to mod your calculator and put a connector on it which is hardwired into the keypad. My goal was to create a device for non-hardware junkies to interface with their calculators. It's part of the TI-Nterface project. It started with the interface platform. Now I'm building all sorts of peripherals for TI calculators :)

I have posted some hardware stuff a few months ago @cemetech. I'm gonna post some of my latest creations there.
Title: Re: TI83+ series compatible GAMEPAD!!!
Post by: critor on July 14, 2012, 07:30:42 pm
Nice.
Have you thought of directly sending key commands to the TI serial format ?

That format is supported on all flash z80/68k calculators except the TI-73.

It's used by the TI-Keyboard device and by the TilEm software when it sends the ROM dumping command to the calculator for example.


That way, games might not have to adapt themselves to your controller.
Title: Re: TI83+ series compatible GAMEPAD!!!
Post by: Keoni29 on July 15, 2012, 04:31:39 am
Nice.
Have you thought of directly sending key commands to the TI serial format ?

That format is supported on all flash z80/68k calculators except the TI-73.

It's used by the TI-Keyboard device and by the TilEm software when it sends the ROM dumping command to the calculator for example.


That way, games might not have to adapt themselves to your controller.
Does that work while ASM games run? Otherwise it's not feasable.
Title: Re: TI83+ series compatible GAMEPAD!!!
Post by: critor on July 15, 2012, 06:10:27 am
I'm not sure, but I'm just trying to help you finding a way which does not require every game author to update their games.
Title: Re: TI83+ series compatible GAMEPAD!!!
Post by: Keoni29 on July 15, 2012, 12:32:47 pm
The I/O port is driven by software, so you need to either mod a game yourself (ask for the source) or hard wire every button on the gamepad into your calculator :P

Edit: I am now writing a benchmark program to compare the speed of the gamepad vs the buttons on the calculator.