From 2a850cd5ad80e92e72bb5a0e7657ad1efedc1264 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 12 Nov 2015 10:37:12 +0100 Subject: [PATCH 1/8] debian: update create tarball script --- debian-packager/create_built_tarball.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/debian-packager/create_built_tarball.sh b/debian-packager/create_built_tarball.sh index 7ab5f9a14f..3b3481a033 100644 --- a/debian-packager/create_built_tarball.sh +++ b/debian-packager/create_built_tarball.sh @@ -100,12 +100,10 @@ remove_not_yet_free_plugin() remove_remaining_non_free_file() { echo "Remove remaining non free file. TODO UPSTREAM" + rm -fr $LOCAL_REPO/unfree rm -fr $LOCAL_REPO/plugins/GSdx/baseclasses rm -f $LOCAL_REPO/plugins/zzogl-pg/opengl/Win32/aviUtil.h - rm -f $LOCAL_REPO/plugins/spu2-x/src/Windows/Hyperlinks.h - rm -f $LOCAL_REPO/plugins/spu2-x/src/Windows/Hyperlinks.cpp rm -f $LOCAL_REPO/common/src/Utilities/x86/MemcpyFast.cpp - rm -f $LOCAL_REPO/common/include/comptr.h } remove_dot_git() { From 4bfb60865c55afe3ab1a5516d3e6c872c0abcd39 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 6 Nov 2015 23:18:03 +0100 Subject: [PATCH 2/8] common: ifdef x64 specific code gcc warning: set but unused --- common/src/x86emitter/cpudetect.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/src/x86emitter/cpudetect.cpp b/common/src/x86emitter/cpudetect.cpp index 47910bac92..de917bb660 100644 --- a/common/src/x86emitter/cpudetect.cpp +++ b/common/src/x86emitter/cpudetect.cpp @@ -197,8 +197,10 @@ void x86capabilities::Identify() u32 cmds; //AMD 64 STUFF +#ifdef __x86_64__ u32 x86_64_8BITBRANDID; u32 x86_64_12BITBRANDID; +#endif memzero( VendorName ); __cpuid( regs, 0 ); @@ -227,7 +229,9 @@ void x86capabilities::Identify() Model = (regs[ 0 ] >> 4) & 0xf; FamilyID = (regs[ 0 ] >> 8) & 0xf; TypeID = (regs[ 0 ] >> 12) & 0x3; +#ifdef __x86_64__ x86_64_8BITBRANDID = regs[ 1 ] & 0xff; +#endif Flags = regs[ 3 ]; Flags2 = regs[ 2 ]; } @@ -238,7 +242,9 @@ void x86capabilities::Identify() { __cpuid( regs, 0x80000001 ); +#ifdef __x86_64__ x86_64_12BITBRANDID = regs[1] & 0xfff; +#endif EFlags2 = regs[ 2 ]; EFlags = regs[ 3 ]; } From 6180515212c0ffa9b91cbcfc712c2b7b16990304 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 6 Nov 2015 23:18:58 +0100 Subject: [PATCH 3/8] spu2x: sign compare --- plugins/spu2-x/src/Linux/Alsa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/spu2-x/src/Linux/Alsa.cpp b/plugins/spu2-x/src/Linux/Alsa.cpp index 9bc5631125..093c95adba 100644 --- a/plugins/spu2-x/src/Linux/Alsa.cpp +++ b/plugins/spu2-x/src/Linux/Alsa.cpp @@ -47,7 +47,7 @@ protected: fprintf(stderr,"* SPU2-X:Iz in your internal callback.\n"); avail = snd_pcm_avail_update( handle ); - while (avail >= period_time ) + while (avail >= (int)period_time ) { StereoOut16 buff[PacketsPerBuffer * SndOutPacketSize]; StereoOut16* p1 = buff; From abb4cb48103dd277af8e5174fc06a119a2811fc0 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 6 Nov 2015 23:25:55 +0100 Subject: [PATCH 4/8] plugin API: use const char* insead of char* I hope it doesn't change the ABI v2: fix GSnull/zzogl/zerogs v3: duplicated code on windows... --- common/include/PS2Edefs.h | 4 ++-- plugins/GSdx/GS.cpp | 6 +++--- plugins/GSnull/GS.cpp | 2 +- plugins/GSnull/Linux/GSLinux.cpp | 2 +- plugins/GSnull/Linux/GSLinux.h | 2 +- plugins/GSnull/Windows/GSwin.cpp | 2 +- plugins/GSnull/Windows/GSwin.h | 2 +- plugins/zerogs/dx/GSmain.cpp | 2 +- plugins/zzogl-pg/opengl/GSmain.cpp | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/common/include/PS2Edefs.h b/common/include/PS2Edefs.h index b27be0f0a1..bd40043cb9 100644 --- a/common/include/PS2Edefs.h +++ b/common/include/PS2Edefs.h @@ -241,7 +241,7 @@ extern "C" { // basic funcs s32 CALLBACK GSinit(); -s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread); +s32 CALLBACK GSopen(void *pDsp, const char *Title, int multithread); void CALLBACK GSclose(); void CALLBACK GSshutdown(); void CALLBACK GSsetSettingsDir( const char* dir ); @@ -572,7 +572,7 @@ typedef void (CALLBACK* _PS2EsetEmuVersion)(const char* emuId, u32 version); // // GS // NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs // If you want to use them, need to save and restore current ones -typedef s32 (CALLBACK* _GSopen)(void *pDsp, char *Title, int multithread); +typedef s32 (CALLBACK* _GSopen)(void *pDsp, const char *Title, int multithread); typedef s32 (CALLBACK* _GSopen2)( void *pDsp, u32 flags ); typedef void (CALLBACK* _GSvsync)(int field); typedef void (CALLBACK* _GSgifTransfer)(const u32 *pMem, u32 size); diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index 28553dd613..19437e9c6c 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -179,7 +179,7 @@ EXPORT_C GSclose() } } -static int _GSopen(void** dsp, char* title, GSRendererType renderer, int threads = -1) +static int _GSopen(void** dsp, const char* title, GSRendererType renderer, int threads = -1) { GSDevice* dev = NULL; @@ -528,7 +528,7 @@ EXPORT_C_(int) GSopen2(void** dsp, uint32 flags) } stored_toggle_state = toggle_state; - int retval = _GSopen(dsp, NULL, renderer); + int retval = _GSopen(dsp, "", renderer); if (s_gs != NULL) s_gs->SetAspectRatio(0); // PCSX2 manages the aspect ratios @@ -538,7 +538,7 @@ EXPORT_C_(int) GSopen2(void** dsp, uint32 flags) return retval; } -EXPORT_C_(int) GSopen(void** dsp, char* title, int mt) +EXPORT_C_(int) GSopen(void** dsp, const char* title, int mt) { /* if(!XInitThreads()) return -1; diff --git a/plugins/GSnull/GS.cpp b/plugins/GSnull/GS.cpp index 252d38b94c..2054d2ddae 100644 --- a/plugins/GSnull/GS.cpp +++ b/plugins/GSnull/GS.cpp @@ -121,7 +121,7 @@ EXPORT_C_(void) GSshutdown() GSLog::Close(); } -EXPORT_C_(s32) GSopen(void *pDsp, char *Title, int multithread) +EXPORT_C_(s32) GSopen(void *pDsp, const char *Title, int multithread) { int err = 0; GSLog::WriteLn("GS open."); diff --git a/plugins/GSnull/Linux/GSLinux.cpp b/plugins/GSnull/Linux/GSLinux.cpp index af3fd65b7f..9f8349a200 100644 --- a/plugins/GSnull/Linux/GSLinux.cpp +++ b/plugins/GSnull/Linux/GSLinux.cpp @@ -20,7 +20,7 @@ Display *display; int screen; GtkScrolledWindow *win; -int GSOpenWindow(void *pDsp, char *Title) +int GSOpenWindow(void *pDsp, const char *Title) { display = XOpenDisplay(0); screen = DefaultScreen(display); diff --git a/plugins/GSnull/Linux/GSLinux.h b/plugins/GSnull/Linux/GSLinux.h index 23e1375afc..5b872ef223 100644 --- a/plugins/GSnull/Linux/GSLinux.h +++ b/plugins/GSnull/Linux/GSLinux.h @@ -20,7 +20,7 @@ #include #include -extern int GSOpenWindow(void *pDsp, char *Title); +extern int GSOpenWindow(void *pDsp, const char *Title); extern int GSOpenWindow2(void *pDsp, u32 flags); extern void GSCloseWindow(); extern void GSProcessMessages(); diff --git a/plugins/GSnull/Windows/GSwin.cpp b/plugins/GSnull/Windows/GSwin.cpp index 079b11000b..b7b48416e9 100644 --- a/plugins/GSnull/Windows/GSwin.cpp +++ b/plugins/GSnull/Windows/GSwin.cpp @@ -34,7 +34,7 @@ LRESULT CALLBACK MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return 0; } -int GSOpenWindow(void *pDsp, char *Title) +int GSOpenWindow(void *pDsp, const char *Title) { WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, diff --git a/plugins/GSnull/Windows/GSwin.h b/plugins/GSnull/Windows/GSwin.h index cefdb93eaf..723867158a 100644 --- a/plugins/GSnull/Windows/GSwin.h +++ b/plugins/GSnull/Windows/GSwin.h @@ -18,7 +18,7 @@ #include #include -extern int GSOpenWindow(void *pDsp, char *Title); +extern int GSOpenWindow(void *pDsp, const char *Title); extern void GSCloseWindow(); extern void GSProcessMessages(); extern void HandleKeyEvent(keyEvent *ev); diff --git a/plugins/zerogs/dx/GSmain.cpp b/plugins/zerogs/dx/GSmain.cpp index 33e03afe34..3e04de6654 100644 --- a/plugins/zerogs/dx/GSmain.cpp +++ b/plugins/zerogs/dx/GSmain.cpp @@ -358,7 +358,7 @@ LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) return DefWindowProc( hWnd, msg, wParam, lParam ); } -s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread) { +s32 CALLBACK GSopen(void *pDsp, const char *Title, int multithread) { g_GSMultiThreaded = multithread; diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp index 2409690560..95c27eac7f 100644 --- a/plugins/zzogl-pg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg/opengl/GSmain.cpp @@ -282,7 +282,7 @@ __forceinline void InitMisc() ResetRegs(); } -EXPORT_C_(s32) GSopen(void *pDsp, char *Title, int multithread) +EXPORT_C_(s32) GSopen(void *pDsp, const char *Title, int multithread) { FUNCLOG From c12958bf105d180aede39326cccfa086c767885f Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 7 Nov 2015 09:59:41 +0100 Subject: [PATCH 5/8] gsdx: sign-compare Need review --- plugins/GSdx/GSRendererSW.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/GSdx/GSRendererSW.cpp b/plugins/GSdx/GSRendererSW.cpp index 64cc290220..2c41c92f14 100644 --- a/plugins/GSdx/GSRendererSW.cpp +++ b/plugins/GSdx/GSRendererSW.cpp @@ -1449,7 +1449,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data) { gd.sel.zpsm = GSLocalMemory::m_psm[context->ZBUF.PSM].fmt; gd.sel.ztst = ztest ? context->TEST.ZTST : ZTST_ALWAYS; - gd.sel.zoverflow = GSVector4i(m_vt.m_max.p).z == 0x80000000; + gd.sel.zoverflow = (uint32)GSVector4i(m_vt.m_max.p).z == 0x80000000U; } #if _M_SSE >= 0x501 From b53be72c6efe27f884ca6c3022614260a272bf76 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 7 Nov 2015 10:01:33 +0100 Subject: [PATCH 6/8] lilypad: sign compare --- plugins/LilyPad/LilyPad.cpp | 4 ++-- plugins/LilyPad/Linux/Config.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index 593e36949b..632ba36ec4 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -77,7 +77,7 @@ int windowThreadId = 0; int updateQueued = 0; #endif -int bufSize = 0; +u32 bufSize = 0; unsigned char outBuf[50]; unsigned char inBuf[50]; @@ -126,7 +126,7 @@ void DEBUG_NEW_SET() { if (config.debug && bufSize>1) { HANDLE hFile = CreateFileA("logs\\padLog.txt", FILE_APPEND_DATA, FILE_SHARE_READ, 0, OPEN_ALWAYS, 0, 0); if (hFile != INVALID_HANDLE_VALUE) { - int i; + u32 i; char temp[1500]; char *end = temp; sprintf(end, "%02X (%02X) ", inBuf[0], inBuf[1]); diff --git a/plugins/LilyPad/Linux/Config.cpp b/plugins/LilyPad/Linux/Config.cpp index eaf9a5e4f2..c2325a5df1 100644 --- a/plugins/LilyPad/Linux/Config.cpp +++ b/plugins/LilyPad/Linux/Config.cpp @@ -168,7 +168,7 @@ int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int s if (!config.multipleBinding) { for (int port2=0; port2<2; port2++) { for (int slot2=0; slot2<4; slot2++) { - if (port2==port && slot2 == slot) continue; + if (port2==(int)port && slot2 == (int)slot) continue; PadBindings *p = dev->pads[port2]+slot2; for (int i=0; i < p->numBindings; i++) { Binding *b = p->bindings+i; @@ -220,7 +220,7 @@ void CALLBACK PADsetSettingsDir( const char *dir ) int SaveSettings(wchar_t *file=0) { CfgHelper cfg; - for (int i=0; i Date: Sat, 7 Nov 2015 10:31:48 +0100 Subject: [PATCH 7/8] pcsx2: add missing case in switch --- pcsx2/DebugTools/MipsAssembler.cpp | 2 ++ pcsx2/System/SysThreadBase.cpp | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pcsx2/DebugTools/MipsAssembler.cpp b/pcsx2/DebugTools/MipsAssembler.cpp index 0f48269db6..4fbf3b3cd7 100644 --- a/pcsx2/DebugTools/MipsAssembler.cpp +++ b/pcsx2/DebugTools/MipsAssembler.cpp @@ -691,6 +691,8 @@ void CMipsInstruction::encodeNormal() switch (immediateType) { + case MIPS_NOIMMEDIATE: + break; case MIPS_IMMEDIATE5: case MIPS_IMMEDIATE20: encoding |= immediate.value << 6; diff --git a/pcsx2/System/SysThreadBase.cpp b/pcsx2/System/SysThreadBase.cpp index f4b472aa56..a92f9836e4 100644 --- a/pcsx2/System/SysThreadBase.cpp +++ b/pcsx2/System/SysThreadBase.cpp @@ -93,9 +93,8 @@ void SysThreadBase::Suspend( bool isBlocking ) switch( m_ExecMode ) { - // FIXME what to do for this case - // case ExecMode_NoThreadYet: - + // Invalid thread state, nothing to suspend + case ExecMode_NoThreadYet: // Check again -- status could have changed since above. case ExecMode_Closed: return; From d68d378a48d9fabdaf9eaba03b76bbe34f8a8bb7 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 7 Nov 2015 10:32:06 +0100 Subject: [PATCH 8/8] pcsx2: sign compare --- pcsx2/x86/ix86-32/iCore-32.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/x86/ix86-32/iCore-32.cpp b/pcsx2/x86/ix86-32/iCore-32.cpp index cc66547fda..e8eaa98a7c 100644 --- a/pcsx2/x86/ix86-32/iCore-32.cpp +++ b/pcsx2/x86/ix86-32/iCore-32.cpp @@ -279,7 +279,7 @@ int _allocX86reg(int x86reg, int type, int reg, int mode) if( x86reg >= 0 ) { // requested specific reg, so return that instead - if( i != x86reg ) { + if( i != (uint)x86reg ) { if( x86regs[i].mode & MODE_READ ) readfromreg = i; mode |= x86regs[i].mode&MODE_WRITE; x86regs[i].inuse = 0;