You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some games, such as Mystical Ninja Starring Goemon, have bugs in their audio code that trigger an underflow in the sample count calculation. This results in them sending a negative value converted to an unsigned value as the queued sample count to the runtime, which results in problems when the runtime tries to allocate a buffer to hold 4 billion samples.
There are two things to do here: the first is to mask the sample count to 17 bits as the original hardware did (the AI_LENGTH register). However, while that solves the 4 billion sample issue, it'll still cause audio glitches in a given game. Therefore, the runtime should also cast the input value to a signed 32-bit value and check if it's less than zero before the mask, and then raise an assert or warning if so. That will help people who are recompiling games with this type of bug figure out that there's code that has to be fixed in the game.
The text was updated successfully, but these errors were encountered:
Some games, such as Mystical Ninja Starring Goemon, have bugs in their audio code that trigger an underflow in the sample count calculation. This results in them sending a negative value converted to an unsigned value as the queued sample count to the runtime, which results in problems when the runtime tries to allocate a buffer to hold 4 billion samples.
There are two things to do here: the first is to mask the sample count to 17 bits as the original hardware did (the AI_LENGTH register). However, while that solves the 4 billion sample issue, it'll still cause audio glitches in a given game. Therefore, the runtime should also cast the input value to a signed 32-bit value and check if it's less than zero before the mask, and then raise an assert or warning if so. That will help people who are recompiling games with this type of bug figure out that there's code that has to be fixed in the game.
The text was updated successfully, but these errors were encountered: