--- Daodan/src/Daodan.c 2009/03/17 12:12:24 274 +++ Daodan/src/Daodan.c 2009/06/06 12:25:58 340 @@ -1,10 +1,18 @@ #include "Daodan.h" #include "Daodan_Patch.h" #include "Daodan_Utility.h" +#include "Daodan_Win32.h" +#include "Daodan_Cheater.h" +#include "Daodan_Persistence.h" #include "Oni.h" +#include "Oni_Persistence.h" + #include "BFW_Utility.h" +#include "oni_gl.h" +#include "daodan_gl.h" + HMODULE DDrDLLModule; HMODULE DDrONiModule; @@ -41,9 +49,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 +61,35 @@ 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); + + // Multi-byte patch (multiple language support) + DDrPatch_Byte (OniExe + 0x0002d8f8, 0xeb); + DDrPatch_Byte (OniExe + 0x0002d9ad, 0xeb); + DDrPatch_Byte (OniExe + 0x0002dbe2, 0xeb); + DDrPatch_Byte (OniExe + 0x0002dec3, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e2ab, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e2c4, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e379, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e48c, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e4d0, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e4f4, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e646, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e695, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e944, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e95d, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e98e, 0xeb); + DDrPatch_Byte (OniExe + 0x0002e9dc, 0xeb); + + // Cheat table patch + DDrPatch_Int32 (OniExe + 0x000f616b, (int)&DDr_CheatTable[0].name); + DDrPatch_Int32 (OniExe + 0x000f617a, (int)&DDr_CheatTable[0].message_on); + return true; } @@ -62,6 +100,23 @@ 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); + + // Cheats always enabled + DDrPatch_MakeJump(ONrPersist_GetWonGame, DDrPersist_GetWonGame); + + // Windowed mode +// DDrPatch_MakeJump(ONrPlatform_Initialize, DDrPlatform_Initialize); +// DDrPatch_MakeJump(gl_platform_initialize, daodangl_platform_initialize); + + init_daodan_gl(); + ONiMain(argc, argv); }