Index: /Daodan/src/Daodan_Config.c
===================================================================
--- /Daodan/src/Daodan_Config.c	(revision 999)
+++ /Daodan/src/Daodan_Config.c	(revision 1000)
@@ -26,10 +26,135 @@
 
 ConfigSection_t config[] = {
-	{ "patches", "Patches", {
-		{ "alttab",
-			"Allows to Alt-Tab out of Oni and use Windows key. May enable the screensaver as well.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
+	{ "", "Command line only", {
+		{ "help",
+			"Generates this help file.",
+			C_CMD,
+			{.intBoolVal = 0},
+			{.callback = DDrConfig_PrintHelp} },
+		{ 0, 0, 0, {0}, {0} }
+	} },
+	{ "devmode", "Developer Mode", {
+		{ "highres_console",
+			"Fixes bug where console line becomes invisible at higher resolutions.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "showtriggervolumes",
+			"Allows BSL variable \"show_triggervolumes\" and Ctrl+Shift+X (in devmode) to work.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ 0, 0, 0, {0}, {0} }
+	} },
+	{ "gameplay", "Gameplay", {
+		{ "cheatsenabled",
+			"Enables cheats without having to beat the game first.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "cheattable",
+			"Replaces Oni's cheat table with table that includes new cheats including devmode.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "cooldowntimer",
+			"Disables weapon cooldown exploit.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "kickguns",
+			"EXPERIMENTAL! Unfinished, do not use.",
+			C_BOOL,
+			{.intBoolVal = false},
+			{.intBoolVal = false} },
+		{ "pathfinding",
+			"Size of pathfinding grid cache increased by eight times in order to prevent crashes in large levels.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "projaware",
+			"Allows AI to dodge incoming gunfire properly.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "throwtest",
+			"EXPERIMENTAL! Experiment with allowing enemies to be thrown over railings.",
+			C_BOOL,
+			{.intBoolVal = false},
+			{.intBoolVal = false} },
+		{ "wpfadetime",
+			"Adds working function for existing BSL command wp_fadetime, sets fade time to 4800.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ 0, 0, 0, {0}, {0} }
+	} },
+	{ "graphics", "Graphics", {
+		{ "binkplay",
+			"Fix binkplay calls to use GDI and outro same mode as intro.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "daodangl",
+			"Provides an improved windowed mode (-noswitch).",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "displayenum",
+			"Offers a more accurate list of available display modes in the Options menu.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "gamma",
+			"Enable gamma slider in fullscreen, disable in windowed mode.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "newweap",
+			"Standing above a weapon displays a message containing the weapon name and amount of ammo.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "optionsvisible",
+			"Always show options button in main menu, even when pausing from a game.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "showalllasersights",
+			"Show all (also enemies') weapon lasersights.",
+			C_BOOL,
+			{.intBoolVal = false},
+			{.intBoolVal = false} },
+		{ "widescreenportraits",
+			"Prevents fly-in portraits from being stretched when playing in widescreen resolutions.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ 0, 0, 0, {0}, {0} }
+	} },
+	{ "language", "Language", {
+		{ "chinese",
+			"Allow for chinese fonts to be shown if the required DLL is available.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "fonttexturecache",
+			"Doubles size of font texture cache.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "language",
+			"Localization for hardcoded strings (e.g. \"Savepoints\").",
+			C_STRING,
+			{.stringVal = "en"},
+			{.stringVal = "en"} },
+		{ "nomultibyte",
+			"Enables languages which use multibyte coding (such as Chinese).",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ 0, 0, 0, {0}, {0} }
+	} },
+	{ "modding", "Modding", {
 		{ "argb8888",
 			"Allows using textures with ARGB8888.",
@@ -37,34 +162,4 @@
 			{.intBoolVal = true},
 			{.intBoolVal = true} },
-		{ "binkplay",
-			"Fix binkplay calls to use GDI and outro same mode as intro.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "cheatsenabled",
-			"Enables cheats without having to beat the game first.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "cheattable",
-			"Replaces Oni's cheat table with table that includes new cheats including devmode.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "chinese",
-			"Allow for chinese fonts to be shown if the required DLL is available.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "clipcursor",
-			"Limit cursor to Oni's window.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "cooldowntimer",
-			"Disables weapon cooldown exploit.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
 		{ "d_regen",
 			"Enables script command d_regen (query/set regeneration for any character).",
@@ -72,21 +167,6 @@
 			{.intBoolVal = true},
 			{.intBoolVal = true} },
-		{ "daodandisplayenum",
-			"Offers a more accurate list of available display modes in the Options menu.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "directinput",
-			"Enforces the usage of DirectInput on every system. Should be off for Linux/Wine.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "disablecmdline",
-			"Disables Oni's existing command line parser as Daodan has its own.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "fonttexturecache",
-			"Doubles size of font texture cache.",
+		{ "daodanbsl",
+			"Adds new BSL commands.",
 			C_BOOL,
 			{.intBoolVal = true},
@@ -97,19 +177,4 @@
 			{.intBoolVal = true},
 			{.intBoolVal = true} },
-		{ "highres_console",
-			"Fixes bug where console line becomes invisible at higher resolutions.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "kickguns",
-			"EXPERIMENTAL! Unfinished, do not use.",
-			C_BOOL,
-			{.intBoolVal = false},
-			{.intBoolVal = false} },
-		{ "killvtune",
-			"Prevent loading of vtuneapi.dll.",
-			C_BOOL,
-			{.intBoolVal = false},
-			{.intBoolVal = false} },
 		{ "largetextures",
 			"Textures up to 512x512 can be used.",
@@ -122,82 +187,7 @@
 			{.intBoolVal = true},
 			{.intBoolVal = true} },
-		{ "newweap",
-			"Standing above a weapon displays a message containing the weapon name and amount of ammo.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "nomultibyte",
-			"Enables languages which use multibyte coding (such as Chinese).",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "optionsvisible",
-			"Always show options button in main menu, even when pausing from a game.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "pathfinding",
-			"Size of pathfinding grid cache increased by eight times in order to prevent crashes in large levels.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "projaware",
-			"Allows AI to dodge incoming gunfire properly.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "safeprintf",
-			"Replaces Oni's function that prints to startup.txt with a safer one.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "showalllasersights",
-			"Show all (also enemies') weapon lasersights.",
-			C_BOOL,
-			{.intBoolVal = false},
-			{.intBoolVal = false} },
-		{ "showtriggervolumes",
-			"Allows BSL variable \"show_triggervolumes\" and Ctrl+Shift+X (in devmode) to work.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "throwtest",
-			"EXPERIMENTAL! Experiment with allowing enemies to be thrown over railings.",
-			C_BOOL,
-			{.intBoolVal = false},
-			{.intBoolVal = false} },
-		{ "usedaodanbsl",
-			"Adds new BSL commands.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "usedaodangl",
-			"Provides an improved windowed mode (-noswitch).",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "usegettickcount",
-			"Replaces Oni's timing functions with more accurate ones.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "widescreenportraits",
-			"Prevents fly-in portraits from being stretched when playing in widescreen resolutions.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "wpfadetime",
-			"Adds working function for existing BSL command wp_fadetime, sets fade time to 4800.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
 		{ 0, 0, 0, {0}, {0} }
 	} },
-	{ "options", "Options", {
-		{ "border",
-			"Add a border if in windowed mode and \"usedaodangl\" patch is active.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
+	{ "oni", "Original Oni Options", {
 		{ "debug",
 			"Not useful, probably does nothing.",
@@ -215,14 +205,4 @@
 			{.intBoolVal = false },
 			{.extBoolVal = &SSgSearchOnDisk } },
-		{ "gamma",
-			"Enable gamma slider in fullscreen, disable in windowed mode.",
-			C_BOOL,
-			{.intBoolVal = true},
-			{.intBoolVal = true} },
-		{ "help",
-			"Generates this help file.",
-			C_CMD,
-			{.intBoolVal = 0},
-			{.callback = DDrConfig_PrintHelp} },
 		{ "ignore_private_data",
 			"Not useful, probably does nothing.",
@@ -240,4 +220,42 @@
 			{.intBoolVal = true},
 			{.extBoolVal = &M3gResolutionSwitch} },
+		{ 0, 0, 0, {0}, {0} }
+	} },
+	{ "windows", "Windows", {
+		{ "alttab",
+			"Allows to Alt-Tab out of Oni and use Windows key. May enable the screensaver as well.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "border",
+			"Add a border if in windowed mode and \"usedaodangl\" patch is active.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "clipcursor",
+			"Limit cursor to Oni's window.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "directinput",
+			"Enforces the usage of DirectInput on every system. Should be off for Linux/Wine.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "disablecmdline",
+			"Disables Oni's existing command line parser as Daodan has its own.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
+		{ "killvtune",
+			"Prevent loading of vtuneapi.dll.",
+			C_BOOL,
+			{.intBoolVal = false},
+			{.intBoolVal = false} },
+		{ "safeprintf",
+			"Replaces Oni's function that prints to startup.txt with a safer one.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
 		{ "topmost",
 			"Keep game window on top in windowed mode, even when switching applications.",
@@ -245,9 +263,9 @@
 			{.intBoolVal = false},
 			{.intBoolVal = false} },
-		{ "language",
-			"Localization for hardcoded strings (e.g. \"Savepoints\").",
-			C_STRING,
-			{.stringVal = "en"},
-			{.stringVal = "en"} },
+		{ "usegettickcount",
+			"Replaces Oni's timing functions with more accurate ones.",
+			C_BOOL,
+			{.intBoolVal = true},
+			{.intBoolVal = true} },
 		{ 0, 0, 0, {0}, {0} }
 	} }
@@ -299,23 +317,7 @@
 				char* desc = co->description;
 				const char* tName = DDrConfig_GetOptionTypeName(co->type);
-				int boolV = co->defaultValue.intBoolVal;
-				char* val;
-				switch (co->type) {
-					case C_STRING:
-						val = co->defaultValue.stringVal;
-						break;
-					case EXT_BOOL:
-						val = (boolV ? "true" : "false");
-						break;
-					case C_BOOL:
-						val = (boolV ? "true" : "false");
-						break;
-					case C_CMD:
-						val = "";
-						break;
-					default:
-						val = malloc(20);
-						sprintf(val, "%d", boolV);
-				}
+				const char* val = DDrConfig_GetOptionValueString(co, 1);
+				if (!val)
+					val = "";
 				fprintf(fp, "        %-22s %6s=%-5s %s\n", name, tName, val, desc);
 			}
@@ -326,13 +328,9 @@
 		fprintf(fp, "    [sectionX]\n    parameterName = false\n");
 		fprintf(fp, "\nTo pass the parameter on the command line:\n");
-		fprintf(fp, "    Oni.exe -sectionX.parameterName false\n");
+		fprintf(fp, "    Oni.exe -parameterName false\n");
 		fprintf(fp, "For bool parameters the value can be ommitted so it is regarded as \"true\":\n");
-		fprintf(fp, "    Oni.exe -sectionX.parameterName\n");
+		fprintf(fp, "    Oni.exe -parameterName\n");
 		fprintf(fp, "To disable a bool parameter you can prefix \"no\" to the parameter name like this:\n");
-		fprintf(fp, "    Oni.exe -sectionX.noparameterName\n");
-		fprintf(fp, "If no section is given it is assumed to be \"%s\", e.g.\n", defaultSection);
-		fprintf(fp, "    Oni.exe -%s.parametername\n", defaultSection);
-		fprintf(fp, "can simply be written as\n");
-		fprintf(fp, "    Oni.exe -parametername\n");
+		fprintf(fp, "    Oni.exe -noparameterName\n");
 
 		fclose(fp);
@@ -362,4 +360,45 @@
 }
 
+const char* DDrConfig_GetOptionValueString(ConfigOption_t* opt, char printdefault)
+{
+	OptionValue_t* optVal = (printdefault ? &opt->defaultValue : &opt->value);
+	int boolV = optVal->intBoolVal;
+	char* val = 0;
+	switch (opt->type) {
+		case C_STRING:
+			return optVal->stringVal;
+		case EXT_BOOL:
+			if (printdefault)
+				return (boolV ? "true" : "false");
+			else
+				return (*optVal->extBoolVal ? "true" : "false");
+		case C_BOOL:
+			return (boolV ? "true" : "false");
+		case C_CMD:
+			return 0;
+		default:
+			val = malloc(20);
+			sprintf(val, "%d", boolV);
+			return val;
+	}
+}
+
+char DDrConfig_NonDefaultOptionValue(ConfigOption_t* opt)
+{
+	switch (opt->type) {
+		case C_STRING:
+			return _stricmp(opt->defaultValue.stringVal, opt->value.stringVal);
+		case EXT_BOOL:
+			return !opt->defaultValue.intBoolVal != !*opt->value.extBoolVal;
+		case C_BOOL:
+			return !opt->defaultValue.intBoolVal != !opt->value.intBoolVal;
+		case C_CMD:
+			return 0;
+		case C_INT:
+			return opt->defaultValue.intBoolVal != opt->value.intBoolVal;
+	}
+	return 0;
+}
+
 static ConfigOption_t* DDrConfig_GetOption(const char* fullOptName)
 {
@@ -374,6 +413,8 @@
 	*option++ = 0;
 
+	char isWildcardSection = !_stricmp(section, "*");
+
 	for (unsigned int s = 0; s < ARRAY_SIZE(config); s++) {
-		if (!_stricmp(config[s].name, section)) {
+		if (isWildcardSection || !_stricmp(config[s].name, section)) {
 			for (ConfigOption_t* co = config[s].options; co->name != 0; co++) {
 				if (!_stricmp(co->name, option)) {
@@ -381,9 +422,14 @@
 				}
 			}
-			STARTUPMESSAGE("Could not find option \"%s\" in section \"%s\"", option, section);
-			return 0;
-		}
-	}
-	STARTUPMESSAGE("Could not find section \"%s\" for option \"%s\"", section, option);
+			if (!isWildcardSection) {
+				STARTUPMESSAGE("Could not find option \"%s\" in section \"%s\"", option, section);
+				return 0;
+			}
+		}
+	}
+	if (!isWildcardSection)
+		STARTUPMESSAGE("Could not find section \"%s\" for option \"%s\"", section, option);
+	else
+		STARTUPMESSAGE("Could not find option \"%s\"", option);
 	return 0;
 }
@@ -419,5 +465,5 @@
 
 
-void DDrConfig_WriteTemplateIni()
+void DDrConfig_WriteIni()
 {
 	FILE* fp;
@@ -427,5 +473,14 @@
 	{
 		for (unsigned int s = 0; s < ARRAY_SIZE(config); s++) {
-			fprintf(fp, "[%s]\n", config[s].name);
+			if (strlen(config[s].name)) {
+				fprintf(fp, "[%s]\n", config[s].name);
+				for (ConfigOption_t* co = config[s].options; co->name != 0; co++) {
+					char* name = co->name;
+					const char* val = DDrConfig_GetOptionValueString(co, 0);
+					if (val && DDrConfig_NonDefaultOptionValue(co))
+						fprintf(fp, "%s = %s\n", name, val);
+				}
+				fprintf(fp, "\n");
+			}
 		}
 		fclose(fp);
@@ -440,5 +495,4 @@
 void DDrIniCallback(const char* section, const char* name, const char* value)
 {
-	static char curSection[20];
 	char fullOptName[50];
 
@@ -446,9 +500,7 @@
 		section = "patches";
 
-	strcpy(curSection, section);
-
-	strcpy(fullOptName, curSection);
-	fullOptName[strlen(curSection)] = '.';
-	strcpy(fullOptName+strlen(curSection)+1, name);
+	strcpy(fullOptName, section);
+	fullOptName[strlen(section)] = '.';
+	strcpy(fullOptName+strlen(section)+1, name);
 
 	ConfigOption_t* co = DDrConfig_GetOption(fullOptName);
@@ -480,5 +532,8 @@
 	} else {
 		char buf[50];
-		sprintf_s(buf, sizeof(buf), "  %s.%s\n", section, name);
+		if (!_stricmp(section, "*"))
+			sprintf_s(buf, sizeof(buf), "  %s\n", name);
+		else
+			sprintf_s(buf, sizeof(buf), "  %s.%s\n", section, name);
 		if (strlen(buf) + strlen(invalidCurParamaters) < sizeof(invalidCurParamaters) - 1) {
 			strcpy(invalidCurParamaters + strlen(invalidCurParamaters), buf);
@@ -494,22 +549,8 @@
 		if (argv[i][0] == '-')
 		{
-			const char* section;
-			char* optionsep;
 			char* option;
 			bool invertedOption;
 
-			if ((optionsep = strchr(argv[i], '.')))
-			// Is "section.option"
-			{
-				*optionsep = 0;
-				option = optionsep+1;
-				section = argv[i]+1;
-			}
-			else
-			// Is just "option"
-			{
-				section = defaultSection;
-				option = argv[i]+1;
-			}
+			option = argv[i]+1;
 
 			invertedOption = (option[0] == 'n' || option[0] == 'N') && (option[1] == 'o' || option[1] == 'O');
@@ -520,14 +561,11 @@
 			// Has value in next field
 			{
-				DDrIniCallback(section, option, argv[++i]);
+				DDrIniCallback("*", option, argv[++i]);
 			}
 			else
 			// Implicit value
 			{
-				DDrIniCallback(section, option, (invertedOption ? "false" : "true"));
-			}
-
-			if (optionsep)
-				*optionsep = '.';
+				DDrIniCallback("*", option, (invertedOption ? "false" : "true"));
+			}
 		}
 		else
@@ -546,5 +584,5 @@
 
 	if (GetFileAttributes(iniName) == INVALID_FILE_ATTRIBUTES)
-		DDrConfig_WriteTemplateIni();
+		DDrConfig_WriteIni();
 	
 	STARTUPMESSAGE("Parsing daodan.ini...", 0);
@@ -578,4 +616,6 @@
 	}
 
+	DDrConfig_WriteIni();
+
 //	DDrConfig_Print();
 }
Index: /Daodan/src/Daodan_Config.h
===================================================================
--- /Daodan/src/Daodan_Config.h	(revision 999)
+++ /Daodan/src/Daodan_Config.h	(revision 1000)
@@ -32,12 +32,15 @@
 	char* name;
 	char* description;
-	ConfigOption_t options[50];
+	ConfigOption_t options[20];
 } ConfigSection_t;
 
 
 void DDrConfig(int argc, char* argv[]);
+void DDrConfig_WriteIni();
 
 ConfigOption_t* DDrConfig_GetOptOfType(const char* fullOptName, OptionType_t type);
 const char* DDrConfig_GetOptionTypeName(OptionType_t type);
+const char* DDrConfig_GetOptionValueString(ConfigOption_t* opt, char printdefault);
+char DDrConfig_NonDefaultOptionValue(ConfigOption_t* opt);
 
 #endif
Index: /Daodan/src/Patches/Cheater.c
===================================================================
--- /Daodan/src/Patches/Cheater.c	(revision 999)
+++ /Daodan/src/Patches/Cheater.c	(revision 1000)
@@ -253,5 +253,5 @@
 		case cheat_elderrune:
 		{
-			if (DDrConfig_GetOptOfType("patches.d_regen", C_BOOL)->value.intBoolVal)
+			if (DDrConfig_GetOptOfType("modding.d_regen", C_BOOL)->value.intBoolVal)
 			{
 				int* Regeneration = &ONgGameState->PlayerCharacter->RegenHax;
Index: /Daodan/src/Patches/GL.c
===================================================================
--- /Daodan/src/Patches/GL.c	(revision 999)
+++ /Daodan/src/Patches/GL.c	(revision 1000)
@@ -254,5 +254,5 @@
 		else
 		{
-			ConfigOption_t* co = DDrConfig_GetOptOfType("options.border", C_BOOL);
+			ConfigOption_t* co = DDrConfig_GetOptOfType("windows.border", C_BOOL);
 			if (co && co->value.intBoolVal)
 			{
@@ -318,5 +318,5 @@
 static void ONICALL DD_GLiGamma_Restore(void)
 {
-	ConfigOption_t* co = DDrConfig_GetOptOfType("options.gamma", C_BOOL);
+	ConfigOption_t* co = DDrConfig_GetOptOfType("graphics.gamma", C_BOOL);
 	if (co->value.intBoolVal)
 	{
@@ -330,5 +330,5 @@
 static void ONICALL DD_GLiGamma_Initialize(void)
 {
-	ConfigOption_t* co = DDrConfig_GetOptOfType("options.gamma", C_BOOL);
+	ConfigOption_t* co = DDrConfig_GetOptOfType("graphics.gamma", C_BOOL);
 	if (co->value.intBoolVal)
 	{
@@ -402,5 +402,5 @@
 	}
 
-	ConfigOption_t* co = DDrConfig_GetOptOfType("options.gamma", C_BOOL);
+	ConfigOption_t* co = DDrConfig_GetOptOfType("graphics.gamma", C_BOOL);
 	if (!M3gResolutionSwitch && co->value.intBoolVal)
 	{
Index: /Daodan/src/Patches/Localization.c
===================================================================
--- /Daodan/src/Patches/Localization.c	(revision 999)
+++ /Daodan/src/Patches/Localization.c	(revision 1000)
@@ -127,5 +127,5 @@
 void DD_Localization()
 {
-	char* lang = DDrConfig_GetOptOfType("options.language", C_STRING)->value.stringVal;
+	char* lang = DDrConfig_GetOptOfType("language.language", C_STRING)->value.stringVal;
 	char filename[50] = "daodan_locales/";
 	strcpy(filename + strlen(filename), lang);
Index: /Daodan/src/Patches/Patches.c
===================================================================
--- /Daodan/src/Patches/Patches.c	(revision 999)
+++ /Daodan/src/Patches/Patches.c	(revision 1000)
@@ -18,5 +18,5 @@
 static void ONICALL DD_ONiOGU_GammaSlider_SetRange(void* window, int min_value, int max_value)
 {
-	ConfigOption_t* co = DDrConfig_GetOptOfType("options.gamma", C_BOOL);
+	ConfigOption_t* co = DDrConfig_GetOptOfType("graphics.gamma", C_BOOL);
 	WMrWindow_SetEnabled(window, M3gResolutionSwitch && co->value.intBoolVal);
 	WMrSlider_SetRange(window, min_value, max_value);
@@ -85,5 +85,5 @@
 void ONICALL DDrGame_Init()
 {
-	if (DDrConfig_GetOptOfType("patches.usedaodanbsl", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("modding.daodanbsl", C_BOOL)->value.intBoolVal)
 		SLrDaodan_Initialize();
 }
@@ -292,5 +292,5 @@
 	// Windows key but has the possible side effect of allowing the screensaver
 	// to enable itself in-game.
-	if (DDrConfig_GetOptOfType("patches.alttab", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("windows.alttab", C_BOOL)->value.intBoolVal)
 	{
 		// 0xC3 = ret, so makes those functions just have a "ret" instruction at their start
@@ -300,5 +300,5 @@
 	
 	// Textures using ARGB8888 can be used
-	if (DDrConfig_GetOptOfType("patches.argb8888", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("modding.argb8888", C_BOOL)->value.intBoolVal)
 	{
 		// Update conversion lookups in IMgConvertPixelType_List
@@ -311,5 +311,5 @@
 	// outro (ie., BKrMovie_Play() instead of ONrMovie_Play_Hardware() as the
 	// latter has problems on WINE).
-	if (DDrConfig_GetOptOfType("patches.binkplay", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("graphics.binkplay", C_BOOL)->value.intBoolVal)
 	{
 		// push BINKBUFFERAUTO -> push BINKBUFFERDIBSECTION.
@@ -319,9 +319,9 @@
 	}
 
-	if (DDrConfig_GetOptOfType("patches.d_regen", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("modding.d_regen", C_BOOL)->value.intBoolVal)
 		DD_Patch_Regeneration();
 
 	// Cheats always enabled
-	if (DDrConfig_GetOptOfType("patches.cheatsenabled", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("gameplay.cheatsenabled", C_BOOL)->value.intBoolVal)
 	{
 		DDrPatch_MakeJump((void*)ONrPersist_GetWonGame, (void*)DDrPersist_GetWonGame);
@@ -329,5 +329,5 @@
 
 	// Use Daodan's own cheattable
-	if (DDrConfig_GetOptOfType("patches.cheattable", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("gameplay.cheattable", C_BOOL)->value.intBoolVal)
 	{
 		// In ONrGameState_HandleCheats: Replace pointers to orig cheattable
@@ -349,9 +349,9 @@
 	}
 	
-	if (DDrConfig_GetOptOfType("patches.chinese", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("language.chinese", C_BOOL)->value.intBoolVal)
 		DD_Patch_Chinese();
 
 	// Limit cursor to Oni's window
-	if (DDrConfig_GetOptOfType("patches.clipcursor", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("windows.clipcursor", C_BOOL)->value.intBoolVal)
 	{
 		// LIrMode_Set: replace LIrPlatform_Mode_Set call with our hook.
@@ -366,5 +366,5 @@
 
 	// Disables weapon cooldown exploit
-	if (DDrConfig_GetOptOfType("patches.cooldowntimer", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("gameplay.cooldowntimer", C_BOOL)->value.intBoolVal)
 	{
 		// In WPrRelease: NoOp 4 MOVs
@@ -373,5 +373,5 @@
 
 	// Daodan device mode enumeration function
-	if (DDrConfig_GetOptOfType("patches.daodandisplayenum", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("graphics.displayenum", C_BOOL)->value.intBoolVal)
 	{
 		DDrPatch_MakeJump((void*)gl_enumerate_valid_display_modes, (void*)DD_GLrEnumerateDisplayModes);
@@ -379,5 +379,5 @@
 	
 	// Forced DirectInput (for Windows NT)
-	if (DDrConfig_GetOptOfType("patches.directinput", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("windows.directinput", C_BOOL)->value.intBoolVal)
 	{
 		// LIrPlatform_Initialize: replace conditional jump by unconditional
@@ -386,5 +386,5 @@
 
 	// Disable Oni's command line parser so it doesn't interfere with ours
-	if (DDrConfig_GetOptOfType("patches.disablecmdline", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("windows.disablecmdline", C_BOOL)->value.intBoolVal)
 	{
 		// Replace start of OniParseCommandLine with XOR eax,eax; RET
@@ -395,5 +395,5 @@
 
 	// Font texture cache doubled
-	if (DDrConfig_GetOptOfType("patches.fonttexturecache", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("language.fonttexturecache", C_BOOL)->value.intBoolVal)
 	{
 		// Double two values in TMrGame_Initialize
@@ -403,5 +403,5 @@
 
 	// Allow HD screens on resolutions < 1024*768
-	if (DDrConfig_GetOptOfType("patches.hdscreens_lowres", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("modding.hdscreens_lowres", C_BOOL)->value.intBoolVal)
 	{
 		DDrPatch_MakeJump((void*)M3rDraw_BigBitmap, (void*)DD_M3rDraw_BigBitmap);
@@ -409,5 +409,5 @@
 
 	// Allow for console to show on higher resolutions
-	if (DDrConfig_GetOptOfType("patches.highres_console", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("devmode.highres_console", C_BOOL)->value.intBoolVal)
 	{
 		Oni_COrTextArea_Resize = DDrPatch_MakeDetour((void*)COrTextArea_Resize, (void*)DD_COrTextArea_Resize);
@@ -416,5 +416,5 @@
 	// Hackish fix for Konoko not kicking guns
 	// Don't use this, it breaks stairs.
-	if (DDrConfig_GetOptOfType("patches.kickguns", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("gameplay.kickguns", C_BOOL)->value.intBoolVal)
 	{
 		// In ONrCharacter_EnablePhysics: Load different values to same addresses as before
@@ -424,5 +424,5 @@
 	
 	// Disable loading the vtuneapi.dll
-	if (DDrConfig_GetOptOfType("patches.killvtune", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("windows.killvtune", C_BOOL)->value.intBoolVal)
 	{
 		// Instantly return from UUrLoadVtuneAPI
@@ -431,5 +431,5 @@
 
 	// Now supports textures up to 512x512
-	if (DDrConfig_GetOptOfType("patches.largetextures", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("modding.largetextures", C_BOOL)->value.intBoolVal)
 	{
 		DDrPatch_Byte((char*)(OniExe + 0x00005251), 0x10);
@@ -437,5 +437,5 @@
 	
 	// Non-"_Final" levels are now valid
-	if (DDrConfig_GetOptOfType("patches.levelplugins", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("modding.levelplugins", C_BOOL)->value.intBoolVal)
 	{
 		// Patch in TMrUtility_LevelInfo_Get: 
@@ -444,5 +444,5 @@
 
 	// Weapon on ground shown with name and magazine contents
-	if (DDrConfig_GetOptOfType("patches.newweap", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("graphics.newweap", C_BOOL)->value.intBoolVal)
 	{
 		//Makes it always say "Received weapon_name."
@@ -464,5 +464,5 @@
 
 	// Disable Multi-byte character awareness patch (multiple language support)
-	if (DDrConfig_GetOptOfType("patches.nomultibyte", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("language.nomultibyte", C_BOOL)->value.intBoolVal)
 	{
 		// TSiContext_DrawLine: Replace conditional jumps by unconditional ones
@@ -489,5 +489,5 @@
 
 	// Fix options not visible in main menu when a game was started
-	if (DDrConfig_GetOptOfType("patches.optionsvisible", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("graphics.optionsvisible", C_BOOL)->value.intBoolVal)
 	{
 		// replace WMrWindow_SetVisible calls
@@ -497,5 +497,5 @@
 
 	// Pathfinding grid cache size x8
-	if (DDrConfig_GetOptOfType("patches.pathfinding", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("gameplay.pathfinding", C_BOOL)->value.intBoolVal)
 	{
 		// Replaces conditional jump (je) with unconditional jump
@@ -509,5 +509,5 @@
 
 	// Projectile awareness fixed
-	if (DDrConfig_GetOptOfType("patches.projaware", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("gameplay.projaware", C_BOOL)->value.intBoolVal)
 	{
 		DDrPatch_Byte  ((char*)(OniExe + 0x0009c07c), 0x6c);
@@ -518,5 +518,5 @@
 
 	// Safe startup message printer
-	if (DDrConfig_GetOptOfType("patches.safeprintf", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("windows.safeprintf", C_BOOL)->value.intBoolVal)
 	{
 		DDrPatch_MakeJump((void*)UUrStartupMessage, (void*)DDrStartupMessage);
@@ -524,5 +524,5 @@
 
 	// Show all (also enemies') lasersights
-	if (DDrConfig_GetOptOfType("patches.showalllasersights", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("graphics.showalllasersights", C_BOOL)->value.intBoolVal)
 	{
 		DDrPatch_NOOP((char*)(OniExe + 0x000E1957), 6 );
@@ -530,5 +530,5 @@
 
 	// Allow bsl-var show_triggervolumes or ctrl+shift+x (devmode) to work
-	if (DDrConfig_GetOptOfType("patches.showtriggervolumes", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("devmode.showtriggervolumes", C_BOOL)->value.intBoolVal)
 	{
 		Oni_ONrMechanics_Register = DDrPatch_MakeDetour((void*)ONrMechanics_Register, (void*)DD_ONrMechanics_Register);
@@ -537,5 +537,5 @@
 	
 	// Experiment with allowing enemies to be thrown over railings
-	if (DDrConfig_GetOptOfType("patches.throwtest", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("gameplay.throwtest", C_BOOL)->value.intBoolVal)
 	{
 		DDrPatch_NOOP((char*)(OniExe + 0x000dc190), 10);
@@ -543,5 +543,5 @@
 
 	// DaodanGL with windowed mode support
-	if (DDrConfig_GetOptOfType("patches.usedaodangl", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("graphics.daodangl", C_BOOL)->value.intBoolVal)
 	{
 		// LIrPlatform_Mode_Set: GetWindowRect -> GetClientRect.
@@ -580,5 +580,5 @@
 
 	// Performance patch
-	if (DDrConfig_GetOptOfType("patches.usegettickcount", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("windows.usegettickcount", C_BOOL)->value.intBoolVal)
 	{
 		DDrPatch_MakeJump((void*)UUrMachineTime_High, (void*)DDrMachineTime_High);
@@ -588,5 +588,5 @@
 
 	// Fix displaying the talking portraits in widescreen modes
-	if (DDrConfig_GetOptOfType("patches.widescreenportraits", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("graphics.widescreenportraits", C_BOOL)->value.intBoolVal)
 	{
 		SLrDaodan_Patch();
@@ -594,5 +594,5 @@
 	
 	// Adds working function for existing BSL command wp_fadetime, sets fade time to 4800
-	if (DDrConfig_GetOptOfType("patches.wpfadetime", C_BOOL)->value.intBoolVal)
+	if (DDrConfig_GetOptOfType("gameplay.wpfadetime", C_BOOL)->value.intBoolVal)
 	{
 		// Makes wp_fadetime actually have a function (changes within WPrRelease)
Index: /Daodan/src/Patches/Win32.c
===================================================================
--- /Daodan/src/Patches/Win32.c	(revision 999)
+++ /Daodan/src/Patches/Win32.c	(revision 1000)
@@ -153,9 +153,9 @@
 	else
 	{
-		ConfigOption_t* co = DDrConfig_GetOptOfType("options.border", C_BOOL);
+		ConfigOption_t* co = DDrConfig_GetOptOfType("windows.border", C_BOOL);
 		int opt_border = 0;
 		if (co && co->value.intBoolVal)
 			opt_border = 1;
-		co = DDrConfig_GetOptOfType("options.topmost", C_BOOL);
+		co = DDrConfig_GetOptOfType("windows.topmost", C_BOOL);
 		int opt_topmost = 0;
 		if (co && co->value.intBoolVal)
