Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //For Ben
- #include <iostream>
- #include <iomanip>
- #include <fstream>
- using namespace std;
- void getCodes(float, float, float);
- int main(){
- float x;
- float y;
- float z;
- cout << "X: ";
- cin >> x;
- cout << "Y: ";
- cin >> y;
- cout << "Z: ";
- cin >> z;
- cout << endl;
- getCodes(x, y, z);
- cout << "Saved to 'codes.txt'" << endl;
- system("pause");
- return 0;
- }
- void getCodes(float x, float y, float z){
- ofstream codes;
- codes.open("codes.txt");
- int i = *(reinterpret_cast<int*>(&x));
- codes << "D01C84B5 0020" << endl;
- codes << "811DAA54 " << hex << setw(4) << setfill('0') << (i>>16 & 0xFFFF) << endl;
- codes << "D01C84B5 0020" << endl;
- codes << "811DAA56 " << hex << setw(4) << setfill('0') << (i & 0xFFFF) << endl;
- int j = *(reinterpret_cast<int*>(&y));
- codes << "D01C84B5 0020" << endl;
- codes << "811DAA58 " << hex << setw(4) << setfill('0') << (j>>16 & 0xFFFF) << endl;
- codes << "D01C84B5 0020" << endl;
- codes << "811DAA5A " << hex << setw(4) << setfill('0') << (j & 0xFFFF) << endl;
- int k = *(reinterpret_cast<int*>(&z));
- codes << "D01C84B5 0020" << endl;
- codes << "811DAA5C " << hex << setw(4) << setfill('0') << (k>>16 & 0xFFFF) << endl;
- codes << "D01C84B5 0020" << endl;
- codes << "811DAA5E " << hex << setw(4) << setfill('0') << (k & 0xFFFF) << endl;
- codes.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement