summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-04-15 17:27:01 +0200
committerBad Diode <bd@badd10de.dev>2021-04-15 17:27:01 +0200
commit6bac80fa01566645787e416a365e281075ec8282 (patch)
tree3c57c7fc25cc5f3893e972f7318b42890d701a6a
parent37e72d68fe6fbbdc211a6ef2b7756877e31e8061 (diff)
downloadgba-experiments-6bac80fa01566645787e416a365e281075ec8282.tar.gz
gba-experiments-6bac80fa01566645787e416a365e281075ec8282.zip
Add comment for clarification
-rw-r--r--src/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index cbfa2a7..7c33166 100644
--- a/src/main.c
+++ b/src/main.c
@@ -239,6 +239,8 @@ static inline void
239put_pixel_m4(int x, int y, u8 col_index) { 239put_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);