Fix undeflow in RESMP.

This commit is contained in:
Christian Speckner 2016-12-08 22:20:51 +01:00
parent 38d8d893aa
commit a9d1ed3741
1 changed files with 3 additions and 3 deletions

View File

@ -215,13 +215,13 @@ uInt8 Player::getRespClock() const
switch (myWidth)
{
case 8:
return myCounter - 3;
return (myCounter + 160 - 3) % 160;
case 16:
return myCounter - 9;
return (myCounter + 160 - 9) % 160;
case 32:
return myCounter - 13;
return (myCounter + 160 - 13) % 160;
default:
throw runtime_error("invalid width");