RetroAchievements / RAIntegration

The DLL responsible to integrate emulators with RetroAchievements.org
https://retroachievements.org
MIT License
98 stars 23 forks source link

Add Modulus Operator #1090

Closed redwizard42 closed 6 months ago

redwizard42 commented 6 months ago

Adds the modulus operator to allow scaling to the remainder of a division. Most useful for anytime you have an increasing index that in practice has looping behavior without its value actually looping.

Example: A Game with 5 stages that loop, but the 0-based stage identified only ever increases, with no loop counter is present in RAM. With modulus operator, the developer could check that you are on 'any third stage' in the sequence using "Add Source Stage % 5 = Value 2"

Currently only modulo using a power of two can be accomplished (with Bitwise And)