OSDN Git Service

added design text file for codeing design!
[proj16/16.git] / design.txt
1 Near functions should be for frequently used functions that update the game engine are are time critial\r
2 \r
3 far functions are for like menus, file loaders, and such\r
4 \r
5 \r
6 \r
7 "\r
8 It is also possible to use the small code option, and to override certain functions and pointers to functions as\r
9 being\r
10  far.\r
11   However, this method may lead to problems.  The Open Watcom C\r
12 16\r
13  compiler generates special\r
14 function calls that the programmer doesn’t see, such as checking for stack overflow when a function is\r
15 invoked.  These calls are either\r
16  near\r
17  or\r
18  far\r
19  depending entirely on the memory model chosen when the\r
20 module is compiled.  If the small code model is being used, all calls will be near calls.  If, however, several\r
21 code groups are created with far calls between them, they will all need to access the stack overflow\r
22 checking routines.  The linker can only place these special routines in one of the code groups, leaving the\r
23 other functions without access to them, causing an error.\r
24 To resolve this problem, mixing code models requires that all modules be compiled with the big code\r
25 model, overriding certain functions as being near.  In this manner, the stack checking routines can be placed\r
26 in any code group, which the other code groups can still access.  Alternatively, a command-line switch may\r
27 be used to turn off stack checking, so no stack checking routines get called.\r
28 "\r