diff options
Diffstat (limited to 'ppu.c')
| -rw-r--r-- | ppu.c | 15 |
1 files changed, 15 insertions, 0 deletions
| @@ -0,0 +1,15 @@ | |||
| 1 | #include "ppu.h" | ||
| 2 | |||
| 3 | struct ppu ppu = {0}; | ||
| 4 | |||
| 5 | void | ||
| 6 | ppu_tick(void) | ||
| 7 | { | ||
| 8 | ppu.cycles++; | ||
| 9 | if (ppu.cycles >= 341) { | ||
| 10 | ppu.cycles -= 341; | ||
| 11 | ppu.scanlines++; | ||
| 12 | } | ||
| 13 | if (ppu.scanlines >= 262) | ||
| 14 | ppu.scanlines -= 262; | ||
| 15 | } | ||
