aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ppu.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ppu.c b/src/ppu.c
index dcf4e9c..dde934e 100644
--- a/src/ppu.c
+++ b/src/ppu.c
@@ -64,11 +64,12 @@ rgb565(u32 rgba) {
64 64
65void 65void
66ppu_pixel(u8 *layer, u16 x, u16 y, u8 color) { 66ppu_pixel(u8 *layer, u16 x, u16 y, u8 color) {
67 if(x < screen_width && y < screen_height) { 67 if (x >= screen_width || y >= screen_height) {
68 Uint32 i = x + y *screen_width; 68 return;
69 if(color != layer[i]) { 69 }
70 layer[i] = color; 70 Uint32 i = x + y *screen_width;
71 } 71 if(color != layer[i]) {
72 layer[i] = color;
72 } 73 }
73 dirty_lines[y] |= 1; 74 dirty_lines[y] |= 1;
74} 75}