From 5335c64f123834e266532d2447bc6d70ededde83 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut@gmail.com" Date: Sat, 23 Apr 2011 08:11:40 +0000 Subject: [PATCH] spu2x: remove some definition (fix gcc-4.6) gsdx: add a missing include (fix gcc-4.6). Force an init of sdl to allow in-emulation configuration git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4587 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSWnd.cpp | 9 +++++++++ plugins/GSdx/stdafx.h | 1 + plugins/spu2-x/src/PS2E-spu2.h | 4 ++++ plugins/spu2-x/src/Spu2replay.cpp | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index 42e51439a4..6c19f0d82d 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -346,6 +346,15 @@ bool GSWnd::Create(const string& title, int w, int h) } #ifdef _LINUX + // When you reconfigure the plugins during the play, SDL is shutdown so SDL_GetNumVideoDisplays return 0 + // and the plugins is badly closed. NOTE: SDL is initialized in SDL_CreateWindow. + // + // I'm not sure this sanity check is still useful, normally (I hope) SDL_CreateWindow will return a null + // hence a false for this current function. + // For the moment do an init -- Gregory + if(!SDL_WasInit(SDL_INIT_VIDEO)) + if(SDL_Init(SDL_INIT_VIDEO) < 0) return false; + // Sanity check; if there aren't any video displays available, we can't create a window. if (SDL_GetNumVideoDisplays() <= 0) return false; #endif diff --git a/plugins/GSdx/stdafx.h b/plugins/GSdx/stdafx.h index 9e4688d5f1..5f3b4f04ce 100644 --- a/plugins/GSdx/stdafx.h +++ b/plugins/GSdx/stdafx.h @@ -71,6 +71,7 @@ // stdc +#include #include #include #include diff --git a/plugins/spu2-x/src/PS2E-spu2.h b/plugins/spu2-x/src/PS2E-spu2.h index c74419a552..65ff602751 100644 --- a/plugins/spu2-x/src/PS2E-spu2.h +++ b/plugins/spu2-x/src/PS2E-spu2.h @@ -48,6 +48,9 @@ EXPORT_C_(void) SPU2dmaInterrupt(s32 channel); // dma irq callbacks not needed anymore, they are handled by the dmac EXPORT_C_(void) SPU2irqCallback(void (*SPU2callback)()); #else +// These defines are useless and gcc-4.6 complain about redefinition +// so we remove them on linux +#ifndef __LINUX__ EXPORT_C_(void) SPU2readDMA4Mem(u16 *pMem, u32 size); EXPORT_C_(void) SPU2writeDMA4Mem(u16 *pMem, u32 size); EXPORT_C_(void) SPU2interruptDMA4(); @@ -61,6 +64,7 @@ EXPORT_C_(u32) SPU2ReadMemAddr(int core); EXPORT_C_(void) SPU2WriteMemAddr(int core,u32 value); EXPORT_C_(void) SPU2irqCallback(void (*SPU2callback)(),void (*DMA4callback)(),void (*DMA7callback)()); #endif +#endif // extended funcs // if start is 1, starts recording spu2 data, else stops diff --git a/plugins/spu2-x/src/Spu2replay.cpp b/plugins/spu2-x/src/Spu2replay.cpp index 8b20e4a65b..6dd0f4557a 100644 --- a/plugins/spu2-x/src/Spu2replay.cpp +++ b/plugins/spu2-x/src/Spu2replay.cpp @@ -97,6 +97,7 @@ u32 pclocks; u32 oldlimit; +#ifdef _MSC_VER void dummy1() { } @@ -117,7 +118,6 @@ void dummy7() #define Cread(a,b,c,d) if(fread(a,b,c,d)