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.

Coding > GBAccelerometer coding application for Micro

#166453 - replicashooter - Sun Feb 08, 2009 12:37 pm

Evening folks, I had an idea involving the GBAccelerometer and Micro and am throwing it out there to see if anyone else thinks it is feasible:

[Images not permitted - Click here to view it]

So I'm thinking that the software works as a layer (ie. something that will have to be GBA format executable from the Flash Cart) that wraps around the ROM and takes the signal from the accelerometer and feeds the direction of tilt and duration information to the ROM so it responds as if it is receiving direct input from the Dpad.

What do you think?

#166476 - Dwedit - Sun Feb 08, 2009 6:45 pm

I love the power glove, it's so bad.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#167616 - replicashooter - Fri Mar 20, 2009 11:09 am

Thank you for your contribution Dwedit, you may now return to your regularly scheduled bag of lead paint chips.

Is there anyone on here that can do this or I think I may just take the hardware and directly mod it to the dpad inputs of the GBA instead.

#167650 - albinofrenchy - Sat Mar 21, 2009 9:07 am

Quote:
Thank you for your contribution Dwedit, you may now return to your regularly scheduled bag of lead paint chips.


Its bad form to be spiteful to someone for a silly joke. Also, lead paint chips don't come in bags. I'd say change 'bags' to 'meal'. Also I'm pretty sure DWEdit's meal of lead paint chips isn't till much later. :-p

Quote:
So I'm thinking that the software works as a layer (ie. something that will have to be GBA format executable from the Flash Cart) that wraps around the ROM and takes the signal from the accelerometer and feeds the direction of tilt and duration information to the ROM so it responds as if it is receiving direct input from the Dpad.

What do you think?


If you mean for homebrew or something you compile yourself, this would be trivial. Switch out the appropriate input libraries to report whatever when the program asks for d-pad status. Done. If you mean for compiled roms, you would either have to get soldering, or do some crazy ass programatic assembly modification that would seriously not be worth it and might be impossible.

#167660 - Dwedit - Sat Mar 21, 2009 1:52 pm

I've made a tool which patches games to modify their IRQ handler to add sleep mode to games which don't support it natively. The procedure I used was to look for the two lines of code which load an address and store it into the system IRQ vector. My code replaced it with a long jump, which installs a custom IRQ handler which also goes back to their original code.

If you wanted to patch a game's controller reading code, you could look for the line which loads the address of the controller port, then look for code which reads the controller data. Replace the address of the controller port with a load of a long jump for an address, then replace the controller read with a bx to that address.

Now that you've hooked the controller reading code, the rest is up to you. Then there's the big problem: How do you effectively turn accelerometer data into digital DPAD input?
The simple answer: You don't. It's really hard to do a decent job. If the well-paid designers of the power glove couldn't do it well, then it's gotta be really hard. Watch the Angry Video Game Nerd's review of the power glove, and that sums things up.

Can you think of any games which would benefit from Power Glove-style control?
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."