--- Daodan/src/Daodan.c 2009/03/17 12:12:24 274 +++ Daodan/src/Daodan.c 2009/05/17 12:19:35 323 @@ -1,10 +1,14 @@ #include "Daodan.h" #include "Daodan_Patch.h" #include "Daodan_Utility.h" +#include "Daodan_Win32.h" #include "Oni.h" #include "BFW_Utility.h" +#include "oni_gl.h" +#include "daodan_gl.h" + HMODULE DDrDLLModule; HMODULE DDrONiModule; @@ -41,9 +45,10 @@ bool DDrPatch_Init() // Sets the fadetime to 4800 by default DDrPatch_Int16 (OniExe + 0x0011ab0e, 0x12c0); + // Hackish fix for Konoko not kicking guns - const 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 }; - DDrPatch_Const (OniExe + 0x000dc420, kickgun_patch); +// const 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 }; +// DDrPatch_Const (OniExe + 0x000dc420, kickgun_patch); // Cooldown timer exploit fix ^_^ const 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 }; @@ -52,6 +57,13 @@ bool DDrPatch_Init() // const char throwtest_patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; // DDrPatch_Const(OniExe + 0x000dc190, throwtest_patch); + // Disable UUrPlatform_Initalize/Terminate, this enables the Alt-Tab and the Windows key but has the possible side effect of allowing the screensaver to enable itself in-game. + DDrPatch_Byte ((void*)UUrPlatform_Initialize, 0xC3); + DDrPatch_Byte ((void*)UUrPlatform_Terminate, 0xC3); + + // Unlocks particle action disabling/enabling bits for all events. (Will be controlled by a command line switch when I figure out how to do that without Win32 hacks.) + //DDrPatch_Int16 (OniExe + 0x001b184, 0x9090); + return true; } @@ -62,6 +74,17 @@ void __cdecl DDrMain(int argc, char* arg // Safe startup message printer DDrPatch_MakeJump(UUrStartupMessage, DDrStartupMessage); + // Daodan device mode enumeration function + DDrPatch_MakeJump(gl_enumerate_valid_display_modes, daodan_enumerate_valid_display_modes); + + // Performance patch + DDrPatch_MakeJump(UUrMachineTime_High, DDrMachineTime_High); + DDrPatch_MakeJump(UUrMachineTime_High_Frequency, DDrMachineTime_High_Frequency); + DDrPatch_MakeJump(UUrMachineTime_Sixtieths, DDrMachineTime_Sixtieths); + + // Windowed mode + DDrPatch_MakeJump(ONrPlatform_Initialize, DDrPlatform_Initialize); + ONiMain(argc, argv); }