Actually, I knew that thing was done in asm and that's one of the reasons I asked you to post here . It seems to me that you'd know more about the internal structure of the PE format, since you've got down to the nitty gritty. I'm hoping that you can bring some of that knowledge to bear - such as nice things to include for {$SetPEFlags} and {$SetPEOptFlags} (Delphi 6+) that could have a bearing on some of the things that the compiler doesn't have options for (unfortunately).

Also, I seem to recall from a gamedev thread that you have access to the code for the RTL (i.e., a better Delphi than Personal Edition), though I could be wrong there. (The thread where somebody asked for the source to System.pas, I think, is the one from which I got that impression.) I only have the Delphi 5 version, which is no use for D6 (I simply couldn't get the damned thing to accept the new .dcu, no matter how many brick walls I hit my head against).

I'm under no illusions that it wouldn't be better to use C++ (w/ Rasmus' 1.5K OpenGL init code at Flipcode) or asm (for obvious reasons). However, that's a moot point to me. I'm wondering how small can Delphi go since it will make my life easier. Also, I'm trying to see if I can match the 4K bump mapping in Turbo Pascal just for personal kicks (there's an article about this in one of the Hugis, IIRC). Of course, I'm not there yet... I may experiment with the Free Pascal Compiler later on, depending on how this goes.