For a few weeks, a bug with my emulator has been driving me nuts... I'd press a key and then it would just randomly repeat. See this video for an illustration.
I've been chipping away at getting emulated instructions to pass a suite of tests, but sadly no joy at solving the issue.
Anyway, today I noticed a bug with my implementation of POP. Specifically, POP AF. I have a class that holds the flags for convenient access rather than just using the F register. This is a design decision I regret, but I'm stuck with it now.
So the fix was basically to add this after the POP:
input.State.Flags = Flags.FromByte(input.State.Registers[Register.F]);
This has fixed the repeating key problem, so I'm inching closer to a working emulator.
