From: Michael Gernoth Date: Mon, 14 Jan 2008 22:40:07 +0000 (+0100) Subject: enable swapping for 8 bit on big endian machines X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/micropolis/commitdiff_plain/42be101dbb6e2183730f6509f8e3b76380fbd460?hp=5f6ac7d80b62e0ac93a50c5f0cadaad0f4b7102e enable swapping for 8 bit on big endian machines --- diff --git a/src/sim/g_smmaps.c b/src/sim/g_smmaps.c index 4ca499a..84b7a47 100644 --- a/src/sim/g_smmaps.c +++ b/src/sim/g_smmaps.c @@ -142,9 +142,9 @@ int DynamicData[32]; #define BE_ROW3_32 BE_ROW1_32(0) BE_ROW1_32(1) BE_ROW1_32(2) #define ROW3_8 if (view->x->needs_swap) { BE_ROW3_8 } else { LE_ROW3_8 } -#define ROW3_16 if (view->x->needs_swap) { BE_ROW3_16 } else { LE_ROW3_16 } -#define ROW3_24 if (view->x->needs_swap) { BE_ROW3_24 } else { LE_ROW3_24 } -#define ROW3_32 if (view->x->needs_swap) { BE_ROW3_32 } else { LE_ROW3_32 } +#define ROW3_16 LE_ROW3_16 +#define ROW3_24 LE_ROW3_24 +#define ROW3_32 LE_ROW3_32 #define ROW3 \ switch (view->x->depth) { \ diff --git a/src/sim/w_x.c b/src/sim/w_x.c index 0d68209..06d3b9e 100644 --- a/src/sim/w_x.c +++ b/src/sim/w_x.c @@ -585,8 +585,7 @@ InitNewView(SimView *view, char *title, int class, int w, int h) view->type = X_Mem_View; } - /* XXX: Find cases where transaltion is needed */ - view->x->needs_swap = 0; + view->x->needs_swap = !(*(unsigned char*) (&test)); GetPixmaps(view->x);