Porting Stella to the PlayStation 2/Linux environment was fairly easy, so I wanted
to add something special that no other Stella port has--force feedback added
to a 20 year old game.
I decided to add force feedback for moving (a low rumble), firing (a quick kickback), and of course, getting hit (big long rumble). My initial plan was to look for sprite collisions in one or more registers of the TIA chip. It seemed to work, but then I realized that it was only registering when your tank is blown through the sides or top/bottom of the screen. I then looked in main RAM to look for key events.
Here's the interface I used. The first row shows the frame drawing time (irrelevant here), followed by the TIA registers, the M6532 registers, and then 8 rows of 16 bytes each of RAM--that's right, the Atari 2600 had only 128 bytes of RAM! You can see this display by hitting L3 on your control pad.
By moving, firing, and getting shot while watching RAM, it was possible to determine certain key locations in memory:
After figuring out these locations, I added support in the program to look at the emulated memory and play the appropriate force feedback events when movement, firing, and hits are detected. After years of making sound effects when making a hit while playing Combat, I can finally be quiet and let my opponent's controller do the talking for me!