Unified · Split
| @@ -247,7 +247,7 @@ attachscreen(Rectangle *r, ulong *chan, int *d, int *width, int *softscreen) · 246 unmodified lines | |||
| 247 | 247 | ||
| 248 | gscreendata = malloc(Xsize * Ysize * (displaydepth >> 3)); | 248 | gscreendata = malloc(Xsize * Ysize * (displaydepth >> 3)); |
| 249 | if(gscreendata == nil) { | 249 | if(gscreendata == nil) { |
| 250 | fprint(2, "emu: cannot allocate screen buffer (%dx%d)\n", Xsize*Ysize); | 250 | fprint(2, "emu: cannot allocate screen buffer (%dx%dx%d)\n", Xsize, Ysize, displaydepth); |
| 251 | cleanexit(0); | 251 | cleanexit(0); |
| 252 | } | 252 | } |
| 253 | xscreendata = (uchar*)img->data; | 253 | xscreendata = (uchar*)img->data; |
| @@ -264,13 +264,13 @@ attachscreen(Rectangle *r, ulong *chan, int *d, int *width, int *softscreen) · 10 unmodified lines | |||
| 264 | gscreendata = malloc(Xsize * Ysize * (displaydepth >> 3)); | 264 | gscreendata = malloc(Xsize * Ysize * (displaydepth >> 3)); |
| 265 | xscreendata = malloc(Xsize * Ysize * (depth >> 3)); | 265 | xscreendata = malloc(Xsize * Ysize * (depth >> 3)); |
| 266 | if(!gscreendata || !xscreendata) { | 266 | if(!gscreendata || !xscreendata) { |
| 267 | fprint(2, "emu: can not allocate virtual screen buffer\n"); | 267 | fprint(2, "emu: can not allocate virtual screen buffer (%dx%dx%d[%d])\n", Xsize, Ysize, displaydepth, depth); |
| 268 | return 0; | 268 | return 0; |
| 269 | } | 269 | } |
| 270 | img = XCreateImage(xdisplay, xvis, xscreendepth, ZPixmap, 0, | 270 | img = XCreateImage(xdisplay, xvis, xscreendepth, ZPixmap, 0, |
| 271 | (char*)xscreendata, Xsize, Ysize, 8, Xsize * (depth >> 3)); | 271 | (char*)xscreendata, Xsize, Ysize, 8, Xsize * (depth >> 3)); |
| 272 | if(img == nil) { | 272 | if(img == nil) { |
| 273 | fprint(2, "emu: can not allocate virtual screen buffer\n"); | 273 | fprint(2, "emu: can not allocate virtual screen buffer (%dx%dx%d)\n", Xsize, Ysize, depth); |
| 274 | return 0; | 274 | return 0; |
| 275 | } | 275 | } |
| 276 | 276 | ||
| @@ -290,6 +290,7 @@ flushmemscreen(Rectangle r) · 13 unmodified lines | |||
| 290 | { | 290 | { |
| 291 | int x, y, width, height, dx; | 291 | int x, y, width, height, dx; |
| 292 | uchar *p, *ep, *cp; | 292 | uchar *p, *ep, *cp; |
| 293 | char chanbuf[16]; | ||
| 293 | 294 | ||
| 294 | // Clip to screen | 295 | // Clip to screen |
| 295 | if(r.min.x < 0) | 296 | if(r.min.x < 0) |
| @@ -304,7 +305,7 @@ flushmemscreen(Rectangle r) · 8 unmodified lines | |||
| 304 | // is there anything left ... | 305 | // is there anything left ... |
| 305 | width = r.max.x-r.min.x; | 306 | width = r.max.x-r.min.x; |
| 306 | height = r.max.y-r.min.y; | 307 | height = r.max.y-r.min.y; |
| 307 | if((width < 1) | (height < 1)) | 308 | if(width <= 0 || height <= 0) |
| 308 | return; | 309 | return; |
| 309 | 310 | ||
| 310 | // Blit the pixel data ... | 311 | // Blit the pixel data ... |
| @@ -411,7 +412,8 @@ flushmemscreen(Rectangle r) · 100 unmodified lines | |||
| 411 | } | 412 | } |
| 412 | } | 413 | } |
| 413 | else{ | 414 | else{ |
| 414 | fprint(2, "emu: bad display depth %d\n", displaydepth); | 415 | fprint(2, "emu: bad display depth %d chan %s xscreendepth %d\n", displaydepth, |
| 416 | chantostr(chanbuf, displaychan), xscreendepth); | ||
| 415 | cleanexit(0); | 417 | cleanexit(0); |
| 416 | } | 418 | } |
| 417 | 419 | ||