summaryrefslogtreecommitdiff
path: root/ppu.c
diff options
context:
space:
mode:
Diffstat (limited to 'ppu.c')
-rw-r--r--ppu.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ppu.c b/ppu.c
new file mode 100644
index 0000000..4ae0162
--- /dev/null
+++ b/ppu.c
@@ -0,0 +1,15 @@
1#include "ppu.h"
2
3struct ppu ppu = {0};
4
5void
6ppu_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}