![]() |
![]() |
![]() |
||||||
|
||||||||
|
THE BUGS: "RELEASE FOR FOX" COMPILATION Every common Visual C++ user that tried to make the game work in this mode of compilation experienced the same problem. This page will explain what compilation modes are, what's the problem with it here, to finally give you my solution to the matter. 1) Compilation modes In Microsoft Visual C++, you can compile your source code in 2 different & common modes:
In the second case, no debug stuff will appear because it will concern the public version of the application. So in our example, the added console commands are present in the code, but won't be in the game. The other use of these compilation modes is to customize the projects. For instance, you can decide to generate debug informations in the "Win32 Debug" mode and not in the "Win32 Release" mode. All is a matter of project organization. Note that you can create other compilation modes if you wish... Now in the case of AvP, Rebellion dudes gave us 3 compilation modes that are:
2) The "Win32 release For Fox" bug The bug appears if you try to run the application in the "Win32 Release For Fox" mode, under Windows 98 only. The significant clue on the bug is that if you compile the application in the other modes, no bug appears: which means that there are portions of code that aren't present or different in both Debug modes. After a personnal session of study of the code and a debug in assembly language, I discovered that the "bad guy" (this is the term I will employ in the next) was the call to the function "ToAscii" in the win_proj.cpp file (in the procedure "MakeToAsciiTable"). What I experienced in my source code modifications to find the bug was that when I added instructions around the "bad guy", sometimes, it worked ! Strange bug huh ?! 3) My solution What I finally understood of all this was that the application crashes because of compiler optimizations on the "MakeToAsciiTable" code (keep in mind that it works in the Debug modes: these ones aren't as optimized as the Release mode). So here's the code to add (in blue) to correct the thing: #pragma optimize("", off) This will simply tell the compiler to disable optimizations on the procedure. Please note that I'm very proud of my discover, because I work on it since 2001 and despite the fact that it took a long time to find, I helped the first AvP mod - i.e. Cancer Black made by Eldritch & the AMP team - (and maybe future mods) to be compatible with Windows 98. Note: the funny thing to remark here is that both the compiler & the "ToAscii" function are Microsoft home made ! So there's an incompability between things that should be compatible ! Anyway, I've got nothing against Microsoft: "error is human". |
|||||||