From e3314c0b4829526449cd36db3e550838dff4738a Mon Sep 17 00:00:00 2001
From: FunkyFr3sh <cc.red.alert.1@googlemail.com>
Date: Thu, 30 May 2024 07:20:44 +0200
Subject: [PATCH] add presets for madeline math + adds new seetings to disable
 compat mode warnings

---
 README.md     |  2 ++
 inc/config.h  |  1 +
 src/config.c  | 35 +++++++++++++++++++++++++++++++++++
 src/dllmain.c |  3 ++-
 4 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index ad85ba0..9374554 100644
--- a/README.md
+++ b/README.md
@@ -192,6 +192,8 @@ Some games may require additional steps before they can be used with cnc-ddraw,
 - Lionheart - Legacy of the Crusader
 - Locomotion
 - Lode Runner 2
+- Madeline 1st Grade Math
+- Madeline 2nd Grade Math
 - Majesty Gold
 - Majesty Gold HD
 - Mech Warrior 3
diff --git a/inc/config.h b/inc/config.h
index 4d56eac..2bf06ad 100644
--- a/inc/config.h
+++ b/inc/config.h
@@ -79,6 +79,7 @@ typedef struct CNCDDRAWCONFIG
     char fake_mode[128];
     BOOL wine_allow_resize;
     BOOL lock_mouse_top_left;
+    BOOL no_compat_warning;
 
     /* Hotkeys */
 
diff --git a/src/config.c b/src/config.c
index 0910668..64fe101 100644
--- a/src/config.c
+++ b/src/config.c
@@ -92,6 +92,7 @@ void cfg_load()
     GET_STRING("fake_mode", "", g_config.fake_mode, sizeof(g_config.fake_mode));
     GET_BOOL(g_config.wine_allow_resize, "wine_allow_resize", FALSE);
     GET_BOOL(g_config.lock_mouse_top_left, "lock_mouse_top_left", FALSE);
+    GET_BOOL(g_config.no_compat_warning, "no_compat_warning", FALSE);
 
     /* Hotkeys */
 
@@ -310,6 +311,7 @@ static void cfg_create_ini()
             ";fake_mode=640x480x32\n"
             "wine_allow_resize=false\n"
             "lock_mouse_top_left=false\n"
+            "no_compat_warning=false\n"
             "\n"
             "\n"
             "\n"
@@ -1020,6 +1022,39 @@ static void cfg_create_ini()
             "[Lionheart]\n"
             "hook_peekmessage=true\n"
             "\n"
+            "; Madeline 1st Grade Math\n"
+            "[madmath1]\n"
+            "nonexclusive=true\n"
+            "no_compat_warning=true\n"
+            "adjmouse=false\n"
+            "width=0\n"
+            "height=0\n"
+            "resizable=false\n"
+            "maintas=false\n"
+            "boxing=false\n"
+            "\n"
+            "; Madeline 1st Grade Math: Progress Report\n"
+            "[madpr]\n"
+            "nonexclusive=true\n"
+            "no_compat_warning=true\n"
+            "adjmouse=false\n"
+            "width=0\n"
+            "height=0\n"
+            "resizable=false\n"
+            "maintas=false\n"
+            "boxing=false\n"
+            "\n"
+            "; Madeline 2nd Grade Math\n"
+            "[madmath2]\n"
+            "nonexclusive=true\n"
+            "no_compat_warning=true\n"
+            "adjmouse=false\n"
+            "width=0\n"
+            "height=0\n"
+            "resizable=false\n"
+            "maintas=false\n"
+            "boxing=false\n"
+            "\n"
             "; Majesty Gold\n"
             "[Majesty]\n"
             "minfps=-2\n"
diff --git a/src/dllmain.c b/src/dllmain.c
index 637f5e5..0f9e5c4 100644
--- a/src/dllmain.c
+++ b/src/dllmain.c
@@ -72,7 +72,8 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
                         "then try to start the game again.",
                         s);
 
-                    MessageBoxA(NULL, mes, "Compatibility modes detected - cnc-ddraw", MB_OK);
+                    if (!g_config.no_compat_warning)
+                        MessageBoxA(NULL, mes, "Compatibility modes detected - cnc-ddraw", MB_OK);
 
                     break;
                 }