source: Daodan/src/patches/Patches.c@ 876

Last change on this file since 876 was 876, checked in by gumby, 11 years ago

Daodan pass 1

File size: 17.6 KB
Line 
1#include <windows.h>
2
3#include "../Daodan.h"
4#include "../Daodan_BSL.h"
5#include "../Daodan_Cheater.h"
6#include "../Daodan_Config.h"
7#include "../Daodan_GL.h"
8#include "../Daodan_Patch.h"
9#include "../Daodan_Persistence.h"
10#include "../Daodan_Utility.h"
11#include "../Daodan_Win32.h"
12#ifdef FLATLINE
13#include "../Flatline_BSL.h"
14#include "../Flatline_Hooks.h"
15#endif
16#include "../Oni.h"
17
18typedef int (__cdecl *CHINESEPROC)(DWORD ThreadId);
19
20// Hooked WMrSlider_SetRange() in ONiOGU_Options_InitDialog. Disables a gamma
21// slider in windowed mode.
22static void ONICALL DD_ONiOGU_GammaSlider_SetRange(WMtWindow* window, int min_value, int max_value)
23{
24 WMrWindow_SetEnabled(window, M3gResolutionSwitch && opt_gamma);
25 WMrSlider_SetRange(window, min_value, max_value);
26}
27
28void ONICALL DDrShowResumeButton(WMtWindow* window, int visibility)
29{
30 if (visibility)
31 WMrWindow_SetLocation(window, 150, 350);
32 WMrWindow_SetVisible(window, visibility);
33}
34
35
36/* Options always visible patch */
37void ONICALL DDrShowOptionsButton(WMtWindow* window, int visibility)
38{
39 WMrWindow_SetVisible(window, 1);
40}
41
42void ONICALL DDrGame_Init()
43{
44 if (opt_usedaodanbsl)
45 SLrDaodan_Initialize();
46}
47
48
49//this was broken
50FILE** _UUgError_WarningFile = (FILE**)0x005711B4;
51FILE *__fastcall DDrPrintWarning(int filename, int linenumber, unsigned __int16 errornum, int message)
52{
53
54 FILE *v4; // eax@1
55 FILE *result; // eax@4
56 char v6[512]; // [sp+0h] [bp-100h]@1
57 FILE* UUgError_WarningFile = *_UUgError_WarningFile;
58
59 if (filename && message && (strlen((const char*)filename)+strlen((const char*)message))<420) {
60 sprintf(
61 v6,
62 "Error %x reported from File: %s, Line: %d (message follows) \r\n%s",
63 errornum,
64 (const char*)filename,
65 linenumber,
66 (const char*)message);
67
68 if ( UUgError_WarningFile
69 || (UUgError_WarningFile = oni_fopen("debugger.txt", "wb"), UUgError_WarningFile ) )
70 {
71 oni_fprintf(UUgError_WarningFile, "%s\r\n", v6);
72 oni_fflush(UUgError_WarningFile);
73 }
74 }
75 //oni_fprintf(stdout, v6);
76 //sprintf(&v6, "%s", message);
77 *_UUgError_WarningFile = UUgError_WarningFile;
78 result = UUgError_WarningFile;
79 return result;
80}
81
82
83int FLrHook_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output)
84{
85 //flags = (1 << 10);
86 type = 1;
87 //DDrPatch_Byte( 0x005EB83C + 3, 0xff );
88 DDrPatch_Int32((int*)(OniExe + 0x001EB83C), 0xFF000000 );
89 return M3rTextureMap_New(width, height, type, allocated, flags, name, output);
90}
91
92short FLrHook_DebugNameShadeHack( Character* Char )
93{
94 return TSrContext_SetShade(*(void**)(OniExe + 0x001EB844), ONrCharacter_GetHealthShade( Char->Health, Char->MaxHealth ));
95 //return TSrContext_SetShade(*(void**)0x005EB844, 0xFFFFFFFF);
96}
97
98
99// Disable UUrPlatform_Initalize/Terminate, this enables the Alt-Tab and the
100// Windows key but has the possible side effect of allowing the screensaver
101// to enable itself in-game.
102void DD_Patch_AltTab()
103{
104 // 0xC3 = ret, so makes those functions just have a "ret" instruction at their start
105 DDrPatch_Byte ((char*)UUrPlatform_Initialize, 0xC3);
106 DDrPatch_Byte ((char*)UUrPlatform_Terminate, 0xC3);
107}
108
109// Textures using ARGB8888 can be used
110void DD_Patch_ARGB8888()
111{
112 DDrPatch_Byte ((char*)(OniExe + 0x00135af0), 0x07);
113 DDrPatch_Byte ((char*)(OniExe + 0x00135af4), 0x0B);
114}
115
116// Fix BinkBufferInit() call in BKrMovie_Play() to use GDI (DIB) blitting
117// instead of DirectDraw; patch ONiRunGame to use the same method to play
118// outro (ie., BKrMovie_Play() instead of ONrMovie_Play_Hardware() as the
119// latter has problems on WINE).
120void DD_Patch_BinkPlay()
121{
122 // push BINKBUFFERAUTO -> push BINKBUFFERDIBSECTION.
123 DDrPatch_Byte((void*)(OniExe + 0x0008829b + 1), 0x02);
124 // call ONrMovie_Play_Hardware -> call ONrMovie_Play
125 DDrPatch_MakeCall((void*)(OniExe + 0x000d496f), ONrMovie_Play);
126}
127
128// Enables d_regen (unfinished) and prevents fly-in portraits from being
129// stretched when playing in widescreen resolutions.
130void DD_Patch_BSL()
131{
132 //Calculating the value of the needed offset is much more reliable when the compiler does it for you.
133
134 //TODO: fix moonshadow.
135 Character * Chr = 0;
136 int NoPath = (int)&(Chr[0].RegenHax) & 0x000000FF;
137 const unsigned char regen_patch[] =
138 {0x90, 0x90, 0x90, 0x90, 0x90, // mov al, _WPgRegenerationCheat -> NOOP
139 0x90, 0x90, // test al, al -> NOOP
140 0x90, 0x90, // jz short loc_51BB98 -> NOOP
141 0x8B, 0x86, (char)NoPath, 0x01, 0x00, 0x00, // mov eax, [esi+Character.field_1E8]
142 // -> mov eax, [esi+Character.RegenHax]
143 0x85, 0xC0, // test eax, eax
144 0x74, 0x21 // jnz 0x21 -> jz 0x21
145 };
146 DDrPatch_Const((char*)(OniExe + 0x0011BB64), regen_patch);
147
148 // Patches for existing BSL functions
149 SLrDaodan_Patch();
150}
151
152// Adds new cheat codes if cheattable is also enabled
153void DD_Patch_Cheater()
154{
155 DDrPatch_MakeCall((void*)(OniExe + 0x000f618f), (void*)DDrCheater);
156 DDrPatch_Int16((short*)(OniExe + 0x000deb45), 0x5590);
157#if 1
158 DDrPatch_MakeCall((void*)(OniExe + 0x000deb47), (void*)FallingFrames);
159#endif
160 DDrPatch_MakeJump((void*)(OniExe + 0x0010f021), (void*)DDrCheater_LevelLoad);
161}
162
163// Cheats always enabled
164void DD_Patch_CheatsEnabled()
165{
166 DDrPatch_MakeJump((void*)ONrPersist_GetWonGame, (void*)DDrPersist_GetWonGame);
167}
168
169// Use Daodan's own cheattable
170void DD_Patch_CheatTable()
171{
172 DDrPatch_Int32 ((int*)(OniExe + 0x000f616b), (int)&DDr_CheatTable[0].name);
173 DDrPatch_Int32 ((int*)(OniExe + 0x000f617a), (int)&DDr_CheatTable[0].message_on);
174}
175
176// Load chinese font DLL if available
177void DD_Patch_Chinese()
178{
179 if (GetFileAttributes("xfhsm_oni.dll") != INVALID_FILE_ATTRIBUTES)
180 {
181 HMODULE dll;
182 DWORD err;
183
184 DDrStartupMessage("Daodan: Loading chinese DLL");
185 dll = LoadLibrary("xfhsm_oni.dll");
186 err = GetLastError();
187 if( dll )
188 {
189 void* proc = GetProcAddress( dll, "InstallHook" );
190 if(proc)
191 {
192 ((CHINESEPROC)proc)(GetCurrentThreadId());
193 }
194 } else {
195 char msg[100];
196 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, msg, 100, NULL);
197 DDrStartupMessage("Daodan: Loading DLL failed with error %i: %s", err, msg);
198 }
199 }
200}
201
202// Limit cursor to Oni's window
203void DD_Patch_ClipCursor()
204{
205 // LIrMode_Set: replace LIrPlatform_Mode_Set call with our hook.
206 DDrPatch_MakeCall((void*)(OniExe + 0x00003f9f), (void*) DD_LIrPlatform_Mode_Set);
207
208 // LIrMode_Set_Internal: replace LIrPlatform_Mode_Set call with our hook.
209 DDrPatch_MakeCall((void*)(OniExe + 0x00003fff), (void*) DD_LIrPlatform_Mode_Set);
210
211 // LIrTermiante: replace LIrPlatform_Terminate call with our hook.
212 DDrPatch_MakeCall((void*)(OniExe + 0x000004cb8), (void*) DD_LIrPlatform_Terminate);
213}
214
215// Disables weapon cooldown exploit
216void DD_Patch_CooldownTimer()
217{
218 const unsigned char cooldown_patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
219 DDrPatch_Const ((char*)(OniExe + 0x0011a825), cooldown_patch);
220}
221
222// Daodan device mode enumeration function
223void DD_Patch_DaodanDisplayEnum()
224{
225 DDrPatch_MakeJump((void*)gl_enumerate_valid_display_modes, (void*)DD_GLrEnumerateDisplayModes);
226}
227
228// Adds new BSL functions if usedaodanbsl is enabled
229void DD_Patch_DaodanInit()
230{
231 DDrPatch_MakeCall((void*)(OniExe + 0x000d345a), (void*)DDrGame_Init);
232}
233
234// Forced DirectInput (for Windows NT)
235void DD_Patch_DirectInput()
236{
237 DDrPatch_Byte((char*)(OniExe + 0x00002e6d), 0xeb);
238}
239
240// Disable Oni's command line parser so it doesn't interfere with ours
241void DD_Patch_DisableCmdLine()
242{
243 DDrPatch_Int32 ((int*)(OniExe + 0x000d3570), 0xc3c03366);
244}
245
246// Font texture cache doubled
247void DD_Patch_FontTextureCache()
248{
249 DDrPatch_Byte((char*)(OniExe + 0x00020ea7), 0x20);
250 DDrPatch_Byte((char*)(OniExe + 0x00020f4a), 0x40);
251}
252
253// Disable Oni's internal CLrGetCommandLine function (to eventually replace it with our own)
254void DD_Patch_GetCmdLine()
255{
256 DDrPatch_NOOP ((char*)(OniExe + 0x000d3280), 51);
257}
258
259// Hackish fix for Konoko not kicking guns
260// Don't use this, it breaks stairs.
261void DD_Patch_KickGuns()
262{
263 const unsigned char kickgun_patch[] = { 0x00, 0x05, 0x00, 0x00, 0x00, 0xC7, 0x05, 0x1C, 0xC9, 0x5E, 0x00, 0x70, 0xB8, 0x43, 0x00, 0xC7, 0x05, 0x20, 0xC9, 0x5E, 0x00, 0x20, 0xBE, 0x43 };
264 DDrPatch_Const ((char*)(OniExe + 0x000dc420), kickgun_patch);
265}
266
267// Disable loading the vtuneapi.dll
268void DD_Patch_KillVTune()
269{
270 DDrPatch_Byte ((char*)(OniExe + 0x00026340), 0xC3);
271}
272
273// Now supports textures up to 512x512
274void DD_Patch_LargeTextures()
275{
276 DDrPatch_Byte ((char*)(OniExe + 0x00005251), 0x10);
277}
278
279// Non-"_Final" levels are now valid
280void DD_Patch_LevelPlugins()
281{
282 DDrPatch_Byte ((char*)(OniExe + 0x000206a8), 0x01);
283}
284
285// Weapon on ground shown with name and magazine contents
286void DD_Patch_NewWeap()
287{
288 //Makes it always say "Received weapon_name."
289 //Needs check for loc_4DFC66
290 //DDrPatch_NOOP((char*)(OniExe + 0x000E4DF8),2);
291
292 //Adds Weapon name and ammo meter to pickup autoprompt
293 DDrPatch_NOOP((char*)(OniExe + 0x000FAC73), 9);
294 DDrPatch_NOOP((char*)(OniExe + 0x000FAC80), 5);
295 DDrPatch_MakeCall((void*)(OniExe + 0xFAC85), (void*)DDrWeapon2Message);
296
297 //Moves location of colors
298 //DDrPatch_Int32((int*)(OniExe + 0x0002E3D5), (int)&DDrDSayColors );
299 //DDrPatch_Int32((int*)(OniExe + 0x0002E3DA), (int)&DDrDSayColors );
300}
301
302// Disable Multi-byte character awareness patch (multiple language support)
303void DD_Patch_NoMultiByte()
304{
305 DDrPatch_Byte ((char*)(OniExe + 0x0002d8f8), 0xeb);
306 DDrPatch_Byte ((char*)(OniExe + 0x0002d9ad), 0xeb);
307 DDrPatch_Byte ((char*)(OniExe + 0x0002dbe2), 0xeb);
308 DDrPatch_Byte ((char*)(OniExe + 0x0002dec3), 0xeb);
309 DDrPatch_Byte ((char*)(OniExe + 0x0002e2ab), 0xeb);
310 DDrPatch_Byte ((char*)(OniExe + 0x0002e2c4), 0xeb);
311 DDrPatch_Byte ((char*)(OniExe + 0x0002e379), 0xeb);
312 DDrPatch_Byte ((char*)(OniExe + 0x0002e48c), 0xeb);
313 DDrPatch_Byte ((char*)(OniExe + 0x0002e4d0), 0xeb);
314 DDrPatch_Byte ((char*)(OniExe + 0x0002e4f4), 0xeb);
315 DDrPatch_Byte ((char*)(OniExe + 0x0002e646), 0xeb);
316 DDrPatch_Byte ((char*)(OniExe + 0x0002e695), 0xeb);
317 DDrPatch_Byte ((char*)(OniExe + 0x0002e944), 0xeb);
318 DDrPatch_Byte ((char*)(OniExe + 0x0002e95d), 0xeb);
319 DDrPatch_Byte ((char*)(OniExe + 0x0002e98e), 0xeb);
320 DDrPatch_Byte ((char*)(OniExe + 0x0002e9dc), 0xeb);
321}
322
323// Fix options not visible in main menu when a game was started
324void DD_Patch_OptionsVisible()
325{
326 DDrPatch_MakeCall((void*)(OniExe + 0x000d2d2d), DDrShowOptionsButton);
327 DDrPatch_MakeCall((void*)(OniExe + 0x000d2d43), DDrShowResumeButton);
328}
329
330// Unlocks particle action disabling/enabling bits for all events. (Will be
331// controlled by a command line switch when I figure out how to do that without
332// Win32 hacks.)
333void DD_Patch_ParticleDisableBit()
334{
335 DDrPatch_Int16 ((short*)(OniExe + 0x001b184), 0x9090);
336}
337
338// Pathfinding grid cache size x8
339void DD_Patch_PathFinding()
340{
341 const unsigned char pathfinding[2] = {0x90 , 0xE9 };
342 DDrPatch_Byte ((char*)(OniExe + 0x0010b03b), 0x20);
343 DDrPatch_Byte ((char*)(OniExe + 0x0010b04c), 0x20);
344
345 //other stuff
346 DDrPatch_Const((char*)(OniExe + 0x00040789), pathfinding);
347}
348
349// Projectile awareness fixed
350void DD_Patch_ProjAware()
351{
352 DDrPatch_Byte ((char*)(OniExe + 0x0009c07c), 0x6c);
353 DDrPatch_Byte ((char*)(OniExe + 0x0009c080), 0x70);
354 DDrPatch_Byte ((char*)(OniExe + 0x0009c084), 0x74);
355 DDrPatch_Byte ((char*)(OniExe + 0x0009c110), 0x6c);
356}
357
358// Safe startup message printer
359void DD_Patch_SafePrintf()
360{
361 DDrPatch_MakeJump((void*)UUrStartupMessage, (void*)DDrStartupMessage);
362}
363
364// Experiment with allowing enemies to be thrown over railings
365void DD_Patch_Throwtest()
366{
367 const unsigned char throwtest_patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
368 DDrPatch_Const((char*)(OniExe + 0x000dc190), throwtest_patch);
369}
370
371// DaodanGL with windowed mode support
372void DD_Patch_UseDaodanGL()
373{
374 // LIrPlatform_Mode_Set: GetWindowRect -> GetClientRect.
375 DDrPatch_NOOP((char*) OniExe + 0x00002dd6, 6);
376 DDrPatch_MakeCall((char*) OniExe + 0x00002dd6, (void*) GetClientRect);
377
378 // UUrWindow_GetSize: GetWindowRect -> GetClientRect.
379 DDrPatch_NOOP((char*) OniExe + 0x0002651c, 6);
380 DDrPatch_MakeCall((char*) OniExe + 0x0002651c, (void*) GetClientRect);
381
382 // LIrPlatform_PollInputForAction: fix GetCursorPos call to return client coordinates.
383 DDrPatch_NOOP((char*) OniExe + 0x000032cc, 6);
384 DDrPatch_MakeCall((char*) OniExe + 0x000032cc, (void*) DD_GetCursorPos);
385
386 // LIrPlatform_InputEvent_GetMouse: fix GetCursorPos call to return client coordinates.
387 DDrPatch_NOOP((char*) OniExe + 0x00002cc2, 6);
388 DDrPatch_MakeCall((char*) OniExe + 0x00002cc2, (void*) DD_GetCursorPos);
389
390 // LIrPlatform_PollInputForAction: translate SetCursorPos position to screen coordinates.
391 DDrPatch_NOOP((char*) OniExe + 0x000032b7, 6);
392 DDrPatch_MakeCall((char*) OniExe + 0x000032b7, (void*) DD_SetCursorPos);
393
394 // LIrPlatform_PollInputForAction: translate SetCursorPos position to screen coordinates.
395 DDrPatch_NOOP((char*) OniExe + 0x00003349, 6);
396 DDrPatch_MakeCall((char*) OniExe + 0x00003349, (void*) DD_SetCursorPos);
397
398 // Replace ONrPlatformInitialize.
399 DDrPatch_MakeJump((void*) ONrPlatform_Initialize, (void*) DD_ONrPlatform_Initialize);
400
401 // Replace gl_platform_initialize.
402 DDrPatch_MakeJump((void*) gl_platform_initialize, (void*) DD_GLrPlatform_Initialize);
403
404 // Replace gl_platform_dispose.
405 DDrPatch_MakeJump((void *) gl_platform_dispose, (void*) DD_GLrPlatform_Dispose);
406}
407
408// Performance patch
409void DD_Patch_UseGetTickCount()
410{
411 DDrPatch_MakeJump((void*)UUrMachineTime_High, (void*)DDrMachineTime_High);
412 DDrPatch_MakeJump((void*)UUrMachineTime_High_Frequency, (void*)DDrMachineTime_High_Frequency);
413 DDrPatch_MakeJump((void*)UUrMachineTime_Sixtieths, (void*)DDrMachineTime_Sixtieths);
414}
415
416// Adds working function for existing BSL command wp_fadetime, sets fade time to 4800
417void DD_Patch_WpFadetime()
418{
419 // Makes wp_fadetime actually have a function
420 const unsigned char fadetime_patch[] = { 0x66, 0x8B, 0x1D, 0xC4, 0x7D, 0x62, 0x00, 0x66, 0x89, 0x5E, 0x46, 0x5B, 0x5E, 0x83, 0xC4, 0x14, 0xC3 };
421 DDrPatch_Const ((char*)(OniExe + 0x0011a889), fadetime_patch);
422 DDrPatch_Byte ((char*)(OniExe + 0x0011a560), 0x31);
423
424 // Sets the fadetime to 4800 by default
425 DDrPatch_Int16 ((short*)(OniExe + 0x0011ab0e), 0x12c0);
426}
427
428// Disable gamma slider in options in windowed mode
429void DD_Patch_GammaSlider()
430{
431 DDrPatch_MakeCall((void*)(OniExe + 0x000d262c), (void*)DD_ONiOGU_GammaSlider_SetRange);
432}
433
434// Fix the warning print method
435void DD_Patch_PrintWarning()
436{
437 DDrPatch_MakeJump((void*)(OniExe + 0x000245A0), (void*)DDrPrintWarning);
438}
439
440//Fix crappy ai2_shownames
441void DD_Patch_ShowNames()
442{
443 //Set distance above head to 4.0
444 DDrPatch_Int32((int*)(OniExe + 0x0008C998), 0x005296C8);
445 //texture height
446 DDrPatch_Byte((char*)(OniExe + 0x0008C9DF), 0x3F );
447 //texture width
448 DDrPatch_NOOP((char*)(OniExe + 0x0008C9CA), 6 );
449
450/*
451// Crashes game.
452 //Set the text color to whatever we like ;)
453 DDrPatch_NOOP((char*)(OniExe + 0x0008C898), 6 );
454 DDrPatch_Byte((char*)(OniExe + 0x0008C898), 0x8B );
455 DDrPatch_Byte((char*)(OniExe + 0x0008C899), 0xCE );
456
457 DDrPatch_MakeCall((void*)(OniExe + 0x0008C8A3), FLrHook_DebugNameShadeHack);
458
459 //Make the background black for additive blending
460 DDrPatch_MakeCall((void*)(OniExe + 0x0008C802), FLrHook_DebugNameTextureInit );
461*/
462}
463
464bool DD_Patch_Init()
465{
466 DDrStartupMessage("Daodan: Patching engine");
467
468 if (patch_alttab)
469 DD_Patch_AltTab();
470
471 if (patch_argb8888)
472 DD_Patch_ARGB8888();
473
474 if (patch_binkplay)
475 DD_Patch_BinkPlay();
476
477 if (patch_bsl)
478 DD_Patch_BSL();
479
480 if (patch_cheater)
481 DD_Patch_Cheater();
482
483 if (patch_cheatsenabled)
484 DD_Patch_CheatsEnabled();
485
486 if (patch_cheattable)
487 DD_Patch_CheatTable();
488
489 if (patch_chinese)
490 DD_Patch_Chinese();
491
492 if (patch_clipcursor)
493 DD_Patch_ClipCursor();
494
495 if (patch_cooldowntimer)
496 DD_Patch_CooldownTimer();
497
498 if (patch_daodandisplayenum)
499 DD_Patch_DaodanDisplayEnum();
500
501 if (patch_daodaninit)
502 DD_Patch_DaodanInit();
503
504 if (patch_directinput)
505 DD_Patch_DirectInput();
506
507 if (patch_disablecmdline)
508 DD_Patch_DisableCmdLine();
509
510 if (patch_fonttexturecache)
511 DD_Patch_FontTextureCache();
512
513 if (patch_getcmdline)
514 DD_Patch_GetCmdLine();
515
516 if (patch_kickguns)
517 DD_Patch_KickGuns();
518
519 //if (patch_killvtune)
520 // DD_Patch_KillVTune();
521
522 if (patch_largetextures)
523 DD_Patch_LargeTextures();
524
525 if (patch_levelplugins)
526 DD_Patch_LevelPlugins();
527
528 if (patch_newweapon)
529 DD_Patch_NewWeap();
530
531 if (patch_nomultibyte)
532 DD_Patch_NoMultiByte();
533
534 if(patch_optionsvisible)
535 DD_Patch_OptionsVisible();
536
537 if (patch_particledisablebit)
538 DD_Patch_ParticleDisableBit();
539
540 if (patch_pathfinding)
541 DD_Patch_PathFinding();
542
543 if (patch_projaware)
544 DD_Patch_ProjAware();
545
546 if (patch_safeprintf)
547 DD_Patch_SafePrintf();
548
549 if (patch_throwtest)
550 DD_Patch_Throwtest();
551
552 if (patch_usedaodangl)
553 DD_Patch_UseDaodanGL();
554
555 if (patch_usegettickcount)
556 DD_Patch_UseGetTickCount();
557
558 if (patch_wpfadetime)
559 DD_Patch_WpFadetime();
560
561
562 DD_Patch_GammaSlider();
563
564 DD_Patch_PrintWarning();
565
566
567 DD_Patch_ShowNames();
568
569#ifdef FLATLINE
570 DDrPatch_NOOP((char*)(OniExe + 0x000E1957), 6 );
571 DDrPatch_MakeCall((void*)(OniExe + 0x000E17F6), FLrHook_Lasers );
572
573
574
575 //Flatline related stuff
576 DDrPatch_MakeCall((void*)(OniExe + 0x000FBCEA), DDrText_Hook);
577
578 DDrPatch_Int32((int*)(OniExe + 0x000B24D2), FLrSpawnHack);
579
580 DDrPatch_NOOP((char*)(OniExe + 0x000C26CB), 6);
581
582 DDrPatch_MakeCall((void*)(OniExe + 0x000C26CB), FLrHook_DoorOpen);
583 DDrPatch_MakeCall((void*)(OniExe + 0x000EE3CF), FLrHook_ConsoleActivate);
584#endif
585
586 return true;
587}
588
Note: See TracBrowser for help on using the repository browser.