--- Daodan/src/Daodan.c 2009/07/14 06:40:55 422 +++ Daodan/src/Daodan.c 2009/07/19 11:03:44 445 @@ -6,6 +6,7 @@ #include "Daodan_Win32.h" #include "Daodan_Cheater.h" #include "Daodan_Persistence.h" +#include "Daodan_BSL.h" #include "Daodan_WindowHack.h" @@ -36,6 +37,7 @@ bool patch_alttab = true; bool patch_particledisablebit = false; bool patch_multibyte = false; bool patch_cheattable = true; +bool patch_argb8888 = true; bool patch_safeprintf = true; bool patch_daodandisplayenum = true; @@ -43,6 +45,9 @@ bool patch_usegettickcount = true; bool patch_cheatsenabled = true; bool patch_usedaodangl = false; bool patch_windowhack = true; +bool patch_daodaninit = true; + +bool opt_usedaodanbsl = true; bool DDrPatch_Init() { @@ -154,17 +159,27 @@ bool DDrPatch_Init() DDrPatch_Int32 (OniExe + 0x000f617a, (int)&DDr_CheatTable[0].message_on); } + if (patch_argb8888) + { + DDrPatch_Byte (OniExe + 0x00135af0, 0x07); + DDrPatch_Byte (OniExe + 0x00135af4, 0x0B); + } + return true; } -enum {s_unknown, s_patch, s_language} ini_section; +enum {s_unknown, s_options, s_patch, s_bsl, s_language} ini_section; bool DDrIniCallback(char* section, bool newsection, char* name, char* value) { if (newsection) { - if (!stricmp(section, "patch")) + if (!stricmp(section, "options")) + ini_section = s_options; + else if (!stricmp(section, "patch")) ini_section = s_patch; + else if (!stricmp(section, "bsl")) + ini_section = s_bsl; else if (!stricmp(section, "language")) ini_section = s_language; else @@ -176,6 +191,10 @@ bool DDrIniCallback(char* section, bool switch (ini_section) { + case s_options: + if (!stricmp(name, "usedaodanbsl")) + opt_usedaodanbsl = !stricmp(value, "true"); + break; case s_patch: if (!stricmp(name, "fonttexturecache")) patch_fonttexturecache = !stricmp(value, "true"); @@ -205,6 +224,8 @@ bool DDrIniCallback(char* section, bool patch_multibyte = !stricmp(value, "true"); else if (!stricmp(name, "cheattable")) patch_cheattable = !stricmp(value, "true"); + else if (!stricmp(name, "argb8888")) + patch_argb8888 = !stricmp(value, "true"); else if (!stricmp(name, "safeprintf")) patch_safeprintf = !stricmp(value, "true"); else if (!stricmp(name, "daodandisplayenum")) @@ -217,9 +238,14 @@ bool DDrIniCallback(char* section, bool patch_usedaodangl = !stricmp(value, "true"); else if (!stricmp(name, "windowhack")) patch_windowhack = !stricmp(value, "true"); + else if (!stricmp(name, "daodaninit")) + patch_daodaninit = !stricmp(value, "true"); else DDrStartupMessage("unrecognised patch \"%s\"", name); break; + case s_bsl: + + break; case s_language: if (!stricmp(name, "savepoint")) { @@ -354,6 +380,12 @@ void DDrConfig() DDrStartupMessage("finished parsing"); } +void ONICALL DDrGame_Init() +{ + if (opt_usedaodanbsl) + SLrDaodan_Initalize(); +} + void __cdecl DDrMain(int argc, char* argv[]) { DDrStartupMessage("daodan attached!"); @@ -391,6 +423,9 @@ void __cdecl DDrMain(int argc, char* arg if (patch_windowhack) DDrWindowHack_Install(); + if (patch_daodaninit) + DDrPatch_MakeCall(OniExe + 0x000d345a, DDrGame_Init); + init_daodan_gl(); ONiMain(argc, argv);