Fix touch coord calc when OpenGL is not available, probably fix off by one here too (I think this is right?)

This commit is contained in:
CasualPokePlayer 2023-09-25 05:35:15 -07:00
parent 07126b1e48
commit f6a77a8410
2 changed files with 7 additions and 2 deletions

View File

@ -191,8 +191,8 @@ namespace BizHawk.Client.Common.Filters
{
var ret = _nds.GetTouchCoords((int)point.X, (int)point.Y);
var vp = _nds.AsVideoProvider();
ret.X *= vp.BufferWidth / 255.0f;
ret.Y *= vp.BufferHeight / 191.0f;
ret.X *= vp.BufferWidth / 256.0f;
ret.Y *= vp.BufferHeight / 192.0f;
return ret;
}

View File

@ -77,6 +77,11 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
{
_core.GetTouchCoords(ref x, ref y);
}
else
{
// no GL context, so nothing fancy can be applied
y = Math.Max(0, y - 192);
}
return new(x, y);
}