ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/MSVC/Daodan.c
(Generate patch)

Comparing Daodan/MSVC/Daodan.c (file contents):
Revision 567 by gumby, Fri Jun 25 03:52:34 2010 UTC vs.
Revision 569 by gumby, Wed Jul 14 07:35:40 2010 UTC

# Line 82 | Line 82 | bool DDrPatch_Init()
82          // Pathfinding grid cache size x8
83          if (patch_pathfinding)
84          {
85 +                const char pathfinding[2] = {0x90 , 0xE9 };
86                  DDrPatch_Byte  (OniExe + 0x0010b03b, 0x20);
87                  DDrPatch_Byte  (OniExe + 0x0010b04c, 0x20);
88 +
89 +                //other stuff
90 +                DDrPatch_Const(0x440789, pathfinding);
91          }
92          
93          // Projectile awareness fixed
# Line 98 | Line 102 | bool DDrPatch_Init()
102          // Forced DirectInput (for Windows NT)
103          if (patch_directinput)
104                  DDrPatch_Byte  (OniExe + 0x00002e6d, 0xeb);
105 <        
105 >
106          if (patch_wpfadetime)
107          {
108                  // Makes wp_fadetime actually have a function
# Line 110 | Line 114 | bool DDrPatch_Init()
114                  DDrPatch_Int16 ((OniExe + 0x0011ab0e), 0x12c0);
115          }
116          
117 +        // FIXME: add switches
118 +        //pathfinding fix
119 +
120 +        
121 +
122          
123          // Hackish fix for Konoko not kicking guns
124          // Don't use this, it breaks stairs.
# Line 207 | Line 216 | bool DDrPatch_Init()
216          if (patch_disablecmdline)
217                  DDrPatch_Int32 (OniExe + 0x000d3570, 0xc3c03366);
218          
219 +        if (patch_bsl)
220 +        {
221 +                //Calculating the value of the needed offset is much more reliable when the compiler does it for you.
222 +
223 +                //TODO: fix moonshadow.
224 +                Character * Chr = 0;
225 +                int NoPath = (int)&(Chr[0].RegenHax) & 0x000000FF;
226 +                const char regen_patch[] =
227 +                {0x90, 0x90, 0x90, 0x90, 0x90,                          // mov    al, _WPgRegenerationCheat     -> NOOP
228 +                0x90, 0x90,                                                                     // test   al, al                                        -> NOOP
229 +                0x90, 0x90,                                                                     // jz     short loc_51BB98                      -> NOOP
230 +                0x8B, 0x86, (char)NoPath, 0x01, 0x00, 0x00, // mov     eax, [esi+Character.field_1E8]
231 +                                                                                                        //      -> mov     eax, [esi+Character.RegenHax]
232 +                0x85, 0xC0,                                                                     // test eax, eax
233 +                0x74, 0x21                                                                      // jnz 0x21 -> jz 0x21
234 +                };      
235 +                DDrPatch_Const(0x0051BB64, regen_patch);
236 +        }
237 +
238 +
239          return true;
240   }
241  
# Line 561 | Line 590 | void __cdecl DDrMain(int argc, char* arg
590          // Cheats always enabled
591          if (patch_cheatsenabled)
592                  DDrPatch_MakeJump(ONrPersist_GetWonGame, DDrPersist_GetWonGame);
593 < #if 0
593 > //#if 0
594          // Windowed mode
595 <        if (patch_usedaodangl)
595 > //      if (patch_usedaodangl)
596          {
597 +        DDrPatch_NOOP((char*)0x004032B7, 6);
598 +        DDrPatch_MakeCall((char*)0x004032B7, LIiP_SetCursorPosHook);
599 +        
600 +        DDrPatch_NOOP((char*)0x00403349, 6);
601 +        DDrPatch_MakeCall((char*)0x00403349, LIiP_SetCursorPosHook);
602                  DDrPatch_MakeJump(ONrPlatform_Initialize, DDrPlatform_Initialize);
603                  DDrPatch_MakeJump(gl_platform_initialize, daodangl_platform_initialize);
604          }
605 < #endif
605 > //#endif
606          // Hacked windowed mode (for when daodangl isn't working properly)
607          //if (patch_windowhack)
608  
609 <                DDrWindowHack_Install();
609 >        //      DDrWindowHack_Install();
610          
611          if (patch_daodaninit)
612                  DDrPatch_MakeCall(OniExe + 0x000d345a, DDrGame_Init);

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)