diff --git a/Assets/dll/melonDS.wbx.zst b/Assets/dll/melonDS.wbx.zst index 15c1b21c67..11d32cc819 100644 Binary files a/Assets/dll/melonDS.wbx.zst and b/Assets/dll/melonDS.wbx.zst differ diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs index 73dadc080d..634d11137b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs @@ -70,7 +70,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS else { // no GL context, so nothing fancy can be applied - y = Math.Max(0, y - 192); + y -= 192; } return new(x, y); @@ -85,7 +85,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS else { // no GL context, so nothing fancy can be applied - y = Math.Min(256, y + 192); + y += 192; } return new(x, y); diff --git a/waterbox/melon/BizGLPresenter.cpp b/waterbox/melon/BizGLPresenter.cpp index 52643e8757..da92f6bf80 100644 --- a/waterbox/melon/BizGLPresenter.cpp +++ b/waterbox/melon/BizGLPresenter.cpp @@ -10,6 +10,8 @@ namespace Frontend { + extern float TouchMtx[6]; + extern bool BotEnable; extern void M23_Transform(float* m, float& x, float& y); } @@ -323,10 +325,18 @@ ECL_EXPORT void SetScreenSettings(const ScreenSettings* screenSettings, u32* wid ECL_EXPORT void GetTouchCoords(int* x, int* y) { - if (!Frontend::GetTouchCoords(*x, *y, true)) + float vx = *x; + float vy = *y; + + Frontend::M23_Transform(Frontend::TouchMtx, vx, vy); + + *x = vx; + *y = vy; + + if (!Frontend::BotEnable) { - *x = 0; - *y = 0; + // top screen only, offset y to account for that + *y -= 192; } } @@ -342,9 +352,18 @@ ECL_EXPORT void GetScreenCoords(float* x, float* y) } } - // bottom screen not visible - *x = 0; - *y = 0; + // top screen only, offset y to account for that + *y += 192; + + for (int i = 0; i < NumScreens; i++) + { + // top screen + if (ScreenKinds[i] == 0) + { + Frontend::M23_Transform(&ScreenMatrix[i * 6], *x, *y); + return; + } + } } } diff --git a/waterbox/melon/melonDS b/waterbox/melon/melonDS index d4899fe9b9..3c9510523b 160000 --- a/waterbox/melon/melonDS +++ b/waterbox/melon/melonDS @@ -1 +1 @@ -Subproject commit d4899fe9b9669edf009b52b2d432280c597cbdfd +Subproject commit 3c9510523bfbdf7d39e5185dcfbc72146bb8b52f