diff --git a/src/overlay/overlay.cpp b/src/overlay/overlay.cpp index 5c7e67c..3eb8f81 100644 --- a/src/overlay/overlay.cpp +++ b/src/overlay/overlay.cpp @@ -1399,8 +1399,12 @@ class tmap_visualizer for (uint32_t i = 0; i < num_dots; i++) { uint8_t tdat = tile_data[i]; - if (tdat > 0 && tdat < 16) // 8bpp quirk handling + if (tdat > 0 && tdat < 16) { // 8bpp quirk handling tdat += palette_offset; + if (t256c) { + tdat |= 0x80; + } + } pixels[i] = palette[tdat]; } } else { @@ -1450,8 +1454,13 @@ class tmap_visualizer for (int tj = 0; tj < tile_width; tj++) { uint8_t tdat = tile_data[src2]; src2 += src2_add; - if (tdat > 0 && tdat < 16) + if (tdat > 0 && tdat < 16) { tdat += pal; + if (t256c) { + tdat |= 0x80; + } + } + pixels[dst2++] = palette[tdat]; } } diff --git a/src/vera/vera_video.cpp b/src/vera/vera_video.cpp index f8aee85..5f98971 100644 --- a/src/vera/vera_video.cpp +++ b/src/vera/vera_video.cpp @@ -56,7 +56,7 @@ // Version #define VERA_VERSION_MAJOR 0x00 #define VERA_VERSION_MINOR 0x03 -#define VERA_VERSION_PATCH 0x01 +#define VERA_VERSION_PATCH 0x02 static bool is_fullscreen = false; @@ -761,8 +761,11 @@ static void render_layer_line_tile(uint16_t y) uint8_t col_index = (s >> color_shift) & props->color_mask; // Apply Palette Offset - if (palette_offset && col_index > 0 && col_index < 16) { + if (col_index > 0 && col_index < 16) { col_index += palette_offset; + if (props->text_mode_256c) { + col_index |= 0x80; + } } layer_line[layer][i] = col_index; @@ -810,8 +813,11 @@ static void render_layer_line_bitmap(uint16_t y) uint8_t col_index = (s >> (props->first_color_pos - ((xx & props->color_fields_max) << props->color_depth))) & props->color_mask; // Apply Palette Offset - if (palette_offset && col_index > 0 && col_index < 16) { + if (col_index > 0 && col_index < 16) { col_index += palette_offset << 4; + if (props->text_mode_256c) { + col_index |= 0x80; + } } layer_line[layer][i] = col_index; @@ -2109,4 +2115,4 @@ vera_video_rect vera_video_get_scan_visible() VGA_Y_OFFSET, VGA_Y_OFFSET + SCREEN_HEIGHT }; } -} \ No newline at end of file +}