--- Daodan/src/Daodan.c 2009/05/28 10:33:59 326 +++ Daodan/src/Daodan.c 2009/06/06 13:23:59 342 @@ -2,8 +2,12 @@ #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" @@ -14,6 +18,8 @@ HMODULE DDrONiModule; bool DDrPatch_Init() { + DDrStartupMessage("daodan attached, patching engine"); + // Font texture cache doubled DDrPatch_Byte (OniExe + 0x00020ea7, 0x20); DDrPatch_Byte (OniExe + 0x00020f4a, 0x40); @@ -64,6 +70,28 @@ bool DDrPatch_Init() // 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; } @@ -82,9 +110,12 @@ void __cdecl DDrMain(int argc, char* arg 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); +// DDrPatch_MakeJump(ONrPlatform_Initialize, DDrPlatform_Initialize); +// DDrPatch_MakeJump(gl_platform_initialize, daodangl_platform_initialize); init_daodan_gl();