X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fdfxvideo%2Fgpulib_if.c;h=d7d69a7657e552bb43f34f4273d9fb488d700838;hb=04bd10b132d06eff2a803125dc8da640be2454db;hp=50130f6f1a9c36cd0151da66ac6c2656557193b6;hpb=9ee0fd5b333039b1140d90f935aa9299825f1e42;p=pcsx_rearmed.git diff --git a/plugins/dfxvideo/gpulib_if.c b/plugins/dfxvideo/gpulib_if.c index 50130f6f..d7d69a76 100644 --- a/plugins/dfxvideo/gpulib_if.c +++ b/plugins/dfxvideo/gpulib_if.c @@ -40,7 +40,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) @@ -219,18 +219,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) @@ -260,6 +254,10 @@ unsigned short sSetMask = 0; unsigned long lSetMask = 0; long lLowerpart; +#if defined(__GNUC__) && __GNUC__ >= 6 +#pragma GCC diagnostic ignored "-Wmisleading-indentation" +#endif + #include "soft.c" #include "prim.c" @@ -342,7 +340,12 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) while(1) { - if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end) + if(list_position >= list_end) { + cmd = -1; + goto breakloop; + } + + if((*list_position & 0xf000f000) == 0x50005000) break; list_position++; @@ -360,7 +363,12 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) while(1) { - if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end) + if(list_position >= list_end) { + cmd = -1; + goto breakloop; + } + + if((*list_position & 0xf000f000) == 0x50005000) break; list_position += 2; @@ -386,6 +394,7 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) } } +breakloop: gpu.ex_regs[1] &= ~0x1ff; gpu.ex_regs[1] |= lGPUstatusRet & 0x1ff; @@ -421,5 +430,7 @@ void renderer_set_config(const struct rearmed_cbs *cbs) { iUseDither = cbs->gpu_peops.iUseDither; dwActFixes = cbs->gpu_peops.dwActFixes; + if (cbs->pl_set_gpu_caps) + cbs->pl_set_gpu_caps(0); set_vram(gpu.vram); }