diff options
author | Charles Forsyth <charles.forsyth@gmail.com> | 2018-12-21 14:55:06 +0000 |
---|---|---|
committer | Charles Forsyth <charles.forsyth@gmail.com> | 2018-12-21 14:55:06 +0000 |
commit | f2847740e449ea52349968e40fa4e5fb8426bb41 (patch) | |
tree | 8f66ea2731c38fa20a34980c882929e8f7efe041 | |
parent | 9a6abc0c151869394091363dde0ecc082ad3ca65 (diff) | |
parent | 811a63300c4a3c25a557a5fdb7ae46256a258f17 (diff) |
Merged in dboddie/inferno-os (pull request #21)
Fixed compilation of 9load for x86 with modern GCC versions.
Approved-by: Charles Forsyth <charles.forsyth@gmail.com>
-rw-r--r-- | emu/port/win-x11a.c | 38 | ||||
-rw-r--r-- | utils/8l/l.h | 12 |
2 files changed, 44 insertions, 6 deletions
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 @@ -313,6 +313,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) { int dx, width; @@ -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: diff --git a/utils/8l/l.h b/utils/8l/l.h index da151014..85964bc3 100644 --- a/utils/8l/l.h +++ b/utils/8l/l.h @@ -195,7 +195,7 @@ EXTERN union uchar obuf[MAXIO]; /* output buffer */ uchar ibuf[MAXIO]; /* input buffer */ } u; - char dbuf[1]; + char dbuf[2*MAXIO]; } buf; #define cbuf u.obuf @@ -236,8 +236,8 @@ EXTERN char debug[128]; EXTERN char literal[32]; EXTERN Prog* etextp; EXTERN Prog* firstp; -EXTERN char fnuxi8[8]; -EXTERN char fnuxi4[4]; +EXTERN uchar fnuxi8[8]; +EXTERN uchar fnuxi4[4]; EXTERN Sym* hash[NHASH]; EXTERN Sym* histfrog[MAXHIST]; EXTERN int histfrogp; @@ -247,9 +247,9 @@ EXTERN char* libraryobj[50]; EXTERN int libraryp; EXTERN int xrefresolv; EXTERN char* hunk; -EXTERN char inuxi1[1]; -EXTERN char inuxi2[2]; -EXTERN char inuxi4[4]; +EXTERN uchar inuxi1[1]; +EXTERN uchar inuxi2[2]; +EXTERN uchar inuxi4[4]; EXTERN char ycover[Ymax*Ymax]; EXTERN uchar* andptr; EXTERN uchar and[30]; |