But there are dozens of CHIP-8 games around.
By my count so far: 456.
Does any of them depend on the correct behavior of
RESTORE and break if
I is not updated?
Yes, there are CHIP-8 games that will break if
Fx65 do not increment the index variable
Here's an excerpt from the source code listing to the game "5 Row Mastermind" by Robert Lindley, as printed in VIPER magazine, volume 1, issue 7, page 22, from February 1979 (memory addresses
As you can see, the program first loads five bytes from memory (the player's "answer" to the Mastermind puzzle), then immediately stores those bytes in the five memory addresses following the first ones (as a "working copy").
I wasn't incremented between those two instructions, it would instead "overwrite" the player's answer with itself (a no-op), and the working copy would not be what the game would later expect.
However, lots of subsequent emulators didn't implement this behavior correctly (leaving
I unchanged by these operations)
A short history lesson to explain how this schism occured: CHIP-8 faded into obscurity after 1983 (when the PC became the dominant platform, and computers rarely had hexadecimal keypads anymore and anyone could write BASIC easily). In 1990 it resurfaced on the HP48 graphing calculators, as CHIP48 and later the extended SUPER-CHIP. These new implementations introduced the
Fx65 incompatibility (among others); CHIP48 incremented
I, but erroneously (it incremented it one time less than the COSMAC VIP, as it wasn't incremented on the final iteration), while SUPER-CHIP didn't increment it at all. You can read a detailed disassembly and analysis of that code here.
Since the old COSMAC VIP CHIP-8 interpreter and its games were, at that point in the Internet's nascent history, lost to time temporarily (found only in physical newsletters and on tape cassettes that hadn't been digitized in a modern manner), the SUPER-CHIP behavior became dominant. David Winter ported it to DOS, and it spread from there.
It is tempting to sweep this question under the rug for my CHIP-8 implementation, and just not change the
I register in
That sounds like a reasonable default behavior. The answer to a slightly rephrased version of your question, "Do any of the games that are readily available online break if
I doesn't increment?", the answer is "probably not". Most games available today use the "modern" behavior, and most games that are made today (for Octojam each October, for example) are made to not depend on either behavior (by not relying on the value of
I after such an operation) so they can run in as many interpreters as possible.
However, the best course of action is probably to allow this "quirk" (as the inconsistencies between CHIP-8 specifications are often called) to be configured by the user. Use the modern behavior as default, but put a toggle somewhere, so old games are playable as well. Many modern "emulators" (interpreters) do this, such as Octo.