| 6 |
|
#include "Daodan_Win32.h" |
| 7 |
|
#include "Daodan_Cheater.h" |
| 8 |
|
#include "Daodan_Persistence.h" |
| 9 |
+ |
#include "Daodan_BSL.h" |
| 10 |
|
|
| 11 |
|
#include "Daodan_WindowHack.h" |
| 12 |
|
|
| 37 |
|
bool patch_particledisablebit = false; |
| 38 |
|
bool patch_multibyte = false; |
| 39 |
|
bool patch_cheattable = true; |
| 40 |
+ |
bool patch_argb8888 = true; |
| 41 |
|
|
| 42 |
|
bool patch_safeprintf = true; |
| 43 |
|
bool patch_daodandisplayenum = true; |
| 45 |
|
bool patch_cheatsenabled = true; |
| 46 |
|
bool patch_usedaodangl = false; |
| 47 |
|
bool patch_windowhack = true; |
| 48 |
+ |
bool patch_daodaninit = true; |
| 49 |
+ |
bool patch_bsl = true; |
| 50 |
+ |
|
| 51 |
+ |
bool opt_usedaodanbsl = true; |
| 52 |
|
|
| 53 |
|
bool DDrPatch_Init() |
| 54 |
|
{ |
| 160 |
|
DDrPatch_Int32 (OniExe + 0x000f617a, (int)&DDr_CheatTable[0].message_on); |
| 161 |
|
} |
| 162 |
|
|
| 163 |
+ |
if (patch_argb8888) |
| 164 |
+ |
{ |
| 165 |
+ |
DDrPatch_Byte (OniExe + 0x00135af0, 0x07); |
| 166 |
+ |
DDrPatch_Byte (OniExe + 0x00135af4, 0x0B); |
| 167 |
+ |
} |
| 168 |
+ |
|
| 169 |
|
return true; |
| 170 |
|
} |
| 171 |
|
|
| 172 |
< |
enum {s_unknown, s_patch, s_language} ini_section; |
| 172 |
> |
enum {s_unknown, s_options, s_patch, s_bsl, s_language} ini_section; |
| 173 |
|
|
| 174 |
|
bool DDrIniCallback(char* section, bool newsection, char* name, char* value) |
| 175 |
|
{ |
| 176 |
|
if (newsection) |
| 177 |
|
{ |
| 178 |
< |
if (!stricmp(section, "patch")) |
| 178 |
> |
if (!stricmp(section, "options")) |
| 179 |
> |
ini_section = s_options; |
| 180 |
> |
else if (!stricmp(section, "patch")) |
| 181 |
|
ini_section = s_patch; |
| 182 |
+ |
else if (!stricmp(section, "bsl")) |
| 183 |
+ |
ini_section = s_bsl; |
| 184 |
|
else if (!stricmp(section, "language")) |
| 185 |
|
ini_section = s_language; |
| 186 |
|
else |
| 192 |
|
|
| 193 |
|
switch (ini_section) |
| 194 |
|
{ |
| 195 |
+ |
case s_options: |
| 196 |
+ |
if (!stricmp(name, "usedaodanbsl")) |
| 197 |
+ |
opt_usedaodanbsl = !stricmp(value, "true"); |
| 198 |
+ |
break; |
| 199 |
|
case s_patch: |
| 200 |
|
if (!stricmp(name, "fonttexturecache")) |
| 201 |
|
patch_fonttexturecache = !stricmp(value, "true"); |
| 225 |
|
patch_multibyte = !stricmp(value, "true"); |
| 226 |
|
else if (!stricmp(name, "cheattable")) |
| 227 |
|
patch_cheattable = !stricmp(value, "true"); |
| 228 |
+ |
else if (!stricmp(name, "argb8888")) |
| 229 |
+ |
patch_argb8888 = !stricmp(value, "true"); |
| 230 |
|
else if (!stricmp(name, "safeprintf")) |
| 231 |
|
patch_safeprintf = !stricmp(value, "true"); |
| 232 |
|
else if (!stricmp(name, "daodandisplayenum")) |
| 239 |
|
patch_usedaodangl = !stricmp(value, "true"); |
| 240 |
|
else if (!stricmp(name, "windowhack")) |
| 241 |
|
patch_windowhack = !stricmp(value, "true"); |
| 242 |
+ |
else if (!stricmp(name, "daodaninit")) |
| 243 |
+ |
patch_daodaninit = !stricmp(value, "true"); |
| 244 |
+ |
else if (!stricmp(name, "bsl")) |
| 245 |
+ |
patch_bsl = !stricmp(value, "true"); |
| 246 |
|
else |
| 247 |
|
DDrStartupMessage("unrecognised patch \"%s\"", name); |
| 248 |
|
break; |
| 249 |
+ |
case s_bsl: |
| 250 |
+ |
|
| 251 |
+ |
break; |
| 252 |
|
case s_language: |
| 253 |
|
if (!stricmp(name, "savepoint")) |
| 254 |
|
{ |
| 383 |
|
DDrStartupMessage("finished parsing"); |
| 384 |
|
} |
| 385 |
|
|
| 386 |
+ |
void ONICALL DDrGame_Init() |
| 387 |
+ |
{ |
| 388 |
+ |
if (opt_usedaodanbsl) |
| 389 |
+ |
SLrDaodan_Initalize(); |
| 390 |
+ |
} |
| 391 |
+ |
|
| 392 |
|
void __cdecl DDrMain(int argc, char* argv[]) |
| 393 |
|
{ |
| 394 |
|
DDrStartupMessage("daodan attached!"); |
| 426 |
|
if (patch_windowhack) |
| 427 |
|
DDrWindowHack_Install(); |
| 428 |
|
|
| 429 |
+ |
if (patch_daodaninit) |
| 430 |
+ |
DDrPatch_MakeCall(OniExe + 0x000d345a, DDrGame_Init); |
| 431 |
+ |
|
| 432 |
+ |
// Patches for existing BSL functions |
| 433 |
+ |
if (patch_bsl) |
| 434 |
+ |
SLrDaodan_Patch(); |
| 435 |
+ |
|
| 436 |
|
init_daodan_gl(); |
| 437 |
|
|
| 438 |
|
ONiMain(argc, argv); |