aboutsummaryrefslogtreecommitdiff
path: root/hw/display
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-05-11 12:28:30 +0200
committerHelge Deller <deller@gmx.de>2022-05-16 15:58:22 +0200
commita377b574eb2cbcbff3fc579529e0f1b2fbda8af8 (patch)
tree03be8d71abb684546501ff00b82ec50ee7675b6d /hw/display
parent482afe020b558d36d3b863970ad1672981b22d48 (diff)
downloadqemu-a377b574eb2cbcbff3fc579529e0f1b2fbda8af8.zip
qemu-a377b574eb2cbcbff3fc579529e0f1b2fbda8af8.tar.gz
qemu-a377b574eb2cbcbff3fc579529e0f1b2fbda8af8.tar.bz2
artist: Allow to turn cursor on or off
Bit 0x80 in the cursor_cntrl register specifies if the cursor should be visible. Prevent rendering the cursor if it's invisible. Signed-off-by: Helge Deller <deller@gmx.de> Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/artist.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/display/artist.c b/hw/display/artist.c
index 780cb15..b8930b7 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -353,10 +353,20 @@ static void artist_get_cursor_pos(ARTISTState *s, int *x, int *y)
}
}
+static inline bool cursor_visible(ARTISTState *s)
+{
+ /* cursor is visible if bit 0x80 is set in cursor_cntrl */
+ return s->cursor_cntrl & 0x80;
+}
+
static void artist_invalidate_cursor(ARTISTState *s)
{
int x, y;
+ if (!cursor_visible(s)) {
+ return;
+ }
+
artist_get_cursor_pos(s, &x, &y);
artist_invalidate_lines(&s->vram_buffer[ARTIST_BUFFER_AP],
y, s->cursor_height);
@@ -1218,6 +1228,10 @@ static void artist_draw_cursor(ARTISTState *s)
struct vram_buffer *cursor0, *cursor1 , *buf;
int cx, cy, cursor_pos_x, cursor_pos_y;
+ if (!cursor_visible(s)) {
+ return;
+ }
+
cursor0 = &s->vram_buffer[ARTIST_BUFFER_CURSOR1];
cursor1 = &s->vram_buffer[ARTIST_BUFFER_CURSOR2];
buf = &s->vram_buffer[ARTIST_BUFFER_AP];