X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fgpulib%2Fgpu.h;h=4637a71c07b1f4c12144a6ba7bc5763f674b4b85;hb=4d66d894c6563cbfb78fe8ccc0b374809fc44b0d;hp=3bab7fff3f4344b78e82504c505a9250112e5452;hpb=f23b103c8248c10855949bfb2185b6b10d4f0457;p=pcsx_rearmed.git diff --git a/plugins/gpulib/gpu.h b/plugins/gpulib/gpu.h index 3bab7fff..4637a71c 100644 --- a/plugins/gpulib/gpu.h +++ b/plugins/gpulib/gpu.h @@ -8,6 +8,9 @@ * See the COPYING file in the top-level directory. */ +#ifndef __GPULIB_GPU_H__ +#define __GPULIB_GPU_H__ + #include #ifdef __cplusplus @@ -16,6 +19,18 @@ extern "C" { #define CMD_BUFFER_LEN 1024 +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define HTOLE32(x) __builtin_bswap32(x) +#define HTOLE16(x) __builtin_bswap16(x) +#define LE32TOH(x) __builtin_bswap32(x) +#define LE16TOH(x) __builtin_bswap16(x) +#else +#define HTOLE32(x) (x) +#define HTOLE16(x) (x) +#define LE32TOH(x) (x) +#define LE16TOH(x) (x) +#endif + #define BIT(x) (1 << (x)) #define PSX_GPU_STATUS_DHEIGHT BIT(19) @@ -61,6 +76,7 @@ struct psx_gpu { uint32_t hcnt; } last_list; uint32_t last_vram_read_frame; + uint32_t w_out_old, h_out_old, status_vo_old; } state; struct { int32_t set:3; /* -1 auto, 0 off, 1-3 fixed */ @@ -107,7 +123,7 @@ struct GPUFreeze; long GPUinit(void); long GPUshutdown(void); void GPUwriteDataMem(uint32_t *mem, int count); -long GPUdmaChain(uint32_t *rambase, uint32_t addr); +long GPUdmaChain(uint32_t *rambase, uint32_t addr, uint32_t *progress_addr); void GPUwriteData(uint32_t data); void GPUreadDataMem(uint32_t *mem, int count); uint32_t GPUreadData(void); @@ -123,3 +139,5 @@ void GPUrearmedCallbacks(const struct rearmed_cbs *cbs_); #ifdef __cplusplus } #endif + +#endif /* __GPULIB_GPU_H__ */