We could introduce a bitmask or individual flags for the quirks which are checked at runtime in each emulator cycle, or we could implement different sub-interpreters (e.g. classic CHIP8, S-CHIP, XO-CHIP, etc.). The performance penalty should be negligible thanks to CPU branch predictors.
Over the years, CHIP-8 emulators have accumulated different "quirks" or differences in the way certain instructions are supposed to behave.
More information is available at:
We could introduce a bitmask or individual flags for the quirks which are checked at runtime in each emulator cycle, or we could implement different sub-interpreters (e.g. classic CHIP8, S-CHIP, XO-CHIP, etc.). The performance penalty should be negligible thanks to CPU branch predictors.
Sketch (taken from here):