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 @@ +#include "ppu.h" + +struct ppu ppu = {0}; + +void +ppu_tick(void) +{ + ppu.cycles++; + if (ppu.cycles >= 341) { + ppu.cycles -= 341; + ppu.scanlines++; + } + if (ppu.scanlines >= 262) + ppu.scanlines -= 262; +} |