Changeset 466
- Timestamp:
- Oct 17, 2009, 1:49:49 PM (15 years ago)
- Location:
- Daodan
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/Daodan.c
r465 r466 40 40 bool patch_argb8888 = true; 41 41 bool patch_killvtune = true; 42 bool patch_getcmdline = true; 43 bool patch_disablecmdline = true; 42 44 43 45 bool patch_safeprintf = true; … … 174 176 DDrPatch_Byte (OniExe + 0x00026340, 0xC3); 175 177 178 // Disable Oni's internal CLrGetCommandLine function (to eventually replace it with our own) 179 if (patch_getcmdline) 180 DDrPatch_NOOP (OniExe + 0x000d3280, 51); 181 182 // Disable Oni's command line parser so it doesn't interfere with ours 183 if (patch_disablecmdline) 184 DDrPatch_Int32 (OniExe + 0x000d3570, 0xc3c03366); 185 176 186 return true; 177 187 } … … 194 204 { 195 205 ini_section = s_unknown; 196 DDrStartupMessage("unrecognised inisection \"%s\"", section);206 DDrStartupMessage("unrecognised section \"%s\"", section); 197 207 } 198 208 } … … 203 213 if (!stricmp(name, "usedaodanbsl")) 204 214 opt_usedaodanbsl = !stricmp(inifile_cleanstr(value), "true"); 215 else if (!stricmp(name, "debug")) 216 AKgDebug_DebugMaps = !stricmp(inifile_cleanstr(value), "true"); 217 else if (!stricmp(name, "debugfiles")) 218 BFgDebugFileEnable = !stricmp(inifile_cleanstr(value), "true"); 219 else if (!stricmp(name, "findsounds")) 220 SSgSearchOnDisk = !stricmp(inifile_cleanstr(value), "true"); 221 else if (!stricmp(name, "ignore_private_data")) 222 opt_ignore_private_data = !stricmp(inifile_cleanstr(value), "true"); 223 else if (!stricmp(name, "sound")) 224 opt_sound = !stricmp(inifile_cleanstr(value), "true"); 225 else if (!stricmp(name, "switch")) 226 M3gResolutionSwitch = !stricmp(inifile_cleanstr(value), "true"); 227 else 228 DDrStartupMessage("unrecognised option \"%s\"", name); 205 229 break; 206 230 case s_patch: … … 237 261 else if (!stricmp(name, "killvtune")) 238 262 patch_killvtune = !stricmp(inifile_cleanstr(value), "true"); 263 else if (!stricmp(name, "getcmdline")) 264 patch_getcmdline = !stricmp(inifile_cleanstr(value), "true"); 265 else if (!stricmp(name, "disablecmdline")) 266 patch_disablecmdline = !stricmp(inifile_cleanstr(value), "true"); 239 267 else if (!stricmp(name, "safeprintf")) 240 268 patch_safeprintf = !stricmp(inifile_cleanstr(value), "true"); … … 402 430 { 403 431 DDrStartupMessage("daodan attached!"); 432 433 opt_ignore_private_data = false; 434 opt_sound = true; 435 404 436 DDrConfig(); 437 DDrStartupMessage("parsing command line..."); 438 int i; 439 char* section; 440 char* option; 441 bool falseoption; 442 for (i = 1; i < argc; i ++) 443 { 444 if (argv[i][0] == '-') 445 { 446 section = argv[i] + 1; 447 if ((option = strchr(argv[i], '.'))) 448 { 449 *option = '\0'; 450 falseoption = (option[1] == 'n' || option[1] == 'N') && (option[2] = 'o' || option[2] == 'O'); 451 if (i < (argc - 1) && argv[i + 1][0] != '-') 452 DDrIniCallback(section, true, option + (falseoption ? 3 : 1), argv[++i]); 453 else 454 DDrIniCallback(section, true, option + (falseoption ? 3 : 1), (falseoption ? "false" : "true")); 455 *option = '.'; 456 } 457 else 458 { 459 falseoption = (section[0] == 'n' || section[0] == 'N') && (section[1] = 'o' || section[1] == 'O'); 460 ini_section = s_options; 461 if (i < (argc - 1) && argv[i + 1][0] != '-') 462 DDrIniCallback(NULL, false, section + (falseoption ? 2 : 0), argv[++i]); 463 else 464 DDrIniCallback(NULL, false, section + (falseoption ? 2 : 0), (falseoption ? "false" : "true")); 465 } 466 } 467 else 468 { 469 DDrStartupMessage("parse error \"%s\"", argv[i]); 470 break; 471 } 472 } 473 DDrStartupMessage("finished parsing"); 405 474 DDrPatch_Init(); 406 475 -
Daodan/src/Oni.h
r452 r466 25 25 extern void* ONgGameState; 26 26 27 extern char M3gResolutionSwitch; 28 29 extern char opt_sound; 30 extern uint32_t opt_ignore_private_data; 31 32 extern char AKgDebug_DebugMaps; 33 extern char BFgDebugFileEnable; 34 extern char SSgSearchOnDisk; 35 27 36 #endif -
Daodan/src/Oni_Symbols.S
r452 r466 20 20 symbol ( _ONgGameState , 0x001ece7c ) 21 21 22 symbol ( _AKgDebug_DebugMaps , 0x002b2204 ) 23 symbol ( _BFgDebugFileEnable , 0x0015c8d0 ) 24 symbol ( _SSgSearchOnDisk , 0x001eb758 ) 25 26 symbol ( _opt_sound , 0x002370fc ) 27 symbol ( _opt_ignore_private_data , 0x002370f0 ) 28 22 29 // Oni Persistance 23 30 symbol ( @ONrPersist_GetGamma@0 , 0x0010f450 ) … … 29 36 symbol ( @UUrMachineTime_High_Frequency@0 , 0x000264b0 ) 30 37 symbol ( @UUrMachineTime_Sixtieths@0 , 0x000263e0 ) 31 symbol ( _ONgFileStartup , 0x001711b8 )32 33 38 symbol ( @UUrPlatform_Initialize@0 , 0x00026010 ) 34 39 symbol ( @UUrPlatform_Terminate@0 , 0x00026310 ) 40 symbol ( _AUrMessageBox , 0x000378c0 ) 35 41 36 symbol ( _ AUrMessageBox , 0x000378c0)42 symbol ( _ONgFileStartup , 0x001711b8 ) 37 43 38 44 // Motoko -
Daodan/src/inifile_reader.c
r451 r466 11 11 int i; 12 12 for (i = strlen(str) - 1; i >= 0; i --) 13 if ( !isspace(str[i]))14 {15 str[i + 1] = '\0';13 if (isspace(str[i])) 14 str[i] = '\0'; 15 else 16 16 break; 17 }18 17 19 18 while (isspace(*str))
Note:
See TracChangeset
for help on using the changeset viewer.