diff options
author | Bad Diode <bd@badd10de.dev> | 2021-04-15 17:27:01 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-04-15 17:27:01 +0200 |
commit | 6bac80fa01566645787e416a365e281075ec8282 (patch) | |
tree | 3c57c7fc25cc5f3893e972f7318b42890d701a6a | |
parent | 37e72d68fe6fbbdc211a6ef2b7756877e31e8061 (diff) | |
download | gba-experiments-6bac80fa01566645787e416a365e281075ec8282.tar.gz gba-experiments-6bac80fa01566645787e416a365e281075ec8282.zip |
Add comment for clarification
-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); |