26.12.2007, 20:37:16
I'd like to start a discussion thread about this DLL project here.
Firstly, let me inform you about what the "package" contains:
A thing we need to discuss is some coding conventions.
Naming shouldn't be a problem, you can simply adapt to my naming scheme I suppose (I will post a sample header/cpp soon which you can comment on).
Inline assembly is a more critical aspect.
It is essential at many parts, although I will try my best to keep it minimal.
Since I'm writing this on MS Visual C++ 6.0 (which is recommended since the game itself was programmed on it), but its way of implementing inline assembly is different to GCC's way (to name one example).
An example.
MSVCPP:
GCC:
As you see, GCC uses just "asm" and uses it as a function taking a const char*, so there's no way to make one notation working for both compilers.
Does anyone know of a compiler-directive that can make out the compiler's internal name?
As you might also see, I use the Intel notation, GCC defaults to the AT&T notation.
The notation can be switched with some flag, will dig it out later.
Finally, as Blade proposed, there should be a central repository for DLLs that are considered authentic.
My current RP2 place can be turned into such a place, I think it would be the best idea.
Firstly, let me inform you about what the "package" contains:
- A minimally edited gamemd.exe. It includes IcySon55's high resolution YR icon for the looks, as well as a disabled launcher notification (ie it can run without ra2md.exe) and, of course, some DLL loader code and required memory.
The file is probably not going to be changed any further, since all the other edits are possible using the DLL system.
- An application currently called "Debugger.exe". It is the new launcher of gamemd.exe that activates the DLL system (running gamemd.exe by itself will run the unmodified game).
Its name will probably be changed (it's "Debugger" because the app technically acts like one).
To make Debugger.exe work with gamemd.exe, it has to find a corresponding information file, "Debugger.pdo" (a pdo-file ) which is designed specifically for the target executable.
I made it a raw data format instead of an INI so people will just leave it alone.
Debugger.exe currently comes with the YR icon and passes any command line argument to gamemd.exe.
- The C++ wrapper for YR 1.001. Put the files into some folder and add it to the include list in your compiler.
#include <YRWrapper.h> and you have all you need. More on this later.
A thing we need to discuss is some coding conventions.
Naming shouldn't be a problem, you can simply adapt to my naming scheme I suppose (I will post a sample header/cpp soon which you can comment on).
Inline assembly is a more critical aspect.
It is essential at many parts, although I will try my best to keep it minimal.
Since I'm writing this on MS Visual C++ 6.0 (which is recommended since the game itself was programmed on it), but its way of implementing inline assembly is different to GCC's way (to name one example).
An example.
MSVCPP:
Code:
_asm{mov ecx, [eax+edx*4+0x3C]}
Code:
asm("mov ecx, [eax+edx*4+0x3C]");
Does anyone know of a compiler-directive that can make out the compiler's internal name?
As you might also see, I use the Intel notation, GCC defaults to the AT&T notation.
The notation can be switched with some flag, will dig it out later.
Finally, as Blade proposed, there should be a central repository for DLLs that are considered authentic.
My current RP2 place can be turned into such a place, I think it would be the best idea.