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.

Beginners > Is this project in realm of possiblity? (LONG)

#57359 - butterbee - Sat Oct 15, 2005 6:27 am

OK, I know this doesn't *exactly* sound like a beginner question but really it is. I am brand spanking new to these forums and gba development in general. In fact, this is my very first post.

I have done very little programming in the past (VB) and I am definately scare to death about touching C or embedded programming at all, but I have this idea in my head that just won't go away and I just wanted to ask those that actually *know* stuff if it is even possible to do so I know whether to torture myself and waste all my future time on it.

In 1997 Nintendo released a game in Japan called 'Bio Tetris'. (http://ign64.ign.com/articles/061/061483p1.html) so one night while staying up to late I thought to myself "If I took an existing emulator that runs on the GBA like FakeNES and modified the code so when you ran the rom that the input from a heart monitor would be something like 'input of one degree would add a speed of one to the game you were playing, and and input minus one would remove a degree of speed from the game playing tetris could actually teach you how to relax.'

Of course the problem comes because I know less than nothing about hardware and how the data transfer works. I know the code would work in theory I just no idea if the input from the hardware would.

So in summary my question is, in your much more educated opinion that me is this a project that is in the realm of possiblity at all or am I totally off my rocker because there is just no way the GBA hardware would ever be able to work like that?

#57614 - sgeos - Mon Oct 17, 2005 11:54 am

I don't know exactly what you want to do. You can trap input and have it register later, but you can't register a keypress before the player presses the button. If you want to muck with the speed of the emulator based on some exteral factor, you are basically looking at emulator programming.

-Brendan

#57639 - tepples - Mon Oct 17, 2005 2:32 pm

If you could rig the heart monitor to communicate over the GBA serial port, then you might be able to make a tetramino game with biofeedback speed control.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#57663 - Dwedit - Mon Oct 17, 2005 5:57 pm

You could have a completely dynamic speed with PocketNES and Nintendo's Tetris.
If you want to base this on Nintendo's Tetris for the NES, patch the code at 0x098E (in the file) from 85 AF to EA EA to prevent the game's level from controlling the speed, then have the emulator write to NES RAM address 00AF to control the number of frames to wait before a piece drops.

Only problem with this method is the questionable legality of emulating a rom.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#57703 - tepples - Mon Oct 17, 2005 8:59 pm

Dwedit wrote:
If you want to base this on Nintendo's Tetris for the NES, patch the code at 0x098E (in the file) from 85 AF to EA EA to prevent the game's level from controlling the speed, then have the emulator write to NES RAM address 00AF to control the number of frames to wait before a piece drops.

Only problem with this method is the questionable legality of emulating a rom.

Emulating a ROM isn't the illegal part; making and distributing copies of an all-rights-reserved ROM is. To avoid infringing copyright, use a freely distributable ROM such as Pin Eight Tetramino for NES, and make the corresponding changes. In fact, if you want, I could help you patch the game to read the game speed from the NES's second controller and to work better in unscaled mode.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#58845 - butterbee - Wed Oct 26, 2005 6:36 pm

How would I get the heart monitor to communicate through the serial port though and take that input and throw in into the emulator? That is the question that fills my head. If that is possible at all?

#58849 - thegamefreak0134 - Wed Oct 26, 2005 7:19 pm

It's possible, but you'd almost have to design your own heart monitor so that the GBa could check some memory location (theoretically of course) and have it correspond to what the heart monitor was doing. I also believe (correct me if I'm wrong) that the GBA's link operates like a serial link in that you basically have complete controll over what is sent.

If you're talking about figuring out how to read the monitor, go buy a link cable and a heart monitor and figure out how to splice the wires together. Then, have the GBA check the incoming link to figure out how to get your code to monitor the monitor.

I'm not sure how to get the GBA to give the heart monitor a constant power supply. I know the worm lights and such do it, but I am unsure of how thats done. I'm also not sure if the ammount of power given would be enough to accurately run a heart monitor. What you have here is a pretty serious hardware issue. I think it's possible, but you have to be pretty damn good to make it work.
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#58878 - tepples - Wed Oct 26, 2005 11:05 pm

thegamefreak0134 wrote:
It's possible, but you'd almost have to design your own heart monitor so that the GBa could check some memory location (theoretically of course)

The memory location being the serial port data register. You could modify PocketNES to send the heart monitor data on the emulated NES's second controller.

Quote:
I also believe (correct me if I'm wrong) that the GBA's link operates like a serial link in that you basically have complete controll over what is sent.

True.

Quote:
If you're talking about figuring out how to read the monitor, go buy a link cable and a heart monitor and figure out how to splice the wires together. Then, have the GBA check the incoming link to figure out how to get your code to monitor the monitor.

Specifically, what kind of protocol does the heart monitor use?

There will be three steps toward getting this to work:
  • Write a GBA program that reads the heart monitor.
  • Get PocketNES to emulate a second controller and place the heart rate on the emulated NES's second controller.
  • Modify NES games to use the second controller as a speed control.
Concentrate on step 1 first.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#58882 - phirewind - Wed Oct 26, 2005 11:20 pm

Another method: Make it a DS game, and use the GBA cart as an "option pak" that contains the heart monitor.

Of course, I have no idea precisely how that works, but I know that is the method that Nintendo is using. Some upcoming DS games will come with option paks that include motion sensitivity, rumble paks, etc., so I'd imagine the data path is a two-way street and could be used to interface with a heart monitor.

#58897 - tepples - Thu Oct 27, 2005 12:35 am

The heart monitor in question is this. It looks like a basic circuit that turns a single output on and off in time with the heart rate, and it's powered by a separate 9V battery.

The first steps would be to make a device that puts this signal on the link port's SI pin and then write a GBA program that can pick up the signal in general purpose mode. Then games would be modified to read the time between presses to change some aspect of the game.

phirewind: If it's a homebrew DS game with a dedicated option pak, then where are you going to put the CF card? Or does the SuperCard or M3 have an I/O port? Or are you planning on using a Magic Key 2 and loading the program from the MK2's SD slot (which would work most like a commercial game)?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#61264 - butterbee - Fri Nov 18, 2005 4:51 pm

Actually, I ended up changing directions. I got my hands on the biofeedback device from the PC game http://www.wilddivine.com/. It seems that there has been some development for it over at http://sourceforge.net/ called 'lightstone monitor' so a bunch of code has been written already to get the device to talk to the computer.

Since the device is USB, I'll have to try to get it to communicate with an NES emulator on my PC first for 'proof of concept' before trying to figure out how to run it on the GBA itself.