From 587a893a0ea5d7e670e1617b6879aa01b0ab0731 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Fri, 30 Apr 2021 06:05:13 +0200 Subject: [PATCH] gs-merge: remove initial plugin subsystem --- CMakeLists.txt | 2 - PCSX2_suite.sln | 19 - cmake/SearchForStuff.cmake | 1 - cmake/SelectPcsx2Plugins.cmake | 100 -- common/include/PS2Edefs.h | 237 --- common/include/PS2Eext.h | 358 ----- common/include/PluginCallbacks.h | 1424 ----------------- common/include/PluginCompatibility.h | 50 - pcsx2/CMakeLists.txt | 4 - pcsx2/Config.h | 13 - {plugins/GSdx => pcsx2/GS}/GS.cpp | 0 {plugins/GSdx => pcsx2/GS}/GS.h | 0 {plugins/GSdx => pcsx2/GS}/GSAlignedClass.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSAlignedClass.h | 0 {plugins/GSdx => pcsx2/GS}/GSBlock.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSBlock.h | 0 {plugins/GSdx => pcsx2/GS}/GSCapture.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSCapture.h | 0 {plugins/GSdx => pcsx2/GS}/GSClut.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSClut.h | 0 {plugins/GSdx => pcsx2/GS}/GSCodeBuffer.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSCodeBuffer.h | 0 {plugins/GSdx => pcsx2/GS}/GSCrc.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSCrc.h | 0 .../GSdx => pcsx2/GS}/GSDrawingContext.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSDrawingContext.h | 0 .../GSdx => pcsx2/GS}/GSDrawingEnvironment.h | 0 {plugins/GSdx => pcsx2/GS}/GSDump.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSDump.h | 0 {plugins/GSdx => pcsx2/GS}/GSLocalMemory.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSLocalMemory.h | 0 {plugins/GSdx => pcsx2/GS}/GSLzma.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSLzma.h | 0 {plugins/GSdx => pcsx2/GS}/GSPerfMon.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSPerfMon.h | 0 {plugins/GSdx => pcsx2/GS}/GSPng.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSPng.h | 0 {plugins/GSdx => pcsx2/GS}/GSState.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSState.h | 0 {plugins/GSdx => pcsx2/GS}/GSTables.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSTables.h | 0 {plugins/GSdx => pcsx2/GS}/GSThread.h | 0 {plugins/GSdx => pcsx2/GS}/GSThread_CXX11.h | 0 {plugins/GSdx => pcsx2/GS}/GSUtil.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSUtil.h | 0 {plugins/GSdx => pcsx2/GS}/GSVector.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSVector.h | 0 {plugins/GSdx => pcsx2/GS}/GSVector4.h | 0 {plugins/GSdx => pcsx2/GS}/GSVector4i.h | 0 {plugins/GSdx => pcsx2/GS}/GSVector8.h | 0 {plugins/GSdx => pcsx2/GS}/GSVector8i.h | 0 {plugins/GSdx => pcsx2/GS}/GSdx.cpp | 0 {plugins/GSdx => pcsx2/GS}/GSdx.def | 0 {plugins/GSdx => pcsx2/GS}/GSdx.h | 0 {plugins/GSdx => pcsx2/GS}/GSdx.rc | 0 {plugins/GSdx => pcsx2/GS}/GSdx.vcxproj | 0 .../GSdx => pcsx2/GS}/GSdx.vcxproj.filters | 0 .../GS}/Renderers/Common/GSDevice.cpp | 0 .../GS}/Renderers/Common/GSDevice.h | 0 .../GS}/Renderers/Common/GSDirtyRect.cpp | 0 .../GS}/Renderers/Common/GSDirtyRect.h | 0 .../GS}/Renderers/Common/GSFastList.h | 0 .../GS}/Renderers/Common/GSFunctionMap.cpp | 0 .../GS}/Renderers/Common/GSFunctionMap.h | 0 .../GS}/Renderers/Common/GSOsdManager.cpp | 0 .../GS}/Renderers/Common/GSOsdManager.h | 0 .../GS}/Renderers/Common/GSRenderer.cpp | 0 .../GS}/Renderers/Common/GSRenderer.h | 0 .../GS}/Renderers/Common/GSTexture.cpp | 0 .../GS}/Renderers/Common/GSTexture.h | 0 .../GS}/Renderers/Common/GSVertex.h | 0 .../GS}/Renderers/Common/GSVertexList.cpp | 0 .../GS}/Renderers/Common/GSVertexList.h | 0 .../GS}/Renderers/Common/GSVertexTrace.cpp | 0 .../GS}/Renderers/Common/GSVertexTrace.h | 0 .../GS}/Renderers/DX11/GSDevice11.cpp | 0 .../GS}/Renderers/DX11/GSDevice11.h | 0 .../GS}/Renderers/DX11/GSRendererDX11.cpp | 0 .../GS}/Renderers/DX11/GSRendererDX11.h | 0 .../GS}/Renderers/DX11/GSTexture11.cpp | 0 .../GS}/Renderers/DX11/GSTexture11.h | 0 .../GS}/Renderers/DX11/GSTextureCache11.cpp | 0 .../GS}/Renderers/DX11/GSTextureCache11.h | 0 .../GS}/Renderers/DX11/GSTextureFX11.cpp | 0 .../GS}/Renderers/HW/GSHwHack.cpp | 0 .../GS}/Renderers/HW/GSRendererHW.cpp | 0 .../GS}/Renderers/HW/GSRendererHW.h | 0 .../GS}/Renderers/HW/GSTextureCache.cpp | 0 .../GS}/Renderers/HW/GSTextureCache.h | 0 .../GS}/Renderers/HW/GSVertexHW.h | 0 .../GS}/Renderers/Null/GSDeviceNull.cpp | 0 .../GS}/Renderers/Null/GSDeviceNull.h | 0 .../GS}/Renderers/Null/GSRendererNull.cpp | 0 .../GS}/Renderers/Null/GSRendererNull.h | 0 .../GS}/Renderers/Null/GSTextureNull.cpp | 0 .../GS}/Renderers/Null/GSTextureNull.h | 0 .../GS}/Renderers/OpenGL/GLLoader.cpp | 0 .../GS}/Renderers/OpenGL/GLLoader.h | 0 .../GS}/Renderers/OpenGL/GLState.cpp | 0 .../GS}/Renderers/OpenGL/GLState.h | 0 .../GS}/Renderers/OpenGL/GSDeviceOGL.cpp | 0 .../GS}/Renderers/OpenGL/GSDeviceOGL.h | 0 .../GS}/Renderers/OpenGL/GSRendererOGL.cpp | 0 .../GS}/Renderers/OpenGL/GSRendererOGL.h | 0 .../GS}/Renderers/OpenGL/GSShaderOGL.cpp | 0 .../GS}/Renderers/OpenGL/GSShaderOGL.h | 0 .../Renderers/OpenGL/GSTextureCacheOGL.cpp | 0 .../GS}/Renderers/OpenGL/GSTextureCacheOGL.h | 0 .../GS}/Renderers/OpenGL/GSTextureOGL.cpp | 0 .../GS}/Renderers/OpenGL/GSTextureOGL.h | 0 .../GS}/Renderers/OpenGL/GSUniformBufferOGL.h | 0 .../GS}/Renderers/OpenGL/GSVertexArrayOGL.h | 0 .../GS}/Renderers/OpenGL/PFN_GLLOADER_CPP.h | 0 .../GS}/Renderers/OpenGL/PFN_GLLOADER_HPP.h | 0 .../GS}/Renderers/OpenGL/glext_extra.h | 0 .../GS}/Renderers/SW/GSDrawScanline.cpp | 0 .../GS}/Renderers/SW/GSDrawScanline.h | 0 .../SW/GSDrawScanlineCodeGenerator.cpp | 0 .../SW/GSDrawScanlineCodeGenerator.h | 0 .../GSDrawScanlineCodeGenerator.x64.avx.cpp | 0 .../GSDrawScanlineCodeGenerator.x64.avx2.cpp | 0 .../SW/GSDrawScanlineCodeGenerator.x64.cpp | 0 .../GSDrawScanlineCodeGenerator.x86.avx.cpp | 0 .../GSDrawScanlineCodeGenerator.x86.avx2.cpp | 0 .../SW/GSDrawScanlineCodeGenerator.x86.cpp | 0 .../GS}/Renderers/SW/GSRasterizer.cpp | 0 .../GS}/Renderers/SW/GSRasterizer.h | 0 .../GS}/Renderers/SW/GSRendererSW.cpp | 0 .../GS}/Renderers/SW/GSRendererSW.h | 0 .../GS}/Renderers/SW/GSScanlineEnvironment.h | 0 .../Renderers/SW/GSSetupPrimCodeGenerator.cpp | 0 .../Renderers/SW/GSSetupPrimCodeGenerator.h | 0 .../SW/GSSetupPrimCodeGenerator.x64.avx.cpp | 0 .../SW/GSSetupPrimCodeGenerator.x64.avx2.cpp | 0 .../SW/GSSetupPrimCodeGenerator.x64.cpp | 0 .../SW/GSSetupPrimCodeGenerator.x86.avx.cpp | 0 .../SW/GSSetupPrimCodeGenerator.x86.avx2.cpp | 0 .../SW/GSSetupPrimCodeGenerator.x86.cpp | 0 .../GS}/Renderers/SW/GSTextureCacheSW.cpp | 0 .../GS}/Renderers/SW/GSTextureCacheSW.h | 0 .../GS}/Renderers/SW/GSTextureSW.cpp | 0 .../GS}/Renderers/SW/GSTextureSW.h | 0 .../GS}/Renderers/SW/GSVertexSW.cpp | 0 .../GS}/Renderers/SW/GSVertexSW.h | 0 .../GSdx => pcsx2/GS}/Window/GSCaptureDlg.cpp | 0 .../GSdx => pcsx2/GS}/Window/GSCaptureDlg.h | 0 .../GSdx => pcsx2/GS}/Window/GSDialog.cpp | 0 {plugins/GSdx => pcsx2/GS}/Window/GSDialog.h | 0 .../GS}/Window/GSLinuxDialog.cpp | 0 .../GSdx => pcsx2/GS}/Window/GSSetting.cpp | 0 {plugins/GSdx => pcsx2/GS}/Window/GSSetting.h | 0 .../GS}/Window/GSSettingsDlg.cpp | 0 .../GSdx => pcsx2/GS}/Window/GSSettingsDlg.h | 0 {plugins/GSdx => pcsx2/GS}/Window/GSWnd.cpp | 0 {plugins/GSdx => pcsx2/GS}/Window/GSWnd.h | 0 {plugins/GSdx => pcsx2/GS}/Window/GSWndDX.cpp | 0 {plugins/GSdx => pcsx2/GS}/Window/GSWndDX.h | 0 .../GSdx => pcsx2/GS}/Window/GSWndEGL.cpp | 0 {plugins/GSdx => pcsx2/GS}/Window/GSWndEGL.h | 0 .../GSdx => pcsx2/GS}/Window/GSWndWGL.cpp | 0 {plugins/GSdx => pcsx2/GS}/Window/GSWndWGL.h | 0 {plugins/GSdx => pcsx2/GS}/Window/PFN_WND.h | 0 {plugins/GSdx => pcsx2/GS}/config.h | 0 .../GSdx => pcsx2/GS}/docs/TextureCache.odg | Bin {plugins/GSdx => pcsx2/GS}/linux_replay.cpp | 0 {plugins/GSdx => pcsx2/GS}/res/convert.fx | 0 .../GS}/res/fonts-roboto/Roboto-Regular.ttf | Bin .../GS}/res/fonts-roboto/copyright | 0 {plugins/GSdx => pcsx2/GS}/res/fxaa.fx | 0 .../GS}/res/glsl/common_header.glsl | 0 .../GSdx => pcsx2/GS}/res/glsl/convert.glsl | 0 .../GSdx => pcsx2/GS}/res/glsl/interlace.glsl | 0 .../GSdx => pcsx2/GS}/res/glsl/merge.glsl | 0 .../GS}/res/glsl/shadeboost.glsl | 0 .../GSdx => pcsx2/GS}/res/glsl/tfx_fs.glsl | 0 .../GSdx => pcsx2/GS}/res/glsl/tfx_vgs.glsl | 0 {plugins/GSdx => pcsx2/GS}/res/gsdx-res.xml | 0 {plugins/GSdx => pcsx2/GS}/res/interlace.fx | 0 {plugins/GSdx => pcsx2/GS}/res/logo-null.bmp | Bin {plugins/GSdx => pcsx2/GS}/res/logo-ogl.bmp | Bin {plugins/GSdx => pcsx2/GS}/res/logo11.bmp | Bin {plugins/GSdx => pcsx2/GS}/res/merge.fx | 0 {plugins/GSdx => pcsx2/GS}/res/shadeboost.fx | 0 {plugins/GSdx => pcsx2/GS}/res/tfx.fx | 0 {plugins/GSdx => pcsx2/GS}/resource.h | 0 {plugins/GSdx => pcsx2/GS}/stdafx.cpp | 0 {plugins/GSdx => pcsx2/GS}/stdafx.h | 0 {plugins/GSdx => pcsx2/GS}/targetver.h | 0 .../GS}/vsprops/ProjectRootDir.props | 0 {plugins/GSdx => pcsx2/GS}/vsprops/avx2.props | 0 .../GSdx => pcsx2/GS}/vsprops/common.props | 0 .../GSdx => pcsx2/GS}/vsprops/debug.props | 0 .../GSdx => pcsx2/GS}/vsprops/release.props | 0 {plugins/GSdx => pcsx2/GS}/vsprops/sse4.props | 0 {plugins/GSdx => pcsx2/GS}/vsprops/x64.props | 0 {plugins/GSdx => pcsx2/GS}/vsprops/x86.props | 0 {plugins/GSdx => pcsx2/GS}/xbyak/xbyak.h | 0 .../GSdx => pcsx2/GS}/xbyak/xbyak_mnemonic.h | 0 {plugins/GSdx => pcsx2/GS}/xbyak/xbyak_util.h | 0 pcsx2/PluginManager.cpp | 1382 ---------------- pcsx2/Plugins.h | 456 ------ pcsx2/gui/MainFrame.cpp | 3 - pcsx2/gui/SysState.cpp | 45 - plugins/CMakeLists.txt | 12 - plugins/GSdx/CMakeLists.txt | 291 ---- 205 files changed, 4397 deletions(-) delete mode 100644 cmake/SelectPcsx2Plugins.cmake delete mode 100644 common/include/PS2Edefs.h delete mode 100644 common/include/PS2Eext.h delete mode 100644 common/include/PluginCallbacks.h delete mode 100644 common/include/PluginCompatibility.h rename {plugins/GSdx => pcsx2/GS}/GS.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GS.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSAlignedClass.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSAlignedClass.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSBlock.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSBlock.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSCapture.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSCapture.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSClut.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSClut.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSCodeBuffer.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSCodeBuffer.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSCrc.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSCrc.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSDrawingContext.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSDrawingContext.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSDrawingEnvironment.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSDump.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSDump.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSLocalMemory.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSLocalMemory.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSLzma.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSLzma.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSPerfMon.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSPerfMon.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSPng.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSPng.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSState.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSState.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSTables.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSTables.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSThread.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSThread_CXX11.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSUtil.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSUtil.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSVector.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSVector.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSVector4.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSVector4i.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSVector8.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSVector8i.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSdx.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/GSdx.def (100%) rename {plugins/GSdx => pcsx2/GS}/GSdx.h (100%) rename {plugins/GSdx => pcsx2/GS}/GSdx.rc (100%) rename {plugins/GSdx => pcsx2/GS}/GSdx.vcxproj (100%) rename {plugins/GSdx => pcsx2/GS}/GSdx.vcxproj.filters (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSDevice.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSDevice.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSDirtyRect.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSDirtyRect.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSFastList.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSFunctionMap.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSFunctionMap.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSOsdManager.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSOsdManager.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSRenderer.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSRenderer.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSTexture.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSTexture.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSVertex.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSVertexList.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSVertexList.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSVertexTrace.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Common/GSVertexTrace.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/DX11/GSDevice11.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/DX11/GSDevice11.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/DX11/GSRendererDX11.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/DX11/GSRendererDX11.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/DX11/GSTexture11.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/DX11/GSTexture11.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/DX11/GSTextureCache11.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/DX11/GSTextureCache11.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/DX11/GSTextureFX11.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/HW/GSHwHack.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/HW/GSRendererHW.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/HW/GSRendererHW.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/HW/GSTextureCache.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/HW/GSTextureCache.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/HW/GSVertexHW.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Null/GSDeviceNull.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Null/GSDeviceNull.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Null/GSRendererNull.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Null/GSRendererNull.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Null/GSTextureNull.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/Null/GSTextureNull.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GLLoader.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GLLoader.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GLState.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GLState.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSDeviceOGL.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSDeviceOGL.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSRendererOGL.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSRendererOGL.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSShaderOGL.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSShaderOGL.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSTextureCacheOGL.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSTextureCacheOGL.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSTextureOGL.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSTextureOGL.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSUniformBufferOGL.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/GSVertexArrayOGL.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/PFN_GLLOADER_CPP.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/PFN_GLLOADER_HPP.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/OpenGL/glext_extra.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSDrawScanline.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSDrawScanline.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSDrawScanlineCodeGenerator.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSDrawScanlineCodeGenerator.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx2.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSDrawScanlineCodeGenerator.x64.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx2.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSDrawScanlineCodeGenerator.x86.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSRasterizer.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSRasterizer.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSRendererSW.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSRendererSW.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSScanlineEnvironment.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSSetupPrimCodeGenerator.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSSetupPrimCodeGenerator.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx2.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSSetupPrimCodeGenerator.x64.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx2.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSSetupPrimCodeGenerator.x86.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSTextureCacheSW.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSTextureCacheSW.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSTextureSW.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSTextureSW.h (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSVertexSW.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Renderers/SW/GSVertexSW.h (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSCaptureDlg.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSCaptureDlg.h (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSDialog.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSDialog.h (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSLinuxDialog.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSSetting.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSSetting.h (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSSettingsDlg.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSSettingsDlg.h (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSWnd.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSWnd.h (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSWndDX.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSWndDX.h (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSWndEGL.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSWndEGL.h (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSWndWGL.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/Window/GSWndWGL.h (100%) rename {plugins/GSdx => pcsx2/GS}/Window/PFN_WND.h (100%) rename {plugins/GSdx => pcsx2/GS}/config.h (100%) rename {plugins/GSdx => pcsx2/GS}/docs/TextureCache.odg (100%) rename {plugins/GSdx => pcsx2/GS}/linux_replay.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/res/convert.fx (100%) rename {plugins/GSdx => pcsx2/GS}/res/fonts-roboto/Roboto-Regular.ttf (100%) rename {plugins/GSdx => pcsx2/GS}/res/fonts-roboto/copyright (100%) rename {plugins/GSdx => pcsx2/GS}/res/fxaa.fx (100%) rename {plugins/GSdx => pcsx2/GS}/res/glsl/common_header.glsl (100%) rename {plugins/GSdx => pcsx2/GS}/res/glsl/convert.glsl (100%) rename {plugins/GSdx => pcsx2/GS}/res/glsl/interlace.glsl (100%) rename {plugins/GSdx => pcsx2/GS}/res/glsl/merge.glsl (100%) rename {plugins/GSdx => pcsx2/GS}/res/glsl/shadeboost.glsl (100%) rename {plugins/GSdx => pcsx2/GS}/res/glsl/tfx_fs.glsl (100%) rename {plugins/GSdx => pcsx2/GS}/res/glsl/tfx_vgs.glsl (100%) rename {plugins/GSdx => pcsx2/GS}/res/gsdx-res.xml (100%) rename {plugins/GSdx => pcsx2/GS}/res/interlace.fx (100%) rename {plugins/GSdx => pcsx2/GS}/res/logo-null.bmp (100%) rename {plugins/GSdx => pcsx2/GS}/res/logo-ogl.bmp (100%) rename {plugins/GSdx => pcsx2/GS}/res/logo11.bmp (100%) rename {plugins/GSdx => pcsx2/GS}/res/merge.fx (100%) rename {plugins/GSdx => pcsx2/GS}/res/shadeboost.fx (100%) rename {plugins/GSdx => pcsx2/GS}/res/tfx.fx (100%) rename {plugins/GSdx => pcsx2/GS}/resource.h (100%) rename {plugins/GSdx => pcsx2/GS}/stdafx.cpp (100%) rename {plugins/GSdx => pcsx2/GS}/stdafx.h (100%) rename {plugins/GSdx => pcsx2/GS}/targetver.h (100%) rename {plugins/GSdx => pcsx2/GS}/vsprops/ProjectRootDir.props (100%) rename {plugins/GSdx => pcsx2/GS}/vsprops/avx2.props (100%) rename {plugins/GSdx => pcsx2/GS}/vsprops/common.props (100%) rename {plugins/GSdx => pcsx2/GS}/vsprops/debug.props (100%) rename {plugins/GSdx => pcsx2/GS}/vsprops/release.props (100%) rename {plugins/GSdx => pcsx2/GS}/vsprops/sse4.props (100%) rename {plugins/GSdx => pcsx2/GS}/vsprops/x64.props (100%) rename {plugins/GSdx => pcsx2/GS}/vsprops/x86.props (100%) rename {plugins/GSdx => pcsx2/GS}/xbyak/xbyak.h (100%) rename {plugins/GSdx => pcsx2/GS}/xbyak/xbyak_mnemonic.h (100%) rename {plugins/GSdx => pcsx2/GS}/xbyak/xbyak_util.h (100%) delete mode 100644 pcsx2/PluginManager.cpp delete mode 100644 pcsx2/Plugins.h delete mode 100644 plugins/CMakeLists.txt delete mode 100644 plugins/GSdx/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 104332a189..3a8ba403b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,9 +28,7 @@ check_compiler_version("7.0" "7.0") include(GNUInstallDirs) # BuildParameters Must be done before SearchForStuff include(BuildParameters) -# SearchForStuff be done before SelectPcsx2Plugins include(SearchForStuff) -include(SelectPcsx2Plugins) # Must be done after SearchForStuff get_git_version_info() diff --git a/PCSX2_suite.sln b/PCSX2_suite.sln index 862a07eda5..9621115963 100644 --- a/PCSX2_suite.sln +++ b/PCSX2_suite.sln @@ -27,8 +27,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{2D6F0A62 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcsx2", "pcsx2\windows\VCprojects\pcsx2.vcxproj", "{1CEFD830-2B76-4596-A4EE-BCD7280A60BD}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GSdx", "plugins\GSdx\GSdx.vcxproj", "{18E42F6F-3A62-41EE-B42F-79366C4F1E95}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "3rdparty\soundtouch\SoundTouch.vcxproj", "{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "3rdparty\zlib\zlib.vcxproj", "{2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}" @@ -97,22 +95,6 @@ Global {1CEFD830-2B76-4596-A4EE-BCD7280A60BD}.Release|Win32.Build.0 = Release|Win32 {1CEFD830-2B76-4596-A4EE-BCD7280A60BD}.Release|x64.ActiveCfg = Release|x64 {1CEFD830-2B76-4596-A4EE-BCD7280A60BD}.Release|x64.Build.0 = Release|x64 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Debug|Win32.ActiveCfg = Debug|Win32 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Debug|Win32.Build.0 = Debug|Win32 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Debug|x64.ActiveCfg = Debug|x64 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Debug|x64.Build.0 = Debug|x64 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Devel|Win32.ActiveCfg = Release|Win32 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Devel|Win32.Build.0 = Release|Win32 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Devel|x64.ActiveCfg = Release|x64 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Devel|x64.Build.0 = Release|x64 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Release AVX2|Win32.ActiveCfg = Release AVX2|Win32 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Release AVX2|Win32.Build.0 = Release AVX2|Win32 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Release AVX2|x64.ActiveCfg = Release AVX2|x64 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Release AVX2|x64.Build.0 = Release AVX2|x64 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Release|Win32.ActiveCfg = Release|Win32 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Release|Win32.Build.0 = Release|Win32 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Release|x64.ActiveCfg = Release|x64 - {18E42F6F-3A62-41EE-B42F-79366C4F1E95}.Release|x64.Build.0 = Release|x64 {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}.Debug|Win32.ActiveCfg = Debug|Win32 {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}.Debug|Win32.Build.0 = Debug|Win32 {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}.Debug|x64.ActiveCfg = Debug|x64 @@ -439,7 +421,6 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {0FADC26C-0E9D-4DD7-84B1-BF4F7754E90C} = {88F517F9-CE1C-4005-9BDF-4481FEB55053} - {18E42F6F-3A62-41EE-B42F-79366C4F1E95} = {703FD00B-D7A0-41E3-BD03-CEC86B385DAF} {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {A51123F5-9505-4EAE-85E7-D320290A272C} = {88F517F9-CE1C-4005-9BDF-4481FEB55053} diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 74259efc4b..62f1bdbebb 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -21,7 +21,6 @@ find_package(OpenGL) find_package(PNG) find_package(Vtune) -# The requirement of wxWidgets is checked in SelectPcsx2Plugins module # Does not require the module (allow to compile non-wx plugins) # Force the unicode build (the variable is only supported on cmake 2.8.3 and above) # Warning do not put any double-quote for the argument... diff --git a/cmake/SelectPcsx2Plugins.cmake b/cmake/SelectPcsx2Plugins.cmake deleted file mode 100644 index f5cddc7c57..0000000000 --- a/cmake/SelectPcsx2Plugins.cmake +++ /dev/null @@ -1,100 +0,0 @@ -#------------------------------------------------------------------------------- -# Dependency message print -#------------------------------------------------------------------------------- -set(msg_dep_common_libs "check these libraries -> wxWidgets (>=3.0), aio") -set(msg_dep_pcsx2 "check these libraries -> wxWidgets (>=3.0), gtk2, zlib (>=1.2.4), pcsx2 common libs") -set(msg_dep_gsdx "check these libraries -> opengl, png (>=1.2), zlib (>=1.2.4), X11, liblzma") - -macro(print_dep str dep) - if (PACKAGE_MODE) - message(FATAL_ERROR "${str}:${dep}") - else() - message(STATUS "${str}:${dep}") - endif() -endmacro(print_dep) - -#------------------------------------------------------------------------------- -# Pcsx2 core & common libs -#------------------------------------------------------------------------------- -# Check for additional dependencies. -# If all dependencies are available, including OS, build it -#------------------------------------------------------------------------------- -if (GTK2_FOUND OR GTK3_FOUND) - set(GTKn_FOUND TRUE) -elseif(APPLE) # Not we have but that we don't change all if(gtkn) entries - set(GTKn_FOUND TRUE) -else() - set(GTKn_FOUND FALSE) -endif() - -if(SDL_FOUND OR SDL2_FOUND) - set(SDLn_FOUND TRUE) -else() - set(SDLn_FOUND FALSE) -endif() - -#--------------------------------------- -# Common libs -# requires: -wx -#--------------------------------------- -if(wxWidgets_FOUND) - set(common_libs TRUE) -elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/common/src") - set(common_libs FALSE) -else() - set(common_libs FALSE) - print_dep("Skip build of common libraries: missing dependencies" "${msg_dep_common_libs}") -endif() - -#--------------------------------------- -# Pcsx2 core -# requires: -wx -# -gtk2 (linux) -# -zlib -# -common_libs -# -aio -#--------------------------------------- -# Common dependancy -if(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs AND NOT (Linux AND NOT AIO_FOUND)) - set(pcsx2_core TRUE) -elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/pcsx2") - set(pcsx2_core FALSE) -else() - set(pcsx2_core FALSE) - print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}") -endif() -# Linux, BSD, use gtk2, but not OSX -if(UNIX AND pcsx2_core AND NOT GTKn_FOUND AND NOT APPLE) - set(pcsx2_core FALSE) - print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}") -endif() - - -#------------------------------------------------------------------------------- -# Plugins -#------------------------------------------------------------------------------- -# Check all plugins for additional dependencies. -# If all dependencies of a plugin are available, including OS, the plugin will -# be build. -#------------------------------------------------------------------------------- - - -#--------------------------------------- -# GSdx -#--------------------------------------- -# requires: -OpenGL -# -PNG -# -X11 -# -zlib -#--------------------------------------- -if(OPENGL_FOUND AND X11_FOUND AND GTKn_FOUND AND ZLIB_FOUND AND PNG_FOUND AND FREETYPE_FOUND AND LIBLZMA_FOUND AND ((EGL_FOUND AND X11_XCB_FOUND) OR APPLE)) - set(GSdx TRUE) -elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx") - set(GSdx FALSE) -else() - set(GSdx FALSE) - print_dep("Skip build of GSdx: missing dependencies" "${msg_dep_gsdx}") -endif() -#--------------------------------------- - -#------------------------------------------------------------------------------- diff --git a/common/include/PS2Edefs.h b/common/include/PS2Edefs.h deleted file mode 100644 index f5e1c0cb27..0000000000 --- a/common/include/PS2Edefs.h +++ /dev/null @@ -1,237 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2010 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#ifndef __PS2EDEFS_H__ -#define __PS2EDEFS_H__ - -/* - * PS2E Definitions v0.6.2 (beta) - * - * Author: linuzappz@hotmail.com - * shadowpcsx2@yahoo.gr - * florinsasu@hotmail.com - */ - -/* - Notes: - * Since this is still beta things may change. - - * OSflags: - __linux__ (linux OS) - _WIN32 (win32 OS) - - * common return values (for ie. GSinit): - 0 - success - -1 - error - - * reserved keys: - F1 to F10 are reserved for the emulator - - * plugins should NOT change the current - working directory. - (on win32, add flag OFN_NOCHANGEDIR for - GetOpenFileName) - -*/ - -#include "Pcsx2Defs.h" - -/////////////////////////////////////////////////////////////////////// - -// freeze modes: -#define FREEZE_LOAD 0 -#define FREEZE_SAVE 1 -#define FREEZE_SIZE 2 - -// event values: -#define KEYPRESS 1 -#define KEYRELEASE 2 - -typedef struct -{ - int size; - s8 *data; -} freezeData; - -typedef struct _keyEvent -{ - u32 key; - u32 evt; -} keyEvent; - -/////////////////////////////////////////////////////////////////////// - -// PS2EgetLibType returns (may be OR'd) -#define PS2E_LT_GS 0x01 - -// PS2EgetLibVersion2 (high 16 bits) -#define PS2E_GS_VERSION 0x0006 - -// key values: -/* key values must be OS dependant: - win32: the VK_XXX will be used (WinUser) - linux: the XK_XXX will be used (XFree86) -*/ - -// for 64bit compilers -typedef char __keyEvent_Size__[(sizeof(keyEvent) == 8) ? 1 : -1]; - -#ifdef __cplusplus -extern "C" { -#endif - -/* GS plugin API */ - -// if this file is included with this define -// the next api will not be skipped by the compiler -#if defined(GSdefs) || defined(BUILTIN_GS_PLUGIN) - -// basic funcs - -s32 CALLBACK GSinit(); -s32 CALLBACK GSopen(void *pDsp, const char *Title, int multithread); -void CALLBACK GSclose(); -void CALLBACK GSshutdown(); -void CALLBACK GSsetSettingsDir(const char *dir); -void CALLBACK GSsetLogDir(const char *dir); - -void CALLBACK GSvsync(int field); -void CALLBACK GSgifTransfer(const u32 *pMem, u32 addr); -void CALLBACK GSgifTransfer1(u32 *pMem, u32 addr); -void CALLBACK GSgifTransfer2(u32 *pMem, u32 size); -void CALLBACK GSgifTransfer3(u32 *pMem, u32 size); -void CALLBACK GSgetLastTag(u64 *ptag); // returns the last tag processed (64 bits) -void CALLBACK GSgifSoftReset(u32 mask); -void CALLBACK GSreadFIFO(u64 *mem); -void CALLBACK GSinitReadFIFO(u64 *mem); -void CALLBACK GSreadFIFO2(u64 *mem, int qwc); -void CALLBACK GSinitReadFIFO2(u64 *mem, int qwc); - -// extended funcs - -// GSkeyEvent gets called when there is a keyEvent from the PAD plugin -void CALLBACK GSkeyEvent(keyEvent *ev); -void CALLBACK GSchangeSaveState(int, const char *filename); -void CALLBACK GSmakeSnapshot(char *path); -void CALLBACK GSmakeSnapshot2(char *pathname, int *snapdone, int savejpg); -void CALLBACK GSirqCallback(void (*callback)()); -void CALLBACK GSsetBaseMem(void *); -void CALLBACK GSsetGameCRC(int crc, int gameoptions); - -// controls frame skipping in the GS, if this routine isn't present, frame skipping won't be done -void CALLBACK GSsetFrameSkip(int frameskip); - -// Starts recording GS frame data -// returns true if successful -bool CALLBACK GSsetupRecording(std::string& filename); - -// Stops recording GS frame data -void CALLBACK GSendRecording(); - -void CALLBACK GSreset(); -//deprecated: GSgetTitleInfo was used in PCSX2 but no plugin supported it prior to r4070: -//void CALLBACK GSgetTitleInfo( char dest[128] ); -void CALLBACK GSgetTitleInfo2(char *dest, size_t length); -void CALLBACK GSwriteCSR(u32 value); -s32 CALLBACK GSfreeze(int mode, freezeData *data); -void CALLBACK GSconfigure(); -void CALLBACK GSabout(); -s32 CALLBACK GStest(); - -#endif - -// might be useful for emulators -#ifdef PLUGINtypedefs - -typedef u32(CALLBACK *_PS2EgetLibType)(void); -typedef u32(CALLBACK *_PS2EgetLibVersion2)(u32 type); -typedef char *(CALLBACK *_PS2EgetLibName)(void); - -// GS -// NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs -// If you want to use them, need to save and restore current ones -typedef void(CALLBACK *_GSosdLog)(const char *utf8, u32 color); -typedef void(CALLBACK *_GSosdMonitor)(const char *key, const char *value, u32 color); -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); -typedef void(CALLBACK *_GSgifTransfer1)(u32 *pMem, u32 addr); -typedef void(CALLBACK *_GSgifTransfer2)(u32 *pMem, u32 size); -typedef void(CALLBACK *_GSgifTransfer3)(u32 *pMem, u32 size); -typedef void(CALLBACK *_GSgifSoftReset)(u32 mask); -typedef void(CALLBACK *_GSreadFIFO)(u64 *pMem); -typedef void(CALLBACK *_GSreadFIFO2)(u64 *pMem, int qwc); -typedef void(CALLBACK *_GSinitReadFIFO)(u64 *pMem); -typedef void(CALLBACK *_GSinitReadFIFO2)(u64 *pMem, int qwc); - -typedef void(CALLBACK *_GSchangeSaveState)(int, const char *filename); -typedef void(CALLBACK *_GSgetTitleInfo2)(char *dest, size_t length); -typedef void(CALLBACK *_GSirqCallback)(void (*callback)()); -typedef void(CALLBACK *_GSsetBaseMem)(void *); -typedef void(CALLBACK *_GSsetGameCRC)(int, int); -typedef void(CALLBACK *_GSsetFrameSkip)(int frameskip); -typedef void(CALLBACK *_GSsetVsync)(int enabled); -typedef void(CALLBACK *_GSsetExclusive)(int isExclusive); -typedef bool(CALLBACK* _GSsetupRecording)(std::string&); -typedef void(CALLBACK* _GSendRecording)(); -typedef void(CALLBACK *_GSreset)(); -typedef void(CALLBACK *_GSwriteCSR)(u32 value); -typedef bool(CALLBACK *_GSmakeSnapshot)(const char *path); -typedef void(CALLBACK *_GSmakeSnapshot2)(const char *path, int *, int); - -#endif - -#ifdef PLUGINfuncs - -// GS -#ifndef BUILTIN_GS_PLUGIN -extern _GSosdLog GSosdLog; -extern _GSosdMonitor GSosdMonitor; -extern _GSopen GSopen; -extern _GSopen2 GSopen2; -extern _GSvsync GSvsync; -extern _GSgifTransfer GSgifTransfer; -extern _GSgifTransfer1 GSgifTransfer1; -extern _GSgifTransfer2 GSgifTransfer2; -extern _GSgifTransfer3 GSgifTransfer3; -extern _GSgifSoftReset GSgifSoftReset; -extern _GSreadFIFO GSreadFIFO; -extern _GSinitReadFIFO GSinitReadFIFO; -extern _GSreadFIFO2 GSreadFIFO2; -extern _GSinitReadFIFO2 GSinitReadFIFO2; - -extern _GSchangeSaveState GSchangeSaveState; -extern _GSgetTitleInfo2 GSgetTitleInfo2; -extern _GSmakeSnapshot GSmakeSnapshot; -extern _GSmakeSnapshot2 GSmakeSnapshot2; -extern _GSirqCallback GSirqCallback; -extern _GSsetBaseMem GSsetBaseMem; -extern _GSsetGameCRC GSsetGameCRC; -extern _GSsetFrameSkip GSsetFrameSkip; -extern _GSsetVsync GSsetVsync; -extern _GSsetupRecording GSsetupRecording; -extern _GSendRecording GSendRecording; -extern _GSreset GSreset; -extern _GSwriteCSR GSwriteCSR; -#endif - -#endif - -#ifdef __cplusplus -} // End extern "C" -#endif - -#endif /* __PS2EDEFS_H__ */ diff --git a/common/include/PS2Eext.h b/common/include/PS2Eext.h deleted file mode 100644 index dfa854c1ea..0000000000 --- a/common/include/PS2Eext.h +++ /dev/null @@ -1,358 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2010 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#ifndef PS2EEXT_H_INCLUDED -#define PS2EEXT_H_INCLUDED - -#include -#include -#include - -#include -#include - -#if defined(_MSC_VER) -#ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0600 -#endif -#include -#include -#include - -#define EXPORT_C_(type) extern "C" type CALLBACK - -#elif defined(__unix__) - -#include -#include -#include - -#define EXPORT_C_(type) extern "C" __attribute__((stdcall, externally_visible, visibility("default"))) type - -#else - -#define EXPORT_C_(type) extern "C" __attribute__((stdcall, externally_visible, visibility("default"))) type - -#endif - -#include -//#include "PS2Edefs.h" - -#if !defined(_MSC_VER) || !defined(UNICODE) -static void SysMessage(const char* fmt, ...); -static void __forceinline PluginNullConfigure(std::string desc, s32& log); -#else -static void SysMessage(const wchar_t* fmt, ...); -static void __forceinline PluginNullConfigure(std::wstring desc, s32& log); -#endif - -enum FileMode -{ - READ_FILE = 0, - WRITE_FILE -}; - -struct PluginLog -{ - bool WriteToFile, WriteToConsole; - FILE* LogFile; - - bool Open(std::string logname) - { - LogFile = px_fopen(logname, "w"); - - if (LogFile) - { - setvbuf(LogFile, NULL, _IONBF, 0); - return true; - } - return false; - } - - void Close() - { - if (LogFile) - { - fclose(LogFile); - LogFile = NULL; - } - } - - void Write(const char* fmt, ...) - { - if (LogFile == NULL) - return; - - va_list list; - if (WriteToFile) - { - va_start(list, fmt); - vfprintf(LogFile, fmt, list); - va_end(list); - } - if (WriteToConsole) - { - va_start(list, fmt); - vfprintf(stdout, fmt, list); - va_end(list); - } - } - - void WriteLn(const char* fmt, ...) - { - if (LogFile == NULL) - return; - - va_list list; - if (WriteToFile) - { - va_start(list, fmt); - vfprintf(LogFile, fmt, list); - va_end(list); - fprintf(LogFile, "\n"); - } - if (WriteToConsole) - { - va_start(list, fmt); - vfprintf(stdout, fmt, list); - va_end(list); - fprintf(stdout, "\n"); - } - } - -#if !defined(_MSC_VER) || !defined(UNICODE) - void Message(const char* fmt, ...) - { - va_list list; - char buf[256]; - - if (LogFile == NULL) - return; - - va_start(list, fmt); - vsprintf(buf, fmt, list); - va_end(list); - - SysMessage(buf); - } -#else - void Message(const wchar_t* fmt, ...) - { - va_list list; - wchar_t buf[256]; - - if (LogFile == NULL) - return; - - va_start(list, fmt); - vswprintf(buf, 256, fmt, list); - va_end(list); - - SysMessage(buf); - } -#endif -}; - -struct PluginConf -{ - FILE* ConfFile; - char* PluginName; - - bool Open(std::string name, FileMode mode = READ_FILE) - { - if (mode == READ_FILE) - { - ConfFile = px_fopen(name, "r"); - } - else - { - ConfFile = px_fopen(name, "w"); - } - - if (ConfFile == NULL) - return false; - - return true; - } - - void Close() - { - if (ConfFile) - { - fclose(ConfFile); - ConfFile = NULL; - } - } - - int ReadInt(const std::string& item, int defval) - { - int value = defval; - std::string buf = item + " = %d\n"; - - if (ConfFile) - if (fscanf(ConfFile, buf.c_str(), &value) < 0) - fprintf(stderr, "Error reading %s\n", item.c_str()); - - return value; - } - - void WriteInt(std::string item, int value) - { - std::string buf = item + " = %d\n"; - - if (ConfFile) - fprintf(ConfFile, buf.c_str(), value); - } -}; - -#if defined(__unix__) -static void SysMessage(const char* fmt, ...) -{ - va_list list; - char msg[512]; - - va_start(list, fmt); - vsprintf(msg, fmt, list); - va_end(list); - - if (msg[strlen(msg) - 1] == '\n') - msg[strlen(msg) - 1] = 0; - - if (!wxIsMainThread()) - { - std::mutex dialogMutex; - std::condition_variable dialogCV; - bool dialogClosed = false; - - wxTheApp->CallAfter([&] { - wxMessageDialog dialog(nullptr, msg, "Info", wxOK); - dialog.ShowModal(); - - { - std::lock_guard dialogLock1(dialogMutex); - dialogClosed = true; - } - dialogCV.notify_all(); - }); - //Block until done - std::unique_lock dialogLock2(dialogMutex); - dialogCV.wait(dialogLock2, [&] { return dialogClosed; }); - } - else - { - wxMessageDialog dialog(nullptr, msg, "Info", wxOK); - dialog.ShowModal(); - } -} - -#define ENTRY_POINT /* We don't need no stinkin' entry point! */ - - -#elif defined(__WXMAC__) || defined(__APPLE__) - -static void SysMessage(const char* fmt, ...) -{ - va_list list; - char msg[512]; - - va_start(list, fmt); - vsprintf(msg, fmt, list); - va_end(list); - - if (msg[strlen(msg) - 1] == '\n') - msg[strlen(msg) - 1] = 0; - - // TODO OSX can we use WX MessageBox here or should Cocoa MessageBox used? -} - -static void SysMessage(const wchar_t* fmt, ...) -{ - va_list list; - wchar_t msg[512]; - - va_start(list, fmt); - //vsprintf(msg, fmt, list); - va_end(list); - - // TODO OSX can we use WX MessageBox here or should Cocoa MessageBox used? -} - -static void __forceinline PluginNullConfigure(std::string desc, int& log) -{ - SysMessage("This space is intentionally left blank."); -} - -#define ENTRY_POINT /* We don't need no stinkin' entry point! */ // TODO OSX WTF is this anyway? - - -#else - -#define usleep(x) Sleep(x / 1000) - -#ifndef UNICODE - -static void __forceinline SysMessage(const char* fmt, ...) -{ - va_list list; - char tmp[512]; - va_start(list, fmt); - vsprintf(tmp, fmt, list); - va_end(list); - MessageBox(GetActiveWindow(), tmp, "Message", MB_SETFOREGROUND | MB_OK); -} - -static void __forceinline PluginNullConfigure(std::string desc, s32& log) -{ - /* To do: Write a dialog box that displays a dialog box with the text in desc, - and a check box that says "Logging", checked if log !=0, and set log to - 1 if it is checked on return, and 0 if it isn't. */ - SysMessage("This space is intentionally left blank."); -} - -#else - -static void __forceinline SysMessage(const wchar_t* fmt, ...) -{ - va_list list; - wchar_t tmp[512]; - va_start(list, fmt); - vswprintf(tmp, 512, fmt, list); - va_end(list); - MessageBox(GetActiveWindow(), tmp, L"Message", MB_SETFOREGROUND | MB_OK); -} - -static void __forceinline PluginNullConfigure(std::string desc, s32& log) -{ - /* To do: Write a dialog box that displays a dialog box with the text in desc, - and a check box that says "Logging", checked if log !=0, and set log to - 1 if it is checked on return, and 0 if it isn't. */ - SysMessage(L"This space is intentionally left blank."); -} - -#endif - -#define ENTRY_POINT \ - HINSTANCE hInst; \ - \ - BOOL APIENTRY DllMain(HANDLE hModule, /* DLL INIT*/ \ - DWORD dwReason, \ - LPVOID lpReserved) \ - { \ - hInst = (HINSTANCE)hModule; \ - return TRUE; /* very quick :)*/ \ - } - -#endif -#endif // PS2EEXT_H_INCLUDED diff --git a/common/include/PluginCallbacks.h b/common/include/PluginCallbacks.h deleted file mode 100644 index 8b8634532c..0000000000 --- a/common/include/PluginCallbacks.h +++ /dev/null @@ -1,1424 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2010 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - - -#ifndef __PLUGINCALLBACKS_H__ -#define __PLUGINCALLBACKS_H__ - -// -------------------------------------------------------------------------------------- -// PS2E - Version 2.xx! -// -------------------------------------------------------------------------------------- -// This header file defines the new PS2E interface, which is laid out to be a little more -// efficient and easy to use, and boasts significantly improved APIs over the original -// PS2E v1.xx, which was mostly a series of hacked additions on top of PS1E. In summary: -// this API is designed from the ground up to suit PS2 emulation, instead of being built -// on top of a PS1 API. -// -// Design Philosophies: -// -// 1. Core APIs are established using a pair of DLL/library bindings (one for plugin callbacks -// and one for emulator callbacks), which pass structures of function pointers. -// -// 2. Plugin instance data should be attached to the end of the plugin's callback api -// data structure (see PS2E_ComponentAPI), and the PS2E_ComponentAPI struct is -// passed along with every callback defined in the structure. -// -// 3. All plugin callbacks use __fastcall calling convention (which passes the first -// two parameters int he ECX and EDX registers). Most compilers support this, and -// register parameter passing is actually the standard convention on x86/64. -// -// Rationale: This design improves code generation efficiency, especially when using -// points 2 and 3 together (typically reduces 2 or 3 dereferences to 1 dereference). -// The drawback is that not all compilers support x86/32 __fastcall, and such compilers -// will be unable to create PS2Ev2 plugins. GCC, MSVC, Intel, and Borland (as -// __msfastcall) do support it, and Watcom as well using #pragma aux. Anything else -// we just don't care about. Sorry. ;) -// -// 4. Emulation is restricted to a single instance per-process, which means that use of -// static/global instance variables by plugins is perfectly valid (however discouraged -// due to efficiency reasons, see 2 and 3). -// -// Rationale: Due to complexities in implementing an optimized PS2 emulator (dynamic -// recompilation, memory protection, console pipe management, thread management, etc.) -// it's really just better this way. The drawback is that every geeks' dream of having -// 6 different games emulating at once, with each output texture mapped to the side of -// a rotating cube, will probably never come true. Tsk. -// - -// -------------------------------------------------------------------------------------- -// <<< Important Notes to Plugin Authors >>> -// -------------------------------------------------------------------------------------- -// * C++ only: C++ Exceptions must be confined to your plugin! Exceptions thrown by plugins -// may not be handled correctly if allowed to escape the scope of the plugin, and could -// result in unexpected behavior or odd crashes (this especially true on non-Windows -// operating systems). For C++ plugins this means ensuring that any code that uses -// 'new' or STL containers (string, list, vector, etc) are contained within a try{} -// block, since the STL can throw std::bad_alloc. -// -// * C++ on MSW only: SEH Exceptions must not be swallowed "blindly." In simple terms this -// means do not use these without proper re-throws, as the emulator may rely on SEH -// for either PS2 VM cache validation or thread cancellation: -// - catch(...) -// - __except(EXCEPTION_EXECUTE_HANDLER) -// -// * Many callbacks are optional, and have been marked as such. Any optional callback can be -// left NULL. Any callback not marked optional and left NULL will cause the emulator to -// invalidate the plugin on either enumeration or initialization. -// - -// -------------------------------------------------------------------------------------- -// <<< Important Notes to All Developers >>> -// -------------------------------------------------------------------------------------- -// * Callback APIs cannot involve LIB-C or STL objects (such as FILE or std::string). The -// internal layout of these structures can vary between versions of GLIB-C / MSVCRT, and -// in the case of STL and other C++ objects, can vary based on seemingly mundane compiler -// switches. -// -// * Callback APIs cannot alloc/free memory across dynamic library boundaries. An object -// allocated by a plugin must be freed by that plugin, and cannot be freed by the emu. -// -// * C++ exception handling cannot be used by either plugin callbacks or emulator callbacks. -// This includes the emulator's Console callbacks, for example, since the nature of C++ -// ID-based RTTI could cause a C++ plugin with its own catch handlers to catch exceptions -// of mismatched types from the emulator. -// -// * Addendum to Exception Handling: On most OS's, pthreads relies on C++ exceptions to -// cancel threads. On Windows, this uses SEH so it works safely even across plugin stack -// frames. On all other non-MSW platforms pthreads cancelation *must* be disabled in -// both emulator and plugin except for a single explicit cancelation point (usually -// provided during vsync). -// -// * If following all these rules, then it shouldn't matter if you mix debug/release builds -// of plugins, SEH options (however it's recommended to ALWAYS have SEH enabled, as it -// hardly has any impact on performance on modern CPUs), compile with different versions -// of your MSVC/GCC compiler, or use different versions of LibC or MSVCRT. :) - - -#ifndef BOOL -typedef int BOOL; -#endif - -// -------------------------------------------------------------------------------------- -// PS2E_HWND - OS-independent window handle -// -------------------------------------------------------------------------------------- -// HWND is our only operating system dependent type. For it to be defined as accurately -// as possible, this header file needs to be included after whatever window/GUI platform -// headers you need (wxWidgets, Windows.h, GTK, etc). -// -// We could be lazy with this typedef, because window handles are always a (void*) on all -// platforms that matter to us (windows, gtk, OSX). But Windows has some type strictness -// on its HWND define that could be useful, and well it's probably good practice to use -// platform available defines when they exist. -// -#if defined(_WX_DEFS_H_) -typedef WXWidget PS2E_HWND; -#elif defined(_WINDEF_) -// For Windows let's use HWND, since it has some type strictness applied to it. -typedef HWND PS2E_HWND; -#else -// Unsupported platform... use void* as a best guess. Should work fine for almost -// any GUI platform, and certainly works for any currently supported one. -typedef void *PS2E_HWND; -#endif - -// -------------------------------------------------------------------------------------- -// PS2E_THISPTR - (ps2 component scope 'this' object pointer type) -// -------------------------------------------------------------------------------------- -// This macro provides C++ plugin authors with a reasonably friendly way to automatically -// typecast the session objects for your plugin to your internal type. Just #define -// PS2E_THISPTR to your internal structure type prior to loading this header file, and all -// APIs will assume your struct type in their signature. Since all pointer types are inter- -// changeable, plugin APIs will retain full compatibility as long as PS2E_THISPTR is a -// pointer type. -// -#ifndef PS2E_THISPTR -#define PS2E_THISPTR struct _PS2E_ComponentAPI * -#else -// Ensure the user's defined PS2E_THISPTR retains the correct signature for our -// plugin API. -static_assert(sizeof(PS2E_THISPTR) == sizeof(void *), "Incorrect signature for PS2E_THISPTR"); -#endif - -// PS2E_LIB_THISPTR - (library scope version of PS2E_THISPTR) -#ifndef PS2E_LIB_THISPTR -#define PS2E_LIB_THISPTR void * -#else -// Ensure the user's defined PS2E_THISPTR retains the correct signature for our -// plugin API. -static_assert(sizeof(PS2E_LIB_THISPTR) == sizeof(void *), "Incorrect signature for PS2E_LIB_THISPTR"); -#endif - -// Use fastcall by default, since under most circumstances the object-model approach of the -// API will benefit considerably from it. (Yes, this means that compilers that do not -// support fastcall are basically unusable for plugin creation. Too bad. :p -#define PS2E_CALLBACK __fastcall - - -#ifndef __cplusplus -extern "C" { -#endif - -// ------------------------------------------------------------------------------------ -// Plugin Type / Version Enumerations -// ------------------------------------------------------------------------------------ - -enum PS2E_ComponentTypes { - PS2E_TYPE_GS = 0, - PS2E_TYPE_SIO, - PS2E_TYPE_Mcd, -}; - -enum PluginLibVersion { - PS2E_VER_GS = 0x1000, - PS2E_VER_SIO = 0x1000 -}; - -enum OSDIconTypes { - OSD_Icon_None = 0, - OSD_Icon_Error, - OSD_Icon_Notice, // An exclamation point maybe? - - // [TODO] -- dunno. What else? - - // Emulators implementing their own custom non-standard icon extensions should do so - // somewhere after OSD_Icon_ReserveEnd. All values below this are reserved. - // . - // . - // . - OSD_Icon_ReserveEnd = 0x1000 -}; - -enum PS2E_MenuItemStyle { - MenuType_Normal = 0, - MenuType_Checked, - MenuType_Radio, - MenuType_Separator -}; - -typedef void *PS2E_MenuHandle; -typedef void *PS2E_MenuItemHandle; -typedef void PS2E_CALLBACK PS2E_OnMenuItemClicked(PS2E_THISPTR *thisptr, void *userptr); - -// -------------------------------------------------------------------------------------- -// PS2E_ConsoleWriterAPI -// -------------------------------------------------------------------------------------- -// APIs for writing text to the console. Typically the emulator will write the text to -// both a console window and to a disk file, however actual implementation is up to the -// emulator. All text must be either 7-bit ASCII or UTF8 encoded. Other codepages or -// MBCS encodings will not be displayed properly. -// -// Standard streams STDIO and STDERR can be used instead, however there is no guarantee -// that they will be handled in a convenient fashion. Different platforms and operating -// systems have different methods of standard stream pipes, which is why the ConsoleWriter -// API has been exposed to plugins. -// -// Development Notes: -// 'char' was chosen over 'wchar_t' because 'wchar_t' is a very loosely defined type that -// can vary greatly between compilers (it can be as small as 8 bits and as large as a -// compiler wants it to be). Because of this we can't even make assumptions about its -// size within the context of a single operating system; so it just won't do. Just make -// sure everything going into the function is UTF8 encoded and all is find. -// -typedef struct _PS2E_ConsoleWriterAPI -{ - // Writes text to console; no newline is appended. - void(PS2E_CALLBACK *Write)(const char *fmt, ...); - - // Appends an automatic newline to the specified formatted output. - void(PS2E_CALLBACK *WriteLn)(const char *fmt, ...); - - // This function always appends a newline. - void(PS2E_CALLBACK *Error)(const char *fmt, ...); - - // This function always appends a newline. - void(PS2E_CALLBACK *Warning)(const char *fmt, ...); - - void *reserved[4]; - -} PS2E_ConsoleWriterAPI; - -// -------------------------------------------------------------------------------------- -// PS2E_ConsoleWriterWideAPI -// -------------------------------------------------------------------------------------- -// This is the wide character version of the ConsoleWriter APi. Please see the description -// of PS2E_ConsoleWriterAPI for details. -// -// Important Usage Note to Plugin Authors: -// Before using the functions in this structure, you *must* confirm that the emulator's -// size of wchar_t matches the size provided by your own compiler. The size of wchar_t -// is provided in the PS2E_EmulatorInfo struct. -// -typedef struct _PS2E_ConsoleWriterWideAPI -{ - // Writes text to console; no newline is appended. - void(PS2E_CALLBACK *Write)(const wchar_t *fmt, ...); - - // Appends an automatic newline to the specified formatted output. - void(PS2E_CALLBACK *WriteLn)(const wchar_t *fmt, ...); - - // This function always appends a newline. - void(PS2E_CALLBACK *Error)(const wchar_t *fmt, ...); - - // This function always appends a newline. - void(PS2E_CALLBACK *Warning)(const wchar_t *fmt, ...); - - void *reserved[4]; - -} PS2E_ConsoleWriterWideAPI; - - -// -------------------------------------------------------------------------------------- -// PS2E_Image -// -------------------------------------------------------------------------------------- -// Simple RGBA image data container, for passing surface textures to the GS plugin, and -// for receiving snapshots from the GS plugin. -// -// fixme - this might be more ideal as BGRA or ABGR format on Windows platforms? -// -typedef struct _PS2E_Image -{ - u32 width; - u32 height; - u8 *data; // RGBA data. top to bottom. - -} PS2E_Image; - -// -------------------------------------------------------------------------------------- -// PS2E_MenuItemInfo -// -------------------------------------------------------------------------------------- -typedef struct _PS2E_MenuItemInfo -{ - const char *LabelText; - const char *HelpText; - - // Optional image displayed with the menu option. The emulator may not support - // this option, or may choose to ignore or resize the image if the size parameters - // are outside a valid threshold. - const PS2E_Image *Image; - - // Specifies the style of the menu, either Normal, Checked, Radio, or Separator. - // This option is overridden if the SubMenu field is non-NULL (in such case the - // menu assumes submenu mode). - PS2E_MenuItemStyle Style; - - // Specifies the handle of a sub menu to bind to this menu. If NULL, the menu is - // created normally. If non-NULL, the menu item will use sub-menu mode and will - // ignore the Style field. - PS2E_MenuHandle SubMenu; - - // Menu that this item is attached to. When this struct is passed into AddMenuItem, - // the menu item will be automatically appended to the menu specified in this field - // if the field is non-NULL (if the field is NULL, then no action is taken). - PS2E_MenuHandle OwnerMenu; - - // When FALSE the menu item will appear grayed out to the user, and unselectable. - BOOL Enabled; - - // Optional user data pointer (or typecast integer value) - void *UserPtr; - - // Callback issued when the menu is clicked/activated. If NULL, the menu will be - // disabled (grayed). - PS2E_OnMenuItemClicked *OnClicked; - -} PS2E_MenuItemInfo; - -// -------------------------------------------------------------------------------------- -// PS2E_MenuItemAPI -// -------------------------------------------------------------------------------------- -typedef struct _PS2E_MenuItemAPI -{ - // Allocates a new MenuItem and returns its handle. The returned item can be added to any - // menu. - PS2E_MenuItemHandle(PS2E_CALLBACK *MenuItem_Create)(PS2E_THISPTR thisptr); - - // Deletes the menu item and frees allocated resources. The menu item will be removed from - // whatever menu it is attached to. If the menu item has a SubMenu, the SubMenu is not - // deleted. - void(PS2E_CALLBACK *MenuItem_Delete)(PS2E_MenuItemHandle mitem); - - // (Re-)Assigns all properties for a menu. Assignment generally takes effect immediately. - void(PS2E_CALLBACK *MenuItem_SetEverything)(PS2E_MenuItemHandle mitem, const PS2E_MenuItemInfo *info); - - // Sets the text label of a menu item. - void(PS2E_CALLBACK *MenuItem_SetText)(PS2E_MenuItemHandle mitem, const char *text); - - // Assigns the help text for a menu item. This text is typically shown in a status - // bar at the bottom of the current window. This value may be ignored if the emu - // interface does not have a context for help text. - void(PS2E_CALLBACK *MenuItem_SetHelpText)(PS2E_MenuItemHandle mitem, const char *helptxt); - - // Gives the menu item an accompanying image (orientation of the image may depend - // on the operating system platform). - void(PS2E_CALLBACK *MenuItem_SetImage)(PS2E_MenuItemHandle mitem, const PS2E_Image *image); - - // Gives the menu item an accompanying image (orientation of the image may depend - // on the operating system platform). - // - // Returns: - // TRUE if the image was loaded successfully, or FALSE if the image was not found, - // could not be opened, or the image data is invalid (not a PNG, or data corrupted). - BOOL(PS2E_CALLBACK *MenuItem_SetImagePng_FromFile) - (PS2E_MenuItemHandle mitem, const char *filename); - - // Gives the menu item an accompanying image (orientation of the image may depend on - // the operating system platform). Image is loaded from memory using a memory stream - // reader. This method is useful for loading image data embedded into the dll. - // - // Returns: - // TRUE if the image was loaded successfully, or FALSE if the image data is invalid - // (not a PNG, or data corrupted). - BOOL(PS2E_CALLBACK *MenuItem_SetImagePng_FromMemory) - (PS2E_MenuItemHandle mitem, const u8 *data); - - // Assigns the menu item's style. - void(PS2E_CALLBACK *MenuItem_SetStyle)(PS2E_MenuItemHandle mitem, PS2E_MenuItemStyle style); - - // Assigns a pointer value that the plugin can use to attach user-defined data to - // specific menu items. The value can be any integer typecast if you don't actually - // need more than an integers worth of data. - void(PS2E_CALLBACK *MenuItem_SetUserData)(PS2E_MenuItemHandle mitem, void *dataptr); - - // Assigns a submenu to the menu item, causing it to open the sub menu in cascade - // fashion. When a submenu is assigned, the Style attribute of the menu will be - // ignored. Passing NULL into this function will clear the submenu and return the - // menu item to whatever its current Style attribute is set to. - void(PS2E_CALLBACK *MenuItem_SetSubMenu)(PS2E_MenuItemHandle mitem, PS2E_MenuHandle submenu); - - // Assigns the callback function for this menu (important!). If passed NULL, the menu - // item will be automatically disabled (grayed out) by the emulator. - void(PS2E_CALLBACK *MenuItem_SetCallback)(PS2E_MenuItemHandle mitem, PS2E_OnMenuItemClicked *onClickedCallback); - - // Assigns the enabled status of a MenuItem. Use FALSE to gray out the menuitem option. - void(PS2E_CALLBACK *MenuItem_Enable)(PS2E_MenuItemHandle mitem, BOOL enable); - - // Returns the current enable status of the specified menu item. - BOOL(PS2E_CALLBACK *MenuItem_IsEnabled) - (PS2E_MenuItemHandle mitem); - - void *reserved[4]; - -} PS2E_MenuItemAPI; - -// -------------------------------------------------------------------------------------- -// PS2E_VersionInfo -// -------------------------------------------------------------------------------------- -// This structure is populated by the plugin via the PS2E_PluginLibAPI::GetVersion() -// callback. Specify -1 for any Version or Revision to disable/ignore it. The emulator -// will not factor that info into the display name of the plugin. -// -typedef struct _PS2E_VersionInfo -{ - // Low/Mid/High versions combine to form a number in the format of: 2.3.1 - // ... where 2 is the high version, 3 mid, and 1 low. - s16 VersionHigh; - s16 VersionMid; - s16 VersionLow; - - // Revision typically refers a revision control system (such as SVN). When displayed - // by the emulator it will have an 'r' prefixed before it. - s64 Revision; - -} PS2E_VersionInfo; - -// -------------------------------------------------------------------------------------- -// PS2E_SessionInfo -// -------------------------------------------------------------------------------------- -// This struct is populated by the emulator prior to starting emulation, and is passed to -// each plugin via a call to PS2E_PluginLibAPI::EmuOpen(). -// -typedef struct _PS2E_SessionInfo -{ - PS2E_HWND window; - - u32 *CycleEE; // current EE cycle count - u32 *CycleIOP; // current IOP cycle count - - u32 ElfCRC; // CRC of the ELF header for this app/game - - // Sony's assigned serial number, valid only for CD/CDVD games (ASCII-Z string). - // Ex: SLUS-2932 - // - // (if the running app is not a sony-registered game, the serial will be a zero - // length string). - char Serial[16]; - -} PS2E_SessionInfo; - -// -------------------------------------------------------------------------------------- -// PS2E_EmulatorInfo -// -------------------------------------------------------------------------------------- -// This struct is populated by the emulator when the application is started, and is passed -// to plugins via PS2E_InitAPI. Plugins may optionally use this information to determine -// compatibility or to select which special CPU-oriented builds and/or functions to bind -// to callbacks. -// -// The GetInt/GetBoolean/GetString/etc methods Provide an interface through which a plugin -// can retrieve special emulator-specific settings and information, or fetch options straight -// from the emulator's ini file itself. These are intended for advanced plugin/emu binding -// only, and should generally be accompanied with the appropriate version/name checks. -// -// Emulators may implement this as a direct match to the emu's ini file/registry contents -// (recommended), or may provide additional and/or alternative custom strings. Direct -// ini.registry relationships are preferred since those are easy for a plugin author to -// reference without documentation. -// -typedef struct _PS2E_EmulatorInfo -{ - // Brief name of the emulator (ex: "PCSX2") [required] - // Depending on the design of the emulator, this string may optionally include version - // information, however that is not recommended since it can inhibit backward support. - const char *EmuName; - - // Version information. All fields besides the emulator's name are optional. - PS2E_VersionInfo EmuVersion; - - // Number of Physical Cores, as detected by the emulator. - // This should always match the real # of cores supported by hardware. - int PhysicalCores; - - // Number of Logical Cores, as detected and/or managed by the emulator. - // This is not necessarily a reflection of real hardware capabilities. The emu reserves - // the right to report this value as it deems appropriate, in management of threading - // resources. - int LogicalCores; - - // Specifies the size of the wchar_t of the emulator, in bytes. Plugin authors should be - // sure to check this against your own sizeof(wchar_t) before using any API that has - // a wchar_t parameter (such as the ConsoleWriterWide interface). wchar_t is a loosely - // defined type that can range from 8 bits to 32 bits (realistically, although there is - // no actual limit on size), and can vary between compilers for the same platform. - int Sizeof_wchar_t; - - - // Reserved area for future expansion of the structure (avoids having to upgrade the - // plugin api for amending new extensions). - int reserved1[6]; - - // GetInt - // Self-explanatory. - // - // Returns: - // 0 - Value was retrieved successfully. - // 1 - Unknown value. Contents of dest are unchanged. - BOOL(PS2E_CALLBACK *GetInt) - (const char *name, int *dest); - - // GetBoolean - // Assigns *dest either 1 (true) or 0 (false). Note to Emulators: Returning any non- - // zero value for true probably "works" but is not recommended, since C/C++ standard - // specifically defines the result of bool->int conversions as a 0 or 1 result. - // - // Returns: - // 0 - Value was retrieved successfully. - // 1 - Unknown value. Contents of dest are unchanged. - BOOL(PS2E_CALLBACK *GetBoolean) - (const char *name, BOOL *result); - - // GetString - // Copies an ASCII-Z string into the dest pointer, to max length allowed. The result - // is always safely zero-terminated (none of that snprintf crap where you have to - // zero-terminate yourself >_<). - // - // Returns: - // 0 - Value was retrieved successfully. - // 1 - Unknown value. Contents of dest are unchanged. - BOOL(PS2E_CALLBACK *GetString) - (const char *name, char *dest, int maxlen); - - // GetStringAlloc - // Provides an alternative to GetString, that can retrieve strings of arbitrary length. - // The plugin must provide a valid allocator callback, which takes a size parameter and - // returns a pointer to an allocation large enough to hold the size. - // - // It is then the responsibility of the plugin to free the allocated pointer when it - // is done with it. - // - char *(PS2E_CALLBACK *GetStringAlloc)(const char *name, void *(PS2E_CALLBACK *allocator)(int size)); - - // OSD_WriteLn - // This function allows the plugin to post messages to the emulator's On-Screen Display. - // The OSD message will be displayed with the specified icon (optional) for the duration - // of a few seconds, or until other messages have scrolled it out of view. - // Implementation of the OSD is emulator specific, and there is no guarantee that the - // OSD will be honored at all. If the emulator does not support OSD then this function - // call is treated as a NOP. - // - // Typically a plugin author should only use the OSD for infrequent notices that are - // potentially useful to users playing games (particularly at fullscreen). Trouble- - // shooting and debug information is best dumped to console or to disk log, or displayed - // using a native popup window managed by the plugin. - // - // Parameters: - // icon - an icon identifier, typically from the PS2E_OSDIconTypes enumeration. Specific - // versions of emulators may provide their own icon extensions. The emulator will - // silently ignore unrecognized icon identifiers, thus retaining cross-compat. - // - // msg - string message displayed to the user. - // - void(PS2E_CALLBACK *OSD_WriteLn)(int icon, const char *msg); - - // ---------------------------------------------------------------------------- - // Menu / MenuItem Section - // ---------------------------------------------------------------------------- - - void(PS2E_CALLBACK *AddMenuItem)(const PS2E_MenuItemInfo *item); - - // Allocates a new menu handle and returns it. The returned menu can have any valid existing - // menu items bound to it, and can be assigned as a submenu to any created MenuItem. The menu - // can belong to multiple menu items, however menu items can only belong to a single menu. - PS2E_MenuHandle(PS2E_CALLBACK *Menu_Create)(PS2E_THISPTR thisptr); - - // Deletes the specified menu and frees its allocated memory resources. NULL pointers are - // safely ignored. Any menu items also attached to this menu will be deleted. Even if you - // do not explicitly delete your plugin's menu resources, the emulator will do automatic - // cleanup after the plugin's instance is freed. - void(PS2E_CALLBACK *Menu_Delete)(PS2E_MenuHandle handle); - - // Adds the specified menu item to this menu. Menu items can only belong to one menu at a - // time. If you assign an item to a created menu that already belongs to another menu, it - // will be removed from the other menu and moved to this one. To append a menu item to - // multiple menus, you will need to create multiple instances of the item. - void(PS2E_CALLBACK *Menu_AddItem)(PS2E_MenuHandle menu, PS2E_MenuItemHandle mitem); - - // Interface for creating menu items and modifying their properties. - PS2E_MenuItemAPI MenuItem; - - // Provides a set of basic console functions for writing text to the emulator's - // console. Some emulators may not support a console, in which case these functions - // will be NOPs. For plain and simple to-disk logging, plugins should create and use - // their own logging facilities. - PS2E_ConsoleWriterAPI Console; - - // Optional wide-version of the Console API. Use with caution -- wchar_t is platform and - // compiler dependent, and so plugin authors should be sure to check the emulator's wchar_t - // side before using this interface. See PS2E_ConsoleWriterWideAPI comments for more info. - PS2E_ConsoleWriterWideAPI ConsoleW; - - void *reserved2[8]; - -} PS2E_EmulatorInfo; - - -// -------------------------------------------------------------------------------------- -// PS2E_FreezeData -// -------------------------------------------------------------------------------------- -// Structure used to pass savestate info between emulator and plugin. -// -typedef struct _PS2E_FreezeData -{ - u32 Size; // size of the data being frozen or thawed. This value is allowed to be changed by Freeze(). - void *Data; // pointer to the data target (freeze) or source (thaw) - -} PS2E_FreezeData; - - -// -------------------------------------------------------------------------------------- -// PS2E_ComponentAPI -// -------------------------------------------------------------------------------------- -// The PluginTypeAPI is provided for every PS2 component plugin (see PS2E_ComponentTypes -// enumeration). For typical dlls which only provide one plugin type of functionality, -// the plugin only needs one instance of this struct. For multi-type plugins, for example -// a plugin that supports both DEV9 and FW together, an interface must be provided for -// each component supported. -// -// These are functions provided to the PS2 emulator from the plugin. The emulator will -// call these functions and expect the plugin to perform defined tasks. -// -typedef struct _PS2E_ComponentAPI -{ - // EmuOpen - // This function is called by the emulator when an emulation session is started. The - // plugin should take this opportunity to bind itself to the given window handle, open - // necessary audio/video/input devices, etc. - // - // Parameters: - // session - provides relevant emulation session information. Provided pointer is - // valid until after the subsequent call to EmuClose() - // - // Threading: EmuOpen is called from the GUI thread. All other emulation threads are - // guaranteed to be suspended or closed at the time of this call (no locks required). - // - void(PS2E_CALLBACK *EmuOpen)(PS2E_THISPTR thisptr, const PS2E_SessionInfo *session); - - // EmuClose - // This function is called by the emulator prior to stopping emulation. The window - // handle specified in EmuOpen is guaranteed to be valid at the time EmuClose is called, - // and the plugin should unload/unbind all window dependencies at this time. - // - // Threading: EmuClose is called from the GUI thread. All other emulation threads are - // guaranteed to be suspended or closed at the time of this call (no locks required). - // - void(PS2E_CALLBACK *EmuClose)(PS2E_THISPTR thisptr); - - // CalcFreezeSize - // This function should calculate and return the amount of memory needed for the plugin - // to freeze its complete emulation state. The value can be larger than the required - // amount of space, but cannot be smaller. - // - // The emulation state when this function is called is guaranteed to be the same as - // the following call to Freeze. - // - // Thread Safety: - // May be called from any thread (GUI, Emu, GS, Unknown, etc). - // All Emulation threads are halted at a PS2 logical vsync-end event. - // No locking is necessary. - u32(PS2E_CALLBACK *CalcFreezeSize)(PS2E_THISPTR thisptr); - - // Freeze - // This function should make a complete copy of the plugin's emulation state into the - // provided dest->Data pointer. The plugin is allowed to reduce the dest->Size value - // but is not allowed to make it larger. The plugin will only receive calls to Freeze - // and Thaw while a plugin is in an EmuOpen() state. - // - // Parameters: - // dest - a pointer to the Data/Size destination buffer (never NULL). - // - // Thread Safety: - // May be called from any thread (GUI, Emu, GS, Unknown, etc). - // All Emulation threads are halted at a PS2 logical vsync-end event. - // No locking is necessary. - void(PS2E_CALLBACK *Freeze)(PS2E_THISPTR thisptr, PS2E_FreezeData *dest); - - // Thaw - // Plugin should restore a complete emulation state from the given FreezeData. The - // plugin will only receive calls to Freeze and Thaw while a plugin is in an EmuOpen() - // state. - // - // Thread Safety: - // May be called from any thread (GUI, Emu, GS, Unknown, etc). - // All Emulation threads are halted at a PS2 logical vsync-end event. - // No locking is necessary. - void(PS2E_CALLBACK *Thaw)(PS2E_THISPTR thisptr, const PS2E_FreezeData *src); - - // Configure - // The plugin should open a modal dialog box with plugin-specific settings and prop- - // erties. This function can be NULL, in which case the user's Configure option for - // this plugin is grayed out. - // - // All emulation is suspended and the plugin's state is saved to memory prior to this - // function being called. Configure is only called outside the context of EmuOpen() - // (after a call to EmuClose()). - // - // Plugin authors should ensure to re-read and re-apply all settings on EmuOpen(), - // which will ensure that any user changes will be applied immediately. For changes - // that can be applied without emulation suspension, see/use the GUI extensions for - // menu and toolbar shortcuts. - // - // Thread Safety: - // Always called from the GUI thread, with emulation in a halted state (no locks - // needed). - void(PS2E_CALLBACK *Configure)(PS2E_THISPTR thisptr); - - // GetLastError - // This is an optional method with allows the emulator to retrieve extended formatted - // error information about a recent failed plugin call. If implemented by the plugin, - // it should store message information in it's PS2E_THISPTR allocation, and free the - // string buffers when the plugin's instance is deleted. - // - // The plugin is allowed to return NULL for either msg_diag or msg_user (or both). - // Returned pointers should be static global arrays, and must be NULL terminated. If - // only one message is provided, it will be used for both console log and popup. - // - // Parameters: - // msg_diag - diagnostic message, which is english only and typically intended for - // console or disk logging. - // - // msg_user - optional translated user message, which is displayed as a popup to explain - // to the user why the plugin failed to initialize. - // - // Thread safety: - // * Thread Affinity: none. May be called from any thread. - // * Interlocking: Instance. All calls from the emu are fully interlocked against - // the plugin instance. - // - void(PS2E_CALLBACK *GetLastError)(PS2E_THISPTR thisptr, char *const *msg_diag, wchar_t *const *msg_user); - - // Reserved area at the end of the structure, for future API expansion. - void *reserved[8]; - -} PS2E_ComponentAPI; - - -// -------------------------------------------------------------------------------------- -// PS2E_LibraryAPI -// -------------------------------------------------------------------------------------- -// The LibraryAPI is an overall library-scope set of functions that perform basic Init, -// Shutdown, and global configuration operations. -// -// These are functions provided to the PS2 emulator from the plugin. The emulator will -// call these functions and expect the plugin to perform defined tasks. -// -// Threading: -// - get* callbacks in this struct are not bound to any particular thread. Implementations -// should not assume any specific thread affinity. -// -// - set* callbacks in this struct are bound to the GUI thread of the emulator, and will -// always be invoked from that thread. -// -typedef struct _PS2E_LibraryAPI -{ - // GetName - // Returns an ASCII-Z (zero-terminated) string name of the plugin. The name should - // *not* include version or build information. That info is returned separately - // via GetVersion. The return value cannot be NULL (if it is NULL, the emulator - // will assume the DLL is invalid and ignore it). - // - // The pointer should reference a static/global scope char array, or an allocated - // heap pointer (not recommended). - // - // This function may be called multiple times by the emulator, so it should accommodate - // for such if it performs heap allocations or other initialization procedures. - const char *(PS2E_CALLBACK *GetName)(); - - // GetVersion - // This function returns name and version information for the requested PS2 component. - // If the plugin does not support the requested component, it should return NULL. - // The returned pointer, if non-NULL, must be either a static value [recommended] or a - // heap-allocated value, and valid for the lifetime of the plugin. - // - // This function may be called multiple times by the emulator, so it should accommodate - // for such if it performs heap allocations or other initialization procedures. - // - // Typically a plugin will return the same version for all supported components. The - // component parameter is mostly provided to allow this function to serve a dual purpose - // of both component versioning and as a component enumerator. - // - // See PS2E_VersionInfo for more details. - // - // Parameters: - // component - indicates the ps2 component plugin to be versioned. If the plugin - // does not support the requested component, the function should return NULL. - // - const PS2E_VersionInfo *(PS2E_CALLBACK *GetVersion)(u32 component); - - // Test - // Called by the plugin enumerator to check the hardware availability of the specified - // component. The function should return 1 if the plugin appears to be supported, or - // 0 if the test failed. - // - // While a plugin is welcome to use its own CPU capabilities information, it is recommended - // that you use the emulator provided CPU capabilities structure instead. The emulator may - // have provisions in its interface to allow for the forced disabling of extended CPU cap- - // abilities, for testing purposes. - // - BOOL(PS2E_CALLBACK *Test) - (u32 component, const PS2E_EmulatorInfo *xinfo); - - // NewComponentInstance - // The emulator calls this function to fetch the API for the requested component. - // The plugin is expected to perform an "availability test" (the same test as performed - // by Test()) and return NULL if the plugin does not support the host machine's hardware - // or software installations. - // - // This function is only called for components which the plugin returned a non-NULL - // version information struct for in GetVersion(). - // - // Plugin Allocation Strategy: - // The Component API has been designed with function invocation efficiency in mind. - // To allocate your plugin's component instance you should create a structure that - // contains PS2E_ComponentAPI_* as the first member (where * refers to the PS2 - // component type), and plugin-specific instance data is stored as any number of - // subsequent members in the struct. - // - // Parameters: - // component - indicates the ps2 component API to return. - // dest - structure to fill with plugin function implementations. Dest should - // be manually typecast by the plugin to match the requested component. - // - // OnError: - // Plugins may optionally prepare more detailed information on why the plugin failed - // it's availability test which the emu can request via GetLastError. - // - PS2E_THISPTR(PS2E_CALLBACK *NewComponentInstance) - (u32 component); - - // DeleteComponentInstance - // Called by the emulator when the plugin component is to be shutdown. The component API - // instance pointer can be safely deleted here. - void(PS2E_CALLBACK *DeleteComponentInstance)(PS2E_THISPTR instance); - - // SetSettingsFolder - // Callback is passed an ASCII-Z string representing the folder where the emulator's - // settings files are stored (may either be under the user's documents folder, or a - // location relative to the CWD of the emu application). - // - // Typically this callback is only issued once per plugin session, aand prior to the - // opening of any PS2 components. It is the responsibility of the emu to save the - // emulation state, shutdown plugins, and restart everything anew from the new settings - // in such an event as a dynamic change of the settings folder. - // - void(PS2E_CALLBACK *SetSettingsFolder)(const char *folder); - - // SetLogFolder - // This callback may be issued at any time. It is the responsibility of the plugin - // to do the necessary actions to close existing disk logging facilities and re-open - // new facilities. - // - // Thread Safety: - // This function is always called from the GUI thread. All emulation threads are - // suspended during the call, so no locking is required. - // - void(PS2E_CALLBACK *SetLogFolder)(const char *folder); - - // Reserved area at the end of the structure, for future API expansion. This area - // should always be zeroed out, so that future versions of emulators that may have - // defined functions here will recognize the functions as not supported by the plugin. - void *reserved[12]; - -} PS2E_LibraryAPI; - -// -------------------------------------------------------------------------------------- -// PS2E_ComponentAPI_GS -// -------------------------------------------------------------------------------------- -// Thread Safety: -// Most GS callbacks are issued from the GS thread only, and are always called synchronously -// with all other component API functions. No locks are needed, and DirectX-based GS -// plugins can safely disable DX multithreading support for speedup (unless the plugin -// utilizes multiple threads of its own internally). -// -typedef struct _PS2E_ComponentAPI_GS -{ - // Base Component API (inherited structure) - struct _PS2E_ComponentAPI Base; - - // SetSnapshotsFolder - // Callback is passed an ASCII-Z string representing the folder where the emulator's - // snapshots are to be saved (typically located under user documents, but may be CWD - // or any user-specified location). - // - // Thread Safety: - // This function may be called from either GUI thread or GS thread. Emulators calling - // it from non-GS threads must ensure mutex locking with TakeSnapshot (meaning the - // plugin should be free to disregard threading concerns). - void(PS2E_CALLBACK *GsSetSnapshotsFolder)(PS2E_THISPTR thisptr, const char *folder); - - // TakeSnapshot - // The GS plugin is to save the current frame into the given target image. This - // function is always called immediately after a GSvsync(), ensuring that the current - // framebuffer is safely intact for capture. - // - // Returns TRUE if the snapshot succeeded, or FALSE if it failed (contents of dest - // are considered indeterminate and will be ignored by the emu). - BOOL(PS2E_CALLBACK *GsTakeSnapshot) - (PS2E_THISPTR thisptr, PS2E_Image *dest); - - // OSD_QueueMessage - // Queues a message to the GS for display to the user. The GS can print the message - // where-ever it pleases, though it's suggested that the messages be printed either - // near the top or the bottom of the window (and in the black/empty area if the - // game's display is letterboxed). - // - // Parameters: - // message - text to queue (UTF8 format); will always be a single line (emulator - // is responsible for pre-processing linebreaks into multiple messages). The pointer - // will become invalid after this call retunrs, so be sure to make a local copy of the - // text. - // - // timeout - Suggested timeout period, in milliseconds. This is a hint and need - // not be strictly adhered to by the GS. - // - void(PS2E_CALLBACK *OSD_QueueMessage)(PS2E_THISPTR thisptr, const char *msg, int timeout); - - // OSD_IconStatus - // Sets the visibility status of an icon. Icon placement can be determined by the GS, - // although it's recommended that the icon be displayed near a corner of the screen, and - // be displayed in the empty/black areas if present (letterboxing). - // - // Parameters: - // iconId - Icon status to change - // alpha - 0.0 is hdden, 1.0 is visible. Other alpha values may be used as either - // transparency or as a scrolling factor (ie, to scroll the icon in and out of view, in - // any way the GS plugin sees fit). - void(PS2E_CALLBACK *OSD_IconStatus)(PS2E_THISPTR thisptr, OSDIconTypes iconId, float alpha); - - // GSvsync - // - // Returns FALSE if the plugin encountered a critical error while updating the display; - // indicating a device or emulation failure that should terminate the current emulation. - // (if any critical errors accumulated during GStransferTags or GStransferImage, they - // should also be handled here by returning FALSE) - // - BOOL(PS2E_CALLBACK *GsVsync) - (int field); - - // GSwriteRegs - // Sends a GIFtag and associated register data. This is the main transfer method for all - // GIF register data. REGLIST mode is unpacked into the forat described below. - // - // Note that SIGNAL, FINISH, and LABEL tags are handled internally by the emulator in a - // thread-safe manner -- the GS plugin should ignore those tags when processing. - // - // Returns FALSE if the plugin encountered a critical error while setting texture; - // indicating a device failure. - // - // Parameters: - // pMem - pointer to source memory for the register descriptors and register data. - // The first 128 bits (1 qwc) is the descriptors unrolled into 16x8 format. The - // following data is (regcnt x tagcnt) QWCs in length. - // - // regcnt - number of registers per loop packet (register descriptors are filled - // low->high). Valid range is 1->16, and will never be zero. - // - // nloop - number of loops of register data. Valid range is 1->32767 (upper 17 - // bits are always zero). This value will never be zero. - void(PS2E_CALLBACK *GsWriteRegs)(const u128 *pMem, int regcnt, int nloop); - - // GSwritePrim - // Starts a new prim by sending the specified value to the PRIM register. The emulator - // only posts this data to the GS s per the rules of GIFpath processing (note however - // that packed register data can also contain PRIM writes). - // - // Parameters: - // primData - value to write to the PRIM register. Only the bottom 10 bits are - // valid. Upper bits are always zero. - void(PS2E_CALLBACK *GsWritePrim)(int primData); - - // GSwriteImage - // Uploads new image data. Data uploaded may be in any number of partial chunks, for - // which the GS is responsible for managing the state machine for writes to GS memory. - // - // Plugin authors: Note that it is valid for games to only modify a small portion of a - // larger texture buffer, or for games to modify several portions of a single large - // buffer, by using mid-transfer writes to TRXPOS and TRXDIR (TRXPOS writes only become - // effective once TRXDIR has been written). - void(PS2E_CALLBACK *GsWriteImage)(const u128 *pMem, int qwc_cnt); - - // GSreadImage - // This special callback is for implementing the Read mode direction of the GIFpath. - // The GS plugin writes the texture data as requested by it's internally managed state - // values for TRXPOS/TRXREG to the buffer provided by pMem. The buffer size is qwc_cnt - // and the GS must not write more than that. - void(PS2E_CALLBACK *GsReadImage)(u128 *pMem, int qwc_cnt); - - void *reserved[8]; - -} PS2E_ComponentAPI_GS; - - -// -------------------------------------------------------------------------------------- -// PS2E_McdSizeInfo -// -------------------------------------------------------------------------------------- -struct PS2E_McdSizeInfo -{ - u16 SectorSize; // Size of each sector, in bytes. (only 512 and 1024 are valid) - u16 EraseBlockSizeInSectors; // Size of the erase block, in sectors (max is 16) - u32 McdSizeInSectors; // Total size of the card, in sectors (no upper limit) - u8 Xor; // Checksum of previous data -}; - -// -------------------------------------------------------------------------------------- -// PS2E_ComponentAPI_Mcd -// -------------------------------------------------------------------------------------- -// Thread Safety: -// * Thread affinity is not guaranteed. Calls may be made from either the main emu thread -// or an IOP child thread (if the emulator uses one). -// -// * No locking required: All calls to the memory cards are interlocked by the emulator. -// -typedef struct _PS2E_ComponentAPI_Mcd -{ - // Base Component API (inherited structure) - struct _PS2E_ComponentAPI Base; - - // McdIsPresent - // Called by the emulator to detect the availability of a memory card. This function - // will be called frequently -- essentially whenever the SIO port for the memory card - // has its status polled - so its overhead should be minimal when possible. - // - // Returns: - // False if the card is not available, or True if it is available. - // - BOOL(PS2E_CALLBACK *McdIsPresent) - (PS2E_THISPTR thisptr, uint port, uint slot); - - // McdGetSectorSize (can be NULL) - // Requests memorycard formatting information from the Mcd provider. See the description of - // PS2E_McdSizeInfo for details on each field. If the Mcd provider supports only standard 8MB - // carts, then this function can be NULL. - // - // Returns: - // Assigned values for memorycard sector size and sector count in 'outways.' - // - void(PS2E_CALLBACK *McdGetSizeInfo)(PS2E_THISPTR thisptr, uint port, uint slot, PS2E_McdSizeInfo *outways); - - // McdIsPSX - // Checks if the memorycard is a PSX one from the Mcd provider. - // - // Returns: - // False: PS2, True: PSX - // - bool(PS2E_CALLBACK *McdIsPSX)(PS2E_THISPTR thisptr, uint port, uint slot); - - // McdRead - // Requests that a block of data be loaded from the memorycard into the specified dest - // buffer (which is allocated by the caller). Bytes read should match the requested - // size. Reads *must* be performed synchronously (function cannot return until the - // read op has finished). - // - // Returns: - // False on failure, and True on success. Emulator may use GetLastError to retrieve additional - // information for logging or displaying to the user. - // - BOOL(PS2E_CALLBACK *McdRead) - (PS2E_THISPTR thisptr, uint port, uint slot, u8 *dest, u32 adr, int size); - - // McdSave - // Saves the provided block of data to the memorycard at the specified seek address. - // Writes *must* be performed synchronously (function cannot return until the write op - // has finished). Write cache flushing is optional. - // - // Returns: - // False on failure, and True on success. Emulator may use GetLastError to retrieve additional - // information for logging or displaying to the user. - // - BOOL(PS2E_CALLBACK *McdSave) - (PS2E_THISPTR thisptr, uint port, uint slot, const u8 *src, u32 adr, int size); - - // McdEraseBlock - // Saves "cleared" data to the memorycard at the specified seek address. Cleared data - // is a series of 0xff values (all bits set to 1). - // Writes *must* be performed synchronously (function cannot return until the write op - // has finished). Write cache flushing is optional. - // - // Returns: - // False on failure, and True on success. Emulator may use GetLastError to retrieve additional - // information for logging or displaying to the user. - // - BOOL(PS2E_CALLBACK *McdEraseBlock) - (PS2E_THISPTR thisptr, uint port, uint slot, u32 adr); - - u64(PS2E_CALLBACK *McdGetCRC)(PS2E_THISPTR thisptr, uint port, uint slot); - - // McdNextFrame - // Inform the memory card that a frame of emulation time has passed. - // Used by the FolderMemoryCard to find a good time to flush written data to the host file system. - void(PS2E_CALLBACK *McdNextFrame)(PS2E_THISPTR thisptr, uint port, uint slot); - - bool(PS2E_CALLBACK *McdReIndex)(PS2E_THISPTR thisptr, uint port, uint slot, const wxString &filter); - - void *reserved[6]; - -} PS2E_ComponentAPI_Mcd; - - -// ------------------------------------------------------------------------------------ -// KeyEvent type enumerations -// ------------------------------------------------------------------------------------ - -enum PS2E_KeyEventTypes { - PS2E_KEY_UP = 0, - PS2E_KEY_DOWN -}; - -enum PS2E_KeyModifiers { - PS2E_SHIFT = 1, - PS2E_CONTROL = 2, - PS2E_ALT = 4 -}; - -// -------------------------------------------------------------------------------------- -// PS2E_KeyEvent -// -------------------------------------------------------------------------------------- -// Structure used to key event data from pad plugin to emulator. -// -typedef struct _PS2E_KeyEvent -{ - PS2E_KeyEventTypes event; - - // Value of the key being pressed or released - uint value; - - // Combination of PS2E_SHIFT, PS2E_CONTROL, and/or PS2E_ALT, indicating which - // modifier keys were also down when the key was pressed. - uint flags; - -} PS2E_KeyEvent; - - -// -------------------------------------------------------------------------------------- -// PS2E_ComponentAPI_Pad -// -------------------------------------------------------------------------------------- -// Thread Safety: -// * Thread affinity is not guaranteed. Even PadKeyEvent may be called from a thread not -// belonging to the active window (the window where the GA is output). Other calls may -// be made from either the main emu thread or an EE/IOP/GS child thread (if the emulator -// uses them). -// -typedef struct _PS2E_ComponentAPI_Pad -{ - // Base Component API (inherited structure) - struct _PS2E_ComponentAPI Base; - - // PadIsPresent - // Called by the emulator to detect the availability of a pad. This function will - // be called frequently -- essentially whenever the SIO port for the pad has its - // status polled - so its overhead should be minimal when possible. - // - // A plugin should behave reasonably when a pad that's not plugged in is polled. - // - // Returns: - // False if the card/pad is not available, or True if it is available. - // - BOOL(PS2E_CALLBACK *PadIsPresent) - (PS2E_THISPTR thisptr, uint port, uint slot); - - // PadStartPoll - // Called by the emulator to start polling the specified pad. - // - // Returns: - // First byte in response to the poll (Typically 0xff). - // - // Threading: - // Called from the EEcore thread. The emulator performs no locking of its own, so - // calls to this may occur concurrently with calls to PadUpdate. - // - u8(PS2E_CALLBACK *PadStartPoll)(PS2E_THISPTR thisptr, uint port, uint slot); - - // PadPoll - // Continues polling the specified pad, sending the given value. - // - // Returns: - // Next byte in response to the poll. - // - // Threading: - // Called from the EEcore thread. The emulator performs no locking of its own, so - // calls to this may occur concurrently with calls to PadUpdate. - // - u8(PS2E_CALLBACK *PadPoll)(PS2E_THISPTR thisptr, u8 value); - - // PadKeyEvent - // Called by the emulator in the gui thread to check for keys being pressed or released. - // - // Returns: - // PS2E_KeyEvent: Key being pressed or released. Should stay valid until next call to - // PadKeyEvent or plugin is closed with EmuClose. - // - // Threading: - // May be called from any thread. The emulator performs no locking of its own, so - // calls to this may occur concurrently with calls to PadUpdate. - // - PS2E_KeyEvent *(PS2E_CALLBACK *PadGetKeyEvent)(PS2E_THISPTR thisptr); - - // PadUpdate - // This callback is issued from the thread that owns the GSwindow, at roughly 50/60hz, - // allowing the Pad plugin to use it for update logic that expects thread affinity with - // the GSwindow. - // - // Threading: - // Called from the same thread that owns the GSwindow (typically either a GUI thread - // or an MTGS thread). The emulator performs no locking of its own, so calls to this - // may occur concurrently with calls to PadKeyEvent and PadPoll. - // - void(PS2E_CALLBACK *PadUpdate)(PS2E_THISPTR thisptr); - - void *reserved[8]; - -} PS2E_ComponentAPI_Pad; - - -// -------------------------------------------------------------------------------------- -// PS2E_InitAPI -// -------------------------------------------------------------------------------------- -// Called by the emulator when the plugin is loaded into memory. The emulator uses the -// presence of this function to detect PS2E-v2 plugin API, and will direct all subsequent -// calls through the returned LibraryAPI. The function is allowed to return NULL if the -// emulator's version information or machine capabilities are insufficient for the -// plugin's needs. -// -// Note: It is recommended that plugins query machine capabilities from the emulator rather -// than the operating system or CPUID directly, since it allows the emulator the option of -// overriding the reported capabilities, for diagnostic purposes. (such behavior is not -// required, however) -// -// This function is called *once* for the duration of a loaded plugin. -// -// Returns: -// A pointer to a static structure that contains the API for this plugin, or NULL if -// the plugin explicitly does not support the emulator version or machine specs. -// -// OnError: -// Plugins may optionally prepare more detailed information on why the plugin failed -// it's availability test which the emu can request via PS2E_GetLastError. -// -// Thread Safety: -// * Affinity: Called only from the Main/GUI thread. -// * Interlocking: Full interlocking garaunteed. -// -typedef const PS2E_LibraryAPI *(PS2E_CALLBACK *_PS2E_InitAPI)(const PS2E_EmulatorInfo *emuinfo); - -// -------------------------------------------------------------------------------------- -// PS2E_GetLastError -// -------------------------------------------------------------------------------------- -// Optional method which may be called by the emulator if the plugin returned NULL on -// PS2E_InitAPI. Plugins may return NULL for either/both msg_diag and msg_user. Returned -// pointers should be static global arrays, and must be NULL terminated. If only one -// message is provided, it will be used for both console log and popup. -// -// Parameters: -// msg_diag - diagnostic message, which is english only and typically intended for console -// or disk logging. -// -// msg_user - optional translated user message, which is displayed as a popup to explain -// to the user why the plugin failed to initialize. -// -typedef void(PS2E_CALLBACK *_PS2E_GetLastError)(char *const *msg_diag, wchar_t *const *msg_user); - -////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////// -// Begin old legacy API here (present for reference purposes only, until all plugin API -// specifics have been accounted for) -////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////// - -#if 0 -// SPU2 -// NOTE: The read/write functions CANNOT use XMM/MMX regs -// If you want to use them, need to save and restore current ones -typedef s32 (CALLBACK* _SPU2init)(char *configpath); -typedef s32 (CALLBACK* _SPU2open)(void *pDisplay); -typedef void (CALLBACK* _SPU2close)(); -typedef void (CALLBACK* _SPU2shutdown)(); -typedef void (CALLBACK* _SPU2write)(u32 mem, u16 value); -typedef u16 (CALLBACK* _SPU2read)(u32 mem); - -typedef void (CALLBACK* _SPU2readDMA4Mem)(u16 *pMem, u32 size); -typedef void (CALLBACK* _SPU2writeDMA4Mem)(u16 *pMem, u32 size); -typedef void (CALLBACK* _SPU2interruptDMA4)(); -typedef void (CALLBACK* _SPU2readDMA7Mem)(u16 *pMem, u32 size); -typedef void (CALLBACK* _SPU2writeDMA7Mem)(u16 *pMem, u32 size); -typedef void (CALLBACK* _SPU2interruptDMA7)(); - -typedef void (CALLBACK* _SPU2readDMAMem)(u16 *pMem, u32 size, u8 core); -typedef void (CALLBACK* _SPU2writeDMAMem)(u16 *pMem, u32 size, u8 core); -typedef void (CALLBACK* _SPU2interruptDMA)(u8 core); -typedef void (CALLBACK* _SPU2setDMABaseAddr)(uptr baseaddr); -typedef void (CALLBACK* _SPU2irqCallback)(void (*SPU2callback)(),void (*DMA4callback)(),void (*DMA7callback)()); -typedef bool (CALLBACK* _SPU2setupRecording)(bool start); - -typedef void (CALLBACK* _SPU2setClockPtr)(u32*ptr); -typedef void (CALLBACK* _SPU2setTimeStretcher)(short int enable); - -typedef u32 (CALLBACK* _SPU2ReadMemAddr)(u8 core); -typedef void (CALLBACK* _SPU2WriteMemAddr)(u8 core,u32 value); -typedef void (CALLBACK* _SPU2async)(u32 cycles); -typedef s32 (CALLBACK* _SPU2freeze)(u8 mode, freezeData *data); -typedef void (CALLBACK* _SPU2keyEvent)(keyEvent* ev); -typedef void (CALLBACK* _SPU2configure)(); -typedef s32 (CALLBACK* _SPU2test)(); -typedef void (CALLBACK* _SPU2about)(); - -// CDVD -// NOTE: The read/write functions CANNOT use XMM/MMX regs -// If you want to use them, need to save and restore current ones -typedef s32 (CALLBACK* _CDVDinit)(char *configpath); -typedef s32 (CALLBACK* _CDVDopen)(const char* pTitleFilename); -typedef void (CALLBACK* _CDVDclose)(); -typedef void (CALLBACK* _CDVDshutdown)(); -typedef s32 (CALLBACK* _CDVDreadTrack)(u32 lsn, int mode); -typedef u8* (CALLBACK* _CDVDgetBuffer)(); -typedef s32 (CALLBACK* _CDVDreadSubQ)(u32 lsn, cdvdSubQ* subq); -typedef s32 (CALLBACK* _CDVDgetTN)(cdvdTN *Buffer); -typedef s32 (CALLBACK* _CDVDgetTD)(u8 Track, cdvdTD *Buffer); -typedef s32 (CALLBACK* _CDVDgetTOC)(void* toc); -typedef s32 (CALLBACK* _CDVDgetDiskType)(); -typedef s32 (CALLBACK* _CDVDgetTrayStatus)(); -typedef s32 (CALLBACK* _CDVDctrlTrayOpen)(); -typedef s32 (CALLBACK* _CDVDctrlTrayClose)(); - -typedef void (CALLBACK* _CDVDkeyEvent)(keyEvent* ev); -typedef s32 (CALLBACK* _CDVDfreeze)(u8 mode, freezeData *data); -typedef void (CALLBACK* _CDVDconfigure)(); -typedef s32 (CALLBACK* _CDVDtest)(); -typedef void (CALLBACK* _CDVDabout)(); -typedef void (CALLBACK* _CDVDnewDiskCB)(void (*callback)()); - -// DEV9 -// NOTE: The read/write functions CANNOT use XMM/MMX regs -// If you want to use them, need to save and restore current ones -typedef s32 (CALLBACK* _DEV9init)(char *configpath); -typedef s32 (CALLBACK* _DEV9open)(void *pDisplay); -typedef void (CALLBACK* _DEV9close)(); -typedef void (CALLBACK* _DEV9shutdown)(); -typedef u8 (CALLBACK* _DEV9read8)(u32 mem); -typedef u16 (CALLBACK* _DEV9read16)(u32 mem); -typedef u32 (CALLBACK* _DEV9read32)(u32 mem); -typedef void (CALLBACK* _DEV9write8)(u32 mem, u8 value); -typedef void (CALLBACK* _DEV9write16)(u32 mem, u16 value); -typedef void (CALLBACK* _DEV9write32)(u32 mem, u32 value); -typedef void (CALLBACK* _DEV9readDMA8Mem)(u32 *pMem, int size); -typedef void (CALLBACK* _DEV9writeDMA8Mem)(u32 *pMem, int size); -typedef void (CALLBACK* _DEV9irqCallback)(DEV9callback callback); -typedef DEV9handler (CALLBACK* _DEV9irqHandler)(void); - -typedef void (CALLBACK* _DEV9keyEvent)(keyEvent* ev); -typedef s32 (CALLBACK* _DEV9freeze)(int mode, freezeData *data); -typedef void (CALLBACK* _DEV9configure)(); -typedef s32 (CALLBACK* _DEV9test)(); - -// USB -// NOTE: The read/write functions CANNOT use XMM/MMX regs -// If you want to use them, need to save and restore current ones -typedef s32 (CALLBACK* _USBinit)(char *configpath); -typedef s32 (CALLBACK* _USBopen)(void *pDisplay); -typedef void (CALLBACK* _USBclose)(); -typedef void (CALLBACK* _USBshutdown)(); -typedef u8 (CALLBACK* _USBread8)(u32 mem); -typedef u16 (CALLBACK* _USBread16)(u32 mem); -typedef u32 (CALLBACK* _USBread32)(u32 mem); -typedef void (CALLBACK* _USBwrite8)(u32 mem, u8 value); -typedef void (CALLBACK* _USBwrite16)(u32 mem, u16 value); -typedef void (CALLBACK* _USBwrite32)(u32 mem, u32 value); -typedef void (CALLBACK* _USBasync)(u32 cycles); - - -typedef void (CALLBACK* _USBirqCallback)(USBcallback callback); -typedef USBhandler (CALLBACK* _USBirqHandler)(void); -typedef void (CALLBACK* _USBsetRAM)(void *mem); - -typedef void (CALLBACK* _USBkeyEvent)(keyEvent* ev); -typedef s32 (CALLBACK* _USBfreeze)(int mode, freezeData *data); -typedef void (CALLBACK* _USBconfigure)(); -typedef s32 (CALLBACK* _USBtest)(); -typedef void (CALLBACK* _USBabout)(); - -//FW -typedef s32 (CALLBACK* _FWinit)(char *configpath); -typedef s32 (CALLBACK* _FWopen)(void *pDisplay); -typedef void (CALLBACK* _FWclose)(); -typedef void (CALLBACK* _FWshutdown)(); -typedef u32 (CALLBACK* _FWread32)(u32 mem); -typedef void (CALLBACK* _FWwrite32)(u32 mem, u32 value); -typedef void (CALLBACK* _FWirqCallback)(void (*callback)()); - -typedef void (CALLBACK* _FWkeyEvent)(keyEvent* ev); -typedef s32 (CALLBACK* _FWfreeze)(int mode, freezeData *data); -typedef void (CALLBACK* _FWconfigure)(); -typedef s32 (CALLBACK* _FWtest)(); -typedef void (CALLBACK* _FWabout)(); - -// General -extern _PS2EgetLibType PS2EgetLibType; -extern _PS2EgetLibVersion2 PS2EgetLibVersion2; -extern _PS2EgetLibName PS2EgetLibName; -extern _PS2EpassConfig PS2EpassConfig; - -#endif - -#ifndef __cplusplus -} -#endif - -#endif // __PLUGINCALLBACKS_H__ diff --git a/common/include/PluginCompatibility.h b/common/include/PluginCompatibility.h deleted file mode 100644 index 2507c73470..0000000000 --- a/common/include/PluginCompatibility.h +++ /dev/null @@ -1,50 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2018 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#ifdef _WIN32 -#include -#endif - -#include -#include -#include - -#ifdef _WIN32 -inline std::string convert_utf16_to_utf8(const std::wstring& utf16_string) -{ - const int size = WideCharToMultiByte(CP_UTF8, 0, utf16_string.c_str(), utf16_string.size(), nullptr, 0, nullptr, nullptr); - std::string converted_string(size, 0); - WideCharToMultiByte(CP_UTF8, 0, utf16_string.c_str(), utf16_string.size(), converted_string.data(), converted_string.size(), nullptr, nullptr); - return converted_string; -} - -inline std::wstring convert_utf8_to_utf16(const std::string &utf8_string) -{ - int size = MultiByteToWideChar(CP_UTF8, 0, utf8_string.c_str(), -1, nullptr, 0); - std::vector converted_string(size); - MultiByteToWideChar(CP_UTF8, 0, utf8_string.c_str(), -1, converted_string.data(), converted_string.size()); - return {converted_string.data()}; -} -#endif - -// _wfopen has to be used on Windows for pathnames containing non-ASCII characters. -inline FILE *px_fopen(const std::string &filename, const std::string &mode) -{ -#ifdef _WIN32 - return _wfopen(convert_utf8_to_utf16(filename).c_str(), convert_utf8_to_utf16(mode).c_str()); -#else - return fopen(filename.c_str(), mode.c_str()); -#endif -} diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 3c468cc982..e40a3494ef 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -1103,10 +1103,6 @@ if(PULSEAUDIO_FOUND) set(pcsx2FinalLibs ${pcsx2FinalLibs} ${PULSEAUDIO_LIBRARIES}) endif() -if(BUILTIN_GS) - set(pcsx2FinalLibs "${pcsx2FinalLibs} GSdx") -endif() - # additonal include directories include_directories( gui diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 40270c13d8..495378d049 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -23,19 +23,6 @@ class IniInterface; -enum PluginsEnum_t -{ - PluginId_GS = 0, - PluginId_Count, - - // Memorycard plugin support is preliminary, and is only hacked/hardcoded in at this - // time. So it's placed afer PluginId_Count so that it doesn't show up in the conf - // screens or other plugin tables. - - PluginId_Mcd, - PluginId_AllocCount // Extra value for correct array allocation -}; - enum GamefixId { GamefixId_FIRST = 0, diff --git a/plugins/GSdx/GS.cpp b/pcsx2/GS/GS.cpp similarity index 100% rename from plugins/GSdx/GS.cpp rename to pcsx2/GS/GS.cpp diff --git a/plugins/GSdx/GS.h b/pcsx2/GS/GS.h similarity index 100% rename from plugins/GSdx/GS.h rename to pcsx2/GS/GS.h diff --git a/plugins/GSdx/GSAlignedClass.cpp b/pcsx2/GS/GSAlignedClass.cpp similarity index 100% rename from plugins/GSdx/GSAlignedClass.cpp rename to pcsx2/GS/GSAlignedClass.cpp diff --git a/plugins/GSdx/GSAlignedClass.h b/pcsx2/GS/GSAlignedClass.h similarity index 100% rename from plugins/GSdx/GSAlignedClass.h rename to pcsx2/GS/GSAlignedClass.h diff --git a/plugins/GSdx/GSBlock.cpp b/pcsx2/GS/GSBlock.cpp similarity index 100% rename from plugins/GSdx/GSBlock.cpp rename to pcsx2/GS/GSBlock.cpp diff --git a/plugins/GSdx/GSBlock.h b/pcsx2/GS/GSBlock.h similarity index 100% rename from plugins/GSdx/GSBlock.h rename to pcsx2/GS/GSBlock.h diff --git a/plugins/GSdx/GSCapture.cpp b/pcsx2/GS/GSCapture.cpp similarity index 100% rename from plugins/GSdx/GSCapture.cpp rename to pcsx2/GS/GSCapture.cpp diff --git a/plugins/GSdx/GSCapture.h b/pcsx2/GS/GSCapture.h similarity index 100% rename from plugins/GSdx/GSCapture.h rename to pcsx2/GS/GSCapture.h diff --git a/plugins/GSdx/GSClut.cpp b/pcsx2/GS/GSClut.cpp similarity index 100% rename from plugins/GSdx/GSClut.cpp rename to pcsx2/GS/GSClut.cpp diff --git a/plugins/GSdx/GSClut.h b/pcsx2/GS/GSClut.h similarity index 100% rename from plugins/GSdx/GSClut.h rename to pcsx2/GS/GSClut.h diff --git a/plugins/GSdx/GSCodeBuffer.cpp b/pcsx2/GS/GSCodeBuffer.cpp similarity index 100% rename from plugins/GSdx/GSCodeBuffer.cpp rename to pcsx2/GS/GSCodeBuffer.cpp diff --git a/plugins/GSdx/GSCodeBuffer.h b/pcsx2/GS/GSCodeBuffer.h similarity index 100% rename from plugins/GSdx/GSCodeBuffer.h rename to pcsx2/GS/GSCodeBuffer.h diff --git a/plugins/GSdx/GSCrc.cpp b/pcsx2/GS/GSCrc.cpp similarity index 100% rename from plugins/GSdx/GSCrc.cpp rename to pcsx2/GS/GSCrc.cpp diff --git a/plugins/GSdx/GSCrc.h b/pcsx2/GS/GSCrc.h similarity index 100% rename from plugins/GSdx/GSCrc.h rename to pcsx2/GS/GSCrc.h diff --git a/plugins/GSdx/GSDrawingContext.cpp b/pcsx2/GS/GSDrawingContext.cpp similarity index 100% rename from plugins/GSdx/GSDrawingContext.cpp rename to pcsx2/GS/GSDrawingContext.cpp diff --git a/plugins/GSdx/GSDrawingContext.h b/pcsx2/GS/GSDrawingContext.h similarity index 100% rename from plugins/GSdx/GSDrawingContext.h rename to pcsx2/GS/GSDrawingContext.h diff --git a/plugins/GSdx/GSDrawingEnvironment.h b/pcsx2/GS/GSDrawingEnvironment.h similarity index 100% rename from plugins/GSdx/GSDrawingEnvironment.h rename to pcsx2/GS/GSDrawingEnvironment.h diff --git a/plugins/GSdx/GSDump.cpp b/pcsx2/GS/GSDump.cpp similarity index 100% rename from plugins/GSdx/GSDump.cpp rename to pcsx2/GS/GSDump.cpp diff --git a/plugins/GSdx/GSDump.h b/pcsx2/GS/GSDump.h similarity index 100% rename from plugins/GSdx/GSDump.h rename to pcsx2/GS/GSDump.h diff --git a/plugins/GSdx/GSLocalMemory.cpp b/pcsx2/GS/GSLocalMemory.cpp similarity index 100% rename from plugins/GSdx/GSLocalMemory.cpp rename to pcsx2/GS/GSLocalMemory.cpp diff --git a/plugins/GSdx/GSLocalMemory.h b/pcsx2/GS/GSLocalMemory.h similarity index 100% rename from plugins/GSdx/GSLocalMemory.h rename to pcsx2/GS/GSLocalMemory.h diff --git a/plugins/GSdx/GSLzma.cpp b/pcsx2/GS/GSLzma.cpp similarity index 100% rename from plugins/GSdx/GSLzma.cpp rename to pcsx2/GS/GSLzma.cpp diff --git a/plugins/GSdx/GSLzma.h b/pcsx2/GS/GSLzma.h similarity index 100% rename from plugins/GSdx/GSLzma.h rename to pcsx2/GS/GSLzma.h diff --git a/plugins/GSdx/GSPerfMon.cpp b/pcsx2/GS/GSPerfMon.cpp similarity index 100% rename from plugins/GSdx/GSPerfMon.cpp rename to pcsx2/GS/GSPerfMon.cpp diff --git a/plugins/GSdx/GSPerfMon.h b/pcsx2/GS/GSPerfMon.h similarity index 100% rename from plugins/GSdx/GSPerfMon.h rename to pcsx2/GS/GSPerfMon.h diff --git a/plugins/GSdx/GSPng.cpp b/pcsx2/GS/GSPng.cpp similarity index 100% rename from plugins/GSdx/GSPng.cpp rename to pcsx2/GS/GSPng.cpp diff --git a/plugins/GSdx/GSPng.h b/pcsx2/GS/GSPng.h similarity index 100% rename from plugins/GSdx/GSPng.h rename to pcsx2/GS/GSPng.h diff --git a/plugins/GSdx/GSState.cpp b/pcsx2/GS/GSState.cpp similarity index 100% rename from plugins/GSdx/GSState.cpp rename to pcsx2/GS/GSState.cpp diff --git a/plugins/GSdx/GSState.h b/pcsx2/GS/GSState.h similarity index 100% rename from plugins/GSdx/GSState.h rename to pcsx2/GS/GSState.h diff --git a/plugins/GSdx/GSTables.cpp b/pcsx2/GS/GSTables.cpp similarity index 100% rename from plugins/GSdx/GSTables.cpp rename to pcsx2/GS/GSTables.cpp diff --git a/plugins/GSdx/GSTables.h b/pcsx2/GS/GSTables.h similarity index 100% rename from plugins/GSdx/GSTables.h rename to pcsx2/GS/GSTables.h diff --git a/plugins/GSdx/GSThread.h b/pcsx2/GS/GSThread.h similarity index 100% rename from plugins/GSdx/GSThread.h rename to pcsx2/GS/GSThread.h diff --git a/plugins/GSdx/GSThread_CXX11.h b/pcsx2/GS/GSThread_CXX11.h similarity index 100% rename from plugins/GSdx/GSThread_CXX11.h rename to pcsx2/GS/GSThread_CXX11.h diff --git a/plugins/GSdx/GSUtil.cpp b/pcsx2/GS/GSUtil.cpp similarity index 100% rename from plugins/GSdx/GSUtil.cpp rename to pcsx2/GS/GSUtil.cpp diff --git a/plugins/GSdx/GSUtil.h b/pcsx2/GS/GSUtil.h similarity index 100% rename from plugins/GSdx/GSUtil.h rename to pcsx2/GS/GSUtil.h diff --git a/plugins/GSdx/GSVector.cpp b/pcsx2/GS/GSVector.cpp similarity index 100% rename from plugins/GSdx/GSVector.cpp rename to pcsx2/GS/GSVector.cpp diff --git a/plugins/GSdx/GSVector.h b/pcsx2/GS/GSVector.h similarity index 100% rename from plugins/GSdx/GSVector.h rename to pcsx2/GS/GSVector.h diff --git a/plugins/GSdx/GSVector4.h b/pcsx2/GS/GSVector4.h similarity index 100% rename from plugins/GSdx/GSVector4.h rename to pcsx2/GS/GSVector4.h diff --git a/plugins/GSdx/GSVector4i.h b/pcsx2/GS/GSVector4i.h similarity index 100% rename from plugins/GSdx/GSVector4i.h rename to pcsx2/GS/GSVector4i.h diff --git a/plugins/GSdx/GSVector8.h b/pcsx2/GS/GSVector8.h similarity index 100% rename from plugins/GSdx/GSVector8.h rename to pcsx2/GS/GSVector8.h diff --git a/plugins/GSdx/GSVector8i.h b/pcsx2/GS/GSVector8i.h similarity index 100% rename from plugins/GSdx/GSVector8i.h rename to pcsx2/GS/GSVector8i.h diff --git a/plugins/GSdx/GSdx.cpp b/pcsx2/GS/GSdx.cpp similarity index 100% rename from plugins/GSdx/GSdx.cpp rename to pcsx2/GS/GSdx.cpp diff --git a/plugins/GSdx/GSdx.def b/pcsx2/GS/GSdx.def similarity index 100% rename from plugins/GSdx/GSdx.def rename to pcsx2/GS/GSdx.def diff --git a/plugins/GSdx/GSdx.h b/pcsx2/GS/GSdx.h similarity index 100% rename from plugins/GSdx/GSdx.h rename to pcsx2/GS/GSdx.h diff --git a/plugins/GSdx/GSdx.rc b/pcsx2/GS/GSdx.rc similarity index 100% rename from plugins/GSdx/GSdx.rc rename to pcsx2/GS/GSdx.rc diff --git a/plugins/GSdx/GSdx.vcxproj b/pcsx2/GS/GSdx.vcxproj similarity index 100% rename from plugins/GSdx/GSdx.vcxproj rename to pcsx2/GS/GSdx.vcxproj diff --git a/plugins/GSdx/GSdx.vcxproj.filters b/pcsx2/GS/GSdx.vcxproj.filters similarity index 100% rename from plugins/GSdx/GSdx.vcxproj.filters rename to pcsx2/GS/GSdx.vcxproj.filters diff --git a/plugins/GSdx/Renderers/Common/GSDevice.cpp b/pcsx2/GS/Renderers/Common/GSDevice.cpp similarity index 100% rename from plugins/GSdx/Renderers/Common/GSDevice.cpp rename to pcsx2/GS/Renderers/Common/GSDevice.cpp diff --git a/plugins/GSdx/Renderers/Common/GSDevice.h b/pcsx2/GS/Renderers/Common/GSDevice.h similarity index 100% rename from plugins/GSdx/Renderers/Common/GSDevice.h rename to pcsx2/GS/Renderers/Common/GSDevice.h diff --git a/plugins/GSdx/Renderers/Common/GSDirtyRect.cpp b/pcsx2/GS/Renderers/Common/GSDirtyRect.cpp similarity index 100% rename from plugins/GSdx/Renderers/Common/GSDirtyRect.cpp rename to pcsx2/GS/Renderers/Common/GSDirtyRect.cpp diff --git a/plugins/GSdx/Renderers/Common/GSDirtyRect.h b/pcsx2/GS/Renderers/Common/GSDirtyRect.h similarity index 100% rename from plugins/GSdx/Renderers/Common/GSDirtyRect.h rename to pcsx2/GS/Renderers/Common/GSDirtyRect.h diff --git a/plugins/GSdx/Renderers/Common/GSFastList.h b/pcsx2/GS/Renderers/Common/GSFastList.h similarity index 100% rename from plugins/GSdx/Renderers/Common/GSFastList.h rename to pcsx2/GS/Renderers/Common/GSFastList.h diff --git a/plugins/GSdx/Renderers/Common/GSFunctionMap.cpp b/pcsx2/GS/Renderers/Common/GSFunctionMap.cpp similarity index 100% rename from plugins/GSdx/Renderers/Common/GSFunctionMap.cpp rename to pcsx2/GS/Renderers/Common/GSFunctionMap.cpp diff --git a/plugins/GSdx/Renderers/Common/GSFunctionMap.h b/pcsx2/GS/Renderers/Common/GSFunctionMap.h similarity index 100% rename from plugins/GSdx/Renderers/Common/GSFunctionMap.h rename to pcsx2/GS/Renderers/Common/GSFunctionMap.h diff --git a/plugins/GSdx/Renderers/Common/GSOsdManager.cpp b/pcsx2/GS/Renderers/Common/GSOsdManager.cpp similarity index 100% rename from plugins/GSdx/Renderers/Common/GSOsdManager.cpp rename to pcsx2/GS/Renderers/Common/GSOsdManager.cpp diff --git a/plugins/GSdx/Renderers/Common/GSOsdManager.h b/pcsx2/GS/Renderers/Common/GSOsdManager.h similarity index 100% rename from plugins/GSdx/Renderers/Common/GSOsdManager.h rename to pcsx2/GS/Renderers/Common/GSOsdManager.h diff --git a/plugins/GSdx/Renderers/Common/GSRenderer.cpp b/pcsx2/GS/Renderers/Common/GSRenderer.cpp similarity index 100% rename from plugins/GSdx/Renderers/Common/GSRenderer.cpp rename to pcsx2/GS/Renderers/Common/GSRenderer.cpp diff --git a/plugins/GSdx/Renderers/Common/GSRenderer.h b/pcsx2/GS/Renderers/Common/GSRenderer.h similarity index 100% rename from plugins/GSdx/Renderers/Common/GSRenderer.h rename to pcsx2/GS/Renderers/Common/GSRenderer.h diff --git a/plugins/GSdx/Renderers/Common/GSTexture.cpp b/pcsx2/GS/Renderers/Common/GSTexture.cpp similarity index 100% rename from plugins/GSdx/Renderers/Common/GSTexture.cpp rename to pcsx2/GS/Renderers/Common/GSTexture.cpp diff --git a/plugins/GSdx/Renderers/Common/GSTexture.h b/pcsx2/GS/Renderers/Common/GSTexture.h similarity index 100% rename from plugins/GSdx/Renderers/Common/GSTexture.h rename to pcsx2/GS/Renderers/Common/GSTexture.h diff --git a/plugins/GSdx/Renderers/Common/GSVertex.h b/pcsx2/GS/Renderers/Common/GSVertex.h similarity index 100% rename from plugins/GSdx/Renderers/Common/GSVertex.h rename to pcsx2/GS/Renderers/Common/GSVertex.h diff --git a/plugins/GSdx/Renderers/Common/GSVertexList.cpp b/pcsx2/GS/Renderers/Common/GSVertexList.cpp similarity index 100% rename from plugins/GSdx/Renderers/Common/GSVertexList.cpp rename to pcsx2/GS/Renderers/Common/GSVertexList.cpp diff --git a/plugins/GSdx/Renderers/Common/GSVertexList.h b/pcsx2/GS/Renderers/Common/GSVertexList.h similarity index 100% rename from plugins/GSdx/Renderers/Common/GSVertexList.h rename to pcsx2/GS/Renderers/Common/GSVertexList.h diff --git a/plugins/GSdx/Renderers/Common/GSVertexTrace.cpp b/pcsx2/GS/Renderers/Common/GSVertexTrace.cpp similarity index 100% rename from plugins/GSdx/Renderers/Common/GSVertexTrace.cpp rename to pcsx2/GS/Renderers/Common/GSVertexTrace.cpp diff --git a/plugins/GSdx/Renderers/Common/GSVertexTrace.h b/pcsx2/GS/Renderers/Common/GSVertexTrace.h similarity index 100% rename from plugins/GSdx/Renderers/Common/GSVertexTrace.h rename to pcsx2/GS/Renderers/Common/GSVertexTrace.h diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp similarity index 100% rename from plugins/GSdx/Renderers/DX11/GSDevice11.cpp rename to pcsx2/GS/Renderers/DX11/GSDevice11.cpp diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.h b/pcsx2/GS/Renderers/DX11/GSDevice11.h similarity index 100% rename from plugins/GSdx/Renderers/DX11/GSDevice11.h rename to pcsx2/GS/Renderers/DX11/GSDevice11.h diff --git a/plugins/GSdx/Renderers/DX11/GSRendererDX11.cpp b/pcsx2/GS/Renderers/DX11/GSRendererDX11.cpp similarity index 100% rename from plugins/GSdx/Renderers/DX11/GSRendererDX11.cpp rename to pcsx2/GS/Renderers/DX11/GSRendererDX11.cpp diff --git a/plugins/GSdx/Renderers/DX11/GSRendererDX11.h b/pcsx2/GS/Renderers/DX11/GSRendererDX11.h similarity index 100% rename from plugins/GSdx/Renderers/DX11/GSRendererDX11.h rename to pcsx2/GS/Renderers/DX11/GSRendererDX11.h diff --git a/plugins/GSdx/Renderers/DX11/GSTexture11.cpp b/pcsx2/GS/Renderers/DX11/GSTexture11.cpp similarity index 100% rename from plugins/GSdx/Renderers/DX11/GSTexture11.cpp rename to pcsx2/GS/Renderers/DX11/GSTexture11.cpp diff --git a/plugins/GSdx/Renderers/DX11/GSTexture11.h b/pcsx2/GS/Renderers/DX11/GSTexture11.h similarity index 100% rename from plugins/GSdx/Renderers/DX11/GSTexture11.h rename to pcsx2/GS/Renderers/DX11/GSTexture11.h diff --git a/plugins/GSdx/Renderers/DX11/GSTextureCache11.cpp b/pcsx2/GS/Renderers/DX11/GSTextureCache11.cpp similarity index 100% rename from plugins/GSdx/Renderers/DX11/GSTextureCache11.cpp rename to pcsx2/GS/Renderers/DX11/GSTextureCache11.cpp diff --git a/plugins/GSdx/Renderers/DX11/GSTextureCache11.h b/pcsx2/GS/Renderers/DX11/GSTextureCache11.h similarity index 100% rename from plugins/GSdx/Renderers/DX11/GSTextureCache11.h rename to pcsx2/GS/Renderers/DX11/GSTextureCache11.h diff --git a/plugins/GSdx/Renderers/DX11/GSTextureFX11.cpp b/pcsx2/GS/Renderers/DX11/GSTextureFX11.cpp similarity index 100% rename from plugins/GSdx/Renderers/DX11/GSTextureFX11.cpp rename to pcsx2/GS/Renderers/DX11/GSTextureFX11.cpp diff --git a/plugins/GSdx/Renderers/HW/GSHwHack.cpp b/pcsx2/GS/Renderers/HW/GSHwHack.cpp similarity index 100% rename from plugins/GSdx/Renderers/HW/GSHwHack.cpp rename to pcsx2/GS/Renderers/HW/GSHwHack.cpp diff --git a/plugins/GSdx/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp similarity index 100% rename from plugins/GSdx/Renderers/HW/GSRendererHW.cpp rename to pcsx2/GS/Renderers/HW/GSRendererHW.cpp diff --git a/plugins/GSdx/Renderers/HW/GSRendererHW.h b/pcsx2/GS/Renderers/HW/GSRendererHW.h similarity index 100% rename from plugins/GSdx/Renderers/HW/GSRendererHW.h rename to pcsx2/GS/Renderers/HW/GSRendererHW.h diff --git a/plugins/GSdx/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp similarity index 100% rename from plugins/GSdx/Renderers/HW/GSTextureCache.cpp rename to pcsx2/GS/Renderers/HW/GSTextureCache.cpp diff --git a/plugins/GSdx/Renderers/HW/GSTextureCache.h b/pcsx2/GS/Renderers/HW/GSTextureCache.h similarity index 100% rename from plugins/GSdx/Renderers/HW/GSTextureCache.h rename to pcsx2/GS/Renderers/HW/GSTextureCache.h diff --git a/plugins/GSdx/Renderers/HW/GSVertexHW.h b/pcsx2/GS/Renderers/HW/GSVertexHW.h similarity index 100% rename from plugins/GSdx/Renderers/HW/GSVertexHW.h rename to pcsx2/GS/Renderers/HW/GSVertexHW.h diff --git a/plugins/GSdx/Renderers/Null/GSDeviceNull.cpp b/pcsx2/GS/Renderers/Null/GSDeviceNull.cpp similarity index 100% rename from plugins/GSdx/Renderers/Null/GSDeviceNull.cpp rename to pcsx2/GS/Renderers/Null/GSDeviceNull.cpp diff --git a/plugins/GSdx/Renderers/Null/GSDeviceNull.h b/pcsx2/GS/Renderers/Null/GSDeviceNull.h similarity index 100% rename from plugins/GSdx/Renderers/Null/GSDeviceNull.h rename to pcsx2/GS/Renderers/Null/GSDeviceNull.h diff --git a/plugins/GSdx/Renderers/Null/GSRendererNull.cpp b/pcsx2/GS/Renderers/Null/GSRendererNull.cpp similarity index 100% rename from plugins/GSdx/Renderers/Null/GSRendererNull.cpp rename to pcsx2/GS/Renderers/Null/GSRendererNull.cpp diff --git a/plugins/GSdx/Renderers/Null/GSRendererNull.h b/pcsx2/GS/Renderers/Null/GSRendererNull.h similarity index 100% rename from plugins/GSdx/Renderers/Null/GSRendererNull.h rename to pcsx2/GS/Renderers/Null/GSRendererNull.h diff --git a/plugins/GSdx/Renderers/Null/GSTextureNull.cpp b/pcsx2/GS/Renderers/Null/GSTextureNull.cpp similarity index 100% rename from plugins/GSdx/Renderers/Null/GSTextureNull.cpp rename to pcsx2/GS/Renderers/Null/GSTextureNull.cpp diff --git a/plugins/GSdx/Renderers/Null/GSTextureNull.h b/pcsx2/GS/Renderers/Null/GSTextureNull.h similarity index 100% rename from plugins/GSdx/Renderers/Null/GSTextureNull.h rename to pcsx2/GS/Renderers/Null/GSTextureNull.h diff --git a/plugins/GSdx/Renderers/OpenGL/GLLoader.cpp b/pcsx2/GS/Renderers/OpenGL/GLLoader.cpp similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GLLoader.cpp rename to pcsx2/GS/Renderers/OpenGL/GLLoader.cpp diff --git a/plugins/GSdx/Renderers/OpenGL/GLLoader.h b/pcsx2/GS/Renderers/OpenGL/GLLoader.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GLLoader.h rename to pcsx2/GS/Renderers/OpenGL/GLLoader.h diff --git a/plugins/GSdx/Renderers/OpenGL/GLState.cpp b/pcsx2/GS/Renderers/OpenGL/GLState.cpp similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GLState.cpp rename to pcsx2/GS/Renderers/OpenGL/GLState.cpp diff --git a/plugins/GSdx/Renderers/OpenGL/GLState.h b/pcsx2/GS/Renderers/OpenGL/GLState.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GLState.h rename to pcsx2/GS/Renderers/OpenGL/GLState.h diff --git a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp rename to pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp diff --git a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.h b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.h rename to pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.h diff --git a/plugins/GSdx/Renderers/OpenGL/GSRendererOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSRendererOGL.cpp similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSRendererOGL.cpp rename to pcsx2/GS/Renderers/OpenGL/GSRendererOGL.cpp diff --git a/plugins/GSdx/Renderers/OpenGL/GSRendererOGL.h b/pcsx2/GS/Renderers/OpenGL/GSRendererOGL.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSRendererOGL.h rename to pcsx2/GS/Renderers/OpenGL/GSRendererOGL.h diff --git a/plugins/GSdx/Renderers/OpenGL/GSShaderOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSShaderOGL.cpp similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSShaderOGL.cpp rename to pcsx2/GS/Renderers/OpenGL/GSShaderOGL.cpp diff --git a/plugins/GSdx/Renderers/OpenGL/GSShaderOGL.h b/pcsx2/GS/Renderers/OpenGL/GSShaderOGL.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSShaderOGL.h rename to pcsx2/GS/Renderers/OpenGL/GSShaderOGL.h diff --git a/plugins/GSdx/Renderers/OpenGL/GSTextureCacheOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSTextureCacheOGL.cpp similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSTextureCacheOGL.cpp rename to pcsx2/GS/Renderers/OpenGL/GSTextureCacheOGL.cpp diff --git a/plugins/GSdx/Renderers/OpenGL/GSTextureCacheOGL.h b/pcsx2/GS/Renderers/OpenGL/GSTextureCacheOGL.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSTextureCacheOGL.h rename to pcsx2/GS/Renderers/OpenGL/GSTextureCacheOGL.h diff --git a/plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp rename to pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp diff --git a/plugins/GSdx/Renderers/OpenGL/GSTextureOGL.h b/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSTextureOGL.h rename to pcsx2/GS/Renderers/OpenGL/GSTextureOGL.h diff --git a/plugins/GSdx/Renderers/OpenGL/GSUniformBufferOGL.h b/pcsx2/GS/Renderers/OpenGL/GSUniformBufferOGL.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSUniformBufferOGL.h rename to pcsx2/GS/Renderers/OpenGL/GSUniformBufferOGL.h diff --git a/plugins/GSdx/Renderers/OpenGL/GSVertexArrayOGL.h b/pcsx2/GS/Renderers/OpenGL/GSVertexArrayOGL.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/GSVertexArrayOGL.h rename to pcsx2/GS/Renderers/OpenGL/GSVertexArrayOGL.h diff --git a/plugins/GSdx/Renderers/OpenGL/PFN_GLLOADER_CPP.h b/pcsx2/GS/Renderers/OpenGL/PFN_GLLOADER_CPP.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/PFN_GLLOADER_CPP.h rename to pcsx2/GS/Renderers/OpenGL/PFN_GLLOADER_CPP.h diff --git a/plugins/GSdx/Renderers/OpenGL/PFN_GLLOADER_HPP.h b/pcsx2/GS/Renderers/OpenGL/PFN_GLLOADER_HPP.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/PFN_GLLOADER_HPP.h rename to pcsx2/GS/Renderers/OpenGL/PFN_GLLOADER_HPP.h diff --git a/plugins/GSdx/Renderers/OpenGL/glext_extra.h b/pcsx2/GS/Renderers/OpenGL/glext_extra.h similarity index 100% rename from plugins/GSdx/Renderers/OpenGL/glext_extra.h rename to pcsx2/GS/Renderers/OpenGL/glext_extra.h diff --git a/plugins/GSdx/Renderers/SW/GSDrawScanline.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanline.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSDrawScanline.cpp rename to pcsx2/GS/Renderers/SW/GSDrawScanline.cpp diff --git a/plugins/GSdx/Renderers/SW/GSDrawScanline.h b/pcsx2/GS/Renderers/SW/GSDrawScanline.h similarity index 100% rename from plugins/GSdx/Renderers/SW/GSDrawScanline.h rename to pcsx2/GS/Renderers/SW/GSDrawScanline.h diff --git a/plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.cpp rename to pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.cpp diff --git a/plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.h b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.h similarity index 100% rename from plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.h rename to pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.h diff --git a/plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx.cpp rename to pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx.cpp diff --git a/plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx2.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx2.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx2.cpp rename to pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx2.cpp diff --git a/plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x64.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x64.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x64.cpp rename to pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x64.cpp diff --git a/plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx.cpp rename to pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx.cpp diff --git a/plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx2.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx2.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx2.cpp rename to pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx2.cpp diff --git a/plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x86.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x86.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSDrawScanlineCodeGenerator.x86.cpp rename to pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.x86.cpp diff --git a/plugins/GSdx/Renderers/SW/GSRasterizer.cpp b/pcsx2/GS/Renderers/SW/GSRasterizer.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSRasterizer.cpp rename to pcsx2/GS/Renderers/SW/GSRasterizer.cpp diff --git a/plugins/GSdx/Renderers/SW/GSRasterizer.h b/pcsx2/GS/Renderers/SW/GSRasterizer.h similarity index 100% rename from plugins/GSdx/Renderers/SW/GSRasterizer.h rename to pcsx2/GS/Renderers/SW/GSRasterizer.h diff --git a/plugins/GSdx/Renderers/SW/GSRendererSW.cpp b/pcsx2/GS/Renderers/SW/GSRendererSW.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSRendererSW.cpp rename to pcsx2/GS/Renderers/SW/GSRendererSW.cpp diff --git a/plugins/GSdx/Renderers/SW/GSRendererSW.h b/pcsx2/GS/Renderers/SW/GSRendererSW.h similarity index 100% rename from plugins/GSdx/Renderers/SW/GSRendererSW.h rename to pcsx2/GS/Renderers/SW/GSRendererSW.h diff --git a/plugins/GSdx/Renderers/SW/GSScanlineEnvironment.h b/pcsx2/GS/Renderers/SW/GSScanlineEnvironment.h similarity index 100% rename from plugins/GSdx/Renderers/SW/GSScanlineEnvironment.h rename to pcsx2/GS/Renderers/SW/GSScanlineEnvironment.h diff --git a/plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.cpp b/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.cpp rename to pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.cpp diff --git a/plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.h b/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.h similarity index 100% rename from plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.h rename to pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.h diff --git a/plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx.cpp b/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx.cpp rename to pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx.cpp diff --git a/plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx2.cpp b/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx2.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx2.cpp rename to pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx2.cpp diff --git a/plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x64.cpp b/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x64.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x64.cpp rename to pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x64.cpp diff --git a/plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx.cpp b/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx.cpp rename to pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx.cpp diff --git a/plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx2.cpp b/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx2.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx2.cpp rename to pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx2.cpp diff --git a/plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x86.cpp b/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x86.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSSetupPrimCodeGenerator.x86.cpp rename to pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.x86.cpp diff --git a/plugins/GSdx/Renderers/SW/GSTextureCacheSW.cpp b/pcsx2/GS/Renderers/SW/GSTextureCacheSW.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSTextureCacheSW.cpp rename to pcsx2/GS/Renderers/SW/GSTextureCacheSW.cpp diff --git a/plugins/GSdx/Renderers/SW/GSTextureCacheSW.h b/pcsx2/GS/Renderers/SW/GSTextureCacheSW.h similarity index 100% rename from plugins/GSdx/Renderers/SW/GSTextureCacheSW.h rename to pcsx2/GS/Renderers/SW/GSTextureCacheSW.h diff --git a/plugins/GSdx/Renderers/SW/GSTextureSW.cpp b/pcsx2/GS/Renderers/SW/GSTextureSW.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSTextureSW.cpp rename to pcsx2/GS/Renderers/SW/GSTextureSW.cpp diff --git a/plugins/GSdx/Renderers/SW/GSTextureSW.h b/pcsx2/GS/Renderers/SW/GSTextureSW.h similarity index 100% rename from plugins/GSdx/Renderers/SW/GSTextureSW.h rename to pcsx2/GS/Renderers/SW/GSTextureSW.h diff --git a/plugins/GSdx/Renderers/SW/GSVertexSW.cpp b/pcsx2/GS/Renderers/SW/GSVertexSW.cpp similarity index 100% rename from plugins/GSdx/Renderers/SW/GSVertexSW.cpp rename to pcsx2/GS/Renderers/SW/GSVertexSW.cpp diff --git a/plugins/GSdx/Renderers/SW/GSVertexSW.h b/pcsx2/GS/Renderers/SW/GSVertexSW.h similarity index 100% rename from plugins/GSdx/Renderers/SW/GSVertexSW.h rename to pcsx2/GS/Renderers/SW/GSVertexSW.h diff --git a/plugins/GSdx/Window/GSCaptureDlg.cpp b/pcsx2/GS/Window/GSCaptureDlg.cpp similarity index 100% rename from plugins/GSdx/Window/GSCaptureDlg.cpp rename to pcsx2/GS/Window/GSCaptureDlg.cpp diff --git a/plugins/GSdx/Window/GSCaptureDlg.h b/pcsx2/GS/Window/GSCaptureDlg.h similarity index 100% rename from plugins/GSdx/Window/GSCaptureDlg.h rename to pcsx2/GS/Window/GSCaptureDlg.h diff --git a/plugins/GSdx/Window/GSDialog.cpp b/pcsx2/GS/Window/GSDialog.cpp similarity index 100% rename from plugins/GSdx/Window/GSDialog.cpp rename to pcsx2/GS/Window/GSDialog.cpp diff --git a/plugins/GSdx/Window/GSDialog.h b/pcsx2/GS/Window/GSDialog.h similarity index 100% rename from plugins/GSdx/Window/GSDialog.h rename to pcsx2/GS/Window/GSDialog.h diff --git a/plugins/GSdx/Window/GSLinuxDialog.cpp b/pcsx2/GS/Window/GSLinuxDialog.cpp similarity index 100% rename from plugins/GSdx/Window/GSLinuxDialog.cpp rename to pcsx2/GS/Window/GSLinuxDialog.cpp diff --git a/plugins/GSdx/Window/GSSetting.cpp b/pcsx2/GS/Window/GSSetting.cpp similarity index 100% rename from plugins/GSdx/Window/GSSetting.cpp rename to pcsx2/GS/Window/GSSetting.cpp diff --git a/plugins/GSdx/Window/GSSetting.h b/pcsx2/GS/Window/GSSetting.h similarity index 100% rename from plugins/GSdx/Window/GSSetting.h rename to pcsx2/GS/Window/GSSetting.h diff --git a/plugins/GSdx/Window/GSSettingsDlg.cpp b/pcsx2/GS/Window/GSSettingsDlg.cpp similarity index 100% rename from plugins/GSdx/Window/GSSettingsDlg.cpp rename to pcsx2/GS/Window/GSSettingsDlg.cpp diff --git a/plugins/GSdx/Window/GSSettingsDlg.h b/pcsx2/GS/Window/GSSettingsDlg.h similarity index 100% rename from plugins/GSdx/Window/GSSettingsDlg.h rename to pcsx2/GS/Window/GSSettingsDlg.h diff --git a/plugins/GSdx/Window/GSWnd.cpp b/pcsx2/GS/Window/GSWnd.cpp similarity index 100% rename from plugins/GSdx/Window/GSWnd.cpp rename to pcsx2/GS/Window/GSWnd.cpp diff --git a/plugins/GSdx/Window/GSWnd.h b/pcsx2/GS/Window/GSWnd.h similarity index 100% rename from plugins/GSdx/Window/GSWnd.h rename to pcsx2/GS/Window/GSWnd.h diff --git a/plugins/GSdx/Window/GSWndDX.cpp b/pcsx2/GS/Window/GSWndDX.cpp similarity index 100% rename from plugins/GSdx/Window/GSWndDX.cpp rename to pcsx2/GS/Window/GSWndDX.cpp diff --git a/plugins/GSdx/Window/GSWndDX.h b/pcsx2/GS/Window/GSWndDX.h similarity index 100% rename from plugins/GSdx/Window/GSWndDX.h rename to pcsx2/GS/Window/GSWndDX.h diff --git a/plugins/GSdx/Window/GSWndEGL.cpp b/pcsx2/GS/Window/GSWndEGL.cpp similarity index 100% rename from plugins/GSdx/Window/GSWndEGL.cpp rename to pcsx2/GS/Window/GSWndEGL.cpp diff --git a/plugins/GSdx/Window/GSWndEGL.h b/pcsx2/GS/Window/GSWndEGL.h similarity index 100% rename from plugins/GSdx/Window/GSWndEGL.h rename to pcsx2/GS/Window/GSWndEGL.h diff --git a/plugins/GSdx/Window/GSWndWGL.cpp b/pcsx2/GS/Window/GSWndWGL.cpp similarity index 100% rename from plugins/GSdx/Window/GSWndWGL.cpp rename to pcsx2/GS/Window/GSWndWGL.cpp diff --git a/plugins/GSdx/Window/GSWndWGL.h b/pcsx2/GS/Window/GSWndWGL.h similarity index 100% rename from plugins/GSdx/Window/GSWndWGL.h rename to pcsx2/GS/Window/GSWndWGL.h diff --git a/plugins/GSdx/Window/PFN_WND.h b/pcsx2/GS/Window/PFN_WND.h similarity index 100% rename from plugins/GSdx/Window/PFN_WND.h rename to pcsx2/GS/Window/PFN_WND.h diff --git a/plugins/GSdx/config.h b/pcsx2/GS/config.h similarity index 100% rename from plugins/GSdx/config.h rename to pcsx2/GS/config.h diff --git a/plugins/GSdx/docs/TextureCache.odg b/pcsx2/GS/docs/TextureCache.odg similarity index 100% rename from plugins/GSdx/docs/TextureCache.odg rename to pcsx2/GS/docs/TextureCache.odg diff --git a/plugins/GSdx/linux_replay.cpp b/pcsx2/GS/linux_replay.cpp similarity index 100% rename from plugins/GSdx/linux_replay.cpp rename to pcsx2/GS/linux_replay.cpp diff --git a/plugins/GSdx/res/convert.fx b/pcsx2/GS/res/convert.fx similarity index 100% rename from plugins/GSdx/res/convert.fx rename to pcsx2/GS/res/convert.fx diff --git a/plugins/GSdx/res/fonts-roboto/Roboto-Regular.ttf b/pcsx2/GS/res/fonts-roboto/Roboto-Regular.ttf similarity index 100% rename from plugins/GSdx/res/fonts-roboto/Roboto-Regular.ttf rename to pcsx2/GS/res/fonts-roboto/Roboto-Regular.ttf diff --git a/plugins/GSdx/res/fonts-roboto/copyright b/pcsx2/GS/res/fonts-roboto/copyright similarity index 100% rename from plugins/GSdx/res/fonts-roboto/copyright rename to pcsx2/GS/res/fonts-roboto/copyright diff --git a/plugins/GSdx/res/fxaa.fx b/pcsx2/GS/res/fxaa.fx similarity index 100% rename from plugins/GSdx/res/fxaa.fx rename to pcsx2/GS/res/fxaa.fx diff --git a/plugins/GSdx/res/glsl/common_header.glsl b/pcsx2/GS/res/glsl/common_header.glsl similarity index 100% rename from plugins/GSdx/res/glsl/common_header.glsl rename to pcsx2/GS/res/glsl/common_header.glsl diff --git a/plugins/GSdx/res/glsl/convert.glsl b/pcsx2/GS/res/glsl/convert.glsl similarity index 100% rename from plugins/GSdx/res/glsl/convert.glsl rename to pcsx2/GS/res/glsl/convert.glsl diff --git a/plugins/GSdx/res/glsl/interlace.glsl b/pcsx2/GS/res/glsl/interlace.glsl similarity index 100% rename from plugins/GSdx/res/glsl/interlace.glsl rename to pcsx2/GS/res/glsl/interlace.glsl diff --git a/plugins/GSdx/res/glsl/merge.glsl b/pcsx2/GS/res/glsl/merge.glsl similarity index 100% rename from plugins/GSdx/res/glsl/merge.glsl rename to pcsx2/GS/res/glsl/merge.glsl diff --git a/plugins/GSdx/res/glsl/shadeboost.glsl b/pcsx2/GS/res/glsl/shadeboost.glsl similarity index 100% rename from plugins/GSdx/res/glsl/shadeboost.glsl rename to pcsx2/GS/res/glsl/shadeboost.glsl diff --git a/plugins/GSdx/res/glsl/tfx_fs.glsl b/pcsx2/GS/res/glsl/tfx_fs.glsl similarity index 100% rename from plugins/GSdx/res/glsl/tfx_fs.glsl rename to pcsx2/GS/res/glsl/tfx_fs.glsl diff --git a/plugins/GSdx/res/glsl/tfx_vgs.glsl b/pcsx2/GS/res/glsl/tfx_vgs.glsl similarity index 100% rename from plugins/GSdx/res/glsl/tfx_vgs.glsl rename to pcsx2/GS/res/glsl/tfx_vgs.glsl diff --git a/plugins/GSdx/res/gsdx-res.xml b/pcsx2/GS/res/gsdx-res.xml similarity index 100% rename from plugins/GSdx/res/gsdx-res.xml rename to pcsx2/GS/res/gsdx-res.xml diff --git a/plugins/GSdx/res/interlace.fx b/pcsx2/GS/res/interlace.fx similarity index 100% rename from plugins/GSdx/res/interlace.fx rename to pcsx2/GS/res/interlace.fx diff --git a/plugins/GSdx/res/logo-null.bmp b/pcsx2/GS/res/logo-null.bmp similarity index 100% rename from plugins/GSdx/res/logo-null.bmp rename to pcsx2/GS/res/logo-null.bmp diff --git a/plugins/GSdx/res/logo-ogl.bmp b/pcsx2/GS/res/logo-ogl.bmp similarity index 100% rename from plugins/GSdx/res/logo-ogl.bmp rename to pcsx2/GS/res/logo-ogl.bmp diff --git a/plugins/GSdx/res/logo11.bmp b/pcsx2/GS/res/logo11.bmp similarity index 100% rename from plugins/GSdx/res/logo11.bmp rename to pcsx2/GS/res/logo11.bmp diff --git a/plugins/GSdx/res/merge.fx b/pcsx2/GS/res/merge.fx similarity index 100% rename from plugins/GSdx/res/merge.fx rename to pcsx2/GS/res/merge.fx diff --git a/plugins/GSdx/res/shadeboost.fx b/pcsx2/GS/res/shadeboost.fx similarity index 100% rename from plugins/GSdx/res/shadeboost.fx rename to pcsx2/GS/res/shadeboost.fx diff --git a/plugins/GSdx/res/tfx.fx b/pcsx2/GS/res/tfx.fx similarity index 100% rename from plugins/GSdx/res/tfx.fx rename to pcsx2/GS/res/tfx.fx diff --git a/plugins/GSdx/resource.h b/pcsx2/GS/resource.h similarity index 100% rename from plugins/GSdx/resource.h rename to pcsx2/GS/resource.h diff --git a/plugins/GSdx/stdafx.cpp b/pcsx2/GS/stdafx.cpp similarity index 100% rename from plugins/GSdx/stdafx.cpp rename to pcsx2/GS/stdafx.cpp diff --git a/plugins/GSdx/stdafx.h b/pcsx2/GS/stdafx.h similarity index 100% rename from plugins/GSdx/stdafx.h rename to pcsx2/GS/stdafx.h diff --git a/plugins/GSdx/targetver.h b/pcsx2/GS/targetver.h similarity index 100% rename from plugins/GSdx/targetver.h rename to pcsx2/GS/targetver.h diff --git a/plugins/GSdx/vsprops/ProjectRootDir.props b/pcsx2/GS/vsprops/ProjectRootDir.props similarity index 100% rename from plugins/GSdx/vsprops/ProjectRootDir.props rename to pcsx2/GS/vsprops/ProjectRootDir.props diff --git a/plugins/GSdx/vsprops/avx2.props b/pcsx2/GS/vsprops/avx2.props similarity index 100% rename from plugins/GSdx/vsprops/avx2.props rename to pcsx2/GS/vsprops/avx2.props diff --git a/plugins/GSdx/vsprops/common.props b/pcsx2/GS/vsprops/common.props similarity index 100% rename from plugins/GSdx/vsprops/common.props rename to pcsx2/GS/vsprops/common.props diff --git a/plugins/GSdx/vsprops/debug.props b/pcsx2/GS/vsprops/debug.props similarity index 100% rename from plugins/GSdx/vsprops/debug.props rename to pcsx2/GS/vsprops/debug.props diff --git a/plugins/GSdx/vsprops/release.props b/pcsx2/GS/vsprops/release.props similarity index 100% rename from plugins/GSdx/vsprops/release.props rename to pcsx2/GS/vsprops/release.props diff --git a/plugins/GSdx/vsprops/sse4.props b/pcsx2/GS/vsprops/sse4.props similarity index 100% rename from plugins/GSdx/vsprops/sse4.props rename to pcsx2/GS/vsprops/sse4.props diff --git a/plugins/GSdx/vsprops/x64.props b/pcsx2/GS/vsprops/x64.props similarity index 100% rename from plugins/GSdx/vsprops/x64.props rename to pcsx2/GS/vsprops/x64.props diff --git a/plugins/GSdx/vsprops/x86.props b/pcsx2/GS/vsprops/x86.props similarity index 100% rename from plugins/GSdx/vsprops/x86.props rename to pcsx2/GS/vsprops/x86.props diff --git a/plugins/GSdx/xbyak/xbyak.h b/pcsx2/GS/xbyak/xbyak.h similarity index 100% rename from plugins/GSdx/xbyak/xbyak.h rename to pcsx2/GS/xbyak/xbyak.h diff --git a/plugins/GSdx/xbyak/xbyak_mnemonic.h b/pcsx2/GS/xbyak/xbyak_mnemonic.h similarity index 100% rename from plugins/GSdx/xbyak/xbyak_mnemonic.h rename to pcsx2/GS/xbyak/xbyak_mnemonic.h diff --git a/plugins/GSdx/xbyak/xbyak_util.h b/pcsx2/GS/xbyak/xbyak_util.h similarity index 100% rename from plugins/GSdx/xbyak/xbyak_util.h rename to pcsx2/GS/xbyak/xbyak_util.h diff --git a/pcsx2/PluginManager.cpp b/pcsx2/PluginManager.cpp deleted file mode 100644 index 11317bbcae..0000000000 --- a/pcsx2/PluginManager.cpp +++ /dev/null @@ -1,1382 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2010 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#include "PrecompiledHeader.h" -#include "IopCommon.h" - -#include -#include -#include - -#include "GS.h" -#include "Gif.h" -#ifdef _WIN32 -#include "PAD/Windows/PAD.h" -#else -#include "PAD/Linux/PAD.h" -#endif - -#include "Utilities/pxStreams.h" -#include "gui/Dialogs/ModalPopups.h" - -#include "svnrev.h" -#include "ConsoleLogger.h" - -SysPluginBindings SysPlugins; - -bool SysPluginBindings::McdIsPresent( uint port, uint slot ) -{ - return !!Mcd->McdIsPresent( (PS2E_THISPTR) Mcd, port, slot ); -} - -void SysPluginBindings::McdGetSizeInfo( uint port, uint slot, PS2E_McdSizeInfo& outways ) -{ - if( Mcd->McdGetSizeInfo ) - Mcd->McdGetSizeInfo( (PS2E_THISPTR) Mcd, port, slot, &outways ); -} - -bool SysPluginBindings::McdIsPSX( uint port, uint slot ) -{ - return Mcd->McdIsPSX( (PS2E_THISPTR) Mcd, port, slot ); -} - -void SysPluginBindings::McdRead( uint port, uint slot, u8 *dest, u32 adr, int size ) -{ - Mcd->McdRead( (PS2E_THISPTR) Mcd, port, slot, dest, adr, size ); -} - -void SysPluginBindings::McdSave( uint port, uint slot, const u8 *src, u32 adr, int size ) -{ - Mcd->McdSave( (PS2E_THISPTR) Mcd, port, slot, src, adr, size ); -} - -void SysPluginBindings::McdEraseBlock( uint port, uint slot, u32 adr ) -{ - Mcd->McdEraseBlock( (PS2E_THISPTR) Mcd, port, slot, adr ); -} - -u64 SysPluginBindings::McdGetCRC( uint port, uint slot ) -{ - return Mcd->McdGetCRC( (PS2E_THISPTR) Mcd, port, slot ); -} - -void SysPluginBindings::McdNextFrame( uint port, uint slot ) { - Mcd->McdNextFrame( (PS2E_THISPTR) Mcd, port, slot ); -} - -bool SysPluginBindings::McdReIndex( uint port, uint slot, const wxString& filter ) { - return Mcd->McdReIndex( (PS2E_THISPTR) Mcd, port, slot, filter ); -} - -// ---------------------------------------------------------------------------- -// Yay, order of this array shouldn't be important. :) -// -const PluginInfo tbl_PluginInfo[] = -{ - { "GS", PluginId_GS, PS2E_LT_GS, PS2E_GS_VERSION }, - { NULL }, - - // See PluginEnums_t for details on the MemoryCard plugin hack. - { "Mcd", PluginId_Mcd, 0, 0 }, -}; - -typedef void CALLBACK VoidMethod(); -typedef void CALLBACK vMeth(); // shorthand for VoidMethod - -// ---------------------------------------------------------------------------- -struct LegacyApi_CommonMethod -{ - const char* MethodName; - - // fallback is used if the method is null. If the method is null and fallback is null - // also, the plugin is considered incomplete or invalid, and an error is generated. - VoidMethod* Fallback; - - // returns the method name as a wxString, converted from UTF8. - wxString GetMethodName( PluginsEnum_t pid ) const - { - return tbl_PluginInfo[pid].GetShortname() + fromUTF8( MethodName ); - } -}; - -// ---------------------------------------------------------------------------- -struct LegacyApi_ReqMethod -{ - const char* MethodName; - VoidMethod** Dest; // Target function where the binding is saved. - - // fallback is used if the method is null. If the method is null and fallback is null - // also, the plugin is considered incomplete or invalid, and an error is generated. - VoidMethod* Fallback; - - // returns the method name as a wxString, converted from UTF8. - wxString GetMethodName( ) const - { - return fromUTF8( MethodName ); - } -}; - -// ---------------------------------------------------------------------------- -struct LegacyApi_OptMethod -{ - const char* MethodName; - VoidMethod** Dest; // Target function where the binding is saved. - - // returns the method name as a wxString, converted from UTF8. - wxString GetMethodName() const { return fromUTF8( MethodName ); } -}; - - -static s32 CALLBACK fallback_freeze(int mode, freezeData *data) -{ - if( mode == FREEZE_SIZE ) data->size = 0; - return 0; -} - -static void CALLBACK fallback_keyEvent(keyEvent *ev) {} -static void CALLBACK fallback_setSettingsDir(const char* dir) {} -static void CALLBACK fallback_setLogDir(const char* dir) {} -static void CALLBACK fallback_configure() {} -static void CALLBACK fallback_about() {} -static s32 CALLBACK fallback_test() { return 0; } - -#ifndef BUILTIN_GS_PLUGIN -_GSvsync GSvsync; -_GSosdLog GSosdLog; -_GSosdMonitor GSosdMonitor; -_GSopen GSopen; -_GSopen2 GSopen2; -_GSgifTransfer GSgifTransfer; -_GSgifTransfer1 GSgifTransfer1; -_GSgifTransfer2 GSgifTransfer2; -_GSgifTransfer3 GSgifTransfer3; -_GSgifSoftReset GSgifSoftReset; -_GSreadFIFO GSreadFIFO; -_GSreadFIFO2 GSreadFIFO2; -_GSinitReadFIFO GSinitReadFIFO; -_GSinitReadFIFO2 GSinitReadFIFO2; -_GSchangeSaveState GSchangeSaveState; -_GSgetTitleInfo2 GSgetTitleInfo2; -_GSmakeSnapshot GSmakeSnapshot; -_GSmakeSnapshot2 GSmakeSnapshot2; -_GSirqCallback GSirqCallback; -_GSsetBaseMem GSsetBaseMem; -_GSsetGameCRC GSsetGameCRC; -_GSsetFrameSkip GSsetFrameSkip; -_GSsetVsync GSsetVsync; -_GSsetExclusive GSsetExclusive; -_GSsetupRecording GSsetupRecording; -_GSendRecording GSendRecording; -_GSreset GSreset; -_GSwriteCSR GSwriteCSR; -#endif - -static void CALLBACK GS_makeSnapshot(const char *path) {} -static void CALLBACK GS_setGameCRC(u32 crc, int gameopts) {} -static void CALLBACK GS_irqCallback(void (*callback)()) {} -static void CALLBACK GS_setFrameSkip(int frameskip) {} -static void CALLBACK GS_setVsync(int enabled) {} -static void CALLBACK GS_setExclusive(int isExcl) {} -static void CALLBACK GS_changeSaveState( int, const char* filename ) {} - -void CALLBACK GS_getTitleInfo2( char* dest, size_t length ) -{ - // Just return a generic "GS" title -- a plugin actually implementing this feature - // should return a title such as "GSdx" instead. --air - - dest[0] = 'G'; - dest[1] = 'S'; - dest[2] = 0; -} - -#if COPY_GS_PACKET_TO_MTGS == 1 -// This legacy passthrough function is needed because the old GS plugins tended to assume that -// a PATH1 transfer that didn't EOP needed an automatic EOP (which was needed to avoid a crash -// in the BIOS when it starts an XGKICK prior to having an EOP written to VU1 memory). The new -// MTGS wraps data around the end of the MTGS buffer, so it often splits PATH1 data into two -// transfers now. -static void CALLBACK GS_Legacy_gifTransfer( const u32* src, u32 data ) -{ - static __aligned16 u128 path1queue[0x400]; - static uint path1size = 0; - - const u128* src128 = (u128*)src; - - if( (src128 + data) >= &RingBuffer.m_Ring[RingBufferSize] ) - { - // the transfer is most likely wrapped/partial. We need to queue it into a linear buffer - // and then send it on its way on the next copy. - - memcpy( path1queue, src128, data*16); - path1size = data; - } - else - { - if (path1size != 0) - { - // Previous transfer check. *Most* likely this one should be added to it, but to know for - // sure we need to check to see if src points to the head of RingBuffer. If its pointing - // to like Ringbuffer[1] instead it means the last transfer finished and this transfer is - // a new one. - - if (src128 == RingBuffer.m_Ring) - { - pxAssert( (data+path1size) <= 0x400 ); - memcpy( &path1queue[path1size], src128, data*16); - path1size += data; - } - GSgifTransfer1( (u32*)path1queue, 0 ); - path1size = 0; - } - else - { - GSgifTransfer1( (u32*)src128, 0 ); - } - } -} -#else -// In this case the MTGS thread will only be using the "GSgifTransfer" -// callback, which falls back to this function if its an old plugin. -// Since GSgifTransfer2 is the least hacky old call-back, and MTGS will -// just be using a single gif path, we'll just solely use path 2... -static void CALLBACK GS_Legacy_gifTransfer(const u32* src, u32 data) { - GSgifTransfer2((u32*)src, data); -} -#endif - -static void CALLBACK GS_Legacy_GSreadFIFO2(u64* pMem, int qwc) { - while(qwc--) GSreadFIFO(pMem); -} - -uptr pDsp[2]; - -// ---------------------------------------------------------------------------- -// Important: Contents of this array must match the order of the contents of the -// LegacyPluginAPI_Common structure defined in Plugins.h. -// -static const LegacyApi_CommonMethod s_MethMessCommon[] = -{ - { "init", NULL }, - { "close", NULL }, - { "shutdown", NULL }, - - { "keyEvent", (vMeth*)fallback_keyEvent }, - { "setSettingsDir", (vMeth*)fallback_setSettingsDir }, - { "setLogDir", (vMeth*)fallback_setLogDir }, - - { "freeze", (vMeth*)fallback_freeze }, - { "test", (vMeth*)fallback_test }, - { "configure", fallback_configure }, - { "about", fallback_about }, - - { NULL } - -}; - -// ---------------------------------------------------------------------------- -// GS Mess! -// ---------------------------------------------------------------------------- -static const LegacyApi_ReqMethod s_MethMessReq_GS[] = -{ - { "GSopen", (vMeth**)&GSopen, NULL }, - { "GSvsync", (vMeth**)&GSvsync, NULL }, - { "GSgifTransfer", (vMeth**)&GSgifTransfer, (vMeth*)GS_Legacy_gifTransfer }, - { "GSgifTransfer2", (vMeth**)&GSgifTransfer2, NULL }, - { "GSgifTransfer3", (vMeth**)&GSgifTransfer3, NULL }, - { "GSreadFIFO2", (vMeth**)&GSreadFIFO2, (vMeth*)GS_Legacy_GSreadFIFO2 }, - - { "GSmakeSnapshot", (vMeth**)&GSmakeSnapshot, (vMeth*)GS_makeSnapshot }, - { "GSirqCallback", (vMeth**)&GSirqCallback, (vMeth*)GS_irqCallback }, - { "GSsetBaseMem", (vMeth**)&GSsetBaseMem, NULL }, - { "GSwriteCSR", (vMeth**)&GSwriteCSR, NULL }, - { "GSsetGameCRC", (vMeth**)&GSsetGameCRC, (vMeth*)GS_setGameCRC }, - - { "GSsetFrameSkip", (vMeth**)&GSsetFrameSkip, (vMeth*)GS_setFrameSkip }, - { "GSsetVsync", (vMeth**)&GSsetVsync, (vMeth*)GS_setVsync }, - { "GSsetExclusive", (vMeth**)&GSsetExclusive, (vMeth*)GS_setExclusive }, - { "GSchangeSaveState",(vMeth**)&GSchangeSaveState,(vMeth*)GS_changeSaveState }, - { "GSgetTitleInfo2", (vMeth**)&GSgetTitleInfo2, (vMeth*)GS_getTitleInfo2 }, - { NULL } -}; - -static const LegacyApi_OptMethod s_MethMessOpt_GS[] = -{ - { "GSosdLog", (vMeth**)&GSosdLog }, - { "GSosdMonitor", (vMeth**)&GSosdMonitor }, - { "GSopen2", (vMeth**)&GSopen2 }, - { "GSreset", (vMeth**)&GSreset }, - { "GSsetupRecording", (vMeth**)&GSsetupRecording }, - { "GSendRecording", (vMeth**)&GSendRecording }, - { "GSmakeSnapshot2", (vMeth**)&GSmakeSnapshot2 }, - { "GSgifSoftReset", (vMeth**)&GSgifSoftReset }, - { "GSreadFIFO", (vMeth**)&GSreadFIFO }, - { "GSinitReadFIFO", (vMeth**)&GSinitReadFIFO }, - { "GSinitReadFIFO2", (vMeth**)&GSinitReadFIFO2 }, - { "GSgifTransfer1", (vMeth**)&GSgifTransfer1 }, - { NULL } -}; - -static const LegacyApi_ReqMethod* const s_MethMessReq[] = -{ - s_MethMessReq_GS, -}; - -static const LegacyApi_OptMethod* const s_MethMessOpt[] = -{ - s_MethMessOpt_GS, -}; - -SysCorePlugins *g_plugins = NULL; - -// --------------------------------------------------------------------------------- -// Plugin-related Exception Implementations -// --------------------------------------------------------------------------------- - -wxString Exception::SaveStateLoadError::FormatDiagnosticMessage() const -{ - FastFormatUnicode retval; - retval.Write("Savestate is corrupt or incomplete!\n"); - OSDlog(Color_Red, false, "Error: Savestate is corrupt or incomplete!"); - _formatDiagMsg(retval); - return retval; -} - -wxString Exception::SaveStateLoadError::FormatDisplayMessage() const -{ - FastFormatUnicode retval; - retval.Write(_("The savestate cannot be loaded, as it appears to be corrupt or incomplete.")); - retval.Write("\n"); - OSDlog(Color_Red, false, "Error: The savestate cannot be loaded, as it appears to be corrupt or incomplete."); - _formatUserMsg(retval); - return retval; -} - -Exception::PluginOpenError::PluginOpenError( PluginsEnum_t pid ) -{ - PluginId = pid; - m_message_diag = L"%s plugin failed to open!"; - m_message_user = _("%s plugin failed to open. Your computer may have insufficient resources, or incompatible hardware/drivers."); -} - -Exception::PluginInitError::PluginInitError( PluginsEnum_t pid ) -{ - PluginId = pid; - m_message_diag = L"%s plugin initialization failed!"; - m_message_user = _("%s plugin failed to initialize. Your system may have insufficient memory or resources needed."); -} - -Exception::PluginLoadError::PluginLoadError( PluginsEnum_t pid ) -{ - PluginId = pid; -} - -wxString Exception::PluginLoadError::FormatDiagnosticMessage() const -{ - return pxsFmt( m_message_diag, WX_STR(tbl_PluginInfo[PluginId].GetShortname()) ) + - L"\n\n" + StreamName; -} - -wxString Exception::PluginLoadError::FormatDisplayMessage() const -{ - return pxsFmt( m_message_user, WX_STR(tbl_PluginInfo[PluginId].GetShortname()) ) + - L"\n\n" + StreamName; -} - -wxString Exception::PluginError::FormatDiagnosticMessage() const -{ - return pxsFmt( m_message_diag, WX_STR(tbl_PluginInfo[PluginId].GetShortname()) ); -} - -wxString Exception::PluginError::FormatDisplayMessage() const -{ - return pxsFmt( m_message_user, WX_STR(tbl_PluginInfo[PluginId].GetShortname()) ); -} - -wxString Exception::FreezePluginFailure::FormatDiagnosticMessage() const -{ - return pxsFmt( - L"%s plugin returned an error while saving the state.\n\n", - tbl_PluginInfo[PluginId].shortname - ); -} - -wxString Exception::FreezePluginFailure::FormatDisplayMessage() const -{ - // [TODO] - return m_message_user; -} - -wxString Exception::ThawPluginFailure::FormatDiagnosticMessage() const -{ - return pxsFmt( - L"%s plugin returned an error while loading the state.\n\n", - tbl_PluginInfo[PluginId].shortname - ); -} - -wxString Exception::ThawPluginFailure::FormatDisplayMessage() const -{ - // [TODO] - return m_message_user; -} - -// -------------------------------------------------------------------------------------- -// PCSX2 Callbacks passed to Plugins -// -------------------------------------------------------------------------------------- -// This is currently unimplemented, and should be provided by the AppHost (gui) rather -// than the EmuCore. But as a quickhackfix until the new plugin API is fleshed out, this -// will suit our needs nicely. :) - -static BOOL PS2E_CALLBACK pcsx2_GetInt( const char* name, int* dest ) -{ - return FALSE; // not implemented... -} - -static BOOL PS2E_CALLBACK pcsx2_GetBoolean( const char* name, BOOL* result ) -{ - return FALSE; // not implemented... -} - -static BOOL PS2E_CALLBACK pcsx2_GetString( const char* name, char* dest, int maxlen ) -{ - return FALSE; // not implemented... -} - -static char* PS2E_CALLBACK pcsx2_GetStringAlloc( const char* name, void* (PS2E_CALLBACK* allocator)(int size) ) -{ - return FALSE; // not implemented... -} - -static void PS2E_CALLBACK pcsx2_OSD_WriteLn( int icon, const char* msg ) -{ - OSDlog( Color_StrongYellow, false, msg ); -} - -// --------------------------------------------------------------------------------- -// DynamicStaticLibrary -// --------------------------------------------------------------------------------- -StaticLibrary::StaticLibrary(PluginsEnum_t _pid) : pid(_pid) -{ -} - -bool StaticLibrary::Load(const wxString& name) -{ - return true; -} - -void* StaticLibrary::GetSymbol(const wxString &name) -{ -#define RETURN_SYMBOL(s) if (name == #s) return (void*)&s; - -#define RETURN_COMMON_SYMBOL(p) \ - RETURN_SYMBOL(p##init) \ - RETURN_SYMBOL(p##close) \ - RETURN_SYMBOL(p##shutdown) \ - RETURN_SYMBOL(p##keyEvent) \ - RETURN_SYMBOL(p##setSettingsDir) \ - RETURN_SYMBOL(p##setLogDir) \ - RETURN_SYMBOL(p##freeze) \ - RETURN_SYMBOL(p##test) \ - RETURN_SYMBOL(p##configure) \ - RETURN_SYMBOL(p##about) - -#ifdef BUILTIN_GS_PLUGIN - RETURN_COMMON_SYMBOL(GS); -#endif - -#undef RETURN_COMMON_SYMBOL -#undef RETURN_SYMBOL - - return NULL; -} - -bool StaticLibrary::HasSymbol(const wxString &name) -{ - return false; -} - -DynamicLibrary::DynamicLibrary() : Lib() -{ -} - -bool DynamicLibrary::Load(const wxString& name) -{ - return Lib.Load(name); -} - -void* DynamicLibrary::GetSymbol(const wxString &name) -{ - return Lib.GetSymbol(name); -} - -bool DynamicLibrary::HasSymbol(const wxString &name) -{ - return Lib.HasSymbol(name); -} - -// --------------------------------------------------------------------------------- -// PluginStatus_t Implementations -// --------------------------------------------------------------------------------- -SysCorePlugins::SysCorePlugins() : - m_mcdPlugin(NULL), m_SettingsFolder(), m_LogFolder(), m_mtx_PluginStatus(), m_mcdOpen(false) -{ -} - -SysCorePlugins::PluginStatus_t::PluginStatus_t( PluginsEnum_t _pid, const wxString& srcfile ) - : Filename( srcfile ) -{ - pid = _pid; - - IsInitialized = false; - IsOpened = false; - - switch (_pid) { -#ifdef BUILTIN_GS_PLUGIN - case PluginId_GS: -#endif - case PluginId_Count: - IsStatic = true; - Lib = new StaticLibrary(_pid); - break; - default: - IsStatic = false; - Lib = new DynamicLibrary(); - break; - } - - if (IsStatic) { - BindCommon( pid ); - - } else { - if( Filename.IsEmpty() ) - throw Exception::PluginInitError( pid ).SetDiagMsg( L"Empty plugin filename" ); - - if( !wxFile::Exists( Filename ) ) - throw Exception::PluginLoadError( pid ).SetStreamName(srcfile) - .SetBothMsgs(pxL("The configured %s plugin file was not found")); - - if( !Lib->Load( Filename ) ) - throw Exception::PluginLoadError( pid ).SetStreamName(Filename) - .SetBothMsgs(pxL("The configured %s plugin file is not a valid dynamic library")); - - - // Try to enumerate the new v2.0 plugin interface first. - // If that fails, fall back on the old style interface. - - //m_libs[i].GetSymbol( L"PS2E_InitAPI" ); // on the TODO list! - - - // 2.0 API Failed; Enumerate the Old Stuff! --> - - _PS2EgetLibName GetLibName = (_PS2EgetLibName) Lib->GetSymbol( L"PS2EgetLibName" ); - _PS2EgetLibVersion2 GetLibVersion2 = (_PS2EgetLibVersion2) Lib->GetSymbol( L"PS2EgetLibVersion2" ); - - if( GetLibName == NULL || GetLibVersion2 == NULL ) - throw Exception::PluginLoadError( pid ).SetStreamName(Filename) - .SetDiagMsg(L"%s plugin init failed: Method binding failure on GetLibName or GetLibVersion2.") - .SetUserMsg(_( "The configured %s plugin is not a PCSX2 plugin, or is for an older unsupported version of PCSX2.")); - - Name = fromUTF8( GetLibName() ); - int version = GetLibVersion2( tbl_PluginInfo[pid].typemask ); - Version.Printf( L"%d.%d.%d", (version>>8)&0xff, version&0xff, (version>>24)&0xff ); - - // Bind Required Functions - // (generate critical error if binding fails) - - BindCommon( pid ); - BindRequired( pid ); - BindOptional( pid ); - } - - - // Run Plugin's Functionality Test. - // A lot of plugins don't bother to implement this function and return 0 (success) - // regardless, but some do so let's go ahead and check it. I mean, we're supposed to. :) - - int testres = CommonBindings.Test(); - if( testres != 0 ) - throw Exception::PluginLoadError( pid ).SetStreamName(Filename) - .SetDiagMsg(wxsFormat( L"Plugin Test failure, return code: %d", testres )) - .SetUserMsg(_("The plugin reports that your hardware or software/drivers are not supported.")); -} - -void SysCorePlugins::PluginStatus_t::BindCommon( PluginsEnum_t pid ) -{ - const LegacyApi_CommonMethod* current = s_MethMessCommon; - VoidMethod** target = (VoidMethod**)&CommonBindings; - - wxDoNotLogInThisScope please; - - while( current->MethodName != NULL ) - { - *target = (VoidMethod*)Lib->GetSymbol( current->GetMethodName( pid ) ); - - if( *target == NULL ) - *target = current->Fallback; - - if( *target == NULL ) - { - throw Exception::PluginLoadError( pid ).SetStreamName(Filename) - .SetDiagMsg(wxsFormat( L"\nMethod binding failure on: %s\n", WX_STR(current->GetMethodName( pid )) )) - .SetUserMsg(_("Configured plugin is not a PCSX2 plugin, or is for an older unsupported version of PCSX2.")); - } - - target++; - current++; - } -} - -void SysCorePlugins::PluginStatus_t::BindRequired( PluginsEnum_t pid ) -{ - const LegacyApi_ReqMethod* current = s_MethMessReq[pid]; - - wxDoNotLogInThisScope please; - - while( current->MethodName != NULL ) - { - *(current->Dest) = (VoidMethod*)Lib->GetSymbol( current->GetMethodName() ); - - if( *(current->Dest) == NULL ) - *(current->Dest) = current->Fallback; - - if( *(current->Dest) == NULL ) - { - throw Exception::PluginLoadError( pid ).SetStreamName(Filename) - .SetDiagMsg(wxsFormat( L"\n%s plugin init error; Method binding failed: %s\n", WX_STR(current->GetMethodName()) )) - .SetUserMsg(_( "Configured %s plugin is not a valid PCSX2 plugin, or is for an older unsupported version of PCSX2.")); - } - - current++; - } -} - -void SysCorePlugins::PluginStatus_t::BindOptional( PluginsEnum_t pid ) -{ - const LegacyApi_OptMethod* current = s_MethMessOpt[pid]; - - wxDoNotLogInThisScope please; - - while( current->MethodName != NULL ) - { - *(current->Dest) = (VoidMethod*)Lib->GetSymbol( current->GetMethodName() ); - current++; - } -} - -// ===================================================================================== -// SysCorePlugins Implementations -// ===================================================================================== - -SysCorePlugins::~SysCorePlugins() -{ - try - { - Unload(); - } - DESTRUCTOR_CATCHALL - - // All library unloading done automatically by wx. -} - -void SysCorePlugins::Load( PluginsEnum_t pid, const wxString& srcfile ) -{ - ScopedLock lock( m_mtx_PluginStatus ); - pxAssert( (uint)pid < PluginId_Count ); - - m_info[pid] = std::make_unique(pid, srcfile); - - Console.Indent().WriteLn(L"Bound %4s: %s [%s %s]", WX_STR(tbl_PluginInfo[pid].GetShortname()), - WX_STR(wxFileName(srcfile).GetFullName()), WX_STR(m_info[pid]->Name), WX_STR(m_info[pid]->Version)); -} - -void SysCorePlugins::Load( const wxString (&folders)[PluginId_Count] ) -{ - if( !NeedsLoad() ) return; - - wxDoNotLogInThisScope please; - - Console.WriteLn(Color_StrongBlue, L"\nLoading plugins from %s...", WX_STR(g_Conf->Folders[FolderId_Plugins].ToString())); - - ConsoleIndentScope indent; - - ForPlugins([&] (const PluginInfo * pi) { - Load( pi->id, folders[pi->id] ); - pxYield( 2 ); - }); - - indent.LeaveScope(); - - Console.WriteLn( Color_StrongBlue, "Plugins loaded successfully.\n" ); - - // HACK! Manually bind the Internal MemoryCard plugin for now, until - // we get things more completed in the new plugin api. - - static const PS2E_EmulatorInfo myself = - { - "PCSX2", - - { 0, PCSX2_VersionHi, PCSX2_VersionLo, SVN_REV }, - - (int)x86caps.PhysicalCores, - (int)x86caps.LogicalCores, - sizeof(wchar_t), - - { 0,0,0,0,0,0 }, - - pcsx2_GetInt, - pcsx2_GetBoolean, - pcsx2_GetString, - pcsx2_GetStringAlloc, - pcsx2_OSD_WriteLn, - - NULL, // AddMenuItem - NULL, // Menu_Create - NULL, // Menu_Delete - NULL, // Menu_AddItem - - { 0 }, // MenuItem - { 0 }, // Console - { 0 }, // ConsoleW - - { 0,0,0,0,0,0,0,0 }, - }; - - m_mcdPlugin = FileMcd_InitAPI( &myself ); - if( m_mcdPlugin == NULL ) - { - // fixme: use plugin's GetLastError (not implemented yet!) - throw Exception::PluginLoadError( PluginId_Mcd ).SetDiagMsg(L"Internal Memorycard Plugin failed to load."); - } - - SendLogFolder(); - SendSettingsFolder(); -} - -void SysCorePlugins::Unload(PluginsEnum_t pid) -{ - ScopedLock lock( m_mtx_PluginStatus ); - pxAssert( (uint)pid < PluginId_Count ); - m_info[pid] = nullptr; -} - -void SysCorePlugins::Unload() -{ - if( NeedsShutdown() ) - Console.Warning( "(SysCorePlugins) Warning: Unloading plugins prior to shutdown!" ); - - //Shutdown(); - - if( !NeedsUnload() ) return; - - DbgCon.WriteLn( Color_StrongBlue, "Unloading plugins..." ); - - for( int i=PluginId_Count-1; i>=0; --i ) - Unload( tbl_PluginInfo[i].id ); - - DbgCon.WriteLn( Color_StrongBlue, "Plugins unloaded successfully." ); -} - -// Exceptions: -// FileNotFound - Thrown if one of the configured plugins doesn't exist. -// NotPcsxPlugin - Thrown if one of the configured plugins is an invalid or unsupported DLL - -extern bool renderswitch; -extern void spu2DMA4Irq(); -extern void spu2DMA7Irq(); -extern void spu2Irq(); - -bool SysCorePlugins::OpenPlugin_GS() -{ - GetMTGS().Resume(); - return true; -} - -bool SysCorePlugins::OpenPlugin_Mcd() -{ - ScopedLock lock( m_mtx_PluginStatus ); - - // [TODO] Fix up and implement PS2E_SessionInfo here!! (the currently NULL parameter) - if( SysPlugins.Mcd ) - SysPlugins.Mcd->Base.EmuOpen( (PS2E_THISPTR) SysPlugins.Mcd, NULL ); - - return true; -} - -void SysCorePlugins::Open( PluginsEnum_t pid ) -{ - pxAssert( (uint)pid < PluginId_Count ); - if( IsOpen(pid) ) return; - - Console.Indent().WriteLn( "Opening %s", tbl_PluginInfo[pid].shortname ); - - // Each Open needs to be called explicitly. >_< - - bool result = true; - switch( pid ) - { - case PluginId_GS: result = OpenPlugin_GS(); break; - - jNO_DEFAULT; - } - if( !result ) - throw Exception::PluginOpenError( pid ); - - ScopedLock lock( m_mtx_PluginStatus ); - if( m_info[pid] ) m_info[pid]->IsOpened = true; -} - -void SysCorePlugins::Open() -{ - Init(); - - if( !NeedsOpen() ) return; // Spam stopper: returns before writing any logs. >_< - - Console.WriteLn( Color_StrongBlue, "Opening plugins..." ); - - SendSettingsFolder(); - - ForPlugins([&] (const PluginInfo * pi) { - Open( pi->id ); - // If GS doesn't support GSopen2, need to wait until call to GSopen - // returns to populate pDsp. If it does, can initialize other plugins - // at same time as GS, as long as GSopen2 does not subclass its window. -#ifdef __linux__ - // On linux, application have also a channel (named display) to communicate with the - // Xserver. The safe rule is 1 thread, 1 channel. In our case we use the display in - // several places. Save yourself of multithread headache. Wait few seconds the end of - // gsopen -- Gregory - if (pi->id == PluginId_GS) GetMTGS().WaitForOpen(); -#else - if (pi->id == PluginId_GS && !GSopen2) GetMTGS().WaitForOpen(); -#endif - }); - - if (GSopen2) GetMTGS().WaitForOpen(); - - if( !m_mcdOpen.exchange(true) ) - { - DbgCon.Indent().WriteLn( "Opening Memorycards"); - OpenPlugin_Mcd(); - } - - Console.WriteLn( Color_StrongBlue, "Plugins opened successfully." ); -} - -void SysCorePlugins::_generalclose( PluginsEnum_t pid ) -{ - ScopedLock lock( m_mtx_PluginStatus ); - if( m_info[pid] ) m_info[pid]->CommonBindings.Close(); -} - -void SysCorePlugins::ClosePlugin_GS() -{ - if( GetMTGS().IsSelf() || GSDump::isRunning ) - _generalclose( PluginId_GS ); - else - { - if (!GSopen2) - PADclose(); - GetMTGS().Suspend(); - } -} - -void SysCorePlugins::ClosePlugin_Mcd() -{ - ScopedLock lock( m_mtx_PluginStatus ); - if( SysPlugins.Mcd ) SysPlugins.Mcd->Base.EmuClose( (PS2E_THISPTR) SysPlugins.Mcd ); -} - -void SysCorePlugins::Close( PluginsEnum_t pid ) -{ - pxAssert( (uint)pid < PluginId_Count ); - - if (!(IsOpen(pid) || GSDump::isRunning) ) return; - - if( !GetMTGS().IsSelf() ) // stop the spam! - Console.Indent().WriteLn( "Closing %s", tbl_PluginInfo[pid].shortname ); - - switch( pid ) - { - case PluginId_GS: ClosePlugin_GS(); break; - case PluginId_Mcd: ClosePlugin_Mcd(); break; - - jNO_DEFAULT; - } - - ScopedLock lock( m_mtx_PluginStatus ); - if( m_info[pid] ) m_info[pid]->IsOpened = false; -} - -void SysCorePlugins::Close() -{ - if( !(NeedsClose() || GSDump::isRunning) ) return; // Spam stopper; returns before writing any logs. >_< - - // Close plugins in reverse order of the initialization procedure, which - // ensures the GS gets closed last. - - Console.WriteLn( Color_StrongBlue, "Closing plugins..." ); - - if( m_mcdOpen.exchange(false) ) - { - DbgCon.Indent().WriteLn( "Closing Memorycards"); - ClosePlugin_Mcd(); - } - - for( int i=PluginId_Count-1; i>=0; --i ) - Close( tbl_PluginInfo[i].id ); - - Console.WriteLn( Color_StrongBlue, "Plugins closed successfully." ); -} - -void SysCorePlugins::Init( PluginsEnum_t pid ) -{ - ScopedLock lock( m_mtx_PluginStatus ); - - if( !m_info[pid] || m_info[pid]->IsInitialized ) return; - - Console.Indent().WriteLn( "Init %s", tbl_PluginInfo[pid].shortname ); - if( 0 != m_info[pid]->CommonBindings.Init() ) - throw Exception::PluginInitError( pid ); - - m_info[pid]->IsInitialized = true; -} - -void SysCorePlugins::Shutdown( PluginsEnum_t pid ) -{ - ScopedLock lock( m_mtx_PluginStatus ); - - if( !m_info[pid] || !m_info[pid]->IsInitialized ) return; - DevCon.Indent().WriteLn( "Shutdown %s", tbl_PluginInfo[pid].shortname ); - m_info[pid]->IsInitialized = false; - m_info[pid]->CommonBindings.Shutdown(); -} - -// Initializes all plugins. Plugin initialization should be done once for every new emulation -// session. During a session emulation can be paused/resumed using Open/Close, and should be -// terminated using Shutdown(). -// -// Returns TRUE if an init was performed for any (or all) plugins. Returns FALSE if all -// plugins were already in an initialized state (no action taken). -// -// In a purist emulation sense, Init() and Shutdown() should only ever need be called for when -// the PS2's hardware has received a *full* hard reset. Soft resets typically should rely on -// the PS2's bios/kernel to re-initialize hardware on the fly. -// -bool SysCorePlugins::Init() -{ - if( !NeedsInit() ) return false; - - Console.WriteLn( Color_StrongBlue, "Initializing plugins..." ); - - ForPlugins([&] (const PluginInfo * pi) { - Init( pi->id ); - }); - - if( SysPlugins.Mcd == NULL ) - { - SysPlugins.Mcd = (PS2E_ComponentAPI_Mcd*)m_mcdPlugin->NewComponentInstance( PS2E_TYPE_Mcd ); - if( SysPlugins.Mcd == NULL ) - { - // fixme: use plugin's GetLastError (not implemented yet!) - throw Exception::PluginInitError( PluginId_Mcd ) - .SetBothMsgs(pxLt("Internal Memorycard Plugin failed to initialize.")); - } - } - - Console.WriteLn( Color_StrongBlue, "Plugins initialized successfully.\n" ); - - return true; -} - - -// Shuts down all plugins. Plugins are closed first, if necessary. -// Returns TRUE if a shutdown was performed for any (or all) plugins. Returns FALSE if all -// plugins were already in shutdown state (no action taken). -// -// In a purist emulation sense, Init() and Shutdown() should only ever need be called for when -// the PS2's hardware has received a *full* hard reset. Soft resets typically should rely on -// the PS2's bios/kernel to re-initialize hardware on the fly. -// -bool SysCorePlugins::Shutdown() -{ - if( !NeedsShutdown()) return false; - - pxAssertDev( !NeedsClose(), "Cannot shut down plugins prior to Close()" ); - - GetMTGS().Cancel(); // cancel it for speedier shutdown! - - Console.WriteLn( Color_StrongGreen, "Shutting down plugins..." ); - - // Shutdown plugins in reverse order (probably doesn't matter... - // ... but what the heck, right?) - - for( int i=PluginId_Count-1; i>=0; --i ) - { - Shutdown( tbl_PluginInfo[i].id ); - } - - // More memorycard hacks!! - - if( (SysPlugins.Mcd != NULL) && (m_mcdPlugin != NULL) ) - { - m_mcdPlugin->DeleteComponentInstance( (PS2E_THISPTR)SysPlugins.Mcd ); - SysPlugins.Mcd = NULL; - } - - Console.WriteLn( Color_StrongGreen, "Plugins shutdown successfully." ); - - return true; -} - -// For internal use only, unless you're the MTGS. Then it's for you too! -// Returns false if the plugin returned an error. -bool SysCorePlugins::DoFreeze( PluginsEnum_t pid, int mode, freezeData* data, bool bypass_tsafety ) -{ - if( (pid == PluginId_GS) && !GetMTGS().IsSelf() && !bypass_tsafety ) - { - // GS needs some thread safety love... - - MTGS_FreezeData woot = { data, 0 }; - GetMTGS().Freeze( mode, woot ); - return woot.retval != -1; - } - else - { - ScopedLock lock( m_mtx_PluginStatus ); - return !m_info[pid] || m_info[pid]->CommonBindings.Freeze( mode, data ) != -1; - } -} - -// Thread Safety: -// This function should only be called by the Main GUI thread and the GS thread (for GS states only), -// as it has special handlers to ensure that GS freeze commands are executed appropriately on the -// GS thread. -// -void SysCorePlugins::Freeze( PluginsEnum_t pid, SaveStateBase& state ) -{ - // No locking leeded -- DoFreeze locks as needed, and this avoids MTGS deadlock. - //ScopedLock lock( m_mtx_PluginStatus ); - - freezeData fP = { 0, NULL }; - if( !DoFreeze( pid, FREEZE_SIZE, &fP ) ) - fP.size = 0; - - int fsize = fP.size; - state.Freeze( fsize ); - - Console.Indent().WriteLn( "%s %s", state.IsSaving() ? "Saving" : "Loading", - tbl_PluginInfo[pid].shortname ); - - if( state.IsLoading() && (fsize == 0) ) - { - // no state data to read, but the plugin expects some state data. - // Issue a warning to console... - if( fP.size != 0 ) - Console.Indent().Warning( "Warning: No data for this plugin was found. Plugin status may be unpredictable." ); - return; - - // Note: Size mismatch check could also be done here on loading, but - // some plugins may have built-in version support for non-native formats or - // older versions of a different size... or could give different sizes depending - // on the status of the plugin when loading, so let's ignore it. - } - - fP.size = fsize; - if( fP.size == 0 ) return; - - state.PrepBlock( fP.size ); - fP.data = (s8*)state.GetBlockPtr(); - - if( state.IsSaving() ) - { - if( !DoFreeze(pid, FREEZE_SAVE, &fP) ) - throw Exception::FreezePluginFailure( pid ); - } - else - { - if( !DoFreeze(pid, FREEZE_LOAD, &fP) ) - throw Exception::ThawPluginFailure( pid ); - } - - state.CommitBlock( fP.size ); -} - -size_t SysCorePlugins::GetFreezeSize( PluginsEnum_t pid ) -{ - freezeData fP = { 0, NULL }; - if (!DoFreeze( pid, FREEZE_SIZE, &fP)) return 0; - return fP.size; -} - -void SysCorePlugins::FreezeOut( PluginsEnum_t pid, void* dest ) -{ - // No locking needed -- DoFreeze locks as needed, and this avoids MTGS deadlock. - //ScopedLock lock( m_mtx_PluginStatus ); - - freezeData fP = { 0, (s8*)dest }; - if (!DoFreeze( pid, FREEZE_SIZE, &fP)) return; - if (!fP.size) return; - - Console.Indent().WriteLn( "Saving %s", tbl_PluginInfo[pid].shortname ); - - if (!DoFreeze(pid, FREEZE_SAVE, &fP)) - throw Exception::FreezePluginFailure( pid ); -} - -void SysCorePlugins::FreezeOut( PluginsEnum_t pid, pxOutputStream& outfp ) -{ - // No locking needed -- DoFreeze locks as needed, and this avoids MTGS deadlock. - //ScopedLock lock( m_mtx_PluginStatus ); - - freezeData fP = { 0, NULL }; - if (!DoFreeze( pid, FREEZE_SIZE, &fP)) return; - if (!fP.size) return; - - Console.Indent().WriteLn( "Saving %s", tbl_PluginInfo[pid].shortname ); - - ScopedAlloc data( fP.size ); - fP.data = data.GetPtr(); - - if (!DoFreeze(pid, FREEZE_SAVE, &fP)) - throw Exception::FreezePluginFailure( pid ); - - outfp.Write( fP.data, fP.size ); -} - -void SysCorePlugins::FreezeIn( PluginsEnum_t pid, pxInputStream& infp ) -{ - // No locking needed -- DoFreeze locks as needed, and this avoids MTGS deadlock. - //ScopedLock lock( m_mtx_PluginStatus ); - - freezeData fP = { 0, NULL }; - if (!DoFreeze( pid, FREEZE_SIZE, &fP )) - fP.size = 0; - - Console.Indent().WriteLn( "Loading %s", tbl_PluginInfo[pid].shortname ); - - if (!infp.IsOk() || !infp.Length()) - { - // no state data to read, but the plugin expects some state data? - // Issue a warning to console... - if( fP.size != 0 ) - Console.Indent().Warning( "Warning: No data for this plugin was found. Plugin status may be unpredictable." ); - - return; - - // Note: Size mismatch check could also be done here on loading, but - // some plugins may have built-in version support for non-native formats or - // older versions of a different size... or could give different sizes depending - // on the status of the plugin when loading, so let's ignore it. - } - - ScopedAlloc data( fP.size ); - fP.data = data.GetPtr(); - - infp.Read( fP.data, fP.size ); - if (!DoFreeze(pid, FREEZE_LOAD, &fP)) - throw Exception::ThawPluginFailure( pid ); -} - -bool SysCorePlugins::KeyEvent( const keyEvent& evt ) -{ - ScopedLock lock( m_mtx_PluginStatus ); - - // [TODO] : The plan here is to give plugins "first chance" handling of keys. - // Handling order will be fixed (GS, SPU2, PAD, etc), and the first plugin to - // pick up the key and return "true" (for handled) will cause the loop to break. - // The current version of PS2E doesn't support it yet, though. - - ForPlugins([&] (const PluginInfo * pi) { - if( m_info[pi->id] ) - m_info[pi->id]->CommonBindings.KeyEvent( const_cast(&evt) ); - }); - - return false; -} - -void SysCorePlugins::SendSettingsFolder() -{ - ScopedLock lock( m_mtx_PluginStatus ); - if( m_SettingsFolder.IsEmpty() ) return; - - ForPlugins([&] (const PluginInfo * pi) { - if( m_info[pi->id] ) m_info[pi->id]->CommonBindings.SetSettingsDir( m_SettingsFolder.utf8_str() ); - }); -} - -void SysCorePlugins::SetSettingsFolder( const wxString& folder ) -{ - ScopedLock lock( m_mtx_PluginStatus ); - - wxString fixedfolder( folder ); - if( !fixedfolder.IsEmpty() && (fixedfolder[fixedfolder.length()-1] != wxFileName::GetPathSeparator() ) ) - { - fixedfolder += wxFileName::GetPathSeparator(); - } - - if( m_SettingsFolder == fixedfolder ) return; - m_SettingsFolder = fixedfolder; -} - -void SysCorePlugins::SendLogFolder() -{ - ScopedLock lock( m_mtx_PluginStatus ); - if( m_LogFolder.IsEmpty() ) return; - - ForPlugins([&] (const PluginInfo * pi) { - if( m_info[pi->id] ) m_info[pi->id]->CommonBindings.SetLogDir( m_LogFolder.utf8_str() ); - }); -} - -void SysCorePlugins::SetLogFolder( const wxString& folder ) -{ - ScopedLock lock( m_mtx_PluginStatus ); - - wxString fixedfolder( folder ); - if( !fixedfolder.IsEmpty() && (fixedfolder[fixedfolder.length()-1] != wxFileName::GetPathSeparator() ) ) - { - fixedfolder += wxFileName::GetPathSeparator(); - } - - if( m_LogFolder == fixedfolder ) return; - m_LogFolder = fixedfolder; -} - -void SysCorePlugins::Configure( PluginsEnum_t pid ) -{ - ScopedLock lock( m_mtx_PluginStatus ); - if( m_info[pid] ) m_info[pid]->CommonBindings.Configure(); -} - -bool SysCorePlugins::AreLoaded() const -{ - ScopedLock lock( m_mtx_PluginStatus ); - for( int i=0; iid); - }); -} - -bool SysCorePlugins::AreAnyLoaded() const -{ - ScopedLock lock( m_mtx_PluginStatus ); - for( int i=0; iid); - }); -} - -bool SysCorePlugins::IsOpen( PluginsEnum_t pid ) const -{ - pxAssert( (uint)pid < PluginId_Count ); - ScopedLock lock( m_mtx_PluginStatus ); - return m_info[pid] && m_info[pid]->IsInitialized && m_info[pid]->IsOpened; -} - -bool SysCorePlugins::IsInitialized( PluginsEnum_t pid ) const -{ - pxAssert( (uint)pid < PluginId_Count ); - ScopedLock lock( m_mtx_PluginStatus ); - return m_info[pid] && m_info[pid]->IsInitialized; -} - -bool SysCorePlugins::IsLoaded( PluginsEnum_t pid ) const -{ - pxAssert( (uint)pid < PluginId_Count ); - return !!m_info[pid]; -} - -bool SysCorePlugins::NeedsLoad() const -{ - return IfPlugins([&] (const PluginInfo * pi) { - return !IsLoaded(pi->id); - }); -} - -bool SysCorePlugins::NeedsUnload() const -{ - - return IfPlugins([&] (const PluginInfo * pi) { - return IsLoaded(pi->id); - }); -} - -bool SysCorePlugins::NeedsInit() const -{ - ScopedLock lock( m_mtx_PluginStatus ); - - return IfPlugins([&] (const PluginInfo * pi) { - return !IsInitialized(pi->id); - }); -} - -bool SysCorePlugins::NeedsShutdown() const -{ - ScopedLock lock( m_mtx_PluginStatus ); - - return IfPlugins([&] (const PluginInfo * pi) { - return IsInitialized(pi->id); - }); -} - -bool SysCorePlugins::NeedsOpen() const -{ - return IfPlugins([&] (const PluginInfo * pi) { - return !IsOpen(pi->id); - }); -} - -bool SysCorePlugins::NeedsClose() const -{ - return IfPlugins([&] (const PluginInfo * pi) { - return IsOpen(pi->id); - }); -} - -const wxString SysCorePlugins::GetName( PluginsEnum_t pid ) const -{ - ScopedLock lock( m_mtx_PluginStatus ); - pxAssert( (uint)pid < PluginId_Count ); - return m_info[pid] ? m_info[pid]->Name : (wxString)_("Unloaded Plugin"); -} - -const wxString SysCorePlugins::GetVersion( PluginsEnum_t pid ) const -{ - ScopedLock lock( m_mtx_PluginStatus ); - pxAssert( (uint)pid < PluginId_Count ); - return m_info[pid] ? m_info[pid]->Version : L"0.0"; -} diff --git a/pcsx2/Plugins.h b/pcsx2/Plugins.h deleted file mode 100644 index b761afc2c0..0000000000 --- a/pcsx2/Plugins.h +++ /dev/null @@ -1,456 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2010 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#pragma once - -#define PLUGINtypedefs -#define PLUGINfuncs - -#include "Config.h" -#include "PS2Edefs.h" -#include "PluginCallbacks.h" - -#include -#include "Utilities/Threading.h" - -#include - -#ifdef _MSC_VER - -// Disabling C4673: throwing 'Exception::Blah' the following types will not be considered at the catch site -// The warning is bugged, and happens even though we're properly inheriting classes with -// 'virtual' qualifiers. But since the warning is potentially useful elsewhere, I disable -// it only for the scope of these exceptions. - -# pragma warning(push) -# pragma warning(disable:4673) -#endif - -struct PluginInfo -{ - const char* shortname; - PluginsEnum_t id; - int typemask; - int version; // minimum version required / supported - - wxString GetShortname() const - { - return fromUTF8( shortname ); - } -}; - -// -------------------------------------------------------------------------------------- -// Plugin-related Exceptions -// -------------------------------------------------------------------------------------- -namespace Exception -{ - // Exception thrown when a corrupted or truncated savestate is encountered. - class SaveStateLoadError : public BadStream - { - DEFINE_STREAM_EXCEPTION( SaveStateLoadError, BadStream ) - - virtual wxString FormatDiagnosticMessage() const; - virtual wxString FormatDisplayMessage() const; - }; - - class PluginError : public RuntimeError - { - DEFINE_RUNTIME_EXCEPTION( PluginError, RuntimeError, L"Generic plugin error!" ) - - public: - PluginsEnum_t PluginId; - - public: - explicit PluginError( PluginsEnum_t pid ) - { - PluginId = pid; - } - - virtual wxString FormatDiagnosticMessage() const; - virtual wxString FormatDisplayMessage() const; - }; - - // Plugin load errors occur when initially trying to load plugins during the - // creation of a SysCorePlugins object. The error may either be due to non-existence, - // corruption, or incompatible versioning. - class PluginLoadError : public PluginError - { - DEFINE_EXCEPTION_COPYTORS( PluginLoadError, PluginError ) - DEFINE_EXCEPTION_MESSAGES( PluginLoadError ) - - public: - wxString StreamName; - - protected: - PluginLoadError() {} - - public: - PluginLoadError( PluginsEnum_t pid ); - - virtual PluginLoadError& SetStreamName( const wxString& name ) { StreamName = name; return *this; } \ - virtual PluginLoadError& SetStreamName( const char* name ) { StreamName = fromUTF8(name); return *this; } - - virtual wxString FormatDiagnosticMessage() const; - virtual wxString FormatDisplayMessage() const; - }; - - // Thrown when a plugin fails it's init() callback. The meaning of this error is entirely - // dependent on the plugin and, in most cases probably never happens (most plugins do little - // more than a couple basic memory reservations during init) - class PluginInitError : public PluginError - { - DEFINE_EXCEPTION_COPYTORS( PluginInitError, PluginError ) - DEFINE_EXCEPTION_MESSAGES( PluginInitError ) - - protected: - PluginInitError() {} - - public: - PluginInitError( PluginsEnum_t pid ); - }; - - // Plugin failed to open. Typically this is a non-critical error that means the plugin has - // not been configured properly by the user, but may also be indicative of a system - class PluginOpenError : public PluginError - { - DEFINE_EXCEPTION_COPYTORS( PluginOpenError, PluginError ) - DEFINE_EXCEPTION_MESSAGES( PluginOpenError ) - - protected: - PluginOpenError() {} - - public: - explicit PluginOpenError( PluginsEnum_t pid ); - }; - - // This exception is thrown when a plugin returns an error while trying to save itself. - // Typically this should be a very rare occurance since a plugin typically shoudn't - // be doing memory allocations or file access during state saving. - // - class FreezePluginFailure : public PluginError - { - DEFINE_EXCEPTION_COPYTORS( FreezePluginFailure, PluginError ) - DEFINE_EXCEPTION_MESSAGES( FreezePluginFailure ) - - protected: - FreezePluginFailure() {} - - public: - explicit FreezePluginFailure( PluginsEnum_t pid ) - { - PluginId = pid; - } - - virtual wxString FormatDiagnosticMessage() const; - virtual wxString FormatDisplayMessage() const; - }; - - class ThawPluginFailure : public SaveStateLoadError - { - DEFINE_EXCEPTION_COPYTORS( ThawPluginFailure, SaveStateLoadError ) - DEFINE_EXCEPTION_MESSAGES( ThawPluginFailure ) - - public: - PluginsEnum_t PluginId; - - protected: - ThawPluginFailure() {} - - public: - explicit ThawPluginFailure( PluginsEnum_t pid ) - { - PluginId = pid; - } - - virtual wxString FormatDiagnosticMessage() const; - virtual wxString FormatDisplayMessage() const; - }; -}; - -#ifdef _MSC_VER -# pragma warning(pop) -#endif - -typedef void CALLBACK FnType_SetDir( const char* dir ); - -// -------------------------------------------------------------------------------------- -// LegacyPluginAPI_Common -// -------------------------------------------------------------------------------------- -// Important: Contents of this structure must match the order of the contents of the -// s_MethMessCommon[] array defined in Plugins.cpp. -// -// Note: Open is excluded from this list because the GS has a custom signatures >_< -// -struct LegacyPluginAPI_Common -{ - s32 (CALLBACK* Init)(); - void (CALLBACK* Close)(); - void (CALLBACK* Shutdown)(); - - void (CALLBACK* KeyEvent)( keyEvent* evt ); - - FnType_SetDir* SetSettingsDir; - FnType_SetDir* SetLogDir; - - s32 (CALLBACK* Freeze)(int mode, freezeData *data); - s32 (CALLBACK* Test)(); - void (CALLBACK* Configure)(); - void (CALLBACK* About)(); - - LegacyPluginAPI_Common() - { - memzero( *this ); - } -}; - -class SaveStateBase; -class SysMtgsThread; - -// -------------------------------------------------------------------------------------- -// PluginBindings -// -------------------------------------------------------------------------------------- -// This structure is intended to be the "future" of PCSX2's plugin interface, and will hopefully -// make the current SysCorePlugins largely obsolete (with the exception of the general Load/Unload -// management facilities) -// -class SysPluginBindings -{ -protected: - PS2E_ComponentAPI_Mcd* Mcd; - -public: - SysPluginBindings() - { - Mcd = NULL; - } - - bool McdIsPresent( uint port, uint slot ); - void McdGetSizeInfo( uint port, uint slot, PS2E_McdSizeInfo& outways ); - bool McdIsPSX( uint port, uint slot ); - void McdRead( uint port, uint slot, u8 *dest, u32 adr, int size ); - void McdSave( uint port, uint slot, const u8 *src, u32 adr, int size ); - void McdEraseBlock( uint port, uint slot, u32 adr ); - u64 McdGetCRC( uint port, uint slot ); - void McdNextFrame( uint port, uint slot ); - bool McdReIndex( uint port, uint slot, const wxString& filter ); - - friend class SysCorePlugins; -}; - -extern SysPluginBindings SysPlugins; - -// -------------------------------------------------------------------------------------- -// SysCorePlugins Class -// -------------------------------------------------------------------------------------- -// -class DynamicStaticLibrary -{ - public: - - DynamicStaticLibrary() {}; - virtual ~DynamicStaticLibrary() {}; - - virtual bool Load(const wxString& name) = 0; - virtual void* GetSymbol(const wxString &name) = 0; - virtual bool HasSymbol(const wxString &name) = 0; -}; - -class StaticLibrary : public DynamicStaticLibrary -{ - PluginsEnum_t pid; - - public: - - StaticLibrary(PluginsEnum_t _pid); - virtual ~StaticLibrary() {}; - - bool Load(const wxString& name); - void* GetSymbol(const wxString &name); - bool HasSymbol(const wxString &name); -}; - -class DynamicLibrary : public DynamicStaticLibrary -{ - wxDynamicLibrary Lib; - - public: - - DynamicLibrary(); - virtual ~DynamicLibrary() {}; - - bool Load(const wxString& name); - void* GetSymbol(const wxString &name); - bool HasSymbol(const wxString &name); -}; - -class SysCorePlugins -{ - DeclareNoncopyableObject( SysCorePlugins ); - -protected: - class PluginStatus_t - { - public: - PluginsEnum_t pid; - - bool IsInitialized; - bool IsOpened; - bool IsStatic; - - wxString Filename; - wxString Name; - wxString Version; - - LegacyPluginAPI_Common CommonBindings; - DynamicStaticLibrary* Lib; - - public: - PluginStatus_t() - { - IsInitialized = false; - IsOpened = false; - IsStatic = false; - Lib = NULL; - } - - PluginStatus_t( PluginsEnum_t _pid, const wxString& srcfile ); - virtual ~PluginStatus_t() { delete Lib; } - - protected: - void BindCommon( PluginsEnum_t pid ); - void BindRequired( PluginsEnum_t pid ); - void BindOptional( PluginsEnum_t pid ); - }; - - const PS2E_LibraryAPI* m_mcdPlugin; - wxString m_SettingsFolder; - wxString m_LogFolder; - Threading::MutexRecursive m_mtx_PluginStatus; - - // Lovely hack until the new PS2E API is completed. - std::atomic m_mcdOpen; - -public: // hack until we unsuck plugins... - std::unique_ptr m_info[PluginId_AllocCount]; - -public: - SysCorePlugins(); - virtual ~SysCorePlugins(); - - virtual void Load( PluginsEnum_t pid, const wxString& srcfile ); - virtual void Load( const wxString (&folders)[PluginId_Count] ); - virtual void Unload(); - virtual void Unload( PluginsEnum_t pid ); - - bool AreLoaded() const; - bool AreOpen() const; - bool AreAnyLoaded() const; - bool AreAnyInitialized() const; - - Threading::Mutex& GetMutex() { return m_mtx_PluginStatus; } - - virtual bool Init(); - virtual void Init( PluginsEnum_t pid ); - virtual void Shutdown( PluginsEnum_t pid ); - virtual bool Shutdown(); - virtual void Open(); - virtual void Open( PluginsEnum_t pid ); - virtual void Close( PluginsEnum_t pid ); - virtual void Close(); - - virtual bool IsOpen( PluginsEnum_t pid ) const; - virtual bool IsInitialized( PluginsEnum_t pid ) const; - virtual bool IsLoaded( PluginsEnum_t pid ) const; - - virtual size_t GetFreezeSize( PluginsEnum_t pid ); - virtual void FreezeOut( PluginsEnum_t pid, void* dest ); - virtual void FreezeOut( PluginsEnum_t pid, pxOutputStream& outfp ); - virtual void FreezeIn( PluginsEnum_t pid, pxInputStream& infp ); - virtual void Freeze( PluginsEnum_t pid, SaveStateBase& state ); - virtual bool DoFreeze( PluginsEnum_t pid, int mode, freezeData* data, bool bypass_tsafety=false ); - - virtual bool KeyEvent( const keyEvent& evt ); - virtual void Configure( PluginsEnum_t pid ); - virtual void SetSettingsFolder( const wxString& folder ); - virtual void SetLogFolder( const wxString& folder ); - virtual void SendSettingsFolder(); - virtual void SendLogFolder(); - - - const wxString GetName( PluginsEnum_t pid ) const; - const wxString GetVersion( PluginsEnum_t pid ) const; - -protected: - virtual bool NeedsClose() const; - virtual bool NeedsOpen() const; - - virtual bool NeedsShutdown() const; - virtual bool NeedsInit() const; - - virtual bool NeedsLoad() const; - virtual bool NeedsUnload() const; - - virtual bool OpenPlugin_GS(); - virtual bool OpenPlugin_Mcd(); - - void _generalclose( PluginsEnum_t pid ); - - virtual void ClosePlugin_GS(); - virtual void ClosePlugin_Mcd(); - - friend class SysMtgsThread; -}; - -extern const PluginInfo tbl_PluginInfo[]; - -template -static void ForPlugins(const Func& f) -{ - const PluginInfo* pi = tbl_PluginInfo; - - do - { - f(pi); - } while(++pi, pi->shortname != nullptr); -} - -template -static bool IfPlugins(const Func& f) -{ - const PluginInfo* pi = tbl_PluginInfo; - - do - { - if (f(pi)) return true; - } while(++pi, pi->shortname != nullptr); - - return false; -} - -// GetPluginManager() is a required external implementation. This function is *NOT* -// provided by the PCSX2 core library. It provides an interface for the linking User -// Interface apps or DLLs to reference their own instance of SysCorePlugins (also allowing -// them to extend the class and override virtual methods). - -extern SysCorePlugins& GetCorePlugins(); - -// Hack to expose internal MemoryCard plugin: - -extern "C" const PS2E_LibraryAPI* FileMcd_InitAPI( const PS2E_EmulatorInfo* emuinfo ); - -// Per ChickenLiver, this is being used to pass the GS plugins window handle to the Pad plugins. -// So a rename to pDisplay is in the works, but it will not, in fact, be removed. -extern uptr pDsp[2]; - diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index 821e9f636c..d598e61f79 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -480,9 +480,6 @@ void MainEmuFrame::CreateConfigMenu() m_menuConfig.Append(MenuId_Config_PAD, _("&GamePad Settings...")); m_menuConfig.AppendSeparator(); - m_menuConfig.Append(MenuId_Config_GS, _("&Video (GS)"), m_PluginMenuPacks[PluginId_GS]); - - m_menuConfig.AppendSeparator(); m_menuConfig.Append(MenuId_Config_Multitap0Toggle, _("Multitap &1"), wxEmptyString, wxITEM_CHECK); m_menuConfig.Append(MenuId_Config_Multitap1Toggle, _("Multitap &2"), wxEmptyString, wxITEM_CHECK); diff --git a/pcsx2/gui/SysState.cpp b/pcsx2/gui/SysState.cpp index ca649db3d2..3bea66cb83 100644 --- a/pcsx2/gui/SysState.cpp +++ b/pcsx2/gui/SysState.cpp @@ -79,29 +79,6 @@ protected: virtual uint GetDataSize() const = 0; }; -class PluginSavestateEntry : public BaseSavestateEntry -{ -protected: - PluginsEnum_t m_pid; - -public: - PluginSavestateEntry(PluginsEnum_t pid) - { - m_pid = pid; - } - - virtual ~PluginSavestateEntry() = default; - - virtual wxString GetFilename() const; - virtual void FreezeIn(pxInputStream& reader) const; - virtual void FreezeOut(SaveStateBase& writer) const; - - virtual bool IsRequired() const { return false; } - -protected: - virtual PluginsEnum_t GetPluginId() const { return m_pid; } -}; - void MemorySavestateEntry::FreezeIn(pxInputStream& reader) const { const uint entrySize = reader.Length(); @@ -122,26 +99,6 @@ void MemorySavestateEntry::FreezeOut(SaveStateBase& writer) const writer.FreezeMem(GetDataPtr(), GetDataSize()); } -wxString PluginSavestateEntry::GetFilename() const -{ - return pxsFmt("Plugin %s.dat", tbl_PluginInfo[m_pid].shortname); -} - -void PluginSavestateEntry::FreezeIn(pxInputStream& reader) const -{ - GetCorePlugins().FreezeIn(GetPluginId(), reader); -} - -void PluginSavestateEntry::FreezeOut(SaveStateBase& writer) const -{ - if (uint size = GetCorePlugins().GetFreezeSize(GetPluginId())) - { - writer.PrepBlock(size); - GetCorePlugins().FreezeOut(GetPluginId(), writer.GetBlockPtr()); - writer.CommitBlock(size); - } -} - // -------------------------------------------------------------------------------------- // SavestateEntry_* (EmotionMemory, IopMemory, etc) // -------------------------------------------------------------------------------------- @@ -337,8 +294,6 @@ static const std::unique_ptr SavestateEntries[] = { std::unique_ptr(new SavestateEntry_SPU2), std::unique_ptr(new SavestateEntry_USB), std::unique_ptr(new SavestateEntry_PAD), - - std::unique_ptr(new PluginSavestateEntry(PluginId_GS)), }; // It's bad mojo to have savestates trying to read and write from the same file at the diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt deleted file mode 100644 index e49e024d87..0000000000 --- a/plugins/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Check that people use the good file -if(NOT TOP_CMAKE_WAS_SOURCED) - message(FATAL_ERROR " - You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir. - It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") -endif() - - -if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx" AND GSdx) - add_subdirectory(GSdx) -endif() - diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt deleted file mode 100644 index ac97b581ad..0000000000 --- a/plugins/GSdx/CMakeLists.txt +++ /dev/null @@ -1,291 +0,0 @@ -# Check that people use the good file -if(NOT TOP_CMAKE_WAS_SOURCED) - message(FATAL_ERROR " - You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir. - It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") -endif() - - -# plugin name (no version number to ease future version bump and bisect) -set(Output GSdx) - -set(CommonFlags - -fno-operator-names # because Xbyak uses and()/xor()/or()/not() function - -Wno-unknown-pragmas - -Wno-parentheses - -Wunused-variable # __dummy variable need to be investigated - ) - -# The next two need to be looked at, but spam really badly in gcc 8. -# Largely class alignment in GSDevice.h and memcpy in GSVector*.h. -if(GCC_VERSION VERSION_EQUAL "8.0" OR GCC_VERSION VERSION_GREATER "8.0") - set(CommonFlags - ${CommonFlags} - -Wno-class-memaccess - -Wno-packed-not-aligned - ) -endif() - -if(USE_ICC) - set(CommonFlags "${CommonFlags} -restrict") -endif() - -set(GSdxFinalFlags ${CommonFlags}) - -if(CMAKE_COMPILER_IS_GNUCXX) - # Newer version default to a correct ABI - if (${GCC_VERSION} VERSION_LESS "5.1") - set(GSdxFinalFlags ${GSdxFinalFlags} -fabi-version=6) - endif() -endif() - -if(XDG_STD) - set(GSdxFinalFlags ${GSdxFinalFlags} -DXDG_STD) -endif() - - -set(GSdxSources - GS.cpp - GSAlignedClass.cpp - GSBlock.cpp - GSCapture.cpp - GSClut.cpp - GSCodeBuffer.cpp - GSCrc.cpp - GSDrawingContext.cpp - GSDump.cpp - GSLocalMemory.cpp - GSLzma.cpp - GSPerfMon.cpp - GSPng.cpp - GSState.cpp - GSTables.cpp - GSUtil.cpp - GSVector.cpp - GSdx.cpp - GSdxResources.cpp - stdafx.cpp - Renderers/Common/GSDevice.cpp - Renderers/Common/GSDirtyRect.cpp - Renderers/Common/GSFunctionMap.cpp - Renderers/Common/GSOsdManager.cpp - Renderers/Common/GSRenderer.cpp - Renderers/Common/GSTexture.cpp - Renderers/Common/GSVertexTrace.cpp - Renderers/Null/GSDeviceNull.cpp - Renderers/Null/GSRendererNull.cpp - Renderers/Null/GSTextureNull.cpp - Renderers/HW/GSHwHack.cpp - Renderers/HW/GSRendererHW.cpp - Renderers/HW/GSTextureCache.cpp - Renderers/SW/GSDrawScanline.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x64.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx2.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x86.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx2.cpp - Renderers/SW/GSRasterizer.cpp - Renderers/SW/GSRendererSW.cpp - Renderers/SW/GSSetupPrimCodeGenerator.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x64.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x64.avx.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x64.avx2.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x86.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x86.avx.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x86.avx2.cpp - Renderers/SW/GSTextureCacheSW.cpp - Renderers/SW/GSTextureSW.cpp - Renderers/OpenGL/GLLoader.cpp - Renderers/OpenGL/GLState.cpp - Renderers/OpenGL/GSDeviceOGL.cpp - Renderers/OpenGL/GSRendererOGL.cpp - Renderers/OpenGL/GSShaderOGL.cpp - Renderers/OpenGL/GSTextureCacheOGL.cpp - Renderers/OpenGL/GSTextureOGL.cpp - Window/GSSetting.cpp - Window/GSWnd.cpp - ) - -set(GSdxHeaders - config.h - GSAlignedClass.h - GSBlock.h - GSCapture.h - GSClut.h - GSCodeBuffer.h - GSCrc.h - GSDrawingContext.h - GSDrawingEnvironment.h - GSDump.h - GSdx.h - GSdxResources.h - GS.h - GSLocalMemory.h - GSLzma.h - GSPerfMon.h - GSPng.h - GSState.h - GSTables.h - GSThread_CXX11.h - GSThread.h - GSUtil.h - GSVector.h - GSVector4.h - GSVector4i.h - GSVector8.h - GSVector8i.h - stdafx.h - Renderers/Common/GSDevice.h - Renderers/Common/GSDirtyRect.h - Renderers/Common/GSFastList.h - Renderers/Common/GSFunctionMap.h - Renderers/Common/GSOsdManager.h - Renderers/Common/GSRenderer.h - Renderers/Common/GSTexture.h - Renderers/Common/GSVertex.h - Renderers/Common/GSVertexList.h - Renderers/Common/GSVertexTrace.h - Renderers/Null/GSDeviceNull.h - Renderers/Null/GSRendererNull.h - Renderers/Null/GSTextureNull.h - Renderers/HW/GSRendererHW.h - Renderers/HW/GSTextureCache.h - Renderers/HW/GSVertexHW.h - Renderers/SW/GSDrawScanlineCodeGenerator.h - Renderers/SW/GSDrawScanline.h - Renderers/SW/GSRasterizer.h - Renderers/SW/GSRendererSW.h - Renderers/SW/GSScanlineEnvironment.h - Renderers/SW/GSSetupPrimCodeGenerator.h - Renderers/SW/GSTextureCacheSW.h - Renderers/SW/GSTextureSW.h - Renderers/SW/GSVertexSW.h - Renderers/OpenGL/GLLoader.h - Renderers/OpenGL/GLState.h - Renderers/OpenGL/GSDeviceOGL.h - Renderers/OpenGL/GSRendererOGL.h - Renderers/OpenGL/GSShaderOGL.h - Renderers/OpenGL/GSTextureCacheOGL.h - Renderers/OpenGL/GSTextureOGL.h - Renderers/OpenGL/GSUniformBufferOGL.h - Renderers/OpenGL/GSVertexArrayOGL.h - Window/GSCaptureDlg.h - Window/GSDialog.h - Window/GSSetting.h - Window/GSSettingsDlg.h - Window/GSWnd.h - xbyak/xbyak.h - xbyak/xbyak_mnemonic.h - xbyak/xbyak_util.h - ) - -if(Windows) - LIST(APPEND GSdxSources - Renderers/DX11/GSDevice11.cpp - Window/GSDialog.cpp - Renderers/DX11/GSRendererDX11.cpp - Renderers/DX11/GSTexture11.cpp - Renderers/DX11/GSTextureCache11.cpp - Renderers/DX11/GSTextureFX11.cpp - GSVertexList.cpp - Renderers/SW/GSVertexSW.cpp - Window/GSCaptureDlg.cpp - Window/GSSettingsDlg.cpp - Window/GSWndDX.cpp - Window/GSWndWGL.cpp - ) - - LIST(APPEND GSdxHeaders - Renderers/DX11/GSDevice11.h - Renderers/DX11/GSRendererDX11.h - Renderers/DX11/GSTexture11.h - Renderers/DX11/GSTextureCache11.h - Window/GSWndDX.h - Window/GSWndWGL.h - resource.h - targetver.h - ) -elseif(APPLE) - LIST(APPEND GSdxSources - Window/GSLinuxDialog.cpp - ) -else() - LIST(APPEND GSdxSources - Window/GSLinuxDialog.cpp - Window/GSWndEGL.cpp - ) - - LIST(APPEND GSdxHeaders - Window/GSWndEGL.h - ) -endif() - - -set(GSdxFinalSources - ${GSdxSources} - ${GSdxHeaders} -) - -set(GSdxFinalLibs - ${X11_LIBRARIES} - ${OPENGL_LIBRARIES} - ${EGL_LIBRARIES} - ${X11_XCB_LIBRARIES} - ${GTK2_LIBRARIES} - ${LIBC_LIBRARIES} - ${PNG_LIBRARIES} - ${FREETYPE_LIBRARIES} - ${LIBLZMA_LIBRARIES} -) - -if(USE_VTUNE) - set(GSdxFinalLibs ${GSdxFinalLibs} ${VTUNE_LIBRARIES}) -endif() - -if(APPLE) - find_library(APPKIT_LIBRARY AppKit) - set(GSdxFinalFlags ${GSdxFinalFlags} -fobjc-arc) - set(GSdxFinalLibs ${GSdxFinalLibs} ${APPKIT_LIBRARY} -fobjc-link-runtime) -endif() - -set(RESOURCE_FILES - res/logo-ogl.bmp - res/fxaa.fx - res/glsl/common_header.glsl - res/glsl/convert.glsl - res/glsl/interlace.glsl - res/glsl/merge.glsl - res/glsl/shadeboost.glsl - res/glsl/tfx_fs.glsl - res/glsl/tfx_vgs.glsl) - -add_custom_glib_res("GSdxResources" "gsdx-res.xml" "GSdx_res" ${RESOURCE_FILES}) - -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -if(BUILTIN_GS) - add_pcsx2_lib(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}") -else() - if (DISABLE_ADVANCE_SIMD) - # Don't append -SSE2 on the first build to keep same name as SIMD build - add_pcsx2_plugin("${Output}" "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags} -msse3 -msse4 -msse4.1") - add_pcsx2_plugin("${Output}-AVX2" "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags} -mavx -mavx2 -mbmi -mbmi2") - target_compile_features("${Output}-AVX2" PRIVATE cxx_std_17) - else() - add_pcsx2_plugin(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}") - endif() -endif() - -target_compile_features(${Output} PRIVATE cxx_std_17) - -################################### Replay Loader -if(BUILD_REPLAY_LOADERS) - set(Replay pcsx2_GSReplayLoader) - set(GSdxReplayLoaderFinalSources - linux_replay.cpp - ) - add_pcsx2_executable(${Replay} "${GSdxReplayLoaderFinalSources}" "${LIBC_LIBRARIES}" "${GSdxFinalFlags}") - target_compile_features(${Replay} PRIVATE cxx_std_17) -endif(BUILD_REPLAY_LOADERS)