Fix PCSX on big-endian systems
[pcsx_rearmed.git] / plugins / dfxvideo / gpu.h
index 663b8b5..25fcc3c 100644 (file)
@@ -72,7 +72,7 @@
 #define SWAP16(x) ({ uint16_t y=(x); (((y)>>8 & 0xff) | ((y)<<8 & 0xff00)); })
 #define SWAP32(x) ({ uint32_t y=(x); (((y)>>24 & 0xfful) | ((y)>>8 & 0xff00ul) | ((y)<<8 & 0xff0000ul) | ((y)<<24 & 0xff000000ul)); })
 
-#ifdef __BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 
 // big endian config
 #define HOST2LE32(x) SWAP32(x)
@@ -178,6 +178,7 @@ typedef struct RECTTAG
 typedef struct TWINTAG
 {
  PSXRect_t  Position;
+ int xmask, ymask;
 } TWin_t;
 
 /////////////////////////////////////////////////////////////////////////////
@@ -207,7 +208,7 @@ typedef struct PSXDISPLAYTAG
 // draw.c
 
 extern int32_t           GlobalTextAddrX,GlobalTextAddrY,GlobalTextTP;
-extern int32_t           GlobalTextREST,GlobalTextABR,GlobalTextPAGE;
+extern int32_t           GlobalTextABR,GlobalTextPAGE;
 extern short          ly0,lx0,ly1,lx1,ly2,lx2,ly3,lx3;
 extern long           lLowerpart;
 extern BOOL           bCheckMask;
@@ -250,18 +251,12 @@ extern int32_t           drawH;
 #define KEY_BADTEXTURES   128
 #define KEY_CHECKTHISOUT  256
 
-#if !defined(__BIG_ENDIAN__) || defined(__x86_64__) || defined(__i386__)
-#ifndef __LITTLE_ENDIAN__
-#define __LITTLE_ENDIAN__
-#endif
-#endif
-
-#ifdef __LITTLE_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 #define RED(x) (x & 0xff)
 #define BLUE(x) ((x>>16) & 0xff)
 #define GREEN(x) ((x>>8) & 0xff)
 #define COLOR(x) (x & 0xffffff)
-#elif defined __BIG_ENDIAN__
+#else
 #define RED(x) ((x>>24) & 0xff)
 #define BLUE(x) ((x>>8) & 0xff)
 #define GREEN(x) ((x>>16) & 0xff)
@@ -313,4 +308,7 @@ void          DoClearFrontBuffer(void);
 unsigned long ulInitDisplay(void);
 void          CloseDisplay(void);
 
+struct rearmed_cbs;
+extern const struct rearmed_cbs *rcbs;
+
 #endif