hw/display: Fix mirrored output in dm163
authorInès Varhol <ines.varhol@telecom-paris.fr>
Sun, 15 Sep 2024 12:57:00 +0000 (14:57 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 20 Sep 2024 05:06:57 +0000 (08:06 +0300)
DM163 is an emulated 8x8 LED matrix. This commit flips the image
horizontally so it's rendered the same way as on the hardware.

Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/display/dm163.c

index f92aee371d92a95fe833cc4f8194d84c3be8f58c..75a91f62bd369bf2068327d90a842b50408d233b 100644 (file)
@@ -271,7 +271,7 @@ static uint32_t *update_display_of_row(DM163State *s, uint32_t *dest,
                                        unsigned row)
 {
     for (unsigned _ = 0; _ < LED_SQUARE_SIZE; _++) {
-        for (int x = 0; x < RGB_MATRIX_NUM_COLS * LED_SQUARE_SIZE; x++) {
+        for (int x = RGB_MATRIX_NUM_COLS * LED_SQUARE_SIZE - 1; x >= 0; x--) {
             /* UI layer guarantees that there's 32 bits per pixel (Mar 2024) */
             *dest++ = s->buffer[s->buffer_idx_of_row[row]][x / LED_SQUARE_SIZE];
         }