gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Hardware > An alternative to buttons: interfacing?

#11206 - cesium - Mon Sep 29, 2003 12:50 am

I need to create my own hardware user interface for the GBA
that will be running an existing game.

I thought it would be pretty easy. (Wrong!)

I popped open one of my GBAs and I found that most of the buttons are pretty strange.
It appears that, for example the up/down/left/right pad is constructed from unique gold plated pads on the PCB.

I'm not sure, but it looks like
the "switch closure" is performed by a little rubber blob that is pushed
down across a gap in the pads. What a hassle!!

Does anyone have a software strategy for implementing a user interface
that bypasses the buttons? The games probably read the "key pressed"
register just like I do... Would it be possible to "patch" a game to read
a different register or call my code?

That sounds awfully hard, but I thought I'd post it in case you have seen
something like this.

I'll tinker with shorting the gold pads together with a FET transistor.
Or even pulling one of them low with a FET.

Does anyone know the details of which pins on the ARM do the keypad IO?
Do you have details of the key pad circuits on the GBA?

Thanks!,
cesium

#11212 - tepples - Mon Sep 29, 2003 4:08 am

If you wanted to make your own GBA input device for your own programs, it'd probably be a better idea to make it a serial device that connects to the "EXT.|>" connector at the edge of the machine.

It'd be possible to patch others' proprietary programs to change their input methods; just debug and look for reads from 0x04000130. Or you could just short the connectors when needed.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#11229 - cesium - Mon Sep 29, 2003 5:11 pm

Hey tepples!
Right. I am not too familiar with ARM assembler. I was worried that
there are a dozen ways to access the key input register...
like on a PIC processor you might see "bit test F and skip if set"
as well as ANDing and Oring and Loading....
Would I need to basically scan the machine code looking for all
commands that would be peeking at this register?

OOps! I forgot, my "hook" would have to fit into the code that I removed!
It would have to be a subroutine call...

I think I like the "short the pads" method!

cesium

#11237 - cesium - Mon Sep 29, 2003 7:41 pm

Just saw this on slashdot...

http://pages.prodigy.net/tan.ax/GBAConsole/gbaconsole.htm

It had this image for connecting an external joystick...
http://pages.prodigy.net/tan.ax/GBAConsole/GBAtestpoints.jpg

Looks like I just GND the TP's to produce a key press event.

cesium

[MOD: please do not "hotlink" images on servers other than your own]

#12898 - cesium - Sun Nov 30, 2003 3:27 am

Well, I modded the GBA to use an external controller, but there
is a ton of work involved in pulling apart the unit and soldering to
traces on the PCB.

Tepples, does your gut tell you that the idea of looking for
reads to the keypad register could be practical?

I thought of scanning the machine code for instructions that
read the register, but you mentioned 'debug' and looking for
reads. I'm not sure I follow you.

Your replies have been tremendous help to me over the past year,
thank you.

cesium

#13369 - haduken - Fri Dec 12, 2003 12:01 am

You could get a SNES controller, for example, and patch it onto (using lots of latches and nand gates...) the GBA's serial port.

#13747 - AcidGame - Mon Dec 22, 2003 4:32 am

Not sure if its possible, but like tebbles ( sp? ) said, wouldnt it be a heck of alot easier to make a thing that connects to the EXT|-> port, and a game have registered information send to it?

edit:

The hardware being connected obviously ( itself ) registers its own data. Get some emulating information on the object's registers and make your game correspond to both sets of registers.

#13748 - tepples - Mon Dec 22, 2003 5:00 am

cesium wrote:
Tepples, does your gut tell you that the idea of looking for reads to the keypad register could be practical?

It worked for Mario Paint for Super NES. One of the ROMs floating around has a trainer that allows use of a standard Super NES controller instead of a mouse.

Quote:
I thought of scanning the machine code for instructions that read the register

That's not quite easy because compilers generate so many different ways to read from a given address on ARM or Thumb. It's not like MIPS where you can just look for lui/lw pairs.

Quote:
Your replies have been tremendous help to me over the past year, thank you.

You're welcome.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.