- 8-bit for delay and sound
- stored as registers
- value goes from
0 to 60
- if value
> 0, then decrement by one 60 times a second
- independent of emulator loop
- sound timer → beeps as long as above 0
- emulator runs normally while timer decrements
- game will check the value and delay if needed
- core design problems:
- because they need to be “independent” from the emulator loop BUT don’t really use a separate thread (for simplicity + race conditions might arise)
- the native machine might not also operate at 60Hz
- resolution:
- we directly track when at least 1 “tick” (i.e. $\frac{1}{60}$ of a second) occurs (by fetching the elapsed timing)
- if a tick does occur, we decrement the timers by that number of ticks
- requires some tweaking to work