In order to accomplish the vibration function, which never previously existed in this game's programming, we need to build it into the emulator. We must constantly watch several areas in RAM, and based on the conditions, we will execute vibration on the left, right, or both simultaneously. It's still not yet determined whether there will be another parameter regarding intensity of vibration, that will come later.
Here are a few locations in RAM we will continuously monitor:
0x10843B (byte) - P2 damage accumulator - when P1 hits P2, the value of the damage will be added here (normally 0x00)
0x108102 (word) - P1 move pointer - when P1 does a move, this will reflect the unique BP (normally 0xF464)
0x108175 (byte) - P1 trigger - if P1 move pointer isn't enough or needs restriction, this byte will work. I believe it's a pointer to which animation is playing for P1.
For discovering conditions, debugging, and preliminary testing, I will use MAME emulator with LUA scripting. Let's take the character 'Daimon' for example:
I am using this MAME cheat file so I can have infinite time, infinite super meter, P2 infinite HP https://github.com/Strugglemeat/kof97/blob/main/kof97.xml
When Daimon is doing his HCB+C throw, 0x108102 will be as follows:
In addition, we can see the P2 damage accumulator has been modified by the game:
In the LUA script, we can see corresponding code:
https://github.com/Strugglemeat/kof97/blob/main/kof97.lua
And now when we play the game with the LUA script enabled:
We can see a box has been drawn on the right side, indicating that this is where vibration should happen.
Ultimately, we do not want to draw boxes in MAME on our PC, we want to feel vibration in the Gaviar handheld. So now we need to port this logic to the gngeo emulator which will run on the Allwinner D1s SoC.
https://github.com/Strugglemeat/gngeo/blob/master/src/rumble.c
Within this file, we can see reading of the same bytes as the LUA script:
And the same watching for conditions to trigger the rumble vibration motors:
Discovering these triggers takes about 2 hours per character. If other people want to contribute, it would be very helpful, since there are about 30 characters. Here you can see a finished Kyo super/special move set for LUA, which needs to be ported to gngeo:
https://docs.google.com/spreadsheets/d/18-3FkS40NmaozHA6sqhKlpHiS5KeQoTrdatqnMOBWYY/edit?usp=sharing
For more information, you can look at the lower pages of this document to see more:
https://docs.google.com/document/d/1g9EnpCVbQXWMn-xd5w0bgmlUGuHL5kMT-kHZRkNL0VY/edit?usp=sharing
Thank you for your interest in this project, and I hope one day you can enjoy the feeling of KoF '97 rumbling in your hands!