From 416c6a8d92725d40e7aa02343fa149c1f889551d Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sat, 1 Jun 2024 06:30:00 +0200 Subject: [PATCH] detect learning company games and remove presets --- src/config.c | 238 ++++----------------------------------------- src/winapi_hooks.c | 23 ++++- 2 files changed, 37 insertions(+), 224 deletions(-) diff --git a/src/config.c b/src/config.c index 3a252ad..e03a05e 100644 --- a/src/config.c +++ b/src/config.c @@ -463,26 +463,6 @@ static void cfg_create_ini() "[Arthur]\n" "renderer=gdi\n" "\n" - "; Arthur's Pet Chase\n" - "[ArthurPP]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Arthur's Sand Castle Contest\n" - "[ArthurSC]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Batman: Toxic Chill\n" - "[Bat1]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Batman: Justice Unbalanced\n" - "[Bat2]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" "; Baldur's Gate II\n" "; Note: 'Use 3D Acceleration' must be disabled and 'Full Screen' must be enabled in BGConfig.exe\n" "[BGMain]\n" @@ -700,6 +680,24 @@ static void cfg_create_ini() "adjmouse=true\n" "nonexclusive=true\n" "\n" + "; ClueFinders Math Adventures 1.0\n" + "[TCFM32]\n" + "adjmouse=false\n" + "width=0\n" + "height=0\n" + "resizable=false\n" + "maintas=false\n" + "boxing=false\n" + "\n" + "; ClueFinders Math Adventures 1.0\n" + "[cfmath32]\n" + "adjmouse=false\n" + "width=0\n" + "height=0\n" + "resizable=false\n" + "maintas=false\n" + "boxing=false\n" + "\n" "; Call To Power 2\n" "[ctp2]\n" "maintas=false\n" @@ -709,66 +707,6 @@ static void cfg_create_ini() "[corsairs]\n" "adjmouse=true\n" "\n" - "; ClueFinders Search and Solve Adventures\n" - "[CFSEARCH]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders Mystery Mansion\n" - "[ClueFinders Mystery Mansion]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders The Incredible Toy Store Adventure\n" - "[ToyStore]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders 3rd Grade Adventures\n" - "[3rdadv32]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders 4th Grade Adventures\n" - "[4thadv32]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders 4th Grade Adventures\n" - "[4thad32]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders 5th Grade Adventures\n" - "[5thadv32]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders 5th Grade Adventures\n" - "[5thad32]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders 6th Grade Adventures\n" - "[CF6]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders(R) Reading Adventures Ages 9-12\n" - "[cfread]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders Math Adventures 1.0\n" - "[TCFM32]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; ClueFinders Math Adventures 2.0\n" - "[cfmath32]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" "; Divine Divinity\n" "[div]\n" "resolutions=2\n" @@ -857,11 +795,6 @@ static void cfg_create_ini() "noactivateapp=true\n" "nonexclusive=true\n" "\n" - "; Hamtaro: Wake Up Snoozer!\n" - "[Ham]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" "; Jazz Jackrabbit 2 plus\n" "[Jazz2]\n" "keytogglefullscreen=0x08\n" @@ -1130,96 +1063,6 @@ static void cfg_create_ini() "maintas=false\n" "boxing=false\n" "\n" - "; Reader Rabbit Toddler: Fly the Dreamship\n" - "[Fly the Dreamship]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Toddler: Playtime for Baby\n" - "[rrbaby]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Learn To Read With Phonics\n" - "[Superr]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Math Ages 4-6\n" - "[RRM46]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit's(R) Math Ages 6 - 9 (2002)\n" - "[RRM69_32]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Preschool 2002\n" - "[Preschool Sparkle Star Rescue]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Preschool 2002\n" - "[RRP]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit 1st Grade\n" - "[RR1]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit 2nd Grade\n" - "[RR2]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Kindergarten\n" - "[RRK]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Learn To Read With Phonics: 1st - 2nd Grade\n" - "[Learn to read Grades 1-2]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Learning Creations: Calendar \n" - "[Calendar]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Learning Creations: Music\n" - "[Music]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Learning Creations: Paint\n" - "[Paint]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Dreamship Tales\n" - "[Dreamship Tales]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Kindergarten\n" - "[rrk32]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Kindergarten: Creative\n" - "[creative]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Reader Rabbit Kindergarten: Learning Creations\n" - "[Learning Creations]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" "; Reader Rabbit Reading Ages 4-6\n" "[rrirjw32]\n" "renderer=gdi\n" @@ -1253,31 +1096,6 @@ static void cfg_create_ini() "[s3]\n" "nonexclusive=true\n" "\n" - "; Scooby-Doo(TM), Case File #2 The Scary Stone Dragon\n" - "[Case File #2]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Strawberry Shortcake: Amazing Cookie Party\n" - "[Strawberry]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; SpongeBob SquarePants: Typing\n" - "[SPT]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; StarFlyers Royal Jewel Rescue\n" - "[Royal Jewel Rescue]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; StarFlyers Alien Space Chase\n" - "[Alien Space Chase]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" "; Star Trek - Armada\n" "[Armada]\n" "armadahack=true\n" @@ -1337,11 +1155,6 @@ static void cfg_create_ini() "maintas=false\n" "boxing=false\n" "\n" - "; The Powerpuff Girls(TM) Mojo Jojo's Clone Zone / The Powerpuff Girls - Princess Snorebucks\n" - "[Powerpuff Girls]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" "; Total Annihilation (Unofficial Beta Patch v3.9.02)\n" "[TotalA]\n" "max_resolutions=32\n" @@ -1444,21 +1257,6 @@ static void cfg_create_ini() "[Zeus]\n" "adjmouse=true\n" "\n" - "; Zoombinis Logical Journey\n" - "[Zoombinis Logicial Journey]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Zoombinis Mountain Rescue\n" - "[zoombini2]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" - "; Zoombinis Island Odyssey\n" - "[Zoombinis Island Odyssey]\n" - "fixchilds=3\n" - "lock_mouse_top_left=true\n" - "\n" , fh); fclose(fh); diff --git a/src/winapi_hooks.c b/src/winapi_hooks.c index 065de5d..ed87c1e 100644 --- a/src/winapi_hooks.c +++ b/src/winapi_hooks.c @@ -1464,9 +1464,25 @@ HWND WINAPI fake_CreateWindowExA( dbg_dump_wnd_styles(dwStyle, dwExStyle); + /* Almost all of the Learning Company Games */ + if (!dwExStyle && + HIWORD(lpClassName) && _strcmpi(lpClassName, "OMWindowChildClass") == 0 && + !lpWindowName && + dwStyle == WS_CHILD | WS_CHILDWINDOW | WS_CLIPSIBLINGS && + !X && + !Y && + g_ddraw.ref && g_ddraw.width && g_ddraw.width == nWidth && g_ddraw.height == nHeight && + g_ddraw.hwnd && hWndParent == g_ddraw.hwnd && + !hMenu) + { + dwExStyle = WS_EX_TRANSPARENT; + g_config.lock_mouse_top_left = TRUE; + g_config.adjmouse = FALSE; + dd_SetDisplayMode(0, 0, 0, 0); + } + /* The American Girls Dress Designer */ - if (HIWORD(lpClassName) && - _strcmpi(lpClassName, "AfxFrameOrView42s") == 0 && + if (HIWORD(lpClassName) && _strcmpi(lpClassName, "AfxFrameOrView42s") == 0 && g_ddraw.ref && g_ddraw.hwnd && hWndParent == g_ddraw.hwnd && g_config.fake_mode[0] && (dwStyle & (WS_POPUP | WS_CHILD)) == (WS_POPUP | WS_CHILD)) @@ -1475,8 +1491,7 @@ HWND WINAPI fake_CreateWindowExA( } /* Center Claw DVD movies */ - if (HIWORD(lpClassName) && - _strcmpi(lpClassName, "Afx:400000:3") == 0 && + if (HIWORD(lpClassName) && _strcmpi(lpClassName, "Afx:400000:3") == 0 && g_ddraw.ref && g_ddraw.hwnd && g_ddraw.width && (dwStyle & (WS_POPUP | WS_CHILD)) == (WS_POPUP | WS_CHILD)) {