L. Spiro wrote:#1:
Because they have teams of people led by someone who specializes in compiler optimizations. The language I am making now will compile much faster as a result of my own gained experience since then, but still might not be as fast as theirs.
???? I thought you had memhack on hold? Are you planning on putting out something even better?
You are right to worry about copy-paste code. If you go the straight-forward route of simply copying the global to a bunch of local places you will die cold and lonely under a bridge.
ROFLMFAO! I am so using that line.
Your concern should rightly be that if you ever decide to change the address, you would have to change them all.
The solution is to make a macro that is the address.
- Code: Select all
extern eMyValue = { E_MYVALUEADDRESS };
The macro E_MYVALUEADDRESS can be defined to include both the module name and offset.
The shortcut of replacing the module name with 0x00400000 makes your address less realistic, but since it does not actually cause a real problem functionally it may be worth it if it saves you too much time.
I'm not sure I understand how using a macro will help with this issue? If I declare a global one with the exe, it brings me back to the issue of it not working until I go in and out of the script and make a small change. But I may at some point find a use for a macro.
However, I did find a way to do it using a constant and the 0x400000 value + the offset value:
- Code: Select all
//exe = 0x54c020(this is the offset address)+0x400000(this is the address of the emulator executable. In this case epsxe.exe). Sum is in decimal format, not hex.
const LONG exe = 9748512;
extern SHORT pauseall = { "", 0x03c9a4+exe}; //address comes out to 0x9889C4
I tested this, and it fixes the issue. I wanted to leave the exe in for presentations sake, but fuck it. I would only be thinking of adapting it for maybe 2 other PS emulators (the other 2 best ones) and by using this I can easily edit all my script in a few minutes using replace in the code editor. Since I just have to change the value stored in the constant exe (which is always near the very top of my code).
You see: I am finally learning stuff here.
Esco.... the name says it all. New Yorikan for life.