diff options
-rw-r--r-- | src/ppu.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -64,11 +64,12 @@ rgb565(u32 rgba) { | |||
64 | 64 | ||
65 | void | 65 | void |
66 | ppu_pixel(u8 *layer, u16 x, u16 y, u8 color) { | 66 | ppu_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 | } |