From e3bca5d865c831d3a6426b05bffd8c8d31e69886 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 14 Jul 2017 00:59:19 +0200 Subject: Fixed warnings from recent versions of GCC. Fixed incorrect buffering due to a change in the way the buf.dbuf array is compiled in at least GCC 4.9.2, GCC 5.4.0 and GCC 6.3.0. --- utils/8l/asm.c | 20 ++++++++++---------- utils/8l/l.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/utils/8l/asm.c b/utils/8l/asm.c index 6d09ae7c..de75499f 100644 --- a/utils/8l/asm.c +++ b/utils/8l/asm.c @@ -408,11 +408,11 @@ datblk(long s, long n) if(debug['a'] && i == 0) { Bprint(&bso, pcstr, l+s+INITDAT); for(j=0; j Date: Sat, 15 Jul 2017 18:12:15 +0200 Subject: Reverted casts in asm.c, changing types in l.h to compensate. Increased the size of the dbuf array to match the total size of obuf and ibuf. --- utils/8l/asm.c | 20 ++++++++++---------- utils/8l/l.h | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/utils/8l/asm.c b/utils/8l/asm.c index de75499f..6d09ae7c 100644 --- a/utils/8l/asm.c +++ b/utils/8l/asm.c @@ -408,11 +408,11 @@ datblk(long s, long n) if(debug['a'] && i == 0) { Bprint(&bso, pcstr, l+s+INITDAT); for(j=0; j Date: Sat, 24 Mar 2018 00:08:37 +0000 Subject: Added a function for drawing on 16-bit displays. --- emu/port/win-x11a.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/emu/port/win-x11a.c b/emu/port/win-x11a.c index 4fdd295a..3670b260 100644 --- a/emu/port/win-x11a.c +++ b/emu/port/win-x11a.c @@ -312,6 +312,33 @@ copy32to32(Rectangle r) } } +static void +copy16to16(Rectangle r) +{ + int dx, width; + u16int *dp, *wp, *edp, *lp; + + width = Dx(r); + dx = Xsize - width; + dp = (u16int*)(gscreendata + ((r.min.y * Xsize) + r.min.x) * 2); + wp = (u16int*)(xscreendata + ((r.min.y * Xsize) + r.min.x) * 2); + edp = (u16int*)(gscreendata + ((r.max.y * Xsize) + r.max.x) * 2); + + /* The pixel format should be the same as the underlying X display (see + the xtruevisual function) unless a different channel format is + explicitly specified on the command line, so just copy the pixel data + without any processing. */ + + while(dp < edp) { + lp = dp + width; + while(dp < lp){ + *wp++ = *dp++; + } + dp += dx; + wp += dx; + } +} + static void copy8to32(Rectangle r) { @@ -435,6 +462,17 @@ flushmemscreen(Rectangle r) case 32: copy32to32(r); break; + case 16: + switch(xscreendepth){ + case 16: + copy16to16(r); + break; + default: + fprint(2, "emu: bad display depth %d chan %s xscreendepth %d\n", displaydepth, + chantostr(chanbuf, displaychan), xscreendepth); + cleanexit(0); + } + break; case 8: switch(xscreendepth){ case 24: -- cgit v1.2.3