Tar, when you modify a function to look for an argument in another location you literally append, for example 4 bytes to the EXE itself, and then redirect the pointer to there, right?
For example, if the exe is 1000 bytes long you make it 1004, and then you redirect the offset to that place?
Cause, i don't understand how redirecting something to other address' inside the exe could be safe. How you know that particular offset is not part of something important?
(I'm talking about the perspective of people editing that value in the SFC editor).
I have no idea why Starfleet executables have redundant data for the double-precision float value of PI so frequently!
All these data are ignored -- according to the Interactive Disassembler and playtesting. No functions ever read them. Some functions, however, read the
single-precision floats for PI to draw circles, calculate circumference, define arcs, etc. If the .exe didn't have any free space, I wouldn't be able to isolate shared variables. Any change to the energy cost of a Plasma-S, for example, would always affect 5 other systems. It would be a hopeless situation. I cannot successfully change the size of the .exe, Carlos. If I did, every pointer would point to the wrong data.
My guess is that the compiler, by design, uses 64-bit PI as easily identifiable "filler" to allow a programmer to modify a program at the Assembly level if the higher level language (C++) just doesn't work as desired. So each 8-byte PI filler gives me a place for two new floats. Then I update specific references to find this new data. Any unknown function will still read the default data and the game will run fine. My method is as safe as possible with the tools I have -- as reliable as modifying C++ code directly. I can make precise changes, but they are always unsophisticated. Essentially, I tell the CPU to read this singly-referenced number instead of that overloaded value. There is no good reason for Photons and Plasmas to share a variable, except to reduce the size of the file, I suppose.