From f74f7988ff40d875dcd15a0dfd0f7138ffa947a6 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 13 Nov 2023 12:29:10 +0200 Subject: [PATCH] MSDOS: implement valid location highlighting ... for VGA and VESA tiled map. --- sys/msdos/vidvesa.c | 18 ++++++++++++++---- sys/msdos/vidvga.c | 10 ++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/msdos/vidvesa.c b/sys/msdos/vidvesa.c index a6afbc80f..461bc13fe 100644 --- a/sys/msdos/vidvesa.c +++ b/sys/msdos/vidvesa.c @@ -720,6 +720,16 @@ vesa_xputg(const glyph_info *glyphinfo, const glyph_info *bkglyphinfo UNUSED) decal_packed(packcell, special); #endif vesa_DisplayCell(glyphinfo->gm.tileidx, col - clipx, ry - clipy); + if (bkglyphinfo->framecolor != NO_COLOR) { + int curtypbak = cursor_type; + int cclr = cursor_color; + + cursor_type = CURSOR_FRAME; + cursor_color = bkglyphinfo->framecolor; + vesa_DrawCursor(); + cursor_type = curtypbak; + cursor_color = cclr; + } } } if (col < (CO - 1)) @@ -2227,14 +2237,14 @@ vesa_DrawCursor(void) default: for (x = left; x <= right; ++x) { - vesa_WritePixel(x, top, FIRST_TEXT_COLOR + 15); + vesa_WritePixel(x, top, FIRST_TEXT_COLOR + cursor_color); } for (y = top + 1; y <= bottom - 1; ++y) { - vesa_WritePixel(left , y, FIRST_TEXT_COLOR + 15); - vesa_WritePixel(right, y, FIRST_TEXT_COLOR + 15); + vesa_WritePixel(left , y, FIRST_TEXT_COLOR + cursor_color); + vesa_WritePixel(right, y, FIRST_TEXT_COLOR + cursor_color); } for (x = left; x <= right; ++x) { - vesa_WritePixel(x, bottom, FIRST_TEXT_COLOR + 15); + vesa_WritePixel(x, bottom, FIRST_TEXT_COLOR + cursor_color); } break; } diff --git a/sys/msdos/vidvga.c b/sys/msdos/vidvga.c index c5e887703..8f9025aa6 100644 --- a/sys/msdos/vidvga.c +++ b/sys/msdos/vidvga.c @@ -415,6 +415,16 @@ vga_xputg(const glyph_info *glyphinfo, if (map[ry][col].special) decal_planar(&planecell, special); vga_DisplayCell(&planecell, col - clipx, row); + if (bkglyphinfo->framecolor != NO_COLOR) { + int curtypbak = cursor_type; + int cclr = cursor_color; + + cursor_type = CURSOR_FRAME; + cursor_color = bkglyphinfo->framecolor; + vga_DrawCursor(); + cursor_type = curtypbak; + cursor_color = cclr; + } } } else { read_planar_tile_O(glyphnum, &planecell_O);