diff options
| author | vin <git@vineetk.net> | 2024-07-21 13:53:04 -0400 |
|---|---|---|
| committer | vin <git@vineetk.net> | 2024-07-21 13:53:04 -0400 |
| commit | 7d148924e2fee1a2692d2c49a01e6770b630f906 (patch) | |
| tree | 0fc1abc86a7dae9c249f9a796f4af2e9ebbaffff /ppu.c | |
| parent | 2df7df5f5b0f325864f92c5a58f3c132cfff989e (diff) | |
start implementing PPU
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 | } | ||
