From 3764acda8583866b974d127c7e5b7240a7d6cbb7 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Sat, 30 Jan 2021 18:42:47 -0800 Subject: [PATCH] The MISC7 (FBITMAPBIT) opcode should flush the correct bits to the display (#328) The MISC7 opcode was not accounting for the offset from the base when calculating which (16-bit) word should be flushed to the actual display. --- src/misc7.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/misc7.c b/src/misc7.c index fcaf349..d596ce9 100644 --- a/src/misc7.c +++ b/src/misc7.c @@ -102,13 +102,19 @@ LispPTR N_OP_misc7(LispPTR arg1, LispPTR arg2, LispPTR arg3, LispPTR arg4, LispP #ifdef SUNDISPLAY #ifdef DISPLAYBUFFER - if (in_display_segment(base)) flush_display_ptrregion(base, 0, 16, 1); + if (in_display_segment(base)) { + /* NB: base + offset doesn't need WORDPTR() wrapper */ + flush_display_ptrregion(base + offset, 0, 16, 1); + } #endif if (displayflg) ShowCursor; #endif /* SUNDISPLAY */ #ifdef XWINDOW - if (in_display_segment(base)) flush_display_ptrregion(base, 0, 16, 1); + if (in_display_segment(base)) { + /* NB: base + offset doesn't need WORDPTR() wrapper */ + flush_display_ptrregion(base + offset, 0, 16, 1); + } #endif /* XWINDOW */ ScreenLocked = NIL;