I recently decided to have another whack at some Chip8 emulation. I was reading Cowgod's technical reference and noticed a slight ambiguity regarding the behaviour of the opcode LD Vx, K (Fx0A).
Cowgod's documentation states that All execution stops until a key is pressed
, but does not clarify whether this affects the behaviour of the timer registers.
Can anyone clarify the decrementation of the timer registers and the main program execution considered asynchronous? i.e. should the timers continue counting down whilst the main execution awaits a keypress or should the timers wait for the keypress as well before continuing to decrement?
My intuition says timing should carry on independently as would occur if the timers were theoretically part of a separate circuit, however it may also be desirable for the timers to wait (i.e. such that the buzzer continues sounding until the user presses any key) so I have decided to ask rather than assume.
Timers are generally counters independent of CPU activity not directly related to them.
I agree with you that Cowgoods statement "All execution stops until a key is pressed" could be interpreted as meaning that the timers stop but that would be contrary to generally accepted designs. No other Chip-8 documentation I viewed made any sort of similar statement.
I would assume that the timers continue running while waiting for user input.
I am sure thare are (many?) other Chip-8 emulaors on the web. You could check their source code to see what they do.