Hacker News new | ask | show | jobs
by userbinator 597 days ago
And just to get this out of the way, the carry flag’s behavior after multiplication isn’t an important detail to emulate at all. Software doesn’t rely on it.

On as fixed of a hardware as a game console, and with the accompanying anti-piracy/anti-cheating/emulation efforts of that industry, I'd expect it to be. From the history of emulating previous consoles, we know that any deterministic difference can and will be exploited, either to determine whether the hardware is authentic, or incidentally as a result of unintentional bugs.

This reminds me of the Z80, where two undefined flags resisted analysis for several decades; a 2-year-old set of slides on the state of that here: https://archive.fosdem.org/2022/schedule/event/z80/attachmen...

3 comments

>> the carry flag’s behavior after multiplication isn’t an important detail to emulate at all. Software doesn’t rely on it.

Famous last words:

https://www.hyrumslaw.com/

While it’s a bit newer than the GBA, there is at least one Wii game with intentional anti-emulation measures:

https://tcrf.net/Cars_2_(PlayStation_3,_Xbox_360,_Windows,_W...

In the GBA scene, people didn't actually tend to exploit the carry flag at all. If there was any anti emulation, it was usually flashcart related or cpu timing related.
It was mostly the Game Pak Prefetch feature that was used to foil GBA emulators. A game can detect if the number of cycles to access ROM (with prefetch enabled) is incorrect.