From e20a2581da67104e8fb26ce5c4a8e620d9c1ca75 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Wed, 16 Jan 2008 00:25:10 +0100 Subject: [PATCH] implement shared memory for 24bpp --- src/sim/g_bigmap.c | 10 ++++++++++ src/sim/w_x.c | 4 +--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/sim/g_bigmap.c b/src/sim/g_bigmap.c index 695cd88..7e99174 100644 --- a/src/sim/g_bigmap.c +++ b/src/sim/g_bigmap.c @@ -169,6 +169,15 @@ MemDrawBeegMapRect(SimView *view, int x, int y, int w, int h) #define ROW8_16(n) ROW4_16(n) ROW4_16(n+4) #define ROW16_16() ROW8_16(0) ROW8_16(8) +#define ROW1_32(n) \ + memcpy((char *)image, (char *)mem + (4 * 16 * (n)), 4 * 16); \ + image = (unsigned QUAD *)(((unsigned char *)image) + lineBytes); + +#define ROW2_32(n) ROW1_32(n) ROW1_32(n+1) +#define ROW4_32(n) ROW2_32(n) ROW2_32(n+2) +#define ROW8_32(n) ROW4_32(n) ROW4_32(n+4) +#define ROW16_32() ROW8_32(0) ROW8_32(8) + switch (view->x->depth) { case 8: @@ -182,6 +191,7 @@ MemDrawBeegMapRect(SimView *view, int x, int y, int w, int h) case 24: case 32: + ROW16_32(); default: /* XXX: handle different depths */ break; diff --git a/src/sim/w_x.c b/src/sim/w_x.c index e32aeed..3ad6c04 100644 --- a/src/sim/w_x.c +++ b/src/sim/w_x.c @@ -456,9 +456,7 @@ FindXDisplay(Tk_Window tkwin) } else { fprintf(stderr, "Cool, I found the shared memory extension!\n"); - fprintf(stderr, - "Disabled SHM, because it is currently broken!\n"); - xd->shared = 0; + xd->shared = 1; } } } -- 2.39.5