Okay, recently I've been doing some research into Mega Man X5's RNG.
The RNG consists of two 1-byte values, 93F70 and 93F71. For convenience, I'll call them RNG1 and RNG2, respectively.
Everytime the RNG cycles, it does the following calculations:
-Take RNG1's value unsigned and a variable (let's call it A). If it's between 0 and 85, A=0. If it's between 86 and 170, A=1. If it's between 171 and 255, A=2.
-For RNG1, add (3*RNG2) and A.
-For RNG2, multiply by 3 and add A.
Or more mathematically put:
-if RNG1 >= 0 and RNG1 <= 85, A=0
-if RNG1 >= 86 and RNG1 <= 170, A=1
-if RNG1 >= 171 and RNG1 <= 255, A=2
-RNG1=RNG1+(RNG2*3)+A
-RNG2=(RNG2*3)+A
I also wrote a program in C++ that predicts RNG values.
Language: C++
#include <iostream>
#include <algorithm>
using namespace std;
char rng1, rng2, a;
int loop;
int main(){
//seed: 55//13 is the game's starting seed
rng1=55;
rng2=13;
loop=0;
while(loop<20) {
//program loops 20 times, rolling the RNG 20 times
//change this number if needed
//display current RNG values
cout << int(rng1) << ", " << int(rng2) << endl;
//uses signed values instead of unsigned
//otherwise the values are the same as in the post
if(rng1 >=0 && rng1<=85) { a=0;}
if(rng1 >=86 || rng1<=-86) { a=1;}
if(rng1 >=-87 && rng1<=-1) { a=2;}
rng1 = rng1 + (3*rng2)+a;
rng2 = (rng2*3)+a;
++loop;
}
//stopping instant program exit the noob way :)
string dump;
cin >> dump;
return 0;
}
This may help in finding improvements, especially for the cannon.
As for how to manipulate it, from what I've found out so far:
-Jumping as either X or Zero advances the RNG twice more.
-Pressing Triangle to shoot the Z-Buster as Zero advances the RNG once.
-Doing either the first or the second slash as Zero advance the RNG once each.
And probably a bunch of other things. This needs more testing.