Today the SH4 forums gave me a great idea for a new patch: have the flags blow in the wind's direction
I fired up OllyDebug and figured out where the object's matrix data is and where it's combined matrix data is (it's matrix data * parent's matrix data). After locating those two key bits of info I then had to figure out the kernel functions for reading angles from the matrix data and storing new angles to the matrix data. Luckily for me, the kernel just happened to have those two functions
After a bit of playing around to figure out which value of the 3 angles returned was the yaw value (of the pitch, yaw, and roll returned) I was able to modify the yaw value returned for the flag. I modified the yaw value to have the flag yaw (rotate around it's Y axis) +45 degrees. I then called the kernel function to set the new angles in the matrix and it worked first try
What I'm trying to derive currently is how to figure out how much the wind influences the flag's yaw. For instance, if the unit's speed is 8 knots @ 90 degrees, the wind's speed is 5 knots @ 315 degrees, how much should the flag yaw