diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -239,6 +239,8 @@ static inline void | |||
239 | put_pixel_m4(int x, int y, u8 col_index) { | 239 | put_pixel_m4(int x, int y, u8 col_index) { |
240 | int buffer_index = (y * SCREEN_WIDTH + x) / 2; | 240 | int buffer_index = (y * SCREEN_WIDTH + x) / 2; |
241 | u16 *destination = &SCREEN_BUFFER[buffer_index]; | 241 | u16 *destination = &SCREEN_BUFFER[buffer_index]; |
242 | // Odd pixels will go to the top 8 bits of the destination. Even pixels to | ||
243 | // the lower 8 bits. | ||
242 | int odd = x & 0x1; | 244 | int odd = x & 0x1; |
243 | if(odd) { | 245 | if(odd) { |
244 | *destination= (*destination & 0xFF) | (col_index << 8); | 246 | *destination= (*destination & 0xFF) | (col_index << 8); |