From f6c138ca7ea4c36dc9e1057f41641c9e006c28ae Mon Sep 17 00:00:00 2001
From: lightningterror <18107717+lightningterror@users.noreply.github.com>
Date: Sat, 22 Aug 2020 05:41:45 +0200
Subject: [PATCH] Goodbye, old friend... Remove zzogl from master branch
(#3614)
* cmake: Remove zzogl from cmake.
* cmake/build: Remove GLSL_API and EGL_API flags.
Only used in zzogl.
* linux various: Remove zzogl.
* sln: Remove zzogl from old plugins solution.
* zzogl: Remove source files.
* debian: Exclude zzogl from copyright.
* linux various: Remove glsl2h.pl
Used only in zzogl?
* linux various: Remove zzogl code from validate_glsl.sh
* debian: Remove zzogl mentions in create built tarball.
* gitignore: Remove zzogl paths.
---
.gitignore | 1 -
build.sh | 4 -
cmake/BuildParameters.cmake | 2 -
cmake/SelectPcsx2Plugins.cmake | 29 +-
debian-packager/copyright | 14 +-
debian-packager/create_built_tarball.sh | 1 -
linux_various/check_format.sh | 1 -
linux_various/glsl2h.pl | 116 -
linux_various/validate_glsl.sh | 10 +-
old_plugins.sln | 45 +-
plugins/CMakeLists.txt | 4 -
plugins/zzogl-pg/opengl/CMakeLists.txt | 237 -
plugins/zzogl-pg/opengl/CRC.h | 408 -
plugins/zzogl-pg/opengl/GLWin.h | 151 -
plugins/zzogl-pg/opengl/GLWin32.cpp | 435 -
plugins/zzogl-pg/opengl/GLWinX11.cpp | 508 -
plugins/zzogl-pg/opengl/GS.h | 1136 -
plugins/zzogl-pg/opengl/GSDump.cpp | 97 -
plugins/zzogl-pg/opengl/GSDump.h | 65 -
plugins/zzogl-pg/opengl/GSUniformBufferOGL.h | 75 -
plugins/zzogl-pg/opengl/GSVertexArrayOGL.h | 287 -
plugins/zzogl-pg/opengl/GSmain.cpp | 837 -
plugins/zzogl-pg/opengl/GifTransfer.cpp | 298 -
plugins/zzogl-pg/opengl/GifTransfer.h | 134 -
plugins/zzogl-pg/opengl/HostMemory.cpp | 620 -
plugins/zzogl-pg/opengl/HostMemory.h | 114 -
plugins/zzogl-pg/opengl/Linux/Conf.cpp | 133 -
plugins/zzogl-pg/opengl/Linux/Linux.cpp | 545 -
plugins/zzogl-pg/opengl/Linux/Linux.h | 31 -
plugins/zzogl-pg/opengl/Mem.cpp | 373 -
plugins/zzogl-pg/opengl/Mem.h | 543 -
plugins/zzogl-pg/opengl/Mem_Swizzle.cpp | 726 -
plugins/zzogl-pg/opengl/Mem_Swizzle.h | 63 -
plugins/zzogl-pg/opengl/Mem_Tables.cpp | 506 -
plugins/zzogl-pg/opengl/Mem_Transmit.h | 318 -
plugins/zzogl-pg/opengl/Profile.cpp | 266 -
plugins/zzogl-pg/opengl/Profile.h | 172 -
plugins/zzogl-pg/opengl/Profile_gl3.cpp | 82 -
plugins/zzogl-pg/opengl/Profile_gl3.h | 57 -
plugins/zzogl-pg/opengl/README.txt | 13 -
plugins/zzogl-pg/opengl/Regs.cpp | 1160 -
plugins/zzogl-pg/opengl/Regs.h | 1045 -
plugins/zzogl-pg/opengl/Util.h | 327 -
plugins/zzogl-pg/opengl/Win32/Conf.cpp | 143 -
plugins/zzogl-pg/opengl/Win32/Win32.cpp | 344 -
plugins/zzogl-pg/opengl/Win32/Win32.h | 28 -
plugins/zzogl-pg/opengl/Win32/aviUtil.h | 488 -
plugins/zzogl-pg/opengl/Win32/ps2hw.dat | Bin 108445 -> 0 bytes
plugins/zzogl-pg/opengl/Win32/resource.h | 50 -
plugins/zzogl-pg/opengl/Win32/resrc1.h | 88 -
plugins/zzogl-pg/opengl/Win32/wglext.h | 813 -
plugins/zzogl-pg/opengl/Win32/zerogs.bmp | Bin 921654 -> 0 bytes
plugins/zzogl-pg/opengl/Win32/zerogs.def | 38 -
plugins/zzogl-pg/opengl/Win32/zerogs.rc | 328 -
.../zzogl-pg/opengl/Win32/zerogsogl.vcxproj | 271 -
.../opengl/Win32/zerogsogl.vcxproj.filters | 241 -
.../zzogl-pg/opengl/Win32/zerogsogl_2008.sln | 42 -
plugins/zzogl-pg/opengl/ZZClut.cpp | 1079 -
plugins/zzogl-pg/opengl/ZZClut.h | 30 -
plugins/zzogl-pg/opengl/ZZDepthTargets.cpp | 315 -
plugins/zzogl-pg/opengl/ZZGl.h | 354 -
plugins/zzogl-pg/opengl/ZZHacks.cpp | 186 -
plugins/zzogl-pg/opengl/ZZHacks.h | 118 -
plugins/zzogl-pg/opengl/ZZKeyboard.cpp | 247 -
plugins/zzogl-pg/opengl/ZZLog.cpp | 439 -
plugins/zzogl-pg/opengl/ZZLog.h | 212 -
plugins/zzogl-pg/opengl/ZZMemoryTargets.cpp | 617 -
plugins/zzogl-pg/opengl/ZZRenderTargets.cpp | 1323 --
plugins/zzogl-pg/opengl/ZZoglCRTC.cpp | 921 -
plugins/zzogl-pg/opengl/ZZoglCRTC.h | 89 -
plugins/zzogl-pg/opengl/ZZoglCreate.cpp | 846 -
plugins/zzogl-pg/opengl/ZZoglDrawing.cpp | 255 -
plugins/zzogl-pg/opengl/ZZoglDrawing.h | 67 -
plugins/zzogl-pg/opengl/ZZoglFlush.cpp | 2754 ---
plugins/zzogl-pg/opengl/ZZoglFlush.h | 123 -
plugins/zzogl-pg/opengl/ZZoglFlushHack.cpp | 531 -
plugins/zzogl-pg/opengl/ZZoglFlushHack.h | 84 -
plugins/zzogl-pg/opengl/ZZoglMath.h | 511 -
plugins/zzogl-pg/opengl/ZZoglMem.cpp | 556 -
plugins/zzogl-pg/opengl/ZZoglMem.h | 790 -
plugins/zzogl-pg/opengl/ZZoglSave.cpp | 174 -
plugins/zzogl-pg/opengl/ZZoglShaders.cpp | 935 -
plugins/zzogl-pg/opengl/ZZoglShaders.h | 782 -
plugins/zzogl-pg/opengl/ZZoglShadersGLSL.cpp | 980 -
plugins/zzogl-pg/opengl/ZZoglShadersGLSL4.cpp | 594 -
plugins/zzogl-pg/opengl/ZZoglShoots.cpp | 667 -
plugins/zzogl-pg/opengl/ZZoglShoots.h | 42 -
plugins/zzogl-pg/opengl/ZZoglVB.cpp | 506 -
plugins/zzogl-pg/opengl/ZZoglVB.h | 158 -
.../opengl/ZeroGSShaders/CMakeLists.txt | 57 -
.../ZeroGSShaders/ZeroGSShaders_2005.sln | 23 -
.../opengl/ZeroGSShaders/copytozerogs.bat | 1 -
.../opengl/ZeroGSShaders/zerogsshaders.cpp | 362 -
.../opengl/ZeroGSShaders/zerogsshaders.h | 120 -
.../opengl/ZeroGSShaders/zlib/crc32.h | 441 -
.../opengl/ZeroGSShaders/zlib/deflate.h | 331 -
.../opengl/ZeroGSShaders/zlib/inffast.h | 11 -
.../opengl/ZeroGSShaders/zlib/inffixed.h | 94 -
.../opengl/ZeroGSShaders/zlib/inflate.h | 115 -
.../opengl/ZeroGSShaders/zlib/inftrees.h | 55 -
.../opengl/ZeroGSShaders/zlib/trees.h | 158 -
.../opengl/ZeroGSShaders/zlib/zconf.h | 332 -
.../opengl/ZeroGSShaders/zlib/zconf.in.h | 332 -
.../zzogl-pg/opengl/ZeroGSShaders/zlib/zlib.h | 1357 --
.../opengl/ZeroGSShaders/zlib/zutil.h | 269 -
.../zzogl-pg/opengl/ZeroGSShaders/zpipe.cpp | 124 -
plugins/zzogl-pg/opengl/ZeroGSShaders/zpipe.h | 26 -
plugins/zzogl-pg/opengl/buildshaders.bat | 3 -
plugins/zzogl-pg/opengl/common.h | 1164 -
plugins/zzogl-pg/opengl/ctx0/ps2hw_ctx.fx | 24 -
plugins/zzogl-pg/opengl/ctx1/ps2hw_ctx.fx | 23 -
plugins/zzogl-pg/opengl/glprocs.c | 17868 ----------------
plugins/zzogl-pg/opengl/glprocs.h | 2217 --
plugins/zzogl-pg/opengl/linux_replay.cpp | 64 -
plugins/zzogl-pg/opengl/ps2hw.dat | Bin 113923 -> 0 bytes
plugins/zzogl-pg/opengl/ps2hw.fx | 867 -
plugins/zzogl-pg/opengl/ps2hw.glsl | 827 -
plugins/zzogl-pg/opengl/ps2hw_gl4.glsl | 915 -
plugins/zzogl-pg/opengl/ps2hw_gl4.h | 944 -
plugins/zzogl-pg/opengl/rasterfont.cpp | 168 -
plugins/zzogl-pg/opengl/rasterfont.h | 43 -
plugins/zzogl-pg/opengl/shaders.sh | 18 -
plugins/zzogl-pg/opengl/targets.cpp | 1291 --
plugins/zzogl-pg/opengl/targets.h | 519 -
plugins/zzogl-pg/opengl/x86-32.S | 716 -
plugins/zzogl-pg/opengl/x86-32.asm | 652 -
plugins/zzogl-pg/opengl/x86.cpp | 1367 --
plugins/zzogl-pg/opengl/x86.h | 120 -
plugins/zzogl-pg/opengl/zerogs.cpp | 442 -
plugins/zzogl-pg/opengl/zerogs.h | 85 -
plugins/zzogl-pg/opengl/zpipe.cpp | 133 -
plugins/zzogl-pg/opengl/zpipe.h | 26 -
132 files changed, 21 insertions(+), 66831 deletions(-)
delete mode 100755 linux_various/glsl2h.pl
delete mode 100644 plugins/zzogl-pg/opengl/CMakeLists.txt
delete mode 100644 plugins/zzogl-pg/opengl/CRC.h
delete mode 100644 plugins/zzogl-pg/opengl/GLWin.h
delete mode 100644 plugins/zzogl-pg/opengl/GLWin32.cpp
delete mode 100644 plugins/zzogl-pg/opengl/GLWinX11.cpp
delete mode 100644 plugins/zzogl-pg/opengl/GS.h
delete mode 100644 plugins/zzogl-pg/opengl/GSDump.cpp
delete mode 100644 plugins/zzogl-pg/opengl/GSDump.h
delete mode 100644 plugins/zzogl-pg/opengl/GSUniformBufferOGL.h
delete mode 100644 plugins/zzogl-pg/opengl/GSVertexArrayOGL.h
delete mode 100644 plugins/zzogl-pg/opengl/GSmain.cpp
delete mode 100644 plugins/zzogl-pg/opengl/GifTransfer.cpp
delete mode 100644 plugins/zzogl-pg/opengl/GifTransfer.h
delete mode 100644 plugins/zzogl-pg/opengl/HostMemory.cpp
delete mode 100644 plugins/zzogl-pg/opengl/HostMemory.h
delete mode 100644 plugins/zzogl-pg/opengl/Linux/Conf.cpp
delete mode 100644 plugins/zzogl-pg/opengl/Linux/Linux.cpp
delete mode 100644 plugins/zzogl-pg/opengl/Linux/Linux.h
delete mode 100644 plugins/zzogl-pg/opengl/Mem.cpp
delete mode 100644 plugins/zzogl-pg/opengl/Mem.h
delete mode 100644 plugins/zzogl-pg/opengl/Mem_Swizzle.cpp
delete mode 100644 plugins/zzogl-pg/opengl/Mem_Swizzle.h
delete mode 100644 plugins/zzogl-pg/opengl/Mem_Tables.cpp
delete mode 100644 plugins/zzogl-pg/opengl/Mem_Transmit.h
delete mode 100644 plugins/zzogl-pg/opengl/Profile.cpp
delete mode 100644 plugins/zzogl-pg/opengl/Profile.h
delete mode 100644 plugins/zzogl-pg/opengl/Profile_gl3.cpp
delete mode 100644 plugins/zzogl-pg/opengl/Profile_gl3.h
delete mode 100644 plugins/zzogl-pg/opengl/README.txt
delete mode 100644 plugins/zzogl-pg/opengl/Regs.cpp
delete mode 100644 plugins/zzogl-pg/opengl/Regs.h
delete mode 100644 plugins/zzogl-pg/opengl/Util.h
delete mode 100644 plugins/zzogl-pg/opengl/Win32/Conf.cpp
delete mode 100644 plugins/zzogl-pg/opengl/Win32/Win32.cpp
delete mode 100644 plugins/zzogl-pg/opengl/Win32/Win32.h
delete mode 100644 plugins/zzogl-pg/opengl/Win32/aviUtil.h
delete mode 100644 plugins/zzogl-pg/opengl/Win32/ps2hw.dat
delete mode 100644 plugins/zzogl-pg/opengl/Win32/resource.h
delete mode 100644 plugins/zzogl-pg/opengl/Win32/resrc1.h
delete mode 100644 plugins/zzogl-pg/opengl/Win32/wglext.h
delete mode 100644 plugins/zzogl-pg/opengl/Win32/zerogs.bmp
delete mode 100644 plugins/zzogl-pg/opengl/Win32/zerogs.def
delete mode 100644 plugins/zzogl-pg/opengl/Win32/zerogs.rc
delete mode 100644 plugins/zzogl-pg/opengl/Win32/zerogsogl.vcxproj
delete mode 100644 plugins/zzogl-pg/opengl/Win32/zerogsogl.vcxproj.filters
delete mode 100644 plugins/zzogl-pg/opengl/Win32/zerogsogl_2008.sln
delete mode 100644 plugins/zzogl-pg/opengl/ZZClut.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZClut.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZDepthTargets.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZGl.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZHacks.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZHacks.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZKeyboard.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZLog.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZLog.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZMemoryTargets.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZRenderTargets.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglCRTC.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglCRTC.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglCreate.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglDrawing.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglDrawing.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglFlush.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglFlush.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglFlushHack.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglFlushHack.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglMath.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglMem.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglMem.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglSave.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglShaders.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglShaders.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglShadersGLSL.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglShadersGLSL4.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglShoots.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglShoots.h
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglVB.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZZoglVB.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/CMakeLists.txt
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/ZeroGSShaders_2005.sln
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/copytozerogs.bat
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zerogsshaders.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zerogsshaders.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/crc32.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/deflate.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/inffast.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/inffixed.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/inflate.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/inftrees.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/trees.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/zconf.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/zconf.in.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/zlib.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zlib/zutil.h
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zpipe.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ZeroGSShaders/zpipe.h
delete mode 100644 plugins/zzogl-pg/opengl/buildshaders.bat
delete mode 100644 plugins/zzogl-pg/opengl/common.h
delete mode 100644 plugins/zzogl-pg/opengl/ctx0/ps2hw_ctx.fx
delete mode 100644 plugins/zzogl-pg/opengl/ctx1/ps2hw_ctx.fx
delete mode 100644 plugins/zzogl-pg/opengl/glprocs.c
delete mode 100644 plugins/zzogl-pg/opengl/glprocs.h
delete mode 100644 plugins/zzogl-pg/opengl/linux_replay.cpp
delete mode 100644 plugins/zzogl-pg/opengl/ps2hw.dat
delete mode 100644 plugins/zzogl-pg/opengl/ps2hw.fx
delete mode 100644 plugins/zzogl-pg/opengl/ps2hw.glsl
delete mode 100644 plugins/zzogl-pg/opengl/ps2hw_gl4.glsl
delete mode 100644 plugins/zzogl-pg/opengl/ps2hw_gl4.h
delete mode 100644 plugins/zzogl-pg/opengl/rasterfont.cpp
delete mode 100644 plugins/zzogl-pg/opengl/rasterfont.h
delete mode 100755 plugins/zzogl-pg/opengl/shaders.sh
delete mode 100644 plugins/zzogl-pg/opengl/targets.cpp
delete mode 100644 plugins/zzogl-pg/opengl/targets.h
delete mode 100644 plugins/zzogl-pg/opengl/x86-32.S
delete mode 100644 plugins/zzogl-pg/opengl/x86-32.asm
delete mode 100644 plugins/zzogl-pg/opengl/x86.cpp
delete mode 100644 plugins/zzogl-pg/opengl/x86.h
delete mode 100644 plugins/zzogl-pg/opengl/zerogs.cpp
delete mode 100644 plugins/zzogl-pg/opengl/zerogs.h
delete mode 100644 plugins/zzogl-pg/opengl/zpipe.cpp
delete mode 100644 plugins/zzogl-pg/opengl/zpipe.h
diff --git a/.gitignore b/.gitignore
index 345ed1795c..a53a51f889 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,7 +22,6 @@
!/plugins/zerogs/dx/x86-32.asm
!/plugins/zerogs/dx/x86-64.asm
!/plugins/zerogs/opengl/x86-32.asm
-!/plugins/zzogl-pg/opengl/x86-32.asm
*.VC.db
*.VC.VC.opendb
diff --git a/build.sh b/build.sh
index 0d8270df41..551efba261 100755
--- a/build.sh
+++ b/build.sh
@@ -204,8 +204,6 @@ for ARG in "$@"; do
--rel|--release ) flags="$flags -DCMAKE_BUILD_TYPE=Release" ; build="$root/build_rel";;
--prof ) flags="$flags -DCMAKE_BUILD_TYPE=Prof" ; build="$root/build_prof";;
--strip ) flags="$flags -DCMAKE_BUILD_STRIP=TRUE" ;;
- --glsl ) flags="$flags -DGLSL_API=TRUE" ;;
- --egl ) flags="$flags -DEGL_API=TRUE" ;;
--sdl12 ) flags="$flags -DSDL2_API=FALSE" ;;
--extra ) flags="$flags -DEXTRA_PLUGINS=TRUE" ;;
--asan ) flags="$flags -DUSE_ASAN=TRUE" ;;
@@ -239,8 +237,6 @@ for ARG in "$@"; do
echo "--no-simd : Only allow sse2"
echo
echo "** Developer option **"
- echo "--glsl : Replace CG backend of ZZogl by GLSL"
- echo "--egl : Replace GLX by EGL (ZZogl plugin)"
echo "--cross-multilib: Build a 32bit PCSX2 on a 64bit machine using multilib."
echo "--opencl : Enable experimental OpenCL support"
echo
diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake
index a60372e557..e2e1890c15 100644
--- a/cmake/BuildParameters.cmake
+++ b/cmake/BuildParameters.cmake
@@ -33,8 +33,6 @@ option(USE_VTUNE "Plug VTUNE to profile GSdx JIT.")
#-------------------------------------------------------------------------------
# Graphical option
#-------------------------------------------------------------------------------
-option(GLSL_API "Replace ZZogl CG backend by GLSL (experimental option)")
-option(EGL_API "Use EGL on ZZogl/GSdx (experimental/developer option)")
option(OPENCL_API "Add OpenCL support on GSdx")
option(REBUILD_SHADER "Rebuild GLSL/CG shader (developer option)")
option(BUILD_REPLAY_LOADERS "Build GS replayer to ease testing (developer option)")
diff --git a/cmake/SelectPcsx2Plugins.cmake b/cmake/SelectPcsx2Plugins.cmake
index 2f1e445b62..5fe49a954e 100644
--- a/cmake/SelectPcsx2Plugins.cmake
+++ b/cmake/SelectPcsx2Plugins.cmake
@@ -10,11 +10,6 @@ set(msg_dep_onepad "check these libraries -> sdl2, X11, gtk2")
set(msg_dep_spu2x "check these libraries -> soundtouch (>=1.5), alsa, portaudio (optional, >=1.9), sdl (>=1.2), pcsx2 common libs")
set(msg_dep_zerospu2 "check these libraries -> soundtouch (>=1.5), alsa")
set(msg_dep_dev "check these libraries -> gtk2, pcap, libxml2")
-if(GLSL_API)
- set(msg_dep_zzogl "check these libraries -> glew, jpeg (>=6.2), opengl, X11, pcsx2 common libs")
-else(GLSL_API)
- set(msg_dep_zzogl "check these libraries -> glew, jpeg (>=6.2), opengl, X11, nvidia-cg-toolkit (>=2.1), pcsx2 common libs")
-endif()
macro(print_dep str dep)
if (PACKAGE_MODE)
@@ -157,7 +152,7 @@ endif()
# -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 NOT EGL_API))
+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)
set(GSdx TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx")
set(GSdx FALSE)
@@ -187,28 +182,6 @@ if(EXTRA_PLUGINS)
endif()
#---------------------------------------
-#---------------------------------------
-# zzogl-pg
-#---------------------------------------
-# requires: -GLEW
-# -OpenGL
-# -X11
-# -CG (only with cg build)
-# -JPEG
-# -common_libs
-#---------------------------------------
-if(EXTRA_PLUGINS)
- if((GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND JPEG_FOUND AND common_libs AND GTKn_FOUND) AND (CG_FOUND OR GLSL_API))
- set(zzogl TRUE)
- elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg")
- set(zzogl FALSE)
- else()
- set(zzogl FALSE)
- print_dep("Skip build of zzogl: missing dependencies" "${msg_dep_zzogl}")
- endif()
-endif()
-#---------------------------------------
-
#---------------------------------------
# PadNull
#---------------------------------------
diff --git a/debian-packager/copyright b/debian-packager/copyright
index b66b5289a3..40b1e37546 100644
--- a/debian-packager/copyright
+++ b/debian-packager/copyright
@@ -12,7 +12,7 @@ Files: pcsx2/* common/* plugins/spu2-x/* plugins/PadNull/Pad* plugins/USBnull/*
Copyright: 2002-2012 PCSX2 Dev Team
License: LGPL-3+
-Files: pcsx2/Mdec.cpp pcsx2/Mdec.h pcsx2/RDebug/deci2_drfp.cpp pcsx2/IPU/mpeg2lib/* pcsx2/cheatscpp.h common/include/api/* plugins/onepad/* plugins/PadNull/Linux/* plugins/SPU2null/* plugins/FWnull/FW.cpp plugins/zerospu2/* plugins/zzogl-pg/* plugins/GSnull/Registers.h plugins/GSnull/Linux/Linux* plugins/GSnull/Linux/Config* plugins/dev9null/DEV9.h plugins/dev9null/Config.*
+Files: pcsx2/Mdec.cpp pcsx2/Mdec.h pcsx2/RDebug/deci2_drfp.cpp pcsx2/IPU/mpeg2lib/* pcsx2/cheatscpp.h common/include/api/* plugins/onepad/* plugins/PadNull/Linux/* plugins/SPU2null/* plugins/FWnull/FW.cpp plugins/zerospu2/* plugins/GSnull/Registers.h plugins/GSnull/Linux/Linux* plugins/GSnull/Linux/Config* plugins/dev9null/DEV9.h plugins/dev9null/Config.*
Copyright: 2002-2012 PCSX2 Dev Team
License: GPL-2+
@@ -20,22 +20,10 @@ Files: plugins/spu2-x/src/Spu2replay.* plugins/spu2-x/src/Decode* plugins/spu2-x
Copyright: 2002-2012 PCSX2 Dev Team
License: LGPL-2.1+
-Files: plugins/zzogl-pg/opengl/glprocs.*
-Copyright: 1991-2000 Silicon Graphics, Inc
-License: SGI FREE SOFTWARE LICENSE B 2.0
-
Files: common/src/Utilities/vssprintf.cpp
Copyright: 2002 Michael Ringgaard
License: BSD-3-Clause
-Files: plugins/zzogl-pg/opengl/zpipe.cpp
-Copyright: not applicable
-License: public-domain
- Author's Note:
- zpipe.c: example of proper use of zlib's inflate() and deflate()
- Not copyrighted -- provided to the public domain
- Version 1.4 11 December 2005 Mark Adler
-
License: LGPL-3 or LGPL-3+
This program 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
diff --git a/debian-packager/create_built_tarball.sh b/debian-packager/create_built_tarball.sh
index 7bb3c23a0d..d79ce15625 100644
--- a/debian-packager/create_built_tarball.sh
+++ b/debian-packager/create_built_tarball.sh
@@ -100,7 +100,6 @@ remove_remaining_non_free_file()
{
echo "Remove remaining non free file. TODO UPSTREAM"
rm -fr $LOCAL_REPO/plugins/GSdx/baseclasses
- rm -f $LOCAL_REPO/plugins/zzogl-pg/opengl/Win32/aviUtil.h
rm -f $LOCAL_REPO/common/src/Utilities/x86/MemcpyFast.cpp
}
remove_dot_git()
diff --git a/linux_various/check_format.sh b/linux_various/check_format.sh
index fc19885151..fda5a3e77f 100755
--- a/linux_various/check_format.sh
+++ b/linux_various/check_format.sh
@@ -51,7 +51,6 @@ files=`git diff --name-only --diff-filter=ACMRT $diff_range -- $PWD | \
grep -v "${1}plugins/USBqemu/" | \
grep -v "${1}plugins/zerogs/" | \
grep -v "${1}plugins/zerospu2/" | \
- grep -v "${1}plugins/zzogl-pg/" | \
\
grep -v "/resource.h" | \
grep -v "3rdparty/" | \
diff --git a/linux_various/glsl2h.pl b/linux_various/glsl2h.pl
deleted file mode 100755
index a80aa831e5..0000000000
--- a/linux_various/glsl2h.pl
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/usr/bin/perl
-
-# PCSX2 - PS2 Emulator for PCs
-# Copyright (C) 2002-2014 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 .
-
-use strict;
-use warnings;
-use File::Spec;
-use File::Basename;
-use File::Copy;
-use Cwd 'abs_path';
-
-# Allow to use the script without the module. I don't want a full PERL as a dependency of PCSX2!
-my $g_disable_md5 = 0;
-eval {
- require Digest::file;
- require Digest::MD5;
- Digest::file->import(qw/digest_file_hex/);
- Digest::MD5->import(qw/md5_hex/);
- 1;
-} or do {
- $g_disable_md5 = 1;
- print "Disable MD5\n";
-};
-
-########################
-# ZZOGL
-########################
-my @zz_res = qw/ps2hw_gl4.glsl/;
-my $zz_path = File::Spec->catdir(dirname(abs_path($0)), "..", "plugins", "zzogl-pg", "opengl");
-my $zz_out = File::Spec->catdir($zz_path, "ps2hw_gl4.h");
-glsl2h($zz_path, $zz_out, \@zz_res);
-
-sub glsl2h {
- my $in_dir = shift;
- my $out_file = shift;
- my $glsl_files = shift;
-
- my $include = "";
- if ($in_dir =~ /GSdx/) {
- $include = "#include \"stdafx.h\""
- }
-
- my $header = <catfile($in_dir, $file)) or die "$! : $file";
- my $line;
- while(defined($line = <$GLSL>)) {
- chomp $line;
- $line =~ s/\\/\\\\/g;
- $line =~ s/"/\\"/g;
- $data .= "\t\"$line\\n\"\n";
- }
- $data .= "\t;\n";
- }
-
- # Rewriting the file will trigger a relink (even if the content is the
- # same). So we check first the content with md5 digest
- if ( -e $out_file and not $g_disable_md5) {
- my $old_md5 = digest_file_hex($out_file, "MD5");
- my $new_md5 = md5_hex($data);
-
- if ($old_md5 ne $new_md5) {
- open(my $H, ">$out_file") or die;
- print $H $data;
- }
- } else {
- open(my $H, ">$out_file") or die;
- print $H $data;
- }
-}
diff --git a/linux_various/validate_glsl.sh b/linux_various/validate_glsl.sh
index 7ce2315e77..356ff212dc 100755
--- a/linux_various/validate_glsl.sh
+++ b/linux_various/validate_glsl.sh
@@ -38,7 +38,6 @@ Help:
--input : input glsl file (mandatory)
--macro : set a macro. Can be repeated
--entry : set an entry point. Note: print the ASM output of the program
- --test_ZZ : test of zzogl glsl file
--test_dx : test of gsdx glsl file
--nofrag : disable fragment processing
--novert : disable vertex processing
@@ -52,7 +51,6 @@ case $1 in
--input|--i) INPUT=$2; shift 2;;
--macro|--m) MACRO="${MACRO}#define $2 $3\n"; shift 3;;
--entry|--e) ENTRY="-entry $2";shift 2;;
- --test_ZZ ) TEST_ZZOGL=1; shift 1;;
--test_dx ) TEST_GSDX=1; shift 1;;
--nofrag) NOFRAG=1; shift 1;;
--novert) NOVERT=1; shift 1;;
@@ -116,13 +114,7 @@ fragment_test()
# Main
######################################################
-if [ "$TEST_ZZOGL" = '1' ] ; then
- ./validate_glsl.sh --input $INPUT --novert --m TEST_AEM 1
- ./validate_glsl.sh --input $INPUT --novert --m REGION_REPEAT 1
- ./validate_glsl.sh --input $INPUT --novert --m EXACT_COLOR 1
- ./validate_glsl.sh --input $INPUT --m WRITE_DEPTH 1
- ./validate_glsl.sh --input $INPUT
-elif [ "$TEST_GSDX" = '1' ] ; then
+if [ "$TEST_GSDX" = '1' ] ; then
echo "not yet implemented"
# A very big shader example (124 instructions!)
./validate_glsl.sh --input $INPUT --novert --entry ps_main --macro PS_TCC 0 --macro PS_TFX 0 --macro PS_IIP 1 --macro PS_ATST 4 --macro PS_FST 1 --macro PS_BLEND 4 --macro PS_COLCLIP 3 --macro PS_SHUFFLE 1 --macro PS_LTF 1 --macro PS_FMT 6 --macro PS_AEM 0 --macro PS_FBMASK 1 --macro PS_FOG 1 --macro PS_WMS 2 --macro PS_WMT 3
diff --git a/old_plugins.sln b/old_plugins.sln
index 98b6714f4a..16f885824f 100644
--- a/old_plugins.sln
+++ b/old_plugins.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30104.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdparty", "3rdparty", "{78EBE642-7A4D-4EA7-86BE-5639C6646C38}"
ProjectSection(SolutionItems) = preProject
@@ -42,8 +42,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utilities", "common\build\U
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "3rdparty\libjpeg\libjpeg.vcxproj", "{BC236261-77E8-4567-8D09-45CD02965EB6}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZZOgl", "plugins\zzogl-pg\opengl\Win32\zerogsogl.vcxproj", "{2D4E85B2-F47F-4D65-B091-701E5C031DAC}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "USBqemu", "plugins\USBqemu\Win32\USBqemu.vcxproj", "{E613DA9F-41B4-4613-9911-E418EF5533BC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wx30_base", "3rdparty\wxwidgets3.0\build\msw\wx30_base.vcxproj", "{3FCC50C2-81E9-5DB2-B8D8-2129427568B1}"
@@ -123,15 +121,18 @@ Global
{BC236261-77E8-4567-8D09-45CD02965EB6}.Release|Win32.ActiveCfg = Release|Win32
{BC236261-77E8-4567-8D09-45CD02965EB6}.Release|Win32.Build.0 = Release|Win32
{BC236261-77E8-4567-8D09-45CD02965EB6}.Release|x64.ActiveCfg = Release|Win32
- {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Debug|Win32.ActiveCfg = Debug|Win32
- {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Debug|Win32.Build.0 = Debug|Win32
- {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Debug|x64.ActiveCfg = Debug|Win32
- {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Devel|Win32.ActiveCfg = Devel|Win32
- {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Devel|Win32.Build.0 = Devel|Win32
- {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Devel|x64.ActiveCfg = Devel|Win32
- {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Release|Win32.ActiveCfg = Release|Win32
- {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Release|Win32.Build.0 = Release|Win32
- {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Release|x64.ActiveCfg = Release|Win32
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Debug|Win32.Build.0 = Debug|Win32
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Debug|x64.ActiveCfg = Debug|x64
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Debug|x64.Build.0 = Debug|x64
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Devel|Win32.ActiveCfg = Devel|Win32
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Devel|Win32.Build.0 = Devel|Win32
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Devel|x64.ActiveCfg = Devel|x64
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Devel|x64.Build.0 = Devel|x64
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Release|Win32.ActiveCfg = Release|Win32
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Release|Win32.Build.0 = Release|Win32
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Release|x64.ActiveCfg = Release|x64
+ {E613DA9F-41B4-4613-9911-E418EF5533BC}.Release|x64.Build.0 = Release|x64
{3FCC50C2-81E9-5DB2-B8D8-2129427568B1}.Debug|Win32.ActiveCfg = Debug|Win32
{3FCC50C2-81E9-5DB2-B8D8-2129427568B1}.Debug|Win32.Build.0 = Debug|Win32
{3FCC50C2-81E9-5DB2-B8D8-2129427568B1}.Debug|x64.ActiveCfg = Debug|x64
@@ -189,18 +190,6 @@ Global
{0FAE817D-9A32-4830-857E-81DA57246E16}.Release|Win32.Build.0 = Release|Win32
{0FAE817D-9A32-4830-857E-81DA57246E16}.Release|x64.ActiveCfg = Release|x64
{0FAE817D-9A32-4830-857E-81DA57246E16}.Release|x64.Build.0 = Release|x64
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Debug|Win32.ActiveCfg = Debug|Win32
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Debug|Win32.Build.0 = Debug|Win32
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Debug|x64.ActiveCfg = Debug|x64
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Debug|x64.Build.0 = Debug|x64
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Devel|Win32.ActiveCfg = Devel|Win32
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Devel|Win32.Build.0 = Devel|Win32
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Devel|x64.ActiveCfg = Devel|x64
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Devel|x64.Build.0 = Devel|x64
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Release|Win32.ActiveCfg = Release|Win32
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Release|Win32.Build.0 = Release|Win32
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Release|x64.ActiveCfg = Release|x64
- {E613DA9F-41B4-4613-9911-E418EF5533BC}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -214,12 +203,14 @@ Global
{7F059854-568D-4E08-9D00-1E78E203E4DC} = {703FD00B-D7A0-41E3-BD03-CEC86B385DAF}
{4639972E-424E-4E13-8B07-CA403C481346} = {88F517F9-CE1C-4005-9BDF-4481FEB55053}
{BC236261-77E8-4567-8D09-45CD02965EB6} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38}
- {2D4E85B2-F47F-4D65-B091-701E5C031DAC} = {703FD00B-D7A0-41E3-BD03-CEC86B385DAF}
+ {E613DA9F-41B4-4613-9911-E418EF5533BC} = {703FD00B-D7A0-41E3-BD03-CEC86B385DAF}
{3FCC50C2-81E9-5DB2-B8D8-2129427568B1} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38}
{01F4CE10-2CFB-41A8-B41F-E54337868A1D} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38}
{6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38}
{D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38}
{0FAE817D-9A32-4830-857E-81DA57246E16} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38}
- {E613DA9F-41B4-4613-9911-E418EF5533BC} = {703FD00B-D7A0-41E3-BD03-CEC86B385DAF}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {7AD976E7-4CAF-4011-B089-995E8A908BB0}
EndGlobalSection
EndGlobal
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index fc4b1b3ce0..9b0cbc4501 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -61,7 +61,3 @@ endif()
if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/USBnull" AND USBnull)
add_subdirectory(USBnull)
endif()
-
-if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl)
- add_subdirectory(zzogl-pg/opengl)
-endif()
diff --git a/plugins/zzogl-pg/opengl/CMakeLists.txt b/plugins/zzogl-pg/opengl/CMakeLists.txt
deleted file mode 100644
index f3d9883973..0000000000
--- a/plugins/zzogl-pg/opengl/CMakeLists.txt
+++ /dev/null
@@ -1,237 +0,0 @@
-if (openSUSE)
- # openSUSE don't install wx in a standard library system
- # path. Let's bypass the dynamic linker and hardcode the path.
- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
-endif()
-
-# 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(NOT TOP_CMAKE_WAS_SOURCED)
-
-# Allow to build the shader files
-if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl/ZeroGSShaders" AND REBUILD_SHADER AND NOT GLSL_API)
- add_subdirectory(ZeroGSShaders)
-endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl/ZeroGSShaders" AND REBUILD_SHADER AND NOT GLSL_API)
-
-# plugin name
-set(Output zzogl-0.4.0)
-
-set(CommonFlags
- -DZEROGS_SSE2
- -fno-strict-aliasing
- -Wstrict-aliasing # Allow to track strict aliasing issue.
- -Wunused-variable
- -Wno-parentheses
- # Mute the warnings about the huge classes we initialise with memset.
- -Wno-class-memaccess
- )
-
-#Clang doesn't support a few common flags that GCC does.
-if(NOT USE_CLANG)
- set(zzoglFinalFlags
- ${zzoglFinalFlags}
- ${CommonFlags} -fno-regmove
- )
-endif(NOT USE_CLANG)
-
-if(CMAKE_BUILD_TYPE STREQUAL Debug)
- set(zzoglFinalFlags
- ${zzoglFinalFlags}
- ${CommonFlags} -g -Wall -D_DEBUG
- )
-elseif(CMAKE_BUILD_TYPE STREQUAL Devel)
- set(zzoglFinalFlags
- ${zzoglFinalFlags}
- ${CommonFlags} -g -W -DZEROGS_DEVBUILD -fvisibility=hidden
- )
-elseif(CMAKE_BUILD_TYPE STREQUAL Release)
- set(zzoglFinalFlags
- ${zzoglFinalFlags}
- ${CommonFlags} -W -fvisibility=hidden
- )
-endif()
-
-# Select the shader API
-if(GLSL_API)
- set(zzoglFinalFlags
- ${zzoglFinalFlags}
- -DGLSL4_API -DOGL4_LOG
- )
- #-DGLSL_API
-else(GLSL_API)
- set(zzoglFinalFlags
- ${zzoglFinalFlags}
- -DNVIDIA_CG_API
- )
-endif(GLSL_API)
-
-# Select the EGL API
-if(EGL_API AND EGL_FOUND)
- if (EGL_GL_CONTEXT_SUPPORT)
- set(zzoglFinalFlags
- ${zzoglFinalFlags}
- -DEGL_API
- )
- else()
- message(WARNING "Current EGL implementation doesn't support openGL context. Fallback to standard GLX.")
- endif()
-endif()
-
-
-# zzogl sources
-set(zzoglSources
- GifTransfer.cpp
- #GLWin32.cpp
- GLWinX11.cpp
- GSDump.cpp
- GSmain.cpp
- HostMemory.cpp
- Mem.cpp
- Mem_Swizzle.cpp
- Mem_Tables.cpp
- Profile.cpp
- rasterfont.cpp
- Regs.cpp
- targets.cpp
- zerogs.cpp
- zpipe.cpp
- ZZDepthTargets.cpp
- ZZMemoryTargets.cpp
- ZZRenderTargets.cpp
- ZZClut.cpp
- ZZHacks.cpp
- ZZKeyboard.cpp
- ZZoglDrawing.cpp
- ZZLog.cpp
- ZZoglCreate.cpp
- ZZoglCRTC.cpp
- ZZoglFlush.cpp
- ZZoglFlushHack.cpp
- ZZoglMem.cpp
- ZZoglSave.cpp
- ZZoglShaders.cpp
- ZZoglShadersGLSL.cpp
- ZZoglShadersGLSL4.cpp
- ZZoglShoots.cpp
- ZZoglVB.cpp
- )
-
-# zzogl headers
-set(zzoglHeaders
- common.h
- CRC.h
- GifTransfer.h
- # glprocs.h
- GS.h
- GSDump.h
- HostMemory.h
- ps2hw_gl4.h
- Mem.h
- Mem_Swizzle.h
- Mem_Transmit.h
- Profile.h
- rasterfont.h
- Regs.h
- targets.h
- Util.h
- x86.h
- zerogs.h
- zpipe.h
- ZZClut.h
- ZZoglFlush.h
- ZZGl.h
- ZZHacks.h
- ZZoglDrawing.h
- ZZLog.h
- ZZoglCRTC.h
- ZZoglMath.h
- ZZoglMem.h
- ZZoglShaders.h
- ZZoglShoots.h
- ZZoglVB.h
- )
-
-# zzogl shader sources
-set(zzoglShaderSources
- ctx0/ps2hw_ctx.fx
- ctx1/ps2hw_ctx.fx)
-
-# zzogl Linux sources
-set(zzoglLinuxSources
- Linux/Conf.cpp
- Linux/Linux.cpp)
-
-# zzogl Linux headers
-set(zzoglLinuxHeaders
- Linux/Linux.h)
-
-set(zzoglFinalSources
- ${zzoglSources}
- ${zzoglHeaders}
- ${zzoglShaderSources}
- ${zzoglLinuxSources}
- ${zzoglLinuxHeaders}
-)
-
-set(zzoglFinalLibs
- Utilities_NO_TLS
- ${OPENGL_LIBRARIES}
-)
-
-# add additional include directories
-include_directories(Linux)
-
-# Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL
-if (REBUILD_SHADER)
- add_custom_command(OUTPUT ps2hw_gl4.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl)
-endif()
-
-if(EGL_API AND EGL_FOUND AND EGL_GL_CONTEXT_SUPPORT)
- set(zzoglFinalLibs
- ${zzoglFinalLibs}
- ${EGL_LIBRARIES}
- )
-endif()
-
-if(NOT GLSL_API)
- set(zzoglFinalLibs
- ${zzoglFinalLibs}
- ${CG_LIBRARIES}
- )
-endif(NOT GLSL_API)
-
-set(zzoglFinalLibs
- ${zzoglFinalLibs}
- ${GLEW_LIBRARY}
- ${X11_LIBRARIES}
- ${JPEG_LIBRARIES}
- ${GTK2_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${LIBC_LIBRARIES}
-)
-
-add_pcsx2_plugin(${Output} "${zzoglFinalSources}" "${zzoglFinalLibs}" "${zzoglFinalFlags}")
-
-# Trick that allow to compile zzogl with GSOPEN2 and the replayer with GSOPEN
-set_target_properties(${Output} PROPERTIES COMPILE_DEFINITIONS USE_GSOPEN2)
-
-if(NOT GLSL_API AND NOT REBUILD_SHADER)
- if(PACKAGE_MODE)
- install(FILES ${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat DESTINATION ${PLUGIN_DIR})
- else()
- install(FILES ${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
- endif()
-endif()
-
-################################### Replay Loader
-if(BUILD_REPLAY_LOADERS)
- set(Replay pcsx2_ZZReplayLoader)
- set(zzoglReplayLoaderFinalSources
- ${zzoglFinalSources}
- linux_replay.cpp
- )
- add_pcsx2_executable(${Replay} "${zzoglReplayLoaderFinalSources}" "${zzoglFinalLibs}" "${zzoglFinalFlags}")
-endif(BUILD_REPLAY_LOADERS)
diff --git a/plugins/zzogl-pg/opengl/CRC.h b/plugins/zzogl-pg/opengl/CRC.h
deleted file mode 100644
index 207e2faa33..0000000000
--- a/plugins/zzogl-pg/opengl/CRC.h
+++ /dev/null
@@ -1,408 +0,0 @@
-/* ZZ Open GL graphics plugin
- * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
- * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef CRC_H_INCLUDED
-#define CRC_H_INCLUDED
-
-#include "ZZHacks.h"
-
-// CRC Information
-enum Title_Info
-{
- Unknown_Title,
- MetalSlug6,
- TomoyoAfter,
- Clannad,
- Lamune,
- KyuuketsuKitanMoonties,
- PiaCarroteYoukosoGPGakuenPrincess,
- KazokuKeikakuKokoroNoKizuna,
- DuelSaviorDestiny,
- FFX,
- FFX2,
- FFXII,
- ShadowHearts,
- Okami,
- MetalGearSolid3,
- DBZBT2,
- DBZBT3,
- SFEX3,
- Bully,
- BullyCC,
- SoTC,
- OnePieceGrandAdventure,
- OnePieceGrandBattle,
- ICO,
- GT4,
- WildArms4,
- WildArms5,
- Manhunt2,
- CrashBandicootWoC,
- ResidentEvil4,
- Spartan,
- AceCombat4,
- Drakengard2,
- Tekken5,
- IkkiTousen,
- GodOfWar,
- GodOfWar2,
- JackieChanAdv,
- HarvestMoon,
- NamcoXCapcom,
- GiTS,
- Onimusha3,
- MajokkoALaMode2,
- TalesOfAbyss,
- SonicUnleashed,
- SimpsonsGame,
- Genji,
- StarOcean3,
- ValkyrieProfile2,
- RadiataStories,
- SMTNocturne,
- SMTDDS1,
- SMTDDS2,
- RozenMaidenGebetGarden,
- Xenosaga,
- Espgaluda,
- OkageShadowKing,
- ShadowTheHedgehog,
- AtelierIris1,
- AtelierIris2,
- AtelierIris3,
- AtelierJudie,
- AtelierLilie,
- AtelierViorate,
- ArTonelico1,
- ArTonelico2,
- ManaKhemia1,
- ManaKhemia2,
- DarkCloud1,
- DarkCloud2,
- GhostInTheShell,
- TitleCount,
- Disgaea,
- Disgaea2,
- Gradius,
- KingdomHearts,
- KingdomHeartsFM,
- KingdomHearts2,
- KingdomHearts2FM,
- KingdomHeartsCOM,
- Tekken4,
- Kaena,
- Sims_The_Urbz,
- MarvelxCapcom2,
- NeoPets_Darkest_Faerie,
- CrashnBurn,
- Xenosaga2,
- HauntingGround,
- NightmareBeforeChristmas,
- PowershotPinball,
- BioHazard4,
- NUMBER_OF_TITLES
-};
-
-enum Region_Info
-{
- Unknown_Region,
- US,
- EU,
- JP,
- JPUNDUB,
- RU,
- FR,
- DE,
- IT,
- ES,
- ASIA,
- RegionCount,
-};
-
-struct Game_Info
-{
- u32 crc;
- Title_Info title;
- Region_Info region;
- u32 flags;
- s32 v_thresh, t_thresh;
-};
-
-static const Game_Info crc_game_list[] =
-{
- // This section is straight from GSdx. Ones that also have ZZOgl hacks are commented out.
-
- {0x00000000, Unknown_Title, Unknown_Region, 0, -1, -1},
- {0x2113EA2E, MetalSlug6, Unknown_Region, 0, -1, -1},
- {0x42E05BAF, TomoyoAfter, JP, 0, -1, -1},
- {0x7800DC84, Clannad, JP, 0, -1, -1},
- {0xA6167B59, Lamune, JP, 0, -1, -1},
- {0xDDB59F46, KyuuketsuKitanMoonties, JP, 0, -1, -1},
- {0xC8EE2562, PiaCarroteYoukosoGPGakuenPrincess, JP, 0, -1, -1},
- {0x6CF94A43, KazokuKeikakuKokoroNoKizuna, JP, 0, -1, -1},
- {0xEDAF602D, DuelSaviorDestiny, JP, 0, -1, -1},
- {0xa39517ab, FFX, EU, 0, -1, -1},
- {0xa39517ae, FFX, FR, 0, -1, -1},
- {0x941bb7d9, FFX, DE, 0, -1, -1},
- {0xa39517a9, FFX, IT, 0, -1, -1},
- {0x941bb7de, FFX, ES, 0, -1, -1},
- {0xb4414ea1, FFX, RU, 0, -1, -1},
- {0xee97db5b, FFX, RU, 0, -1, -1},
- {0xaec495cc, FFX, RU, 0, -1, -1},
- {0xbb3d833a, FFX, US, 0, -1, -1},
- {0x6a4efe60, FFX, JP, 0, -1, -1},
- {0x3866ca7e, FFX, ASIA, 0, -1, -1}, // int.
- {0x658597e2, FFX, JP, 0, -1, -1}, // int.
- {0x9aac5309, FFX2, EU, 0, -1, -1},
- {0x9aac530c, FFX2, FR, 0, -1, -1},
- {0x9aac530a, FFX2, FR, 0, -1, -1}, // ?
- {0x9aac530d, FFX2, DE, 0, -1, -1},
- {0x9aac530b, FFX2, IT, 0, -1, -1},
- {0x48fe0c71, FFX2, US, 0, -1, -1},
- {0xe1fd9a2d, FFX2, JP, 0, -1, -1}, // int.
- {0x78da0252, FFXII, EU, 0, -1, -1},
- {0xc1274668, FFXII, EU, 0, -1, -1},
- {0xdc2a467e, FFXII, EU, 0, -1, -1},
- {0xca284668, FFXII, EU, 0, -1, -1},
- {0x280AD120, FFXII, JP, 0, -1, -1},
- {0x08C1ED4D, HauntingGround, Unknown_Region, 0, -1, -1},
- {0x2CD5794C, HauntingGround, EU, 0, -1, -1},
- {0x867BB945, HauntingGround, JP, 0, -1, -1},
- {0xE263BC4B, HauntingGround, JP, 0, -1, -1},
- {0x901AAC09, HauntingGround, US, 0, -1, -1},
- {0x8BE3D7B2, ShadowHearts, Unknown_Region, 0, -1, -1},
- {0xDEFA4763, ShadowHearts, US, 0, -1, -1},
- //{0x21068223, Okami, US, 0, -1, -1},
- //{0x891f223f, Okami, FR, 0, -1, -1},
- //{0xC5DEFEA0, Okami, JP, 0, -1, -1},
- {0x053D2239, MetalGearSolid3, US, 0, -1, -1},
- {0x086273D2, MetalGearSolid3, FR, 0, -1, -1},
- {0x26A6E286, MetalGearSolid3, EU, 0, -1, -1},
- {0xAA31B5BF, MetalGearSolid3, Unknown_Region, 0, -1, -1},
- {0x9F185CE1, MetalGearSolid3, Unknown_Region, 0, -1, -1},
- {0x98D4BC93, MetalGearSolid3, EU, 0, -1, -1},
- {0x86BC3040, MetalGearSolid3, US, 0, -1, -1}, //Subsistance disc 1
- {0x0481AD8A, MetalGearSolid3, JP, 0, -1, -1},
- {0x79ED26AD, MetalGearSolid3, EU, 0, -1, -1},
- {0x5E31EA42, MetalGearSolid3, EU, 0, -1, -1},
- {0xD7ED797D, MetalGearSolid3, EU, 0, -1, -1},
- {0x278722BF, DBZBT2, US, 0, -1, -1},
- {0xFE961D28, DBZBT2, US, 0, -1, -1},
- {0x0393B6BE, DBZBT2, EU, 0, -1, -1},
- {0xE2F289ED, DBZBT2, JP, 0, -1, -1}, // Sparking Neo!
- {0x35AA84D1, DBZBT2, Unknown_Region, 0, -1, -1},
- {0x428113C2, DBZBT3, US, 0, -1, -1},
- {0xA422BB13, DBZBT3, EU, 0, -1, -1},
- {0x983C53D2, DBZBT3, Unknown_Region, 0, -1, -1},
- {0x983C53D3, DBZBT3, Unknown_Region, 0, -1, -1},
- {0x72B3802A, SFEX3, US, 0, -1, -1},
- {0x71521863, SFEX3, US, 0, -1, -1},
- {0x28703748, Bully, US, 0, -1, -1},
- {0xC78A495D, BullyCC, US, 0, -1, -1},
- {0xC19A374E, SoTC, US, 0, -1, -1},
- {0x7D8F539A, SoTC, EU, 0, -1, -1},
- {0x3122B508, OnePieceGrandAdventure, US, 0, -1, -1},
- {0x8DF14A24, OnePieceGrandAdventure, EU, 0, -1, -1},
- {0xB049DD5E, OnePieceGrandBattle, US, 0, -1, -1},
- {0x5D02CC5B, OnePieceGrandBattle, Unknown_Region, 0, -1, -1},
- {0x6F8545DB, ICO, US, 0, -1, -1},
- {0xB01A4C95, ICO, JP, 0, -1, -1},
- {0x5C991F4E, ICO, Unknown_Region, 0, -1, -1},
- // FIXME multiple CRC
- {0x7ACF7E03, ICO, Unknown_Region, 0, -1, -1},
- {0xAEAD1CA3, GT4, JP, 0, -1, -1},
- {0x44A61C8F, GT4, Unknown_Region, 0, -1, -1},
- {0x0086E35B, GT4, Unknown_Region, 0, -1, -1},
- {0x77E61C8A, GT4, Unknown_Region, 0, -1, -1},
- {0xC164550A, WildArms5, JPUNDUB, 0, -1, -1},
- {0xC1640D2C, WildArms5, US, 0, -1, -1},
- {0x0FCF8FE4, WildArms5, EU, 0, -1, -1},
- {0x2294D322, WildArms5, JP, 0, -1, -1},
- {0x565B6170, WildArms5, JP, 0, -1, -1},
- {0xBBC3EFFA, WildArms4, US, 0, -1, -1},
- {0xBBC396EC, WildArms4, US, 0, -1, -1}, //hmm such a small diff in the CRC..
- {0x8B029334, Manhunt2, Unknown_Region, 0, -1, -1},
- {0x09F49E37, CrashBandicootWoC, Unknown_Region, 0, -1, -1},
- {0x013E349D, ResidentEvil4, US, 0, -1, -1},
- {0x6BA2F6B9, ResidentEvil4, Unknown_Region, 0, -1, -1},
- {0x60FA8C69, ResidentEvil4, JP, 0, -1, -1},
- {0x72E1E60E, Spartan, Unknown_Region, 0, -1, -1},
- {0x5ED8FB53, AceCombat4, JP, 0, -1, -1},
- {0x1B9B7563, AceCombat4, Unknown_Region, 0, -1, -1},
- {0xEC432B24, Drakengard2, Unknown_Region, 0, -1, -1},
- {0xFC46EA61, Tekken5, JP, 0, -1, -1},
- {0x1F88EE37, Tekken5, Unknown_Region, 0, -1, -1},
- {0x652050D2, Tekken5, Unknown_Region, 0, -1, -1},
- {0x9E98B8AE, IkkiTousen, JP, 0, -1, -1},
- //{0xD6385328, GodOfWar, US, 0, -1, -1},
- //{0xFB0E6D72, GodOfWar, EU, 0, -1, -1},
- //{0xEB001875, GodOfWar, EU, 0, -1, -1},
- //{0xA61A4C6D, GodOfWar, Unknown_Region, 0, -1, -1},
- //{0xE23D532B, GodOfWar, Unknown_Region, 0, -1, -1},
- //{0xDF1AF973, GodOfWar, Unknown_Region, 0, -1, -1},
- //{0xD6385328, GodOfWar, Unknown_Region, 0, -1, -1},
- {0x2F123FD8, GodOfWar2, RU, 0, -1, -1},
- {0x2F123FD8, GodOfWar2, US, 0, -1, -1},
- {0x44A8A22A, GodOfWar2, EU, 0, -1, -1},
- {0x4340C7C6, GodOfWar2, Unknown_Region, 0, -1, -1},
- {0xF8CD3DF6, GodOfWar2, Unknown_Region, 0, -1, -1},
- {0x0B82BFF7, GodOfWar2, Unknown_Region, 0, -1, -1},
- {0x5D482F18, JackieChanAdv, Unknown_Region, 0, -1, -1},
- //{0xf0a6d880, HarvestMoon, US, 0, -1, -1},
- {0x75c01a04, NamcoXCapcom, US, 0, -1, -1},
- {0xBF6F101F, GiTS, US, 0, -1, -1},
- {0xA5768F53, GiTS, JP, 0, -1, -1},
- {0x6BF11378, Onimusha3, US, 0, -1, -1},
- {0xF442260C, MajokkoALaMode2, JP, 0, -1, -1},
- {0x14FE77F7, TalesOfAbyss, US, 0, -1, -1},
- {0x045D77E9, TalesOfAbyss, JPUNDUB, 0, -1, -1},
- {0xAA5EC3A3, TalesOfAbyss, JP, 0, -1, -1},
- //{0xFB236A46, SonicUnleashed, US, 0, -1, -1},
- {0x4C7BB3C8, SimpsonsGame, Unknown_Region, 0, -1, -1},
- {0x4C94B32C, SimpsonsGame, Unknown_Region, 0, -1, -1},
- {0xD71B57F4, Genji, Unknown_Region, 0, -1, -1},
- {0x23A97857, StarOcean3, US, 0, -1, -1},
- {0xBEC32D49, StarOcean3, JP, 0, -1, -1},
- {0x8192A241, StarOcean3, JP, 0, -1, -1}, //NTSC JP special directors cut limited extra sugar on top edition (the special one :p)
- {0x23A97857, StarOcean3, JPUNDUB, 0, -1, -1},
- {0xCC96CE93, ValkyrieProfile2, US, 0, -1, -1},
- {0x774DE8E2, ValkyrieProfile2, JP, 0, -1, -1},
- {0x04CCB600, ValkyrieProfile2, EU, 0, -1, -1},
- {0xB65E141B, ValkyrieProfile2, EU, 0, -1, -1}, // PAL German
- {0x47B9B2FD, RadiataStories, US, 0, -1, -1},
- {0xE8FCF8EC, SMTNocturne, US, 0, -1, -1}, // GSdx saves/reloads z buffer around shadow drawing, same issue with all the SMT games following
- {0xF0A31EE3, SMTNocturne, EU, 0, -1, -1}, // SMTNocturne (Lucifers Call in EU)
- {0xAE0DE7B7, SMTNocturne, EU, 0, -1, -1}, // SMTNocturne (Lucifers Call in EU)
- {0xD60DA6D4, SMTNocturne, JP, 0, -1, -1}, // SMTNocturne
- {0x0e762e8d, SMTNocturne, JP, 0, -1, -1}, // SMTNocturne Maniacs
- {0x47BA9034, SMTNocturne, JP, 0, -1, -1}, // SMTNocturne Maniacs Chronicle
- {0xD7273511, SMTDDS1, US, 0, -1, -1}, // SMT Digital Devil Saga
- {0x1683A6BE, SMTDDS1, EU, 0, -1, -1}, // SMT Digital Devil Saga
- {0x44865CE1, SMTDDS1, JP, 0, -1, -1}, // SMT Digital Devil Saga
- {0xD382C164, SMTDDS2, US, 0, -1, -1}, // SMT Digital Devil Saga 2
- {0xD568B684, SMTDDS2, EU, 0, -1, -1}, // SMT Digital Devil Saga 2
- {0xE47C1A9C, SMTDDS2, JP, 0, -1, -1}, // SMT Digital Devil Saga 2
- {0x0B8AB37B, RozenMaidenGebetGarden, JP, 0, -1, -1},
-
- // And these are here for ZZogl hacks.
- {0xA3D63039, Xenosaga, JP, GAME_DOPARALLELCTX, 64, 32},
- {0x0E7807B2, Xenosaga, US, GAME_DOPARALLELCTX, 64, 32},
- {0x7D2FE035, Espgaluda, JP, 0/*GAME_BIGVALIDATE*/, 24, -1},
- {0x21068223, Okami, US, GAME_XENOSPECHACK, -1, -1},
- {0x891f223f, Okami, FR, GAME_XENOSPECHACK, -1, -1},
- {0xC5DEFEA0, Okami, JP, GAME_XENOSPECHACK, -1, -1},
- {0xe0426fc6, OkageShadowKing, Unknown_Region, GAME_XENOSPECHACK, -1, -1},
-
- {0xD6385328, GodOfWar, US, GAME_FULL16BITRES, -1, -1},
- {0xFB0E6D72, GodOfWar, EU, GAME_FULL16BITRES, -1, -1},
- {0xEB001875, GodOfWar, EU, GAME_FULL16BITRES, -1, -1},
- {0xA61A4C6D, GodOfWar, Unknown_Region, GAME_FULL16BITRES, -1, -1},
- {0xE23D532B, GodOfWar, Unknown_Region, GAME_FULL16BITRES, -1, -1},
- {0xDF1AF973, GodOfWar, Unknown_Region, GAME_FULL16BITRES, -1, -1},
- {0xD6385328, GodOfWar, Unknown_Region, GAME_FULL16BITRES, -1, -1},
-
- //{0x2F123FD8, GodOfWar2, Unknown_Region, GAME_FULL16BITRES, -1, -1},
- //{0x44A8A22A, GodOfWar2, Unknown_Region, GAME_FULL16BITRES, -1, -1},
- //{0x4340C7C6, GodOfWar2, Unknown_Region, GAME_FULL16BITRES, -1, -1},
- //{0xF8CD3DF6, GodOfWar2, Unknown_Region, GAME_FULL16BITRES, -1, -1},
- //{0x0B82BFF7, GodOfWar2, Unknown_Region, GAME_FULL16BITRES, -1, -1},
-
- {0xF0A6D880, HarvestMoon, US, GAME_NOSTENCIL, -1, -1},
- //{0x304C115C, HarvestMoon, Unknown, GAME_NOSTENCIL, -1, -1},
- {0xFB236A46, SonicUnleashed, US, GAME_FASTUPDATE | GAME_NOALPHAFAIL, -1, -1},
- {0xa5d29941, ShadowTheHedgehog, US, GAME_FASTUPDATE | GAME_NOALPHAFAIL, -1, -1},
-
- {0x7acf7e03, AtelierIris1, Unknown_Region, GAME_GUSTHACK, -1, -1},
- {0xF0457CEF, AtelierIris1, Unknown_Region, GAME_GUSTHACK, -1, -1},
- {0xE3981DBB, AtelierIris1, US, GAME_GUSTHACK, -1, -1},
- {0x9AC65D6A, AtelierIris2, US, GAME_GUSTHACK, -1, -1},
- {0x4CCC9212, AtelierIris3, US, GAME_GUSTHACK, -1, -1},
- {0xCA295E61, AtelierIris3, JP, GAME_GUSTHACK, -1, -1},
- //{0x4437F4B1, ArTonelico1, US, GAME_GUSTHACK, -1, -1},
- {0xF95F37EE, ArTonelico2, US, GAME_GUSTHACK, -1, -1},
- {0xF46142D3, ArTonelico2, JPUNDUB, GAME_GUSTHACK, -1, -1},
-
- // According to Zeydlitz, Mana Khemia no longer needs the Gust Hack.
- //{0x77b0236f, ManaKhemia1, US, GAME_GUSTHACK, -1, -1},
- //{0x433951e7, ManaKhemia2, US, GAME_GUSTHACK, -1, -1},
- //{0xda11c6d4, AtelierJudie, JP, GAME_GUSTHACK, -1, -1},
- //{0x3e72c085, AtelierLilie, JP, GAME_GUSTHACK, -1, -1},
- //{0x6eac076b, AtelierViorate, JP, GAME_GUSTHACK, -1, -1},
-
- {0xbaa8dd8, DarkCloud1, US, GAME_NOTARGETRESOLVE, -1, -1},
- {0xA5C05C78, DarkCloud1, Unknown_Region, GAME_NOTARGETRESOLVE, -1, -1},
- //{0x1DF41F33, DarkCloud2, US, 0, -1, -1},
- {0x95cc86ef, GhostInTheShell, Unknown_Region, GAME_NOALPHAFAIL, -1, -1}
-
-// Game settings that used to be in the Patches folder. Commented out until I decide what to do with them.
-// {0x951555A0, Disgaea2, US, GAME_NODEPTHRESOLVE, -1, -1},
-// {0x4334E17D, Disgaea2, JP, GAME_NODEPTHRESOLVE, -1, -1},
-//
-// {0x5EB127E7, Gradius, JP, GAME_INTERLACE2X, -1, -1},
-// {0x6ADBC24B, Gradius, EU, GAME_INTERLACE2X, -1, -1},
-// {0xF22CDDAF, Gradius, US, GAME_INTERLACE2X, -1, -1},
-//
-// {0xF52FB2BE, KingdomHearts, EU, GAME_QUICKRESOLVE1, -1, -1},
-// {0xAE3EAA05, KingdomHearts, DE, GAME_QUICKRESOLVE1, -1, -1},
-// {0xF6DC728D, KingdomHearts, FR, GAME_QUICKRESOLVE1, -1, -1},
-// {0x0F6B6315, KingdomHearts, US, GAME_QUICKRESOLVE1, -1, -1},
-// {0x3E68955A, KingdomHeartsFM, JP, GAME_QUICKRESOLVE1, -1, -1},
-//
-// {0xC398F477, KingdomHearts2, EU, GAME_NODEPTHRESOLVE, -1, -1},
-// {0xDA0535FD, KingdomHearts2, US, GAME_NODEPTHRESOLVE, -1, -1},
-// {0x93F8A60B, KingdomHearts2, JP, GAME_NODEPTHRESOLVE, -1, -1},
-// {0xF266B00B, KingdomHearts2FM, JP, GAME_NODEPTHRESOLVE, -1, -1},
-//
-// //The patch claimed to stop characters appearing as wigs on GeForce 8x00 series cards (Disable Alpha Testing)
-// {0x2251E14D, Tekken4, EU, GAME_NOALPHATEST, -1, -1},
-//
-// // This one is supposed to fix a refresh bug.
-// {0x51F91783, Kaena, JP, GAME_NOTARGETRESOLVE, -1, -1},
-//
-// {0xDEFA4763, ShadowHearts, EU, GAME_NODEPTHRESOLVE | GAME_NOQUICKRESOLVE | GAME_NOTARGETRESOLVE | GAME_AUTORESET, -1, -1},
-// {0x8BE3D7B2, ShadowHearts, US, GAME_NODEPTHUPDATE | GAME_AUTORESET | GAME_NOQUICKRESOLVE, -1, -1},
-//
-// {0x015314A2, Sims_The_Urbz, US, GAME_NOQUICKRESOLVE, -1, -1},
-//
-// // "Required fixes to visuals"
-// {0x086273D2, MetalGearSolid3, US, GAME_FULL16BITRES | GAME_NODEPTHRESOLVE, -1, -1},
-//
-// {0x4D228733, MarvelxCapcom2, US, GAME_QUICKRESOLVE1, -1, -1},
-// {0x934F9081, NeoPets_Darkest_Faerie, US, GAME_RESOLVEPROMOTED | GAME_FULL16BITRES | GAME_NODEPTHRESOLVE, -1, -1},
-//
-// {0x21068223, Okami, US, GAME_FULL16BITRES|GAME_NODEPTHRESOLVE|GAME_FASTUPDATE, -1, -1},
-// {0xC5DEFEA0, Okami, JP, GAME_FULL16BITRES|GAME_NODEPTHRESOLVE|GAME_FASTUPDATE, -1, -1},
-//
-// // Speed up
-// {0x6BA2F6B9, ResidentEvil4, EU, GAME_NOTARGETRESOLVE | GAME_32BITTARGS, -1, -1},
-// {0x013E349D, ResidentEvil4, US, GAME_NOTARGETCLUT, -1, -1},
-//
-// {0x2088950A, Xenosaga2, JP, GAME_FULL16BITRES | GAME_NODEPTHRESOLVE, -1, -1},
-// {0x901AAC09, HauntingGround, US, GAME_FULL16BITRES | GAME_NODEPTHRESOLVE, -1, -1},
-// {0x625AF967, NightmareBeforeChristmas, JP, GAME_TEXAHACK, -1, -1},
-//
-// {0x3CFE3B37, PowershotPinball, EU, GAME_AUTORESET, -1, -1},
-// {0x60FA8C69, BioHazard4, JP, GAME_NOTARGETCLUT, -1, -1}
-// End of game settings from the patch folder.
-};
-
-#define GAME_INFO_INDEX (sizeof(crc_game_list)/sizeof(Game_Info))
-
-
-#endif // CRC_H_INCLUDED
diff --git a/plugins/zzogl-pg/opengl/GLWin.h b/plugins/zzogl-pg/opengl/GLWin.h
deleted file mode 100644
index bbc2552a77..0000000000
--- a/plugins/zzogl-pg/opengl/GLWin.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* ZZ Open GL graphics plugin
- * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
- * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef GLWIN_H_INCLUDED
-#define GLWIN_H_INCLUDED
-
-#ifdef _WIN32
-#define GL_WIN32_WINDOW
-#define WGL_API
-
-#else
-
-#define GL_X11_WINDOW
-#include
-#include
-
-#ifdef EGL_API
-#include
-#include
-
-#else
-#define GLX_API
-#include
-
-#endif
-
-#endif
-
-// FIX compilation issue with Mesa 10
-// Note it might be possible to do better with the right include
-// in the rigth order but I don't have time
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-
-#undef CreateWindow // Undo Windows.h global namespace pollution
-
-#ifdef GLX_API
-typedef void (APIENTRYP _PFNSWAPINTERVAL)(int);
-#endif
-
-
-extern void SetDeviceSize(int nNewWidth, int nNewHeight);
-extern void OnFKey(int key, int shift);
-
-class GLWindow
-{
- private:
-#if defined(GL_X11_WINDOW)
- void GetWindowSize();
- void PrintProtocolVersion();
-#endif
- bool CreateContextGL(int, int);
- bool CreateContextGL();
-
-#ifdef GLX_API
- Display *NativeDisplay;
- Window NativeWindow;
-
- GLXContext glxContext;
-
- _PFNSWAPINTERVAL swapinterval;
-#endif
-
-#ifdef EGL_API
- EGLNativeWindowType NativeWindow;
- EGLNativeDisplayType NativeDisplay;
-
- EGLDisplay eglDisplay;
- EGLSurface eglSurface;
- EGLContext eglContext;
-
-
- EGLBoolean OpenEGLDisplay();
- void CloseEGLDisplay();
-#endif
-
-#ifdef WGL_API
- HWND NativeWindow;
- HDC NativeDisplay; // hDC // Private GDI Device Context
- HGLRC wglContext; // hRC // Permanent Rendering Context
-
- bool OpenWGLDisplay();
- void CloseWGLDisplay();
-#endif
-
- bool vsync_supported;
-
-
- public:
- char title[256];
- Size backbuffer;
-
- void SwapGLBuffers();
- bool ReleaseContext();
-
- bool CreateWindow(void *pDisplay);
- void CloseWindow();
- bool DisplayWindow(int _width, int _height);
- void SetTitle(char *strtitle);
- void ProcessEvents();
-
- void* GetProcAddress(const char* function);
-
- void SetVsync(bool enable);
- void InitVsync(bool extension); // dummy in EGL
-
- void UpdateWindowSize(int nNewWidth, int nNewHeight)
- {
- FUNCLOG
- backbuffer.w = std::max(nNewWidth, 16);
- backbuffer.h = std::max(nNewHeight, 16);
-
- if (!(conf.fullscreen()))
- {
- conf.width = nNewWidth;
- conf.height = nNewHeight;
- }
- }
-
- GLWindow() {
-#ifdef WGL_API
- NativeWindow = NULL;
- NativeDisplay = NULL;
- wglContext = NULL;
-#endif
- }
-};
-
-extern GLWindow GLWin;
-
-#endif // GLWIN_H_INCLUDED
diff --git a/plugins/zzogl-pg/opengl/GLWin32.cpp b/plugins/zzogl-pg/opengl/GLWin32.cpp
deleted file mode 100644
index cbad53f1ca..0000000000
--- a/plugins/zzogl-pg/opengl/GLWin32.cpp
+++ /dev/null
@@ -1,435 +0,0 @@
-/* ZZ Open GL graphics plugin
- * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
- * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "GS.h"
-#include "GLWin.h"
-
-#ifdef GL_WIN32_WINDOW
-
-LRESULT WINAPI MsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- static int nWindowWidth = 0, nWindowHeight = 0;
-
- switch (msg)
- {
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
-
- case WM_KEYDOWN:
-// switch(wParam) {
-// case VK_ESCAPE:
-// SendMessage(hWnd, WM_DESTROY, 0L, 0L);
-// break;
-// }
- break;
-
- case WM_SIZE:
- nWindowWidth = lParam & 0xffff;
- nWindowHeight = lParam >> 16;
- GLWin.UpdateWindowSize(nWindowWidth, nWindowHeight);
- break;
-
- case WM_SIZING:
- // if button is 0, then just released so can resize
- if (GetSystemMetrics(SM_SWAPBUTTON) ? !GetAsyncKeyState(VK_RBUTTON) : !GetAsyncKeyState(VK_LBUTTON))
- {
- SetDeviceSize(nWindowWidth, nWindowHeight);
- }
- break;
-
- case WM_SETCURSOR:
- SetCursor(NULL);
- break;
- }
-
- return DefWindowProc(hWnd, msg, wParam, lParam);
-}
-
-bool GLWindow::CreateWindow(void *pDisplay)
-{
- RECT rc, rcdesktop;
- rc.left = 0;
- rc.top = 0;
- rc.right = conf.width;
- rc.bottom = conf.height;
-
- WNDCLASSEX wc;
- HINSTANCE hInstance = GetModuleHandle(NULL); // Grab An Instance For Our Window
- DWORD dwExStyle, dwStyle;
-
- wc.cbSize = sizeof(WNDCLASSEX);
- wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; // Redraw On Move, And Own DC For Window
- wc.lpfnWndProc = (WNDPROC) MsgProc; // MsgProc Handles Messages
- wc.cbClsExtra = 0; // No Extra Window Data
- wc.cbWndExtra = 0; // No Extra Window Data
- wc.hInstance = hInstance; // Set The Instance
- wc.hIcon = NULL;
- wc.hIconSm = NULL; // Load The Default Icon
- wc.hCursor = LoadCursor(NULL, IDC_ARROW); // Load The Arrow Pointer
- wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); // No Background Required For GL
- wc.lpszMenuName = NULL; // We Don't Want A Menu
- wc.lpszClassName = L"PS2EMU_ZEROGS"; // Set The Class Name
-
- RegisterClassEx(&wc);
-
- if (conf.fullscreen())
- {
- dwExStyle = WS_EX_APPWINDOW;
- dwStyle = WS_POPUP;
- }
- else
- {
- dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
- dwStyle = WS_OVERLAPPEDWINDOW | WS_BORDER;
- }
-
- dwStyle |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
- AdjustWindowRectEx(&rc, dwStyle, false, dwExStyle);
-
- GetWindowRect(GetDesktopWindow(), &rcdesktop);
-
- NativeWindow = CreateWindowEx( dwExStyle, // Extended Style For The Window
- L"PS2EMU_ZEROGS", // Class Name
- L"ZZOgl", // Window Title
- dwStyle, // Selected Window Style
- (rcdesktop.right - (rc.right - rc.left)) / 2, // Window Position
- (rcdesktop.bottom - (rc.bottom - rc.top)) / 2, // Window Position
- rc.right - rc.left, // Calculate Adjusted Window Width
- rc.bottom - rc.top, // Calculate Adjusted Window Height
- NULL, // No Parent Window
- NULL, // No Menu
- hInstance, // Instance
- NULL); // Don't Pass Anything To WM_CREATE
-
- if (NativeWindow == NULL)
- {
- ZZLog::Error_Log("Failed to create window. Exiting...");
- return false;
- }
-
- if (pDisplay != NULL) *(HWND*)pDisplay = NativeWindow;
-
- // set just in case
- SetWindowLongPtr(NativeWindow, GWLP_WNDPROC, (LPARAM)(WNDPROC)MsgProc);
-
- ShowWindow(NativeWindow, SW_SHOWDEFAULT);
-
- UpdateWindow(NativeWindow);
-
- SetFocus(NativeWindow);
-
- if (pDisplay == NULL) ZZLog::Error_Log("Failed to create window. Exiting...");
- return (pDisplay != NULL);
-}
-
-bool GLWindow::ReleaseContext()
-{
- if (wglContext) // Do We Have A Rendering Context?
- {
- if (!wglMakeCurrent(NULL, NULL)) // Are We Able To Release The DC And RC Contexts?
- {
- MessageBox(NULL, L"Release Of DC And RC Failed.", L"SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION);
- }
-
- if (!wglDeleteContext(wglContext)) // Are We Able To Delete The RC?
- {
- MessageBox(NULL, L"Release Rendering Context Failed.", L"SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION);
- }
-
- wglContext = NULL; // Set RC To NULL
- }
-
- CloseWGLDisplay();
-
- return true;
-}
-
-void GLWindow::CloseWindow()
-{
- if (NativeWindow != NULL)
- {
- DestroyWindow(NativeWindow);
- NativeWindow = NULL;
- }
-}
-
-bool GLWindow::DisplayWindow(int _width, int _height)
-{
- DWORD dwExStyle; // Window Extended Style
- DWORD dwStyle; // Window Style
-
- RECT rcdesktop;
- GetWindowRect(GetDesktopWindow(), &rcdesktop);
-
- if (conf.fullscreen())
- {
- backbuffer.w = rcdesktop.right - rcdesktop.left;
- backbuffer.h = rcdesktop.bottom - rcdesktop.top;
-
- dwExStyle = WS_EX_APPWINDOW;
- dwStyle = WS_POPUP;
- ShowCursor(false);
- }
- else
- {
- dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
- dwStyle = WS_OVERLAPPEDWINDOW;
- backbuffer.w = _width;
- backbuffer.h = _height;
- }
- dwStyle |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
-
- RECT rc;
-
- rc.left = 0;
- rc.top = 0;
- rc.right = backbuffer.w;
- rc.bottom = backbuffer.h;
- AdjustWindowRectEx(&rc, dwStyle, false, dwExStyle);
- int X = (rcdesktop.right - rcdesktop.left) / 2 - (rc.right - rc.left) / 2;
- int Y = (rcdesktop.bottom - rcdesktop.top) / 2 - (rc.bottom - rc.top) / 2;
-
- SetWindowLong(NativeWindow, GWL_STYLE, dwStyle);
- SetWindowLong(NativeWindow, GWL_EXSTYLE, dwExStyle);
-
- SetWindowPos(NativeWindow, HWND_TOP, X, Y, rc.right - rc.left, rc.bottom - rc.top, SWP_SHOWWINDOW);
-
- if (conf.fullscreen())
- {
- DEVMODE dmScreenSettings;
- memset(&dmScreenSettings, 0, sizeof(dmScreenSettings));
- dmScreenSettings.dmSize = sizeof(dmScreenSettings);
- dmScreenSettings.dmPelsWidth = backbuffer.w;
- dmScreenSettings.dmPelsHeight = backbuffer.h;
- dmScreenSettings.dmBitsPerPel = 32;
- dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
-
- // Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
-
- if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
- {
- if (MessageBox(NULL,
- L"The Requested Fullscreen Mode Is Not Supported By\nYour Video Card. Use Windowed Mode Instead?",
- L"NeHe GL",
- MB_YESNO | MB_ICONEXCLAMATION) == IDYES)
- conf.setFullscreen(false);
- else
- return false;
- }
- }
- else
- {
- // change to default resolution
- ChangeDisplaySettings(NULL, 0);
- }
-
- if (!OpenWGLDisplay()) return false;
-
- if (!CreateContextGL()) return false;
-
- UpdateWindow(NativeWindow);
-
- return true;
-}
-
-bool GLWindow::OpenWGLDisplay()
-{
- GLuint PixelFormat; // Holds The Results After Searching For A Match
- PIXELFORMATDESCRIPTOR pfd = // pfd Tells Windows How We Want Things To Be
-
- {
- sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor
- 1, // Version Number
- PFD_DRAW_TO_WINDOW | // Format Must Support Window
- PFD_SUPPORT_OPENGL | // Format Must Support OpenGL
- PFD_DOUBLEBUFFER, // Must Support Double Buffering
- PFD_TYPE_RGBA, // Request An RGBA Format
- 32, // Select Our Color Depth
- 0, 0, 0, 0, 0, 0, // Color Bits Ignored
- 0, // 8bit Alpha Buffer
- 0, // Shift Bit Ignored
- 0, // No Accumulation Buffer
- 0, 0, 0, 0, // Accumulation Bits Ignored
- 24, // 24Bit Z-Buffer (Depth Buffer)
- 8, // 8bit Stencil Buffer
- 0, // No Auxiliary Buffer
- PFD_MAIN_PLANE, // Main Drawing Layer
- 0, // Reserved
- 0, 0, 0 // Layer Masks Ignored
- };
-
- if (!(NativeDisplay = GetDC(NativeWindow)))
- {
- MessageBox(NULL, L"(1) Can't Create A GL Device Context.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
- return false;
- }
-
- if (!(PixelFormat = ChoosePixelFormat(NativeDisplay, &pfd)))
- {
- MessageBox(NULL, L"(2) Can't Find A Suitable PixelFormat.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
- return false;
- }
-
- if (!SetPixelFormat(NativeDisplay, PixelFormat, &pfd))
- {
- MessageBox(NULL, L"(3) Can't Set The PixelFormat.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
- return false;
- }
-
- return true;
-}
-
-void GLWindow::CloseWGLDisplay()
-{
- if (NativeDisplay && !ReleaseDC(NativeWindow, NativeDisplay)) // Are We Able To Release The DC
- {
- MessageBox(NULL, L"Release Device Context Failed.", L"SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION);
- NativeDisplay = NULL; // Set DC To NULL
- }
-}
-
-bool GLWindow::CreateContextGL()
-{
- return CreateContextGL(2, 0);
-}
-
-bool GLWindow::CreateContextGL(int major, int minor)
-{
- if (major <= 2) {
- if (!(wglContext = wglCreateContext(NativeDisplay)))
- {
- MessageBox(NULL, L"(4) Can't Create A GL Rendering Context.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
- return false;
- }
-
- if (!wglMakeCurrent(NativeDisplay, wglContext))
- {
- MessageBox(NULL, L"(5) Can't Activate The GL Rendering Context.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
- return false;
- }
- } else {
- // todo
- return false;
- }
-
- return true;
-}
-
-void GLWindow::SwapGLBuffers()
-{
- static u32 lastswaptime = 0;
-
- if (glGetError() != GL_NO_ERROR) ZZLog::Debug_Log("glError before swap!");
-
- SwapBuffers(NativeDisplay);
- lastswaptime = timeGetTime();
-}
-
-void GLWindow::SetTitle(char *strtitle)
-{
- if (!conf.fullscreen()) SetWindowText(NativeWindow, wxString::FromUTF8(strtitle));
-}
-
-extern void ChangeDeviceSize(int nNewWidth, int nNewHeight);
-
-void GLWindow::ProcessEvents()
-{
- MSG msg;
-
- ZeroMemory(&msg, sizeof(msg));
-
- while (1)
- {
- if (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
- {
- switch (msg.message)
- {
- case WM_KEYDOWN :
- int my_KeyEvent = msg.wParam;
- bool my_bShift = !!(GetKeyState(VK_SHIFT) & 0x8000);
-
- switch (msg.wParam)
- {
- case VK_F5:
- case VK_F6:
- case VK_F7:
- case VK_F9:
- OnFKey(msg.wParam - VK_F1 + 1, my_bShift);
- break;
-
- case VK_ESCAPE:
-
- if (conf.fullscreen())
- {
- // destroy that msg
- conf.setFullscreen(false);
- ChangeDeviceSize(conf.width, conf.height);
- UpdateWindow(NativeWindow);
- continue; // so that msg doesn't get sent
- }
- else
- {
- SendMessage(NativeWindow, WM_DESTROY, 0, 0);
- return;
- }
-
- break;
- }
-
- break;
- }
-
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- else
- {
- break;
- }
- }
-
- if ((GetKeyState(VK_MENU) & 0x8000) && (GetKeyState(VK_RETURN) & 0x8000))
- {
- conf.zz_options.fullscreen = !conf.zz_options.fullscreen;
-
- SetDeviceSize(
- (conf.fullscreen()) ? 1280 : conf.width,
- (conf.fullscreen()) ? 960 : conf.height);
- }
-}
-
-void* GLWindow::GetProcAddress(const char* function)
-{
- return (void*)wglGetProcAddress(function);
-}
-
-void GLWindow::InitVsync(bool extension)
-{
- vsync_supported = extension;
-}
-
-void GLWindow::SetVsync(bool enable)
-{
- if (vsync_supported) {
- wglSwapIntervalEXT(0);
- }
-}
-
-#endif
diff --git a/plugins/zzogl-pg/opengl/GLWinX11.cpp b/plugins/zzogl-pg/opengl/GLWinX11.cpp
deleted file mode 100644
index 7bdc4b15b2..0000000000
--- a/plugins/zzogl-pg/opengl/GLWinX11.cpp
+++ /dev/null
@@ -1,508 +0,0 @@
-/* ZZ Open GL graphics plugin
- * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
- * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "Util.h"
-#include "GLWin.h"
-
-#if defined(GL_X11_WINDOW)
-
-#ifdef EGL_API
-// Need at least MESA 9.0 (plan for october/november 2012)
-// So force the destiny to at least check the compilation
-#ifndef EGL_KHR_create_context
-#define EGL_KHR_create_context 1
-#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION
-#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
-#define EGL_CONTEXT_FLAGS_KHR 0x30FC
-#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
-#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
-#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE
-#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF
-#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
-#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
-#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
-#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
-#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
-#endif
-#endif
-
-#ifdef USE_GSOPEN2
-bool GLWindow::CreateWindow(void *pDisplay)
-{
- bool ret = true;
-
- NativeWindow = (Window)*((u32*)(pDisplay)+1);
- // Do not take the display which come from pcsx2 neither change it.
- // You need a new one to do the operation in the GS thread
- NativeDisplay = XOpenDisplay(NULL);
- if (!NativeDisplay) ret = false;
-
-#ifdef EGL_API
- if (!OpenEGLDisplay()) ret = false;
-#endif
-
- return ret;
-}
-#else
-bool GLWindow::CreateWindow(void *pDisplay)
-{
- bool ret = true;
-
- // init support of multi thread
- if (!XInitThreads())
- ZZLog::Error_Log("Failed to init the xlib concurent threads");
-
- NativeDisplay = XOpenDisplay(NULL);
- if (!NativeDisplay) ret = false;
-
- if (pDisplay == NULL)
- {
- ZZLog::Error_Log("Failed to create window. Exiting...");
- return false;
- }
-
- // Allow pad to use the display
- *(Display**)pDisplay = NativeDisplay;
- // Pad can use the window to grab the input. For the moment just set to 0 to avoid
- // to grab an unknow window... Anyway GSopen1 might be dropped in the future
- *((u32*)(pDisplay)+1) = 0;
-
-#ifdef EGL_API
- if (!OpenEGLDisplay()) ret = false;
-#endif
-
- return ret;
-}
-#endif
-
-#ifdef EGL_API
-EGLBoolean GLWindow::OpenEGLDisplay()
-{
- // Create an EGL display from the native display
- eglDisplay = eglGetDisplay((EGLNativeDisplayType)NativeDisplay);
- if ( eglDisplay == EGL_NO_DISPLAY ) return EGL_FALSE;
-
- if ( !eglInitialize(eglDisplay, NULL, NULL) ) return EGL_FALSE;
-
- return EGL_TRUE;
-}
-#endif
-
-#ifdef EGL_API
-void GLWindow::CloseEGLDisplay()
-{
- eglTerminate(eglDisplay);
-}
-#endif
-
-bool GLWindow::ReleaseContext()
-{
- bool status = true;
-#ifdef GLX_API
- if (!NativeDisplay) return status;
-
- // free the context
- if (glxContext)
- {
- if (!glXMakeCurrent(NativeDisplay, None, NULL)) {
- ZZLog::Error_Log("GLX: Could not release drawing context.");
- status = false;
- }
-
- glXDestroyContext(NativeDisplay, glxContext);
- glxContext = NULL;
- }
-#endif
-#ifdef EGL_API
- eglReleaseThread();
-#endif
-
- return status;
-}
-
-void GLWindow::CloseWindow()
-{
- SaveConfig();
- if (!NativeDisplay) return;
-
-#ifdef EGL_API
- CloseEGLDisplay();
-#endif
-
- XCloseDisplay(NativeDisplay);
- NativeDisplay = NULL;
-}
-
-void GLWindow::GetWindowSize()
-{
- if (!NativeDisplay or !NativeWindow) return;
-
- u32 depth = 0;
-#ifdef GLX_API
- unsigned int borderDummy;
- Window winDummy;
- s32 xDummy;
- s32 yDummy;
- u32 width;
- u32 height;
-
- XLockDisplay(NativeDisplay);
- XGetGeometry(NativeDisplay, NativeWindow, &winDummy, &xDummy, &yDummy, &width, &height, &borderDummy, &depth);
- XUnlockDisplay(NativeDisplay);
-#endif
-
- // FIXME: Not sure it works but that could remove latest X11 bits.
-#ifdef EGL_API
- int width;
- int height;
- eglQuerySurface(eglDisplay, eglSurface, EGL_WIDTH, &width);
- eglQuerySurface(eglDisplay, eglSurface, EGL_HEIGHT, &height);
-#endif
-
- // update the gl buffer size
- UpdateWindowSize(width, height);
-
-#ifndef USE_GSOPEN2
- // too verbose!
- ZZLog::Dev_Log("Resolution %dx%d. Depth %d bpp. Position (%d,%d)", width, height, depth, conf.x, conf.y);
-#endif
-}
-
-void GLWindow::PrintProtocolVersion()
-{
-#ifdef GLX_API
- int glxMajorVersion, glxMinorVersion;
-
- glXQueryVersion(NativeDisplay, &glxMajorVersion, &glxMinorVersion);
-
- if (glXIsDirect(NativeDisplay, glxContext))
- ZZLog::Error_Log("glX-Version %d.%d with Direct Rendering", glxMajorVersion, glxMinorVersion);
- else
- ZZLog::Error_Log("glX-Version %d.%d with Indirect Rendering !!! It will be slow", glxMajorVersion, glxMinorVersion);
-#endif
-#ifdef EGL_API
- ZZLog::Error_Log("EGL: %s : %s", eglQueryString(eglDisplay, EGL_VENDOR) , eglQueryString(eglDisplay, EGL_VERSION) );
- ZZLog::Error_Log("EGL: extensions supported: %s", eglQueryString(eglDisplay, EGL_EXTENSIONS));
-#endif
-}
-
-#ifdef GLX_API
-bool GLWindow::CreateContextGL(int major, int minor)
-{
- if (!NativeDisplay) return false;
-
- // Get visual information
- int attrListDbl[] =
- {
- // GLX_X_RENDERABLE: If True is specified, then only frame buffer configurations that have associated X
- // visuals (and can be used to render to Windows and/or GLX pixmaps) will be considered. The default value is GLX_DONT_CARE.
- GLX_X_RENDERABLE , True,
- GLX_RED_SIZE , 8,
- GLX_GREEN_SIZE , 8,
- GLX_BLUE_SIZE , 8,
- GLX_DEPTH_SIZE , 24,
- GLX_DOUBLEBUFFER , True,
- None
- };
-
- // Attribute are very sensible to the various implementation (intel, nvidia, amd)
- // Nvidia and Intel doesn't support previous attributes for opengl2.0
- int attrListDbl_2_0[] =
- {
- GLX_RGBA,
- GLX_DOUBLEBUFFER,
- GLX_RED_SIZE, 8,
- GLX_GREEN_SIZE, 8,
- GLX_BLUE_SIZE, 8,
- GLX_DEPTH_SIZE, 24,
- None
- };
-
- // Only keep for older card but NVIDIA and AMD both drop the support of those cards
- if (major <= 2) {
- XVisualInfo *vi = glXChooseVisual(NativeDisplay, DefaultScreen(NativeDisplay), attrListDbl_2_0);
- if (vi == NULL) return false;
-
- glxContext = glXCreateContext(NativeDisplay, vi, NULL, GL_TRUE);
- XFree(vi);
-
- if (!glxContext) return false;
-
- glXMakeCurrent(NativeDisplay, NativeWindow, glxContext);
- return true;
- }
-
- PFNGLXCHOOSEFBCONFIGPROC glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)GetProcAddress("glXChooseFBConfig");
- int fbcount = 0;
- GLXFBConfig *fbc = glXChooseFBConfig(NativeDisplay, DefaultScreen(NativeDisplay), attrListDbl, &fbcount);
- if (!fbc || fbcount < 1) {
- ZZLog::Error_Log("GLX: failed to find a framebuffer");
- return false;
- }
-
- PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)GetProcAddress("glXCreateContextAttribsARB");
- if (!glXCreateContextAttribsARB) return false;
-
- // Create a context
- int context_attribs[] =
- {
- GLX_CONTEXT_MAJOR_VERSION_ARB, major,
- GLX_CONTEXT_MINOR_VERSION_ARB, minor,
- // Keep compatibility for old cruft
- GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
- //GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
- // FIXME : Request a debug context to ease opengl development
-#if (defined(ZEROGS_DEVBUILD) || defined(_DEBUG)) && defined(OGL4_LOG)
- GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
-#endif
- None
- };
-
- glxContext = glXCreateContextAttribsARB(NativeDisplay, fbc[0], 0, true, context_attribs);
- if (!glxContext) {
- ZZLog::Error_Log("GLX: failed to create an opengl context");
- return false;
- }
-
- XSync( NativeDisplay, false);
-
- if (!glXMakeCurrent(NativeDisplay, NativeWindow, glxContext)) {
- ZZLog::Error_Log("GLX: failed to attach the opengl context");
- return false;
- }
-
- return true;
-}
-#endif
-
-bool GLWindow::CreateContextGL()
-{
- bool ret;
-#if defined(OGL4_LOG) || defined(GLSL4_API)
- // We need to define a debug context. So we need at a 3.0 context (if not 3.2 actually)
- ret = CreateContextGL(3, 3);
-#else
- // FIXME there was some issue with previous context creation on Geforce7. Code was rewritten
- // for GSdx unfortunately it was not tested on Geforce7 so keep the 2.0 context for now.
- // Note: Geforce 6&7 was dropped from nvidia driver (2012)
-#if 0
- ret = CreateContextGL(3, 0)
- if (! ret )
- ret = CreateContextGL(2, 0);
-#else
- ret = CreateContextGL(2, 0);
-#endif
-
-#endif
- return ret;
-}
-
-#ifdef EGL_API
-bool GLWindow::CreateContextGL(int major, int minor)
-{
- EGLConfig eglConfig;
- EGLint numConfigs;
- EGLint contextAttribs[] =
- {
- EGL_CONTEXT_MAJOR_VERSION_KHR, major,
- EGL_CONTEXT_MINOR_VERSION_KHR, minor,
- // Keep compatibility for old cruft
- EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR,
- //EGL_CONTEXT_FLAGS_KHR, EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR | EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR,
- // FIXME : Request a debug context to ease opengl development
-#if defined(ZEROGS_DEVBUILD) || defined(_DEBUG)
- EGL_CONTEXT_FLAGS_KHR, EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR,
-#endif
- EGL_NONE
- };
- EGLint attrList[] = {
- EGL_RED_SIZE, 8,
- EGL_GREEN_SIZE, 8,
- EGL_BLUE_SIZE, 8,
- EGL_DEPTH_SIZE, 24,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
- EGL_NONE
- };
-
- eglBindAPI(EGL_OPENGL_API);
-
- if ( !eglChooseConfig(eglDisplay, attrList, &eglConfig, 1, &numConfigs) )
- {
- ZZLog::Error_Log("EGL: Failed to get a frame buffer config!");
- return EGL_FALSE;
- }
-
- eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, NativeWindow, NULL);
- if ( eglSurface == EGL_NO_SURFACE )
- {
- ZZLog::Error_Log("EGL: Failed to get a window surface");
- return EGL_FALSE;
- }
-
- eglContext = eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT, contextAttribs );
- if ( eglContext == EGL_NO_CONTEXT )
- {
- ZZLog::Error_Log("EGL: Failed to create the context");
- ZZLog::Error_Log("EGL STATUS: %x", eglGetError());
- return EGL_FALSE;
- }
-
- if ( !eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext) )
- {
- return EGL_FALSE;
- }
-
- return EGL_TRUE;
-}
-#endif
-
-
-#ifdef USE_GSOPEN2
-bool GLWindow::DisplayWindow(int _width, int _height)
-{
- GetWindowSize();
-
- if ( !CreateContextGL() ) return false;
-
- PrintProtocolVersion();
-
- return true;
-}
-#else
-bool GLWindow::DisplayWindow(int _width, int _height)
-{
- backbuffer.w = _width;
- backbuffer.h = _height;
-
- NativeWindow = XCreateSimpleWindow(NativeDisplay, DefaultRootWindow(NativeDisplay), conf.x, conf.y, backbuffer.w, backbuffer.h, 0, 0, 0);
-
- // Draw the window
- XMapRaised(NativeDisplay, NativeWindow);
- XSync(NativeDisplay, false);
-
- if ( !CreateContextGL() ) return false;
-
- PrintProtocolVersion();
-
- GetWindowSize();
-
- return true;
-}
-#endif
-
-void* GLWindow::GetProcAddress(const char *function)
-{
-#ifdef EGL_API
- return (void*)eglGetProcAddress(function);
-#endif
-#ifdef GLX_API
- return (void*)glXGetProcAddress((const GLubyte*)function);
-#endif
-}
-
-void GLWindow::SwapGLBuffers()
-{
- if (glGetError() != GL_NO_ERROR) ZZLog::Debug_Log("glError before swap!");
- ZZLog::Check_GL_Error();
-
-#ifdef GLX_API
- glXSwapBuffers(NativeDisplay, NativeWindow);
-#endif
-#ifdef EGL_API
- eglSwapBuffers(eglDisplay, eglSurface);
-#endif
- // glClear(GL_COLOR_BUFFER_BIT);
-}
-
-void GLWindow::InitVsync(bool extension)
-{
-#ifdef GLX_API
- vsync_supported = false;
- if (extension) {
- swapinterval = (_PFNSWAPINTERVAL)GetProcAddress("glXSwapInterval");
-
- if (!swapinterval)
- swapinterval = (_PFNSWAPINTERVAL)GetProcAddress("glXSwapIntervalSGI");
-
- if (!swapinterval)
- swapinterval = (_PFNSWAPINTERVAL)GetProcAddress("glXSwapIntervalEXT");
-
- if (swapinterval) {
- swapinterval(0);
- vsync_supported = true;
- } else {
- ZZLog::Error_Log("GLX: No support for SwapInterval (framerate clamped to monitor refresh rate),");
- }
- }
-
-#endif
-}
-
-void GLWindow::SetVsync(bool enable)
-{
- fprintf(stderr, "change vsync %d\n", enable);
-#ifdef EGL_API
- eglSwapInterval(eglDisplay, enable);
-#endif
-#ifdef GLX_API
- if (vsync_supported && swapinterval) {
- swapinterval(enable);
- }
-#endif
-}
-
-u32 THR_KeyEvent = 0; // Value for key event processing between threads
-bool THR_bShift = false;
-bool THR_bCtrl = false;
-
-void GLWindow::ProcessEvents()
-{
- FUNCLOG
-
-#ifdef USE_GSOPEN2
- GetWindowSize();
-#endif
-
- if (THR_KeyEvent) // This value was passed from GSKeyEvents which could be in another thread
- {
- int my_KeyEvent = THR_KeyEvent;
- bool my_bShift = THR_bShift;
- bool my_bCtrl = THR_bCtrl;
- THR_KeyEvent = 0;
-
- switch (my_KeyEvent)
- {
- case XK_F5:
- case XK_F6:
- case XK_F7:
- case XK_F9:
- // Note: to avoid some clash with PCSX2 shortcut in GSOpen2.
- // GS shortcut will only be activated when ctrl is press
- if (my_bCtrl)
- OnFKey(my_KeyEvent - XK_F1 + 1, my_bShift);
- break;
- }
- }
-}
-
-
-// ************************** Function that are useless in GSopen2 (GSopen 1 is only used with the debug replayer)
-void GLWindow::SetTitle(char *strtitle) { }
-
-#endif
diff --git a/plugins/zzogl-pg/opengl/GS.h b/plugins/zzogl-pg/opengl/GS.h
deleted file mode 100644
index fa2fd9bd2a..0000000000
--- a/plugins/zzogl-pg/opengl/GS.h
+++ /dev/null
@@ -1,1136 +0,0 @@
-/* ZZ Open GL graphics plugin
- * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
- * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef __GS_H__
-#define __GS_H__
-
-
-#define ZZNORMAL_MEMORY
-
-#include "Util.h"
-#include "GifTransfer.h"
-#include "HostMemory.h"
-#include "ZZoglShoots.h"
-
-using namespace std;
-
-extern float fFPS;
-
-#ifdef _MSC_VER
-#define EXPORT_C_(type) extern "C" type CALLBACK
-#else
-#define EXPORT_C_(type) extern "C" __attribute__((stdcall,externally_visible,visibility("default"))) type
-#endif
-
-extern int g_LastCRC;
-
-#define VB_NUMBUFFERS 128 // number of vbo buffer allocated
-
-struct Vector_16F
-{
- u16 x, y, z, w;
-};
-
-// PS2 vertex
-
-// Almost same as VertexGPU, controlled by prim.fst flags
-
-struct Vertex
-{
- u16 x, y, f, resv0; // note: xy is 12d3
- u32 rgba;
- u32 z;
- float s, t, q;
- // Texel coordinate of vertex. Used if prim.fst == 1
- // Bits 0-14 and 16-30 of UV
- u16 u, v;
-};
-
-struct VertexGPU
-{
- // gained from XYZ2, XYZ3, XYZF2, XYZF3,
- // X -- bits 0-15, Y-16-31. Z - 32-63 if no F used, 32-55 otherwise, F (fog) - 56-63
- // X, Y stored in 12d3 format,
- s16 x, y;
- s16 f, resv0;
-
- // Vertex color settings. RGB -- luminance of red/green/blue, A -- alpha. 1.0 == 0x80.
- // Goes grom RGBAQ register, bits 0-7, 8-15, 16-23 and 24-31 accordingly
- u32 rgba;
- u32 z;
- // Texture coordinates. S & T going from ST register (bits 0-31, and 32-63).
- // Q goes from RGBAQ register, bits 32-63
- float s, t, q;
-
- void move_x(Vertex v, int offset)
- {
- x = ((((int)v.x - offset) >> 1) & 0xffff);
- }
-
- void move_y(Vertex v, int offset)
- {
- y = ((((int)v.y - offset) >> 1) & 0xffff);
- }
-
- void move_z(Vertex v, int mask)
- {
- z = (mask == 0xffff) ? min((u32)0xffff, v.z) : v.z;
- }
-
- void move_fog(Vertex v)
- {
- f = ((s16)(v).f << 7) | 0x7f;
- }
-
- void set_xy(s16 x1, s16 y1)
- {
- x = x1;
- y = y1;
- }
- void set_xyz(s16 x1, s16 y1, u32 z1)
- {
- x = x1;
- y = y1;
- z = z1;
- }
-
- void set_st(float s1, float t1)
- {
- s = s1;
- t = t1;
- }
-
- void set_stq(float s1, float t1, float q1)
- {
- s = s1;
- t = t1;
- q = q1;
- }
-
- void set_xyzst(s16 x1, s16 y1, u32 z1, float s1, float t1)
- {
- set_xyz(x1, y1, z1);
- set_st(s1, t1);
- }
-
-};
-
-extern GSconf conf;
-
-// PSM values
-// PSM types == Texture Storage Format
-enum PSM_value{
- PSMCT32 = 0, // 000000
- PSMCT24 = 1, // 000001
- PSMCT16 = 2, // 000010
- PSMCT16S = 10, // 001010
- PSMT8 = 19, // 010011
- PSMT4 = 20, // 010100
- PSMT8H = 27, // 011011
- PSMT4HL = 36, // 100100
- PSMT4HH = 44, // 101100
- PSMT32Z = 48, // 110000
- PSMT24Z = 49, // 110001
- PSMT16Z = 50, // 110010
- PSMT16SZ = 58, // 111010
-
- PSMT_BAD_PSM = 63 // for every unknown psm.
-};
-
-// Check target bit mode. PSMCT32 and 32Z return 0, 24 and 24Z - 1
-// 16, 16S, 16Z, 16SZ -- 2, PSMT8 and 8H - 3, PSMT4, 4HL, 4HH -- 4.
-// This code returns the same value on Z-textures, so texel storage mode is (BITMODE and !ISZTEX).
-inline int PSMT_BITMODE(int psm) {return (psm & 0x7);}
-
-template
-inline int PSM_BITMODE() {return (psm & 0x7);}
-
-inline int PSMT_BITS_NUM(int psm)
-{
- // Treat these as 32 bit.
- if ((psm == PSMT8H) || (psm == PSMT4HL) || (psm == PSMT4HH))
- {
- return 4;
- }
-
- switch (PSMT_BITMODE(psm))
- {
- case 4:
- return 0;
-
- case 3:
- return 1;
-
- case 2:
- return 2;
-
- default:
- return 4;
- }
-}
-
-// CLUT = Color look up table. Set proper color to table according CLUT table.
-// Used for PSMT8, PSMT8H, PSMT4, PSMT4HH, PSMT4HL textures
-inline bool PSMT_ISCLUT(int psm) { return (PSMT_BITMODE(psm) > 2);}
-
-// Check to see if it is 32 bits. According to code comments, anyways.
-// I'll have to look closer at it, because it'd seem like it'd return true for 24 bits.
-// Note: the function only works for clut format. Clut PSM is 4 bits only. The possible value are PSMCT32, PSMCT16, PSMCT16S
-inline bool PSMT_IS32BIT(int psm) {return !!(psm <= 1);}
-
-// PSMCT16, PSMCT16S, PSMT16Z, PSMT16SZ is 16-bit targets and usually there is
-// two of them in each 32-bit word.
-inline bool PSMT_IS16BIT(int psm) { return (PSMT_BITMODE(psm) == 2);}
-
-template
-inline bool PSM_IS16BIT() { return ((psm & 0x7) == 2);}
-
-// PSM16Z and PSMT16SZ use -1 offset to z-buff. Need to check this thesis.
-inline bool PSMT_IS16Z(int psm) {return ((psm & 0x32) == 0x32);}
-
-// PSMT32Z, PSMT24Z, PSMT16Z, PSMT16SZ is Z-buffer textures
-inline bool PSMT_ISZTEX(int psm) {return ((psm & 0x30) == 0x30);}
-
-// PSMCT16, PSMCT16S, PSMT8, PSMT8H, PSMT16Z and PSMT16SZ use only half 16 bit per pixel.
-inline bool PSMT_ISHALF(int psm) {return ((psm & 2) == 2);}
-
-template
-inline bool PSM_ISHALF() {return (psm & 2);}
-
-// PSMT8 and PSMT8H use IDTEX8 CLUT, PSMT4H, PSMT4HL, PSMT4HH -- IDTEX4.
-// Don't use it on non clut entries, please!
-inline bool PSMT_IS8CLUT(int psm) {return ((psm & 3) == 3);}
-
-// When color format is RGB24 (PSMCT24) or RGBA16 (PSMCT16 & 16S) alpha value expanded, based on
-// TEXA register and AEM status.
-inline int PSMT_ALPHAEXP(int psm) {return (psm == PSMCT24 || psm == PSMCT16 || psm == PSMCT16S);}
-
-// Check, how many pixels would be stored in side. So 32 and 24 is 32-bit's (1 pixel),
-// 16, 16S -- 16 bit's (2 pixels), 8 and 8H -- 4 pixels, and 4 -- 8 pixels.
-inline int PSMT_BITCOUNT(int psm) {return (PSMT_BITMODE(psm) == 0) ? 1 : 1 << (PSMT_BITMODE(psm) - 1); }
-
-template
-inline int PSM_BITCOUNT() {return (PSM_BITMODE() == 0) ? 1 : 1 << (PSM_BITMODE() - 1); }
-
-// This function updates the 6th and 5th bit of psm
-// 00 or 11 -> 00 ; 01 -> 10 ; 10 -> 01
-inline int Switch_Top_Bytes (int X)
-{
- if ( ( X & 0x30 ) == 0 )
- return X;
- else
- return (X ^ 0x30);
-}
-
-// How many pixel stored in 1 word.
-// PSMT8 has 4 pixels per 32bit, PSMT4 has 8. All 16-bit textures are 2 pixel per bit. And all others are 1 pixel in texture.
-inline int PIXELS_PER_WORD(int psm)
-{
- if (psm == PSMT8)
- return 4;
- if (psm == PSMT4)
- return 8;
- if (PSMT_IS16BIT(psm))
- return 2;
- return 1;
-}
-
-template
-inline int PSM_PIXELS_PER_WORD()
-{
- if (psm == PSMT8)
- return 4;
- if (psm == PSMT4)
- return 8;
- if (PSM_IS16BIT())
- return 2;
- return 1;
-}
-
-// Some psm does not have all pixels in memory.
-template
-inline bool PSM_NON_FULL_WORD()
-{
- return ((psm == PSMCT24) || (psm == PSMT24Z) || (psm == PSMT8H) || (psm == PSMT4HL) || (psm == PSMT4HH));
-}
-
-inline bool PSM_NON_FULL_WORD(int psm)
-{
- return ((psm == PSMCT24) || (psm == PSMT24Z) || (psm == PSMT8H) || (psm == PSMT4HL) || (psm == PSMT4HH));
-}
-
-template
-inline int PSM_PIXEL_SHIFT()
-{
- if (!PSM_NON_FULL_WORD())
- return 0;
- switch (psm) {
- case PSMCT24:
- case PSMT24Z:
- return 0;
- case PSMT8H:
- case PSMT4HL:
- return 24;
- case PSMT4HH:
- return 28;
- default: return 0;
- }
-}
-
-template
-inline int PSM_BITS_PER_PIXEL()
-{
- switch (psm & 0x7) {
- case 0: return 32;
- case 1: return 24;
- case 2: return 16;
- case 3: return 8;
- case 4: return 4;
- default: return 0;
- }
-}
-
-// Some storage formats could share the same memory block (2 textures in 1 format). This include following combinations:
-// PSMT24(24Z) with either 8H, 4HL, 4HH and PSMT4HL with PSMT4HH.
-// We use slightly different versions of this function on comparison with GSDX, Storage format XOR 0x30 made Z-textures
-// similar to normal ones and change higher bits on short (8 and 4 bits) textures.
-inline bool PSMT_HAS_SHARED_BITS (int fpsm, int tpsm) {
- int SUM = Switch_Top_Bytes(fpsm) + Switch_Top_Bytes(tpsm) ;
- return (SUM == 0x15 || SUM == 0x1D || SUM == 0x2C || SUM == 0x30);
-}
-
-// If a clut is in 32-bit color, its size is 4 bytes, and 16-bit clut has a 2 byte size.
-inline int CLUT_PIXEL_SIZE(int cpsm) {return ((cpsm <= 1) ? 4 : 2); }
-
-inline void PSMT_SET_BLOCK_SIZE (int psm, int& W, int&H, int& ppw) {
- switch (PIXELS_PER_WORD(psm)) {
- case 8:
- W = 128; H = 128; ppw = 8;
- case 4:
- W = 128; H = 64; ppw = 4;
- case 2:
- W = 64; H = 64; ppw = 2;
- default:
- W = 32; H = 64; ppw = 1;
- }
-}
-
-template
-inline int PSM_PIXELS_STORED_PER_WORD()
-{
- return 32 / PSM_BITS_PER_PIXEL();
-}
-
-template
-inline int PSM_BYTS_LOAD_PER_WRITE()
-{
- if (psm == PSMCT24 || psm == PSMT24Z) return 3;
- return 4;
-}
-
-
-//----------------------- Data from registers -----------------------
-
-typedef union
-{
- s64 SD;
- u64 UD;
- s32 SL[2];
- u32 UL[2];
- s16 SS[4];
- u16 US[4];
- s8 SC[8];
- u8 UC[8];
-} reg64;
-
-/* general purpose regs structs */
-
-typedef struct
-{
- int fbp;
- int fbw;
- int fbh;
- int psm;
- u32 fbm;
-} frameInfo;
-
-// Create frame structure from known data
-inline frameInfo CreateFrame(int fbp, int fbw, int fbh, int psm, u32 fbm)
-{
- frameInfo frame;
- frame.fbp = fbp;
- frame.fbw = fbw;
- frame.fbh = fbh;
- frame.psm = psm;
- frame.fbm = fbm;
- return frame;
-}
-
-typedef struct
-{
- u16 prim;
-
- union
- {
- struct
- {
- u16 iip : 1;
- u16 tme : 1;
- u16 fge : 1;
- u16 abe : 1;
- u16 aa1 : 1;
- u16 fst : 1;
- u16 ctxt : 1;
- u16 fix : 1;
- u16 resv : 8;
- };
- u16 _val;
- };
-} primInfo;
-
-extern primInfo *prim;
-
-typedef union
-{
- struct
- {
- u32 ate : 1;
- u32 atst : 3;
- u32 aref : 8;
- u32 afail : 2;
- u32 date : 1;
- u32 datm : 1;
- u32 zte : 1;
- u32 ztst : 2;
- u32 resv : 13;
- };
- u32 _val;
-} pixTest;
-
-typedef struct
-{
- int bp;
- int bw;
- int psm;
-} bufInfo;
-
-typedef struct
-{
- int tbp0;
- int tbw;
- int cbp;
- u16 tw, th;
- u8 psm;
- u8 tcc;
- u8 tfx;
- u8 cpsm;
- u8 csm;
- u8 csa;
- u8 cld;
-} tex0Info;
-
-union tex_0_info
-{
- struct
- {
- u64 tbp0 : 14;
- u64 tbw : 6;
- u64 psm : 6;
- u64 tw : 4;
- u64 th : 4;
- u64 tcc : 1;
- u64 tfx : 2;
- u64 cbp : 14;
- u64 cpsm : 4;
- u64 csm : 1;
- u64 csa : 5;
- u64 cld : 3;
- };
-
- u64 _u64;
- u32 _u32[2];
- u16 _u16[4];
- u8 _u8[8];
-
- tex_0_info(u64 data) { _u64 = data; }
- tex_0_info(u32 data) { _u32[0] = data; _u32[1] = 0; }
- tex_0_info(u32 data0, u32 data1) { _u32[0] = data0; _u32[1] = data1; }
-
- u32 tbw_mult()
- {
- if (tbw == 0)
- return 64;
- else
- return ((u32)tbw << 6);
- }
-
- u32 psm_fix()
- {
- // ZZLog::Debug_Log("psm %d\n", psm);
- if (psm == 9) return 1;
-
- return psm;
- }
-
- u32 tw_exp()
- {
- if (tw > 10) return (1 << 10);
-
- return (1 << tw);
- }
-
- u32 th_exp()
- {
- if (th > 10) return (1 << 10);
-
- return (1 << th);
- }
-
- u32 cpsm_fix()
- {
- return cpsm & 0xe;
- }
-
- u32 csa_fix()
- {
- if (cpsm < 2)
- return (csa & 0xf);
- else
- return (csa & 0x1f);
- }
-};
-
-#define TEX_MODULATE 0
-#define TEX_DECAL 1
-#define TEX_HIGHLIGHT 2
-#define TEX_HIGHLIGHT2 3
-
-//bool SaveTexture(const char* filename, u32 textarget, u32 tex, int width, int height, int ext_format = 0);
-extern void SaveTex(tex0Info* ptex, int usevid);
-extern char* NamedSaveTex(tex0Info* ptex, int usevid);
-
-typedef struct
-{
- u32 lcm;
- u32 mxl;
- u32 mmag;
- u32 mmin;
- u32 mtba;
- u32 l;
- u32 k;
-} tex1Info;
-
-typedef struct
-{
- u32 wms;
- u32 wmt;
- u32 minu;
- u32 maxu;
- u32 minv;
- u32 maxv;
-} clampInfo;
-
-typedef struct
-{
- int cbw;
- int cou;
- int cov;
-} clutInfo;
-
-typedef struct
-{
- int tbp[3];
- int tbw[3];
-} miptbpInfo;
-
-typedef struct
-{
- u16 aem;
- u8 ta[2];
-} texaInfo;
-
-typedef struct
-{
- int sx;
- int sy;
- int dx;
- int dy;
- int diry;
- int dirx;
-} trxposInfo;
-
-typedef struct
-{
- union
- {
- struct
- {
- u8 a : 2;
- u8 b : 2;
- u8 c : 2;
- u8 d : 2;
- };
- u8 abcd;
- };
-
- u8 fix : 8;
-} alphaInfo;
-
-typedef struct
-{
- u16 zbp; // u16 address / 64
- u8 psm;
- u8 zmsk;
-} zbufInfo;
-
-typedef struct
-{
- int fba;
-} fbaInfo;
-
-enum transfer_types
-{
- XFER_HOST_TO_LOCAL = 0,
- XFER_LOCAL_TO_HOST = 1,
- XFER_LOCAL_TO_LOCAL = 2,
- XFER_DEACTIVATED = 3
-};
-
-typedef struct
-{
- Vertex gsvertex[4]; // circular buffer that contains the vertex
- Vertex gsTriFanVertex; // Base of triangle fan primitive vertex
- u32 rgba; // global color for flat shading texture
- float q;
- Vertex vertexregs; // accumulation buffer that collect current vertex data
-
- int primC; // number of verts current storing
- int primIndex; // current prim index
- int nTriFanVert; // remember the index of the base of triangle fan
- int new_tri_fan; // 1 if we process a new triangle fan primitive. 0 otherwise
-
- int prac;
- int dthe;
- int colclamp;
- int fogcol;
- int smask;
- int pabe;
- u64 buff[2];
- int buffsize;
- int cbp[2]; // internal cbp registers
-
- u32 CSRw;
-
- primInfo _prim[2];
- bufInfo srcbuf, srcbufnew;
- bufInfo dstbuf, dstbufnew;
-
- clutInfo clut;
-
- texaInfo texa;
- trxposInfo trxpos, trxposnew;
-
- int imageTransfer;
- bool transferring;
-
- Point image, imageEnd;
- Size imageNew, imageTemp;
-
- pathInfo path[4];
- GIFRegDIMX dimx;
- GSMemory mem;
- GSClut clut_buffer;
-
- // Subject to change.
- int vsync, interlace;
-
- int primNext(int inc = 1)
- {
- // Note: ArraySize(gsvertex) == 2^n => modulo is replaced by an and instruction
- return ((primIndex + inc) % ArraySize(gsvertex));
- }
-
- int primPrev(int dec = 1)
- {
- // Note: assert( dec <= ArraySize(gsvertex) );
- // Note: ArraySize(gsvertex) == 2^n => modulo is replaced by an and instruction
- return ((primIndex + (ArraySize(gsvertex) - dec)) % ArraySize(gsvertex));
- }
-
- void setRGBA(u32 r, u32 g, u32 b, u32 a)
- {
- rgba = (r & 0xff) |
- ((g & 0xff) << 8) |
- ((b & 0xff) << 16) |
- ((a & 0xff) << 24);
- }
-
- inline void add_vertex(u16 x, u16 y, u32 z, u16 f)
- {
- vertexregs.x = x;
- vertexregs.y = y;
- vertexregs.z = z;
- vertexregs.f = f;
- if (likely(!new_tri_fan)) {
- gsvertex[primIndex] = vertexregs;
- } else {
- gsTriFanVertex = vertexregs;
- new_tri_fan = false;
- }
- }
-
- inline void add_vertex(u16 x, u16 y, u32 z)
- {
- vertexregs.x = x;
- vertexregs.y = y;
- vertexregs.z = z;
- if (likely(!new_tri_fan)) {
- gsvertex[primIndex] = vertexregs;
- } else {
- gsTriFanVertex = vertexregs;
- new_tri_fan = false;
- }
- }
-} GSinternal;
-
-extern GSinternal gs;
-
-// Note the function is used in a template parameter so it must be declared extern
-// Note2: In this case extern is not compatible with __forceinline so just inline it...
-extern inline u16 RGBA32to16(u32 c)
-{
- return (u16)((((c) & 0x000000f8) >> 3) |
- (((c) & 0x0000f800) >> 6) |
- (((c) & 0x00f80000) >> 9) |
- (((c) & 0x80000000) >> 16));
-}
-
-static __forceinline u32 RGBA16to32(u16 c)
-{
- return (((c) & 0x001f) << 3) |
- (((c) & 0x03e0) << 6) |
- (((c) & 0x7c00) << 9) |
- (((c) & 0x8000) ? 0xff000000 : 0);
-}
-
-#ifndef ZZNORMAL_MEMORY
-// converts float16 [0,1] to BYTE [0,255] (assumes value is in range, otherwise will take lower 8bits)
-// f is a u16
-static __forceinline u16 Float16ToBYTE(u16 f)
-{
- //assert( !(f & 0x8000) );
- if (f & 0x8000) return 0;
-
- u16 d = ((((f & 0x3ff) | 0x400) * 255) >> (10 - ((f >> 10) & 0x1f) + 15));
-
- return d > 255 ? 255 : d;
-}
-
-static __forceinline u16 Float16ToALPHA(u16 f)
-{
- //assert( !(f & 0x8000) );
- if (f & 0x8000) return 0;
-
- // round up instead of down (crash and burn), too much and charlie breaks
- u16 d = (((((f & 0x3ff) | 0x400)) * 255) >> (10 - ((f >> 10) & 0x1f) + 15));
-
- d = (d) >> 1;
-
- return d > 255 ? 255 : d;
-}
-
-#ifndef COLOR_ARGB
-#define COLOR_ARGB(a,r,g,b) \
- ((u32)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
-#endif
-
-// assumes that positive in [1,2] (then extracts fraction by just looking at the specified bits)
-#define Float16ToBYTE_2(f) ((u8)(*(u16*)&f>>2))
-#define Float16To5BIT(f) (Float16ToBYTE(f)>>3)
-
-#define Float16Alpha(f) (((*(u16*)&f&0x7c00)>=0x3900)?0x8000:0) // alpha is >= 1
-
-// converts an array of 4 u16s to a u32 color
-// f is a pointer to a u16
-#define Float16ToARGB(f) COLOR_ARGB(Float16ToALPHA(f.w), Float16ToBYTE(f.x), Float16ToBYTE(f.y), Float16ToBYTE(f.z));
-
-#define Float16ToARGB16(f) (Float16Alpha(f.w)|(Float16To5BIT(f.x)<<10)|(Float16To5BIT(f.y)<<5)|Float16To5BIT(f.z))
-
-// used for Z values
-#define Float16ToARGB_Z(f) COLOR_ARGB((u32)Float16ToBYTE_2(f.w), Float16ToBYTE_2(f.x), Float16ToBYTE_2(f.y), Float16ToBYTE_2(f.z))
-#define Float16ToARGB16_Z(f) ((Float16ToBYTE_2(f.y)<<8)|Float16ToBYTE_2(f.z))
-#endif
-
-
-inline float Clamp(float fx, float fmin, float fmax)
-{
- if (fx < fmin) return fmin;
-
- return fx > fmax ? fmax : fx;
-}
-
-// Get pixel storage format from tex0. Clutted textures store pixels in cpsm format.
-inline int PIXEL_STORAGE_FORMAT(const tex0Info& tex) {
- if (PSMT_ISCLUT(tex.psm))
- return tex.cpsm;
- else
- return tex.psm;
- }
-
-// If pixel storage format not PSMCT24 ot PSMCT32, then it is 16-bit.
-// Z-textures have 0x30 upper bits, so we eliminate them by &&(~0x30)
-inline bool PSMT_ISHALF_STORAGE(const tex0Info& tex0) { return ((PIXEL_STORAGE_FORMAT(tex0) & (~0x30)) > 1); }
-
-//--------------------------- Inlines for bitwise ops
-//--------------------------- textures
-// Tex0Info (TEXD_x registers) bits, lower word
-// The register is really 64-bit, but we use 2 32bit ones to represent it
-// Obtain tbp0 -- Texture Buffer Base Pointer (Word Address/64) -- from data. Bits 0-13.
-static __forceinline int ZZOglGet_tbp0_TexBits(u32 data)
-{
- //return tex_0_info(data).tbp0;
- return (data) & 0x3fff;
-}
-
-// Obtain tbw -- Texture Buffer Width (Texels/64) -- from data, do not multiply to 64. Bits 14-19
-// ( data & 0xfc000 ) >> 14
-static __forceinline int ZZOglGet_tbw_TexBits(u32 data)
-{
- //return tex_0_info(data).tbw;
- return (data >> 14) & 0x3f;
-}
-
-// Obtain tbw -- Texture Buffer Width (Texels) -- from data, do multiply to 64, never return 0.
-static __forceinline int ZZOglGet_tbw_TexBitsMult(u32 data)
-{
- //return text_0_info(data).tbw_mult();
- int result = ZZOglGet_tbw_TexBits(data);
-
- if (result == 0)
- return 64;
- else
- return (result << 6);
-}
-
-// Obtain psm -- Pixel Storage Format -- from data. Bits 20-25.
-// (data & 0x3f00000) >> 20
-static __forceinline int ZZOglGet_psm_TexBits(u32 data)
-{
- //return tex_0_info(data).psm;
- return ((data >> 20) & 0x3f);
-}
-
-// Obtain psm -- Pixel Storage Format -- from data. Bits 20-25. Fix incorrect psm == 9
-static __forceinline int ZZOglGet_psm_TexBitsFix(u32 data)
-{
- //return tex_0_info(data).psm_fix();
- int result = ZZOglGet_psm_TexBits(data) ;
-// ZZLog::Debug_Log("result %d", result);
-
- if (result == 9) result = 1;
-
- return result;
-}
-
-// Obtain tw -- Texture Width (Width = 2^TW) -- from data. Bits 26-29
-// (data & 0x3c000000)>>26
-static __forceinline u16 ZZOglGet_tw_TexBits(u32 data)
-{
- //return tex_0_info(data).tw;
- return ((data >> 26) & 0xf);
-}
-
-// Obtain tw -- Texture Width (Width = TW) -- from data. Width could newer be more than 1024.
-static __forceinline u16 ZZOglGet_tw_TexBitsExp(u32 data)
-{
- //return tex_0_info(data).tw_exp();
- u16 result = ZZOglGet_tw_TexBits(data);
-
- if (result > 10) result = 10;
-
- return (1 << result);
-}
-
-// TH set at the border of upper and higher words.
-// Obtain th -- Texture Height (Height = 2^TH) -- from data. Bits 30-31 lower, 0-1 higher
-// (dataLO & 0xc0000000) >> 30 + (dataHI & 0x3) * 0x4
-static __forceinline u16 ZZOglGet_th_TexBits(u32 dataLO, u32 dataHI)
-{
- //return tex_0_info(dataLO, dataHI).th;
- return (((dataLO >> 30) & 0x3) | ((dataHI & 0x3) << 2));
-}
-
-// Obtain th --Texture Height (Height = 2^TH) -- from data. Height could newer be more than 1024.
-static __forceinline u16 ZZOglGet_th_TexBitsExp(u32 dataLO, u32 dataHI)
-{
- //return tex_0_info(dataLO, dataHI).th_exp();
- u16 result = ZZOglGet_th_TexBits(dataLO, dataHI);
-
- if (result > 10) result = 10;
-
- return (1 << result);
-}
-
-// Tex0Info bits, higher word.
-// Obtain tcc -- Texture Color Component 0=RGB, 1=RGBA + use Alpha from TEXA reg when not in PSM -- from data. Bit 3
-// (data & 0x4)>>2
-static __forceinline u8 ZZOglGet_tcc_TexBits(u32 data)
-{
- //return tex_0_info(0, data).tcc;
- return ((data >> 2) & 0x1);
-}
-
-// Obtain tfx -- Texture Function (0=modulate, 1=decal, 2=hilight, 3=hilight2) -- from data. Bit 4-5
-// (data & 0x18)>>3
-static __forceinline u8 ZZOglGet_tfx_TexBits(u32 data)
-{
- //return tex_0_info(0, data).tfx;
- return ((data >> 3) & 0x3);
-}
-
-// Obtain cbp from data -- Clut Buffer Base Pointer (Address/256) -- Bits 5-18
-// (data & 0x7ffe0)>>5
-static __forceinline int ZZOglGet_cbp_TexBits(u32 data)
-{
- //return tex_0_info(0, data).cbp;
- return ((data >> 5) & 0x3fff);
-}
-
-// Obtain cpsm from data -- Clut pixel Storage Format -- Bits 19-22. 22nd is at no use.
-// (data & 0x700000)>>19
-// 0000 - psmct32; 0010 - psmct16; 1010 - psmct16s.
-static __forceinline u8 ZZOglGet_cpsm_TexBits(u32 data)
-{
- //return (tex_0_info(0, data).cpsm & 0xe);
- return ((data >> 19) & 0xe);
-}
-
-// Obtain csm -- I don't know what is it -- from data. Bit 23
-// (data & 0x800000)>>23
-// csm is the clut storage mode. 0 for CSM1, 1 for CSM2.
-static __forceinline u8 ZZOglGet_csm_TexBits(u32 data)
-{
- //return tex_0_info(0, data).csm;
- return ((data >> 23) & 0x1);
-}
-
-// Obtain csa -- -- from data. Bits 24-28
-// (data & 0x1f000000)>>24
-static __forceinline u8 ZZOglGet_csa_TexBits(u32 data)
-{
- //return tex_0_info(0, data).csa_fix();
-
- if ((data & 0x700000) == 0) // it is cpsm < 2 check
- return ((data >> 24) & 0xf);
- else
- return ((data >> 24) & 0x1f);
-}
-
-// Obtain cld -- -- from data. Bits 29-31
-// (data & 0xe0000000)>>29
-static __forceinline u8 ZZOglGet_cld_TexBits(u32 data)
-{
- //return tex_0_info(0, data).cld;
- return ((data >> 29) & 0x7);
-}
-
-//-------------------------- frames
-// FrameInfo bits.
-// Obtain fbp -- frame Buffer Base Pointer (Word Address/2048) -- from data. Bits 0-15
-inline int ZZOglGet_fbp_FrameBits(u32 data)
-{
- return ((data) & 0x1ff);
-}
-
-// So we got address / 64, henceby frame fbp and tex tbp have the same dimension -- "real address" is x64.
-inline int ZZOglGet_fbp_FrameBitsMult(u32 data)
-{
- return (ZZOglGet_fbp_FrameBits(data) << 5);
-}
-
-// Obtain fbw -- width (Texels/64) -- from data. Bits 16-23
-inline int ZZOglGet_fbw_FrameBits(u32 data)
-{
- return ((data >> 16) & 0x3f);
-}
-
-inline int ZZOglGet_fbw_FrameBitsMult(u32 data)
-{
- return (ZZOglGet_fbw_FrameBits(data) << 6);
-}
-
-
-// Obtain psm -- Pixel Storage Format -- from data. Bits 24-29.
-// (data & 0x3f000000) >> 24
-inline int ZZOglGet_psm_FrameBits(u32 data)
-{
- return ((data >> 24) & 0x3f);
-}
-
-// Function for calculating overal height from frame data.
-inline int ZZOgl_fbh_Calc(int fbp, int fbw, int psm)
-{
- int fbh = (1024 * 1024 - 64 * fbp) / fbw;
- fbh &= ~0x1f;
-
- if (PSMT_ISHALF(psm)) fbh *= 2;
- if (fbh > 1024) fbh = 1024;
-
- //ZZLog::Debug_Log("ZZOgl_fbh_Calc: 0x%x", fbh);
- return fbh;
-}
-
-inline int ZZOgl_fbh_Calc(frameInfo frame)
-{
- return ZZOgl_fbh_Calc(frame.fbp, frame.fbw, frame.psm);
-}
-
-// Calculate fbh from data, It does not set in register
-inline int ZZOglGet_fbh_FrameBitsCalc(u32 data)
-{
- int fbh = 0;
- int fbp = ZZOglGet_fbp_FrameBits(data);
- int fbw = ZZOglGet_fbw_FrameBits(data);
- int psm = ZZOglGet_psm_FrameBits(data);
-
- if (fbw > 0) fbh = ZZOgl_fbh_Calc(fbp, fbw, psm) ;
-
- return fbh ;
-}
-
-// Obtain fbm -- frame mask -- from data. All higher word.
-inline u32 ZZOglGet_fbm_FrameBits(u32 data)
-{
- return (data);
-}
-
-// Obtain fbm -- frame mask -- from data. All higher word. Fixed from psm == PCMT24 (without alpha)
-inline u32 ZZOglGet_fbm_FrameBitsFix(u32 dataLO, u32 dataHI)
-{
- if (PSMT_BITMODE(ZZOglGet_psm_FrameBits(dataLO)) == 1)
- return (dataHI | 0xff000000);
- else
- return dataHI;
-}
-
-// obtain colormask RED
-inline u32 ZZOglGet_fbmRed_FrameBits(u32 data)
-{
- return (data & 0xff);
-}
-
-// obtain colormask Green
-inline u32 ZZOglGet_fbmGreen_FrameBits(u32 data)
-{
- return ((data >> 8) & 0xff);
-}
-
-// obtain colormask Blue
-inline u32 ZZOglGet_fbmBlue_FrameBits(u32 data)
-{
- return ((data >> 16) & 0xff);
-}
-
-// obtain colormask Alpha
-inline u32 ZZOglGet_fbmAlpha_FrameBits(u32 data)
-{
- return ((data >> 24) & 0xff);
-}
-
-// obtain colormask Alpha
-inline u32 ZZOglGet_fbmHighByte(u32 data)
-{
- return (!!(data & 0x80000000));
-}
-
-//-------------------------- tex0 comparison
-// Check if old and new tex0 registers have only clut difference
-inline bool ZZOglAllExceptClutIsSame(const u32* oldtex, const u32* newtex)
-{
- return ((oldtex[0] == newtex[0]) && ((oldtex[1] & 0x1f) == (newtex[1] & 0x1f)));
-}
-
-// Check if the CLUT registers are same, except CLD
-inline bool ZZOglClutMinusCLDunchanged(const u32* oldtex, const u32* newtex)
-{
- return ((oldtex[1] & 0x1fffffe0) == (newtex[1] & 0x1fffffe0));
-}
-
-// Check if CLUT storage mode is not changed (CSA, CSM and CSPM)
-inline bool ZZOglClutStorageUnchanged(const u32* oldtex, const u32* newtex)
-{
- return ((oldtex[1] & 0x1ff10000) == (newtex[1] & 0x1ff10000));
-}
-
-// call to load CLUT data (depending on CLD)
-void texClutWrite(int ctx);
-
-// Perform clutting for flushed texture. Better check if it needs a prior call.
-inline void CluttingForFlushedTex(tex0Info* tex0, u32 Data, int ictx)
-{
- tex0->cbp = ZZOglGet_cbp_TexBits(Data);
- tex0->cpsm = ZZOglGet_cpsm_TexBits(Data);
- tex0->csm = ZZOglGet_csm_TexBits(Data);
- tex0->csa = ZZOglGet_csa_TexBits(Data);
- tex0->cld = ZZOglGet_cld_TexBits(Data);
-
- texClutWrite(ictx);
- };
-
-// CSA and CPSM bitmask 0001 1111 0111 1000 ...
-// 60 56 52
-#define CPSM_CSA_BITMASK 0x1f780000
-#define CPSM_CSA_NOTMASK 0xe0870000
-
-// I'll find a good place for these later.
-
-extern PSM_value PSM_value_Table[64];
-extern bool allowed_psm[256]; // in ZZoglMem.cpp.cpp
-inline void FillAlowedPsnTable() {
-
- allowed_psm[PSMCT32] = true;
- allowed_psm[PSMCT24] = true;
- allowed_psm[PSMCT16] = true;
- allowed_psm[PSMCT16S] = true;
- allowed_psm[PSMT8] = true;
- allowed_psm[PSMT4] = true;
- allowed_psm[PSMT8H] = true;
- allowed_psm[PSMT4HH] = true;
- allowed_psm[PSMT4HL] = true;
- allowed_psm[PSMT32Z] = true;
- allowed_psm[PSMT24Z] = true;
- allowed_psm[PSMT16Z] = true;
- allowed_psm[PSMT16SZ] = true;
-
- PSM_value_Table[PSMCT32] = PSMCT32;
- PSM_value_Table[PSMCT24] = PSMCT24;
- PSM_value_Table[PSMCT16] = PSMCT16;
- PSM_value_Table[PSMCT16S] = PSMCT16S;
- PSM_value_Table[PSMT8] = PSMT8;
- PSM_value_Table[PSMT4] = PSMT4;
- PSM_value_Table[PSMT8H] = PSMT8H;
- PSM_value_Table[PSMT4HH] = PSMT4HH;
- PSM_value_Table[PSMT4HL] = PSMT4HL;
- PSM_value_Table[PSMT32Z] = PSMT32Z;
- PSM_value_Table[PSMT24Z] = PSMT24Z;
- PSM_value_Table[PSMT16Z] = PSMT16Z;
- PSM_value_Table[PSMT16SZ] = PSMT16SZ;
-};
-
-#endif
diff --git a/plugins/zzogl-pg/opengl/GSDump.cpp b/plugins/zzogl-pg/opengl/GSDump.cpp
deleted file mode 100644
index 70381c7d98..0000000000
--- a/plugins/zzogl-pg/opengl/GSDump.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2007-2009 Gabest
- * http://www.gabest.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program 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 GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#include "GSDump.h"
-
-GSDump::GSDump()
- : m_gs(NULL)
- , m_frames(0)
-{
-}
-
-GSDump::~GSDump()
-{
- Close();
-}
-
-void GSDump::Open(const string& fn, u32 crc, const freezeData& fd, u8* regs)
-{
- if (m_gs) return;
-
- m_gs = fopen(fn.c_str(), "wb");
-
- m_frames = 0;
-
- if(m_gs)
- {
- fwrite(&crc, 4, 1, m_gs);
- fwrite(&fd.size, 4, 1, m_gs);
- fwrite(fd.data, fd.size, 1, m_gs);
- fwrite(regs, 0x2000, 1, m_gs);
- }
-}
-
-void GSDump::Close()
-{
- if(m_gs) {
- fclose(m_gs);
- m_gs = NULL;
- fprintf(stderr, "Closing GS dump");
- }
-}
-
-void GSDump::Transfer(int index, const u32* mem, size_t size, u32 real_size)
-{
- if(m_gs && size > 0)
- {
- fputc(0, m_gs);
- fputc(index, m_gs);
- fwrite(&size, 4, 1, m_gs);
- fwrite(&real_size, 4, 1, m_gs);
- fwrite(mem, size, 1, m_gs);
- }
-}
-
-void GSDump::ReadFIFO(u32 size)
-{
- if(m_gs && size > 0)
- {
- fputc(2, m_gs);
- fwrite(&size, 4, 1, m_gs);
- }
-}
-
-void GSDump::VSync(int field, bool last, u8* regs)
-{
- if(m_gs)
- {
- fputc(3, m_gs);
- fwrite(regs, 0x2000, 1, m_gs);
-
- fputc(1, m_gs);
- fwrite(&field, 4, 1, m_gs);
-
- if((++m_frames & 1) == 0 && last)
- {
- Close();
- }
- }
-}
diff --git a/plugins/zzogl-pg/opengl/GSDump.h b/plugins/zzogl-pg/opengl/GSDump.h
deleted file mode 100644
index 066812bd9d..0000000000
--- a/plugins/zzogl-pg/opengl/GSDump.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2007-2009 Gabest
- * http://www.gabest.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program 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 GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#pragma once
-
-#include "Util.h"
-
-using namespace std;
-
-/*
-
-Dump file format:
-- [crc/4] [state size/4] [state data/size] [PMODE/0x2000] [id/1] [data/?] .. [id/1] [data/?]
-
-Transfer data (id == 0)
-- [0/1] [path index/1] [size/4] [data/size]
-
-VSync data (id == 1)
-- [1/1] [field/1]
-
-ReadFIFO2 data (id == 2)
-- [2/1] [size/?]
-
-Regs data (id == 3)
-- [PMODE/0x2000]
-
-*/
-
-class GSDump
-{
- FILE* m_gs;
- int m_frames;
-
-public:
- GSDump();
- virtual ~GSDump();
-
- void Open(const string& fn, u32 crc, const freezeData& fd, u8* regs);
- void Close();
- void ReadFIFO(u32 size);
- void Transfer(int index, const u32* mem, size_t size, u32 real_size);
- void VSync(int field, bool last, u8* regs);
- operator bool() {return m_gs != NULL;}
-};
-
-extern GSDump g_dump;
-
diff --git a/plugins/zzogl-pg/opengl/GSUniformBufferOGL.h b/plugins/zzogl-pg/opengl/GSUniformBufferOGL.h
deleted file mode 100644
index 5011da33a7..0000000000
--- a/plugins/zzogl-pg/opengl/GSUniformBufferOGL.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2011-2011 Gregory hainaut
- * Copyright (C) 2007-2009 Gabest
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program 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 GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-// Note: it is same code that was developed for GSdx plugin
-
-#pragma once
-
-#ifdef GLSL4_API
-class GSUniformBufferOGL {
- GLuint buffer; // data object
- GLuint index; // GLSL slot
- uint size; // size of the data
- const GLenum target;
-
-public:
- GSUniformBufferOGL(GLuint index, uint size) : index(index)
- , size(size)
- ,target(GL_UNIFORM_BUFFER)
- {
- glGenBuffers(1, &buffer);
- bind();
- allocate();
- attach();
- }
-
- void bind()
- {
- glBindBuffer(target, buffer);
- }
-
- void allocate()
- {
- glBufferData(target, size, NULL, GL_STREAM_DRAW);
- }
-
- void attach()
- {
- glBindBufferBase(target, index, buffer);
- }
-
- void upload(const void* src)
- {
- // uint32 flags = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT;
- // uint8* dst = (uint8*) glMapBufferRange(target, 0, size, flags);
- // memcpy(dst, src, size);
- // glUnmapBuffer(target);
- // glMapBufferRange allow to set various parameter but the call is
- // synchronous whereas glBufferSubData could be asynchronous.
- // TODO: investigate the extension ARB_invalidate_subdata
- glBufferSubData(target, 0, size, src);
- }
-
- ~GSUniformBufferOGL() {
- glDeleteBuffers(1, &buffer);
- }
-};
-#endif
diff --git a/plugins/zzogl-pg/opengl/GSVertexArrayOGL.h b/plugins/zzogl-pg/opengl/GSVertexArrayOGL.h
deleted file mode 100644
index e65a52c498..0000000000
--- a/plugins/zzogl-pg/opengl/GSVertexArrayOGL.h
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright (C) 2011-2011 Gregory hainaut
- * Copyright (C) 2007-2009 Gabest
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program 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 GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-// Note: it is same code that was developed for GSdx plugin
-
-#pragma once
-
-#ifdef GLSL4_API
-struct GSInputLayoutOGL {
- GLuint index;
- GLint size;
- GLenum type;
- GLboolean normalize;
- GLsizei stride;
- const GLvoid* offset;
-};
-
-class GSBufferOGL {
- const size_t m_stride;
- size_t m_start;
- size_t m_count;
- size_t m_limit;
- const GLenum m_target;
- GLuint m_buffer;
-
- public:
- GSBufferOGL(GLenum target, size_t stride) :
- m_stride(stride)
- , m_start(0)
- , m_count(0)
- , m_limit(0)
- , m_target(target)
- {
- glGenBuffers(1, &m_buffer);
- // Opengl works best with 1-4MB buffer.
- m_limit = 2 * 1024 * 1024 / m_stride;
- }
-
- ~GSBufferOGL() { glDeleteBuffers(1, &m_buffer); }
-
- void allocate() { allocate(m_limit); }
-
- void allocate(size_t new_limit)
- {
- m_start = 0;
- m_limit = new_limit;
- glBufferData(m_target, m_limit * m_stride, NULL, GL_STREAM_DRAW);
- }
-
- void bind()
- {
- glBindBuffer(m_target, m_buffer);
- }
-
- void upload(const void* src, uint32 count)
- {
-#if 0
- // Upload the data to the buffer
- void* dst;
- if (Map(&dst, count)) {
- // FIXME which one to use
- // GSVector4i::storent(dst, src, m_count * m_stride);
- memcpy(dst, src, m_stride*m_count);
- Unmap();
- }
-#else
- m_count = count;
-
- // Current GPU buffer is really too small need to allocate a new one
- if (m_count > m_limit) {
- allocate(std::max(m_count * 3 / 2, m_limit));
-
- } else if (m_count > (m_limit - m_start) ) {
- // Not enough left free room. Just go back at the beginning
- m_start = 0;
- // Orphan the buffer to avoid synchronization
- allocate(m_limit);
- }
-
- glBufferSubData(m_target, m_stride * m_start, m_stride * m_count, src);
-#endif
- }
-
- bool Map(void** pointer, uint32 count ) {
-
- m_count = count;
-
- // Note: For an explanation of the map flag
- // see http://www.opengl.org/wiki/Buffer_Object_Streaming
- uint32 map_flags = GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT;
-
- // Current GPU buffer is really too small need to allocate a new one
- if (m_count > m_limit) {
- allocate(std::max(m_count * 3 / 2, m_limit));
-
- } else if (m_count > (m_limit - m_start) ) {
- // Not enough left free room. Just go back at the beginning
- m_start = 0;
-
- // Tell the driver that it can orphan previous buffer and restart from a scratch buffer.
- // Technically the buffer will not be accessible by the application anymore but the
- // GL will effectively remove it when draws call are finised.
- map_flags |= GL_MAP_INVALIDATE_BUFFER_BIT;
- } else {
- // Tell the driver that it doesn't need to contain any valid buffer data, and that you promise to write the entire range you map
- map_flags |= GL_MAP_INVALIDATE_RANGE_BIT;
- }
-
- // Upload the data to the buffer
- *pointer = (uint8*) glMapBufferRange(m_target, m_stride*m_start, m_stride*m_count, map_flags);
-
- return true;
- }
-
- void Unmap() { glUnmapBuffer(m_target); }
-
- void EndScene()
- {
- m_start += m_count;
- m_count = 0;
- }
-
- void Draw(GLenum mode)
- {
- glDrawArrays(mode, m_start, m_count);
- }
-
- void Draw(GLenum mode, GLint basevertex)
- {
- glDrawElementsBaseVertex(mode, m_count, GL_UNSIGNED_INT, (void*)(m_start * m_stride), basevertex);
- }
-
- void Draw(GLenum mode, GLint basevertex, int offset, int count)
- {
- glDrawElementsBaseVertex(mode, count, GL_UNSIGNED_INT, (void*)((m_start + offset) * m_stride), basevertex);
- }
-
- size_t GetStart() { return m_start; }
-
- void debug()
- {
- fprintf(stderr, "data buffer: start %d, count %d\n", m_start, m_count);
- }
-
-};
-
-class GSVertexBufferStateOGL {
- GSBufferOGL *m_vb;
- GSBufferOGL *m_ib;
-
- GLuint m_va;
- GLenum m_topology;
-
- // DEBUG
- vector layout_store;
-
-public:
- GSVertexBufferStateOGL(size_t stride, GSInputLayoutOGL* layout, uint32 layout_nbr)
- {
- glGenVertexArrays(1, &m_va);
- layout_store.clear();
-
- m_vb = new GSBufferOGL(GL_ARRAY_BUFFER, stride);
- m_ib = new GSBufferOGL(GL_ELEMENT_ARRAY_BUFFER, sizeof(uint32));
-
- bind();
- // Note: index array are part of the VA state so it need to be bind only once.
- m_ib->bind();
-
- m_vb->allocate();
- m_ib->allocate();
- set_internal_format(layout, layout_nbr);
- }
-
- void bind()
- {
- glBindVertexArray(m_va);
- m_vb->bind();
- }
-
- void set_internal_format()
- {
- for (vector::iterator it = layout_store.begin(); it != layout_store.end(); it++)
- set_internal_format(*it);
- }
-
- void set_internal_format(GSInputLayoutOGL& layout) {
- // Note this function need both a vertex array object and a GL_ARRAY_BUFFER buffer
- glEnableVertexAttribArray(layout.index);
- switch (layout.type) {
- case GL_UNSIGNED_SHORT:
- case GL_UNSIGNED_INT:
- case GL_SHORT:
- case GL_INT:
- // Rule: when shader use integral (not normalized) you must use glVertexAttribIPointer (note the extra I)
- if (layout.normalize == false)
- glVertexAttribIPointer(layout.index, layout.size, layout.type, layout.stride, layout.offset);
- else
- glVertexAttribPointer(layout.index, layout.size, layout.type, layout.normalize, layout.stride, layout.offset);
- break;
- default:
- glVertexAttribPointer(layout.index, layout.size, layout.type, layout.normalize, layout.stride, layout.offset);
- break;
- }
- }
-
- void set_internal_format(GSInputLayoutOGL* layout, uint32 layout_nbr)
- {
- for (uint i = 0; i < layout_nbr; i++) {
- // DEBUG
- layout_store.push_back(layout[i]);
-
- set_internal_format(layout[i]);
- }
- }
-
- void EndScene()
- {
- m_vb->EndScene();
- m_ib->EndScene();
- }
-
- void DrawPrimitive() { m_vb->Draw(m_topology); }
-
- void DrawIndexedPrimitive() { m_ib->Draw(m_topology, m_vb->GetStart() ); }
-
- void DrawIndexedPrimitive(int offset, int count) { m_ib->Draw(m_topology, m_vb->GetStart(), offset, count ); }
-
- void SetTopology(GLenum topology) { m_topology = topology; }
-
- void UploadVB(const void* vertices, size_t count) { m_vb->upload(vertices, count); }
-
- void UploadIB(const void* index, size_t count) { m_ib->upload(index, count); }
-
- bool MapVB(void **pointer, size_t count) { return m_vb->Map(pointer, count); }
-
- void UnmapVB() { m_vb->Unmap(); }
-
- ~GSVertexBufferStateOGL()
- {
- glDeleteVertexArrays(1, &m_va);
- delete m_vb;
- delete m_ib;
- }
-
- void debug()
- {
- string topo;
- switch (m_topology) {
- case GL_POINTS:
- topo = "point";
- break;
- case GL_LINES:
- topo = "line";
- break;
- case GL_TRIANGLES:
- topo = "triangle";
- break;
- case GL_TRIANGLE_STRIP:
- topo = "triangle strip";
- break;
- }
- m_vb->debug();
- m_ib->debug();
- fprintf(stderr, "primitives of %s\n", topo.c_str());
-
- }
-};
-#endif
diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp
deleted file mode 100644
index b98a102ad7..0000000000
--- a/plugins/zzogl-pg/opengl/GSmain.cpp
+++ /dev/null
@@ -1,837 +0,0 @@
-/* ZZ Open GL graphics plugin
- * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
- * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "Util.h"
-#include "GS.h"
-#include "Profile.h"
-#include "GLWin.h"
-#include "ZZoglFlushHack.h"
-#include "ZZoglShaders.h"
-
-
-using namespace std;
-
-extern void SaveSnapshot(const char* filename);
-
-#ifdef _MSC_VER
-#pragma warning(disable:4244)
-#endif
-
-GLWindow GLWin;
-GSinternal gs;
-GSconf conf;
-GSDump g_dump;
-
-int ppf, g_GSMultiThreaded, CurrentSavestate = 0;
-int g_LastCRC = 0, g_TransferredToGPU = 0, s_frameskipping = 0;
-int g_SkipFlushFrame = 0;
-GetSkipCount GetSkipCount_Handler = 0;
-
-int UPDATE_FRAMES = 16, g_nFrame = 0, g_nRealFrame = 0;
-float fFPS = 0;
-
-void (*GSirq)();
-u8* g_pBasePS2Mem = NULL;
-wxString s_strIniPath(L"inis"); // Air's new ini path (r2361)
-
-bool SaveStateExists = true; // We could not know save slot status before first change occured
-const char* SaveStateFile = NULL; // Name of SaveFile for access check.
-
-extern const char* s_aa[5];
-extern const char* pbilinear[];
-// statistics
-u32 g_nGenVars = 0, g_nTexVars = 0, g_nAlphaVars = 0, g_nResolve = 0;
-
-#define VER 4
-const unsigned char zgsversion = PS2E_GS_VERSION;
-unsigned char zgsrevision = 0; // revision and build gives plugin version
-unsigned char zgsbuild = VER;
-unsigned char zgsminor = 0;
-
-#ifdef _DEBUG
-const char *libraryName = "ZZ Ogl PG (Debug) ";
-#elif defined(ZEROGS_DEVBUILD)
-const char *libraryName = "ZZ Ogl PG (Dev)";
-#else
-const char *libraryName = "ZZ Ogl PG ";
-#endif
-
-extern int g_nPixelShaderVer, g_nFrameRender, g_nFramesSkipped;
-
-extern void WriteAA();
-extern void WriteBilinear();
-extern void ZZDestroy();
-extern bool ZZCreate(int width, int height);
-extern void ZZGSStateReset();
-extern int ZZSave(s8* pbydata);
-extern bool ZZLoad(s8* pbydata);
-
-// switches the render target to the real target, flushes the current render targets and renders the real image
-extern void RenderCRTC();
-
-#if defined(_WIN32) && defined(_DEBUG)
-HANDLE g_hCurrentThread = NULL;
-#endif
-
-extern int VALIDATE_THRESH;
-extern u32 TEXDESTROY_THRESH;
-
-EXPORT_C_(u32) PS2EgetLibType()
-{
- return PS2E_LT_GS;
-}
-
-EXPORT_C_(const char*) PS2EgetLibName()
-{
- return libraryName;
-}
-
-EXPORT_C_(u32) PS2EgetLibVersion2(u32 type)
-{
- return (zgsversion << 16) | (zgsrevision << 8) | zgsbuild | (zgsminor << 24);
-}
-
-EXPORT_C_(void) GSsetBaseMem(void* pmem)
-{
- g_pBasePS2Mem = (u8*)pmem;
-}
-
-EXPORT_C_(void) GSsetSettingsDir(const char* dir)
-{
- s_strIniPath = (dir == NULL) ? wxString(L"inis") : wxString(dir, wxConvFile);
-}
-
-EXPORT_C_(void) GSsetLogDir(const char* dir)
-{
- ZZLog::SetDir(dir);
-}
-
-EXPORT_C_(void) GSsetGameCRC(int crc, int options)
-{
- // build a list of function pointer for GetSkipCount (SkipDraw)
- static GetSkipCount GSC_list[NUMBER_OF_TITLES];
- static bool inited = false;
-
- if (!inited)
- {
- inited = true;
-
- memset(GSC_list, 0, sizeof(GSC_list));
-
- GSC_list[Okami] = GSC_Okami;
- GSC_list[MetalGearSolid3] = GSC_MetalGearSolid3;
- GSC_list[DBZBT2] = GSC_DBZBT2;
- GSC_list[DBZBT3] = GSC_DBZBT3;
- GSC_list[SFEX3] = GSC_SFEX3;
- GSC_list[Bully] = GSC_Bully;
- GSC_list[BullyCC] = GSC_BullyCC;
- GSC_list[SoTC] = GSC_SoTC;
- GSC_list[OnePieceGrandAdventure] = GSC_OnePieceGrandAdventure;
- GSC_list[OnePieceGrandBattle] = GSC_OnePieceGrandBattle;
- GSC_list[ICO] = GSC_ICO;
- GSC_list[GT4] = GSC_GT4;
- GSC_list[WildArms4] = GSC_WildArms4;
- GSC_list[WildArms5] = GSC_WildArms5;
- GSC_list[Manhunt2] = GSC_Manhunt2;
- GSC_list[CrashBandicootWoC] = GSC_CrashBandicootWoC;
- GSC_list[ResidentEvil4] = GSC_ResidentEvil4;
- GSC_list[Spartan] = GSC_Spartan;
- GSC_list[AceCombat4] = GSC_AceCombat4;
- GSC_list[Drakengard2] = GSC_Drakengard2;
- GSC_list[Tekken5] = GSC_Tekken5;
- GSC_list[IkkiTousen] = GSC_IkkiTousen;
- GSC_list[GodOfWar] = GSC_GodOfWar;
- GSC_list[GodOfWar2] = GSC_GodOfWar2;
- GSC_list[GiTS] = GSC_GiTS;
- GSC_list[Onimusha3] = GSC_Onimusha3;
- GSC_list[TalesOfAbyss] = GSC_TalesOfAbyss;
- GSC_list[SonicUnleashed] = GSC_SonicUnleashed;
- GSC_list[Genji] = GSC_Genji;
- GSC_list[StarOcean3] = GSC_StarOcean3;
- GSC_list[ValkyrieProfile2] = GSC_ValkyrieProfile2;
- GSC_list[RadiataStories] = GSC_RadiataStories;
- }
-
- // TEXDESTROY_THRESH starts out at 16.
- VALIDATE_THRESH = 8;
- conf.mrtdepth = (conf.settings().disable_mrt_depth != 0);
-
- if (!conf.mrtdepth)
- ZZLog::WriteLn("Disabling MRT depth writing.");
- else
- ZZLog::WriteLn("Enabling MRT depth writing.");
-
- bool CRCValueChanged = (g_LastCRC != crc);
-
- g_LastCRC = crc;
-
- if (crc != 0) ZZLog::WriteLn("Current game CRC is %x.", crc);
-
- if (CRCValueChanged && (crc != 0))
- {
- for (u32 i = 0; i < GAME_INFO_INDEX; i++)
- {
- if (crc_game_list[i].crc == (u32)crc)
- {
- ZZLog::WriteLn("Found CRC[%x] in crc game list.", crc);
-
- if (crc_game_list[i].v_thresh > 0)
- {
- VALIDATE_THRESH = crc_game_list[i].v_thresh;
- ZZLog::WriteLn("Setting VALIDATE_THRESH to %d", VALIDATE_THRESH);
- }
-
- if (crc_game_list[i].t_thresh > 0)
- {
- TEXDESTROY_THRESH = crc_game_list[i].t_thresh;
- ZZLog::WriteLn("Setting TEXDESTROY_THRESH to %d", TEXDESTROY_THRESH);
- }
-
- // FIXME need to check SkipDraw is positive (enabled by users)
- GetSkipCount_Handler = GSC_list[crc_game_list[i].title];
-
- if (!conf.disableHacks)
- {
- conf.def_hacks._u32 |= crc_game_list[i].flags;
- ListHacks();
- }
- return;
- }
- }
- }
- ListHacks();
-}
-
-EXPORT_C_(void) GSsetFrameSkip(int frameskip)
-{
- FUNCLOG
- s_frameskipping |= frameskip;
-
- if (frameskip && g_nFrameRender > 1)
- {
- SetFrameSkip(true);
- }
- else if (!frameskip && g_nFrameRender <= 0)
- {
- SetFrameSkip(false);
- }
-}
-
-EXPORT_C_(void) GSreset()
-{
- FUNCLOG
-
- memset(&gs, 0, sizeof(gs));
-
- ZZGSStateReset();
-
- gs.prac = 1;
- prim = &gs._prim[0];
- gs.transferring = false;
- gs.q = 1;
-}
-
-EXPORT_C_(void) GSgifSoftReset(u32 mask)
-{
- FUNCLOG
-
- if (mask & 1) memset(&gs.path[0], 0, sizeof(gs.path[0]));
- if (mask & 2) memset(&gs.path[1], 0, sizeof(gs.path[1]));
- if (mask & 4) memset(&gs.path[2], 0, sizeof(gs.path[2]));
-
- gs.transferring = false;
- gs.q = 1;
-}
-
-EXPORT_C_(s32) GSinit()
-{
- FUNCLOG
-
- ZZLog::Open();
- ZZLog::WriteLn("Calling GSinit.");
-
- WriteTempRegs();
- GSreset();
-
- ZZLog::WriteLn("GSinit finished.");
- return 0;
-}
-
-__forceinline void InitMisc()
-{
- WriteBilinear();
- WriteAA();
- InitProfile();
- InitPath();
- ResetRegs();
-}
-
-EXPORT_C_(s32) GSopen(void *pDsp, const char *Title, int multithread)
-{
- FUNCLOG
-
- g_GSMultiThreaded = multithread;
-
- ZZLog::WriteLn("Calling GSopen.");
-
-#if defined(_WIN32) && defined(_DEBUG)
- g_hCurrentThread = GetCurrentThread();
-#endif
-
- LoadConfig();
- strcpy(GLWin.title, Title);
-
- ZZLog::GS_Log("Using %s:%d.%d.%d.", libraryName, zgsrevision, zgsbuild, zgsminor);
-
- ZZLog::WriteLn("Creating ZZOgl window.");
- if ((!GLWin.CreateWindow(pDsp)) || (!ZZCreate(conf.width, conf.height))) return -1;
-
- ZZLog::WriteLn("Initialization successful.");
-
- InitMisc();
- ZZLog::GS_Log("GSopen finished.");
- return 0;
-}
-
-#ifdef USE_GSOPEN2
-EXPORT_C_(s32) GSopen2( void* pDsp, u32 flags )
-{
- FUNCLOG
-
- g_GSMultiThreaded = true;
-
- ZZLog::WriteLn("Calling GSopen2.");
-
-#if defined(_WIN32) && defined(_DEBUG)
- g_hCurrentThread = GetCurrentThread();
-#endif
-
- LoadConfig();
-
- ZZLog::GS_Log("Using %s:%d.%d.%d.", libraryName, zgsrevision, zgsbuild, zgsminor);
-
- ZZLog::WriteLn("Capturing ZZOgl window.");
- if ((!GLWin.CreateWindow(pDsp)) || (!ZZCreate(conf.width, conf.height))) return -1;
-
- ZZLog::WriteLn("Initialization successful.");
-
- InitMisc();
- ZZLog::GS_Log("GSopen2 finished.");
- ZZLog::Check_GL_Error();
- return 0;
-
-}
-#endif
-
-EXPORT_C_(void) GSshutdown()
-{
- FUNCLOG
-
- ZZLog::Close();
-}
-
-EXPORT_C_(void) GSclose()
-{
- FUNCLOG
-
- // Clean shader. Must be done before the context is delete
- ZZshExitCleaning();
- ZZDestroy();
-
- GLWin.CloseWindow();
-
- // Free alocated memory. We could close plugin without closing pcsx2, so we SHOULD free all allocated resources
- SaveStateFile = NULL;
- SaveStateExists = true; // default value
- g_LastCRC = 0;
-}
-
-EXPORT_C_(void) GSirqCallback(void (*callback)())
-{
- FUNCLOG
-
- GSirq = callback;
-}
-
-EXPORT_C_(void) GSwriteCSR(u32 write)
-{
- FUNCLOG
-
- gs.CSRw = write;
-}
-
-#ifdef _WIN32
-#define access _access
-#endif
-
-EXPORT_C_(void) GSchangeSaveState(int newstate, const char* filename)
-{
- FUNCLOG
-
- char str[255];
- sprintf(str, "save state %d", newstate);
- ZZAddMessage(str);
- CurrentSavestate = newstate;
-
- SaveStateFile = filename;
- SaveStateExists = (access(SaveStateFile, 0) == 0);
-}
-
-static bool get_snapshot_filename(char *filename, const char* path, const char* extension)
-{
- FUNCLOG
-
- FILE *bmpfile;
- u32 snapshotnr = 0;
-
- // increment snapshot value & try to get filename
-
- for (;;)
- {
- snapshotnr++;
-
- sprintf(filename, "%s/snap%03d.%s", path, snapshotnr, extension);
-
- bmpfile = fopen(filename, "rb");
-
- if (bmpfile == NULL) break;
-
- fclose(bmpfile);
- }
-
- // try opening new snapshot file
- if ((bmpfile = fopen(filename, "wb")) == NULL)
- {
- char strdir[255];
- sprintf(strdir, "%s", path);
-
-#ifdef _WIN32
- CreateDirectory(wxString::FromUTF8(strdir), NULL);
-#else
- mkdir(path, 0777);
-#endif
-
- if ((bmpfile = fopen(filename, "wb")) == NULL) return false;
- }
-
- fclose(bmpfile);
-
- return true;
-}
-
-EXPORT_C_(void) GSmakeSnapshot(char *path)
-{
- FUNCLOG
-
- char filename[256];
- if (get_snapshot_filename(filename, (const char*)path, (conf.zz_options.tga_snap) ? "bmp" : "jpg"))
- SaveSnapshot(filename);
-}
-
-// I'll probably move this somewhere else later, but it's got a ton of dependencies.
-static __forceinline void SetGSTitle()
-{
- char strtitle[256];
-
-#if !defined(ZEROGS_DEVBUILD)
- const char* g_pShaders[4] = { "full", "reduced", "accurate", "accurate-reduced" };
- const char* g_pInterlace[3] = { "interlace 0 |", "interlace 1 |", "" };
- const char* g_pBilinear[3] = { "", "bilinear |", "forced bilinear |" };
-
- if (SaveStateFile != NULL && !SaveStateExists)
- SaveStateExists = (access(SaveStateFile, 0) == 0);
- else
- SaveStateExists = true;
-
- sprintf(strtitle, "ZZ Open GL 0.%d.%d | %.1f fps | %s%s%s savestate %d%s | shaders %s | (%.1f)", zgsbuild, zgsminor, fFPS,
- g_pInterlace[conf.interlace], g_pBilinear[conf.bilinear], (conf.aa ? s_aa[conf.aa] : ""),
- CurrentSavestate, (SaveStateExists ? "" : "*"),
- g_pShaders[g_nPixelShaderVer], (ppf&0xfffff) / (float)UPDATE_FRAMES);
-
-#else
- sprintf(strtitle, "%d | %.1f fps (sk:%d%%) | g: %.1f, t: %.1f, a: %.1f, r: %.1f | p: %.1f | tex: %d %d (%d kbpf)", g_nFrame, fFPS,
- 100*g_nFramesSkipped / g_nFrame,
- g_nGenVars / (float)UPDATE_FRAMES, g_nTexVars / (float)UPDATE_FRAMES, g_nAlphaVars / (float)UPDATE_FRAMES,
- g_nResolve / (float)UPDATE_FRAMES, (ppf&0xfffff) / (float)UPDATE_FRAMES,
- g_MemTargs.listTargets.size(), g_MemTargs.listClearedTargets.size(), g_TransferredToGPU >> 10);
-
- //_snprintf(strtitle, 512, "%x %x", *(int*)(g_pbyGSMemory + 256 * 0x3e0c + 4), *(int*)(g_pbyGSMemory + 256 * 0x3e04 + 4));
-#endif
-
-// if( g_nFrame > 100 && fFPS > 60.0f ) {
-// ZZLog::Debug_Log("Set profile.");
-// g_bWriteProfile = 1;
-// }
- GLWin.SetTitle(strtitle);
-}
-
-// This isn't implemented for some reason? Adding a field for it for the moment, till I get a chance to look closer.
-EXPORT_C_(void) GSsetVsync(int enabled)
-{
- FUNCLOG
-
- ZZLog::Debug_Log("Setting VSync to 0x%x.", enabled);
- gs.vsync = enabled;
- GLWin.SetVsync(enabled);
-}
-
-EXPORT_C_(void) GSvsync(int current_interlace)
-{
- FUNCLOG
-
- //ZZLog::GS_Log("Calling GSvsync.");
-
- static u32 dwTime = timeGetTime();
- static int nToNextUpdate = 1;
-#ifdef _DEBUG
- if (conf.dump & 0x1) {
- freezeData fd;
- fd.size = ZZSave(NULL);
- s8* payload = (s8*)malloc(fd.size);
- fd.data = payload;
-
- ZZSave(fd.data);
-
- char filename[256];
- // FIXME, there is probably a better solution than /tmp ...
- // A possibility will be to save the path from GSmakeSnapshot but you still need to call
- // GSmakeSnapshot first.
- if (get_snapshot_filename(filename, "/tmp", "gs"))
- g_dump.Open(filename, g_LastCRC, fd, g_pBasePS2Mem);
- conf.dump--;
-
- free(payload);
- }
- g_dump.VSync(current_interlace, (conf.dump == 0), g_pBasePS2Mem);
-#endif
-
- GL_REPORT_ERRORD();
-
- g_nRealFrame++;
-
- // The value passed seems to either be 0 or 0x2000, and we want 0 or 1. Perhaps !! would be better...
- gs.interlace = !current_interlace;
- RenderCRTC();
-
- GLWin.ProcessEvents();
-
- if (--nToNextUpdate <= 0)
- {
- u32 d = timeGetTime();
- fFPS = UPDATE_FRAMES * 1000.0f / (float)max(d - dwTime, (u32)1);
- dwTime = d;
- g_nFrame += UPDATE_FRAMES;
-#ifndef USE_GSOPEN2
- // let PCSX2 manage the title
- SetGSTitle();
-#endif
-
-// if( g_nFrame > 100 && fFPS > 60.0f ) {
-// ZZLog::Debug_Log("Set profile.");
-// g_bWriteProfile = 1;
-// }
-
- if (fFPS < 16)
- UPDATE_FRAMES = 4;
- else if (fFPS < 32)
- UPDATE_FRAMES = 8;
- else
- UPDATE_FRAMES = 16;
-
- nToNextUpdate = UPDATE_FRAMES;
-
- ppf = 0;
- g_TransferredToGPU = 0;
- g_nGenVars = 0;
- g_nTexVars = 0;
- g_nAlphaVars = 0;
- g_nResolve = 0;
- g_nFramesSkipped = 0;
- g_SkipFlushFrame = 0;
- }
-
-#if defined(ZEROGS_DEVBUILD)
- if (g_bWriteProfile)
- {
- //g_bWriteProfile = 0;
- DVProfWrite("prof.txt", UPDATE_FRAMES);
- DVProfClear();
- }
-
-#endif
- GL_REPORT_ERRORD();
-
-}
-
-EXPORT_C_(void) GSreadFIFO(u64 *pMem)
-{
- FUNCLOG
-
- //ZZLog::GS_Log("Calling GSreadFIFO.");
-#ifdef _DEBUG
- g_dump.ReadFIFO(1);
-#endif
-
- TransferLocalHost((u32*)pMem, 1);
-}
-
-EXPORT_C_(void) GSreadFIFO2(u64 *pMem, int qwc)
-{
- FUNCLOG
-
- //ZZLog::GS_Log("Calling GSreadFIFO2.");
-#ifdef _DEBUG
- g_dump.ReadFIFO(qwc);
-#endif
-
- TransferLocalHost((u32*)pMem, qwc);
-}
-
-EXPORT_C_(int) GSsetupRecording(int start, void* pData)
-{
- FUNCLOG
-
- if (start)
- StartCapture();
- else
- StopCapture();
-
- return 1;
-}
-
-EXPORT_C_(s32) GSfreeze(int mode, freezeData *data)
-{
- FUNCLOG
-
- switch (mode)
- {
- case FREEZE_LOAD:
- if (!ZZLoad(data->data)) ZZLog::Error_Log("GS: Bad load format!");
- g_nRealFrame += 100;
- break;
-
- case FREEZE_SAVE:
- ZZSave(data->data);
- break;
-
- case FREEZE_SIZE:
- data->size = ZZSave(NULL);
- break;
-
- default:
- break;
- }
-
- return 0;
-}
-
-#ifdef __linux__
-void _fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
-{
- static uint32 read_cnt = 0;
- read_cnt++;
-
- size_t result = fread(ptr, size, nmemb, stream);
- if (result != nmemb) {
- fprintf(stderr, "Read error\n");
- exit(read_cnt);
- }
-}
-
-struct Packet
-{
- u8 type, param;
- u32 size, addr;
- u32 real_size;
- vector buff;
-};
-
-EXPORT_C_(void) GSReplay(char* lpszCmdLine)
-{
- if(FILE* fp = fopen(lpszCmdLine, "rb"))
- {
- GSinit();
-
- u8 regs[0x2000];
- GSsetBaseMem(regs);
-
- //s_vsync = !!theApp.GetConfig("vsync", 0);
-
- void* hWnd = NULL;
-
- const char* title = "replayer";
- GSopen((void**)&hWnd, (char*)title, 0);
-
- u32 crc;
- _fread(&crc, 4, 1, fp);
- GSsetGameCRC(crc, 0);
-
- freezeData fd;
- _fread(&fd.size, 4, 1, fp);
- fd.data = new s8[fd.size];
- _fread(fd.data, fd.size, 1, fp);
- GSfreeze(FREEZE_LOAD, &fd);
- delete [] fd.data;
-
- _fread(regs, 0x2000, 1, fp);
-
- GSvsync(1);
-
- list packets;
- vector buff;
- int type;
-
- while((type = fgetc(fp)) != EOF)
- {
- Packet* p = new Packet();
-
- p->type = (u8)type;
-
- switch(type)
- {
- case 0:
-
- p->param = (u8)fgetc(fp);
-
- _fread(&p->size, 4, 1, fp);
- _fread(&p->real_size, 4, 1, fp);
-
- switch(p->param)
- {
- case 0:
- p->buff.resize(0x4000);
- //p->addr = 0x4000 - p->size;
- //fread(&p->buff[p->addr], p->size, 1, fp);
- _fread(&p->buff[0], p->size, 1, fp);
- break;
- case 1:
- case 2:
- case 3:
- p->buff.resize(p->size);
- _fread(&p->buff[0], p->size, 1, fp);
- break;
- }
-
- break;
-
- case 1:
-
- _fread(&p->param, 4, 1, fp);
- //p->param = (u8)fgetc(fp);
-
- break;
-
- case 2:
-
- _fread(&p->size, 4, 1, fp);
-
- break;
-
- case 3:
-
- p->buff.resize(0x2000);
-
- _fread(&p->buff[0], 0x2000, 1, fp);
-
- break;
-
- default: assert(0);
- }
-
- packets.push_back(p);
- }
-
- sleep(1);
-
- //while(IsWindowVisible(hWnd))
- //FIXME map?
- int finished = 2;
- while(finished > 0)
- {
- unsigned long start = timeGetTime();
- unsigned long frame_number = 0;
- for(list::iterator i = packets.begin(); i != packets.end(); i++)
- {
- Packet* p = *i;
-
- switch(p->type)
- {
- case 0:
-
- //fprintf(stderr, "TRANSFER %d size %d\n", p->param, p->real_size);
- switch(p->param)
- {
- //case 0: GSgifTransfer1((u32*)&p->buff[0], p->addr); break;
- case 0: GSgifTransfer0((u32*)&p->buff[0], p->real_size); break;
- case 1: GSgifTransfer2((u32*)&p->buff[0], p->real_size); break;
- case 2: GSgifTransfer3((u32*)&p->buff[0], p->real_size); break;
- case 3: GSgifTransfer((u32*)&p->buff[0], p->real_size); break;
- }
-
- break;
-
- case 1:
-
- GSvsync(p->param);
- frame_number++;
-
- break;
-
- case 2:
-
- if(buff.size() < p->size) buff.resize(p->size);
-
- // FIXME
- // GSreadFIFO2(&buff[0], p->size / 16);
- fprintf(stderr, "GSreadFIFO2 not yet implemented");
-
- break;
-
- case 3:
-
- memcpy(regs, &p->buff[0], 0x2000);
-
- break;
- }
- }
- unsigned long end = timeGetTime();
- fprintf(stderr, "The %ld frames of the scene was render on %ldms\n", frame_number, end - start);
- fprintf(stderr, "A means of %fms by frame (limit 16ms/f)\n", (float)(end - start)/(float)frame_number);
-
- sleep(1);
- finished--;
- }
-
-
- for(list::iterator i = packets.begin(); i != packets.end(); i++)
- {
- delete *i;
- }
-
- packets.clear();
-
- sleep(1);
-
- GSclose();
- GSshutdown();
-
- fclose(fp);
- }
-}
-#endif
diff --git a/plugins/zzogl-pg/opengl/GifTransfer.cpp b/plugins/zzogl-pg/opengl/GifTransfer.cpp
deleted file mode 100644
index 4ab914606d..0000000000
--- a/plugins/zzogl-pg/opengl/GifTransfer.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/* ZZ Open GL graphics plugin
- * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
- * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "GS.h"
-#include "Mem.h"
-#include "GifTransfer.h"
-
-#ifdef _DEBUG
-static int path1_count = 0;
-#endif
-
-static int nPath3Hack = 0;
-
-EXPORT_C_(void) GSgetLastTag(u64* ptag)
-{
- FUNCLOG
-
- *(u32*)ptag = nPath3Hack;
- nPath3Hack = 0;
-}
-
-#ifdef _WIN32
-// for debug assertion checks (thread affinity checks)
-extern HANDLE g_hCurrentThread;
-#endif
-
-__forceinline void gifTransferLog(int index, const u32 *pMem, u32 size)
-{
-#ifdef DEBUG_TRANSFER
-
- if (conf.log)
- {
- static int nSaveIndex = 0;
- ZZLog::Debug_Log("%d: p:%d %x", nSaveIndex++, index + 1, size);
- int vals[4] = {0};
-
- for (u32 i = 0; i < size; i++)
- {
- for (u32 j = 0; j < 4; ++j)
- vals[j] ^= pMem[4*i+j];
- }
-
- ZZLog::Debug_Log("%x %x %x %x", vals[0], vals[1], vals[2], vals[3]);
- }
-
-#endif
-}
-
-extern int g_GSMultiThreaded;
-
-template void _GSgifTransfer(const u32 *pMem, u32 size)
-{
- FUNCLOG
-
- pathInfo *path = &gs.path[index];
-
-#ifdef _WIN32
- assert(g_hCurrentThread == GetCurrentThread());
-#endif
-
-#ifdef _DEBUG
- gifTransferLog(index, pMem, size);
- const u32* start = pMem;
- u32 size_arg = size;
-#endif
-
- while (size > 0)
- {
- //LOG(_T("Transfer(%08x, %d) START\n"), pMem, size);
- if (path->nloop == 0)
- {
- path->setTag(pMem);
- pMem += 4;
- size--;
-
- // eeuser 7.2.2. GIFtag: "... when NLOOP is 0, the GIF does not output anything, and
- // values other than the EOP field are disregarded."
- if (path->nloop > 0)
- {
- gs.q = 1.0f;
-
- if (path->tag.PRE && (path->tag.FLG == GIF_FLG_PACKED))
- {
- u64 tagprim = path->tag.PRIM;
- GIFRegHandlerPRIM((u32*)&tagprim);
- }
- }
- }
- else
- {
- switch (path->mode)
- {
- case GIF_FLG_PACKED:
- {
- // Needs to be looked at.
-
- // first try a shortcut for a very common case
-
- if (path->adonly && size >= path->nloop)
- {
- size -= path->nloop;
-
- do
- {
- GIFPackedRegHandlerA_D(pMem);
-
- pMem += 4; //sizeof(GIFPackedReg)/4;
- }
- while(--path->nloop > 0);
- break;
- }
-
- do
- {
- u32 reg = path->GetReg();
- g_GIFPackedRegHandlers[reg](pMem);
-
- pMem += 4; //sizeof(GIFPackedReg)/4;
- size--;
- }
- while (path->StepReg() && (size > 0));
-
- break;
- }
-
- case GIF_FLG_REGLIST:
- {
- // Needs to be looked at.
- //ZZLog::GS_Log("%8.8x%8.8x %d L", ((u32*)&gs.regs)[1], *(u32*)&gs.regs, path->tag.nreg/4);
-
- size *= 2;
-
- do
- {
- g_GIFRegHandlers[path->GetReg()](pMem);
-
- pMem += 2;
- size--;
- }
- while (path->StepReg() && (size > 0));
-
- if (size & 1) pMem += 2;
- size /= 2;
- break;
- }
-
- case GIF_FLG_IMAGE: // FROM_VFRAM
- case GIF_FLG_IMAGE2: // Used in the DirectX version, so we'll use it here too.
- {
- int len = min(size, path->nloop);
- //ZZLog::Error_Log("GIF_FLG_IMAGE(%d)=%d", gs.imageTransfer, len);
-
- if (gs.transferring)
- {
- switch (gs.imageTransfer)
- {
- case XFER_HOST_TO_LOCAL:
- TransferHostLocal(pMem, len * 4);
- break;
-
- case XFER_LOCAL_TO_HOST:
- // This can't happen; downloads can not be started or performed as part of
- // a GIFtag operation. They're an entirely separate process that can only be
- // done through the ReverseFIFO transfer (aka ReadFIFO). --air
- assert(0);
- //TransferLocalHost(pMem, len);
- break;
-
- case XFER_LOCAL_TO_LOCAL:
- //TransferLocalLocal();
- break;
-
- case XFER_DEACTIVATED:
- //assert(0);
- break;
-
- default:
- //assert(0);
- break;
- }
-
- }
-
- pMem += len * 4;
-
- path->nloop -= len;
- size -= len;
-
- break;
- }
-
- default: // GIF_IMAGE
- ZZLog::GS_Log("*** WARNING **** Unexpected GIFTag flag.");
- assert(0);
- path->nloop = 0;
- break;
- }
- }
-
- if (index == 0)
- {
- if (path->tag.EOP && path->nloop == 0)
- {
- break;
- }
- }
- }
-
-#ifdef _DEBUG
- g_dump.Transfer(index, start, pMem - start + 4, size_arg);
-#endif
-
- // This is the case when not all data was readed from one try: VU1 has too much data.
- // So we should redo reading from the start.
- if (index == 0)
- {
- if (size == 0 && path->nloop > 0)
- {
- if (g_GSMultiThreaded)
- {
- path->nloop = 0;
- }
- else
- {
- _GSgifTransfer<0>(pMem - 0x4000, 0x4000 / 16);
- }
- }
- }
-}
-
-// Used for replay
-void GSgifTransfer0(u32 *pMem, u32 addr)
-{
- _GSgifTransfer<0>(pMem, addr);
-}
-
-EXPORT_C_(void) GSgifTransfer1(u32 *pMem, u32 addr)
-{
- FUNCLOG
-
- //ZZLog::GS_Log("GSgifTransfer1 0x%x (mode %d).", addr, path->mode);
-
-#ifdef _DEBUG
- ZZLog::Prim_Log("count: %d\n", path1_count);
- path1_count++;
-#endif
-
- _GSgifTransfer<0>((u32*)((u8*)pMem + addr), (0x4000 - addr) / 16);
-}
-
-EXPORT_C_(void) GSgifTransfer2(u32 *pMem, u32 size)
-{
- FUNCLOG
-
- //ZZLog::GS_Log("GSgifTransfer2 size = %lx (mode %d, gs.path2.tag.nloop = %d).", size, gs.path[1].mode, gs.path[1].tag.nloop);
-
- _GSgifTransfer<1>(const_cast(pMem), size);
-}
-
-EXPORT_C_(void) GSgifTransfer3(u32 *pMem, u32 size)
-{
- FUNCLOG
-
- //ZZLog::GS_Log("GSgifTransfer3 size = %lx (mode %d, gs.path3.tag.nloop = %d).", size, gs.path[2].mode, gs.path[2].tag.nloop);
-
- _GSgifTransfer<2>(const_cast(pMem), size);
-}
-
-EXPORT_C_(void) GSgifTransfer(const u32 *pMem, u32 size)
-{
- FUNCLOG
-
- //ZZLog::GS_Log("GSgifTransfer3 size = %lx (mode %d, gs.path3.tag.nloop = %d).", size, gs.path[2].mode, gs.path[2].tag.nloop);
-
- _GSgifTransfer<3>(pMem, size);
-}
-
-void InitPath()
-{
- gs.path[0].mode = gs.path[1].mode = gs.path[2].mode = gs.path[3].mode = 0;
-}
-
diff --git a/plugins/zzogl-pg/opengl/GifTransfer.h b/plugins/zzogl-pg/opengl/GifTransfer.h
deleted file mode 100644
index f178eb7438..0000000000
--- a/plugins/zzogl-pg/opengl/GifTransfer.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* ZZ Open GL graphics plugin
- * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
- * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef GIFTRANSFER_H_INCLUDED
-#define GIFTRANSFER_H_INCLUDED
-
-#include "Util.h"
-#include "GS.h"
-#include "Regs.h"
-
-enum GIF_FLG
-{
- GIF_FLG_PACKED = 0,
- GIF_FLG_REGLIST = 1,
- GIF_FLG_IMAGE = 2,
- GIF_FLG_IMAGE2 = 3
-};
-
-//
-// GIFTag
-union GIFTag
-{
- u64 ai64[2];
- u32 ai32[4];
-
- struct
- {
- u32 NLOOP : 15;
- u32 EOP : 1;
- u32 _PAD1 : 16;
- u32 _PAD2 : 14;
- u32 PRE : 1;
- u32 PRIM : 11;
- u32 FLG : 2; // enum GIF_FLG
- u32 NREG : 4;
- u64 REGS : 64;
- };
-
- void set(const u32 *data)
- {
- for (int i = 0; i <= 3; i++)
- {
- ai32[i] = data[i];
- }
- }
-
- GIFTag(u32 *data)
- {
- set(data);
- }
-
- GIFTag(){ ai64[0] = 0; ai64[1] = 0; }
-};
-
-// EE part. Data transfer packet description
-
-typedef struct
-{
- u32 mode;
- int reg;
- u64 regs;
- u32 nloop;
- int eop;
- int nreg;
- u32 adonly;
- GIFTag tag;
-
- void setTag(const u32 *data)
- {
- tag.set(data);
-
- nloop = tag.NLOOP;
- eop = tag.EOP;
- mode = tag.FLG;
- adonly = false;
-
- // Hmm....
- nreg = tag.NREG << 2;
- if (nreg == 0) nreg = 64;
- regs = tag.REGS;
- reg = 0;
- if ((nreg == 4) && (regs == GIF_REG_A_D)) adonly = true;
-
- // ZZLog::GS_Log("GIFtag: %8.8lx_%8.8lx_%8.8lx_%8.8lx: EOP=%d, NLOOP=%x, FLG=%x, NREG=%d, PRE=%d",
- // data[3], data[2], data[1], data[0],
- // path->eop, path->nloop, mode, path->nreg, tag.PRE);
- }
-
- u32 GetReg()
- {
- return (regs >> reg) & 0xf;
- }
-
- bool StepReg()
- {
- reg += 4;
-
- if (reg == nreg)
- {
- reg = 0;
- nloop--;
-
- if (nloop == 0) return false;
- }
-
- return true;
- }
-
-} pathInfo;
-
-extern void _GSgifPacket(pathInfo *path, const u32 *pMem);
-extern void _GSgifRegList(pathInfo *path, const u32 *pMem);
-extern void GSgifTransfer0(u32* pMem, u32 addr);
-
-extern GIFRegHandler g_GIFPackedRegHandlers[];
-extern GIFRegHandler g_GIFRegHandlers[];
-extern void InitPath();
-#endif // GIFTRANSFER_H_INCLUDED
diff --git a/plugins/zzogl-pg/opengl/HostMemory.cpp b/plugins/zzogl-pg/opengl/HostMemory.cpp
deleted file mode 100644
index 78d6100730..0000000000
--- a/plugins/zzogl-pg/opengl/HostMemory.cpp
+++ /dev/null
@@ -1,620 +0,0 @@
-/* ZZ Open GL graphics plugin
- * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
- * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "GS.h"
-
-#include
-#include "Mem.h"
-#include "x86.h"
-#include "targets.h"
-#include "ZZoglVB.h"
-
-// flush current vertices, call before setting new registers (the main render method)
-extern void Flush(int context);
-
-u8* g_pbyGSMemory = NULL; // 4Mb GS system mem
-
-void GSMemory::init()
-{
- const u32 mem_size = MEMORY_END + 0x10000; // leave some room for out of range accesses (saves on the checks)
-
- // clear
- g_pbyGSMemory = (u8*)_aligned_malloc(mem_size, 1024);
- memset(g_pbyGSMemory, 0, mem_size);
-}
-
-void GSMemory::destroy()
-{
- _aligned_free(g_pbyGSMemory);
- g_pbyGSMemory = NULL;
-}
-
-u8* GSMemory::get()
-{
- return g_pbyGSMemory;
-}
-
-u8* GSMemory::get(u32 addr)
-{
- return &g_pbyGSMemory[addr*8];
-}
-u8* GSMemory::get_raw(u32 addr)
-{
- return &g_pbyGSMemory[addr];
-}
-
-u8* g_pbyGSClut = NULL; // ZZ
-
-void GSClut::init()
-{
- g_pbyGSClut = (u8*)_aligned_malloc(256 * 8, 1024); // need 512 alignment!
- memset(g_pbyGSClut, 0, 256*8);
-}
-
-void GSClut::destroy()
-{
- _aligned_free(g_pbyGSClut);
- g_pbyGSClut = NULL;
-}
-
-u8* GSClut::get()
-{
- return g_pbyGSClut;
-}
-
-u8* GSClut::get(u32 addr)
-{
- return &g_pbyGSClut[addr*8];
-}
-u8* GSClut::get_raw(u32 addr)
-{
- return &g_pbyGSClut[addr];
-}
-
-extern _getPixelAddress getPixelFun[64];
-
-extern CRangeManager s_RangeMngr; // manages overwritten memory
-extern void ResolveInRange(int start, int end);
-
-static vector s_vTempBuffer, s_vTransferCache;
-static int gs_imageEnd = 0;
-
-// From the start of monster labs. In all 3 cases, psm == 0.
-// ZZogl-PG: GetRectMemAddress(0x3f4000, 0x404000, 0x0, 0x0, 0x0, 0x100, 0x40, 0x3f40, 0x100);
-// ZZogl-PG: GetRectMemAddress(0x3f8000, 0x408000, 0x0, 0x0, 0x0, 0x100, 0x40, 0x3f80, 0x100);
-// ZZogl-PG: GetRectMemAddress(0x3fc000, 0x40c000, 0x0, 0x0, 0x0, 0x100, 0x40, 0x3fc0, 0x100);
-
-void GetRectMemAddress(int& start, int& end, int psm, int x, int y, int w, int h, int bp, int bw)
-{
- FUNCLOG
- u32 bits = 0;
-
- if (m_Blocks[psm].bpp == 0)
- {
- ZZLog::Error_Log("ZeroGS: Bad psm 0x%x.", psm);
- start = 0;
- end = MEMORY_END;
- return;
- }
-
- if (PSMT_ISZTEX(psm))
- {
- // This still needs an eye kept on it.
- const BLOCK& b = m_Blocks[psm];
- const int x2 = x + w + b.width - 1;
- const int y2 = y + h - 1;
- bw = bw / b.width;
-
- start = (bp + ((y / b.height) * bw + (x / b.width)) * 0x20) * 0x100;
- end = (bp + ((y2 / b.height) * bw + (x2 / b.width)) * 0x20) * 0x100;
- return;
- }
-
- bits = PSMT_BITS_NUM(psm);
- start = getPixelFun[psm](x, y, bp, bw);
- end = getPixelFun[psm](x + w - 1, y + h - 1, bp, bw) + 1;
-
- if (bits > 0)
- {
- start *= bits;
- end *= bits;
- }
- else
- {
- start /= 2;
- end /= 2;
- }
-}
-
-// Same as GetRectMemAddress, except that we know x & y are zero, so it's simplified a bit.
-void GetRectMemAddressZero(int& start, int& end, int psm, int w, int h, int bp, int bw)
-{
- FUNCLOG
- u32 bits = 0;
-
- if (m_Blocks[psm].bpp == 0)
- {
- ZZLog::Error_Log("ZeroGS: Bad psm 0x%x.", psm);
- start = 0;
- end = MEMORY_END;
- return;
- }
-
- if (PSMT_ISZTEX(psm))
- {
- // This still needs an eye kept on it.
- const BLOCK& b = m_Blocks[psm];
- const int x2 = w + b.width - 1;
- const int y2 = h - 1;
- bw = bw / b.width;
-
- start = bp * 0x100;
- end = (bp + ((y2 / b.height) * bw + (x2 / b.width)) * 0x20) * 0x100;
- return;
- }
-
- bits = PSMT_BITS_NUM(psm);
- start = getPixelFun[psm](0, 0, bp, bw);
- end = getPixelFun[psm](w - 1, h - 1, bp, bw) + 1;
-
- if (bits > 0)
- {
- start *= bits;
- end *= bits;
- }
- else
- {
- start /= 2;
- end /= 2;
- }
-}
-
-
-void GetRectMemAddress(int& start, int& end, int psm, Point p, Size s, int bp, int bw)
-{
- GetRectMemAddress(start, end, psm, p.x, p.y, s.w, s.h, bp, bw);
-}
-
-void GetRectMemAddress(int& start, int& end, int psm, int x, int y, Size s, int bp, int bw)
-{
- GetRectMemAddress(start, end, psm, x, y, s.w, s.h, bp, bw);
-}
-
-void GetRectMemAddressZero(int& start, int& end, int psm, Size s, int bp, int bw)
-{
- GetRectMemAddressZero(start, end, psm, s.w, s.h, bp, bw);
-}
-
-void InitTransferHostLocal()
-{
- FUNCLOG
-
-#if defined(_DEBUG)
- // Xenosaga 1.
- if (gs.trxpos.dx + gs.imageNew.w > gs.dstbuf.bw)
- ZZLog::Debug_Log("Transfer error, width exceeded. (0x%x > 0X%x)", gs.trxpos.dx + gs.imageNew.w, gs.dstbuf.bw);
-#endif
-
- //bool bHasFlushed = false;
-
- gs.image.x = gs.trxpos.dx;
- gs.image.y = gs.trxpos.dy;
-
- gs.imageEnd.x = gs.image.x + gs.imageNew.w;
- gs.imageEnd.y = gs.image.y + gs.imageNew.h;
-
- assert(gs.imageEnd.x < 2048 && gs.imageEnd.y < 2048);
-
- // This needs to be looked in to, since psm should *not* be 63.
- // hack! viewful joe
- if (gs.dstbuf.psm == 63)
- {
- ZZLog::WriteLn("gs.dstbuf.psm set to 0!");
- gs.dstbuf.psm = 0;
- }
-
- int start, end;
-
- GetRectMemAddress(start, end, gs.dstbuf.psm, gs.trxpos.dx, gs.trxpos.dy, gs.imageNew, gs.dstbuf.bp, gs.dstbuf.bw);
-
- if (end > MEMORY_END)
- {
- // Monster Lab - the screwed up title screen
- // Init host local out of bounds! (end == 0x404000)
- // Init host local out of bounds! (end == 0x408000)
- // Init host local out of bounds! (end == 0x40c000)
- // MEMORY_END is 0x400000...
-
- ZZLog::Warn_Log("Init host local out of bounds! (end == 0x%x)", end);
- //gs.transferring = false;
- end = MEMORY_END;
- }
-
- gs_imageEnd = end;
-
- if (vb[0].nCount > 0) Flush(0);
- if (vb[1].nCount > 0) Flush(1);
-
- //ZZLog::Prim_Log("trans: bp:%x x:%x y:%x w:%x h:%x\n", gs.dstbuf.bp, gs.trxpos.dx, gs.trxpos.dy, gs.imageNew.w, gs.imageNew.h);
-}
-
-void TransferHostLocal(const void* pbyMem, u32 nQWordSize)
-{
- FUNCLOG
-
- int start = -1, end = -1;
-
- GetRectMemAddress(start, end, gs.dstbuf.psm, gs.image, gs.imageNew, gs.dstbuf.bp, gs.dstbuf.bw);
-
- if ((start == -1) || (end == -1)) ZZLog::WriteLn("start == %d, end == %d", start, end);
- assert(start < gs_imageEnd);
- end = gs_imageEnd;
-
- // sometimes games can decompress to alpha channel of render target only, in this case
- // do a resolve right away. wolverine x2
- if (((gs.dstbuf.psm == PSMT8H) || (gs.dstbuf.psm == PSMT4HL) || (gs.dstbuf.psm == PSMT4HH)) && !(conf.settings().gust))
- {
- list listTransmissionUpdateTargs;
- s_RTs.GetTargs(start, end, listTransmissionUpdateTargs);
-
- for (list::iterator it = listTransmissionUpdateTargs.begin(); it != listTransmissionUpdateTargs.end(); ++it)
- {
- CRenderTarget* ptarg = *it;
-
- if ((ptarg->status & CRenderTarget::TS_Virtual)) continue;
-
- //ZZLog::Error_Log("Resolving to alpha channel.");
- ptarg->Resolve();
- }
- }
-
- s_RangeMngr.Insert(start, min(end, start + (int)nQWordSize*16));
-
- const u8* porgend = (const u8*)pbyMem + 4 * nQWordSize;
-
- if (s_vTransferCache.size() > 0)
- {
-
- int imagecache = s_vTransferCache.size();
- s_vTempBuffer.resize(imagecache + nQWordSize*4);
- memcpy(&s_vTempBuffer[0], &s_vTransferCache[0], imagecache);
- memcpy(&s_vTempBuffer[imagecache], pbyMem, nQWordSize*4);
-
- pbyMem = (const void*) & s_vTempBuffer[0];
- porgend = &s_vTempBuffer[0] + s_vTempBuffer.size();
-
- int wordinc = imagecache / 4;
-
- if ((nQWordSize * 4 + imagecache) / 3 == ((nQWordSize + wordinc) * 4) / 3)
- {
- // can use the data
- nQWordSize += wordinc;
- }
- }
-
- int leftover = m_Blocks[gs.dstbuf.psm].TransferHostLocal(pbyMem, nQWordSize);
-
- if (leftover > 0)
- {
- // copy the last gs.image24bitOffset to the cache
- s_vTransferCache.resize(leftover);
- memcpy(&s_vTransferCache[0], porgend - leftover, leftover);
- }
- else
- {
- s_vTransferCache.resize(0);
- }
-
-#if defined(_DEBUG)
- if (g_bSaveTrans)
- {
- tex0Info t;
- t.tbp0 = gs.dstbuf.bp;
- t.tw = gs.imageNew.w;
- t.th = gs.imageNew.h;
- t.tbw = gs.dstbuf.bw;
- t.psm = gs.dstbuf.psm;
- SaveTex(&t, 0);
- }
-
-#endif
-}
-
-void InitTransferLocalHost()
-{
- FUNCLOG
- assert(gs.trxpos.sx + gs.imageNew.w <= 2048 && gs.trxpos.sy + gs.imageNew.h <= 2048);
-
-#if defined(_DEBUG)
- if (gs.trxpos.sx + gs.imageNew.w > gs.srcbuf.bw)
- ZZLog::Debug_Log("Transfer error, width exceeded. (0x%x > 0x%x)", gs.trxpos.sx + gs.imageNew.w, gs.srcbuf.bw);
-#endif
-
- gs.image.x = gs.trxpos.sx;
- gs.image.y = gs.trxpos.sy;
-
- gs.imageEnd.x = gs.image.x + gs.imageNew.w;
- gs.imageEnd.y = gs.image.y + gs.imageNew.h;
-
- s_vTransferCache.resize(0);
-
- int start, end;
-
- GetRectMemAddress(start, end, gs.srcbuf.psm, gs.trxpos.sx, gs.trxpos.sy, gs.imageNew, gs.srcbuf.bp, gs.srcbuf.bw);
-
- ResolveInRange(start, end);
-}
-
-template
-void TransferLocalHost(void* pbyMem, u32 nQWordSize, int& x, int& y, u8 *pstart)
-{
- _readPixel_0 rp = readPixelFun_0[gs.srcbuf.psm];
-
- int i = x, j = y;
- T* pbuf = (T*)pbyMem;
- u32 nSize = nQWordSize * 16 / sizeof(T);
-
- for (; i < gs.imageEnd.y; ++i)
- {
- for (; j < gs.imageEnd.x && nSize > 0; ++j, --nSize)
- {
- *pbuf++ = rp(pstart, j % 2048, i % 2048, gs.srcbuf.bw);
- }
-
- if (j >= gs.imageEnd.x)
- {
- assert(j == gs.imageEnd.x);
- j = gs.trxpos.sx;
- }
- else
- {
- assert(nSize == 0);
- break;
- }
- }
-}
-
-void TransferLocalHost_24(void* pbyMem, u32 nQWordSize, int& x, int& y, u8 *pstart)
-{
- _readPixel_0 rp = readPixelFun_0[gs.srcbuf.psm];
-
- int i = x, j = y;
- u8* pbuf = (u8*)pbyMem;
- u32 nSize = nQWordSize * 16 / 3;
-
- for (; i < gs.imageEnd.y; ++i)
- {
- for (; j < gs.imageEnd.x && nSize > 0; ++j, --nSize)
- {
- u32 p = rp(pstart, j % 2048, i % 2048, gs.srcbuf.bw);
- pbuf[0] = (u8)p;
- pbuf[1] = (u8)(p >> 8);
- pbuf[2] = (u8)(p >> 16);
- pbuf += 3;
- }
-
- if (j >= gs.imageEnd.x)
- {
- assert(j == gs.imageEnd.x);
- j = gs.trxpos.sx;
- }
- else
- {
- assert(nSize == 0);
- break;
- }
- }
-}
-
-// left/right, top/down
-void TransferLocalHost(void* pbyMem, u32 nQWordSize)
-{
- FUNCLOG
- assert(gs.imageTransfer == XFER_LOCAL_TO_HOST);
-
- u8* pstart = g_pbyGSMemory + 256 * gs.srcbuf.bp;
-
- switch(PSMT_BITMODE(gs.srcbuf.psm))
- {
- case 0:
- TransferLocalHost(pbyMem, nQWordSize, gs.image.y, gs.image.x, pstart);
- break;
- case 1:
- TransferLocalHost_24(pbyMem, nQWordSize, gs.image.y, gs.image.x, pstart);
- break;
- case 2:
- TransferLocalHost(pbyMem, nQWordSize, gs.image.y, gs.image.x, pstart);
- break;
- case 3:
- TransferLocalHost(pbyMem, nQWordSize, gs.image.y, gs.image.x, pstart);
- break;
- default:
- assert(0);
- break;
- }
-
- if (gs.image.y >= gs.imageEnd.y)
- {
- ZZLog::Error_Log("gs.image.y >= gs.imageEnd.y!");
- assert(gs.image.y == gs.imageEnd.y);
- gs.transferring = false;
- }
-}
-
-__forceinline void _TransferLocalLocal()
-{
- //ZZLog::Error_Log("TransferLocalLocal(0x%x, 0x%x)", gs.srcbuf.psm, gs.dstbuf.psm);
- _writePixel_0 wp = writePixelFun_0[gs.srcbuf.psm];
- _readPixel_0 rp = readPixelFun_0[gs.dstbuf.psm];
- u8* pSrcBuf = g_pbyGSMemory + gs.srcbuf.bp * 256;
- u8* pDstBuf = g_pbyGSMemory + gs.dstbuf.bp * 256;
- u32 widthlimit = 4;
- u32 maxX = gs.trxpos.sx + gs.imageNew.w;
- u32 maxY = gs.trxpos.sy + gs.imageNew.h;
-
- if (PSMT_BITMODE(gs.srcbuf.psm) == 0) widthlimit = 2;
- if ((gs.imageNew.w & widthlimit) != 0) return;
-
- for(u32 i = gs.trxpos.sy, i2 = gs.trxpos.dy; i < maxY; i++, i2++)
- {
- for(u32 j = gs.trxpos.sx, j2 = gs.trxpos.dx; j < maxX; j += widthlimit, j2 += widthlimit)
- {
- wp(pDstBuf, j2%2048, i2%2048,
- rp(pSrcBuf, j%2048, i%2048, gs.srcbuf.bw), gs.dstbuf.bw);
-
- wp(pDstBuf, (j2+1)%2048, i2%2048,
- rp(pSrcBuf, (j+1)%2048, i%2048, gs.srcbuf.bw), gs.dstbuf.bw);
-
- if (widthlimit > 2)
- {
- // Then widthlimit == 4.
- wp(pDstBuf, (j2+2)%2048, i2%2048,
- rp(pSrcBuf, (j+2)%2048, i%2048, gs.srcbuf.bw), gs.dstbuf.bw);
-
- wp(pDstBuf, (j2+3)%2048, i2%2048,
- rp(pSrcBuf, (j+3)%2048, i%2048, gs.srcbuf.bw), gs.dstbuf.bw);
- }
- }
- }
-}
-
-__forceinline void _TransferLocalLocal_4()
-{
- //ZZLog::Error_Log("TransferLocalLocal_4(0x%x, 0x%x)", gs.srcbuf.psm, gs.dstbuf.psm);
- _getPixelAddress_0 gsp = getPixelFun_0[gs.srcbuf.psm];
- _getPixelAddress_0 gdp = getPixelFun_0[gs.dstbuf.psm];
- u8* pSrcBuf = g_pbyGSMemory + gs.srcbuf.bp * 256;
- u8* pDstBuf = g_pbyGSMemory + gs.dstbuf.bp * 256;
- u32 maxX = gs.trxpos.sx + gs.imageNew.w;
- u32 maxY = gs.trxpos.sy + gs.imageNew.h;
-
- assert((gs.imageNew.w % 8) == 0);
-
- for(u32 i = gs.trxpos.sy, i2 = gs.trxpos.dy; i < maxY; ++i, ++i2)
- {
- for(u32 j = gs.trxpos.sx, j2 = gs.trxpos.dx; j < maxX; j += 8, j2 += 8)
- {
- /* NOTE: the 2 conseq 4bit values are in NOT in the same byte */
- u32 read = gsp(j%2048, i%2048, gs.srcbuf.bw);
- u32 write = gdp(j2%2048, i2%2048, gs.dstbuf.bw);
- pDstBuf[write] = (pDstBuf[write]&0xf0)|(pSrcBuf[read]&0x0f);
-
- read = gsp((j+1)%2048, i%2048, gs.srcbuf.bw);
- write = gdp((j2+1)%2048, i2%2048, gs.dstbuf.bw);
- pDstBuf[write] = (pDstBuf[write]&0x0f)|(pSrcBuf[read]&0xf0);
-
- read = gsp((j+2)%2048, i%2048, gs.srcbuf.bw);
- write = gdp((j2+2)%2048, i2%2048, gs.dstbuf.bw);
- pDstBuf[write] = (pDstBuf[write]&0xf0)|(pSrcBuf[read]&0x0f);
-
- read = gsp((j+3)%2048, i%2048, gs.srcbuf.bw);
- write = gdp((j2+3)%2048, i2%2048, gs.dstbuf.bw);
- pDstBuf[write] = (pDstBuf[write]&0x0f)|(pSrcBuf[read]&0xf0);
-
- read = gsp((j+4)%2048, i%2048, gs.srcbuf.bw);
- write = gdp((j2+4)%2048, i2%2048, gs.dstbuf.bw);
- pDstBuf[write] = (pDstBuf[write]&0xf0)|(pSrcBuf[read]&0x0f);
-
- read = gsp((j+5)%2048, i%2048, gs.srcbuf.bw);
- write = gdp((j2+5)%2048, i2%2048, gs.dstbuf.bw);
- pDstBuf[write] = (pDstBuf[write]&0x0f)|(pSrcBuf[read]&0xf0);
-
- read = gsp((j+6)%2048, i%2048, gs.srcbuf.bw);
- write = gdp((j2+6)%2048, i2%2048, gs.dstbuf.bw);
- pDstBuf[write] = (pDstBuf[write]&0xf0)|(pSrcBuf[read]&0x0f);
-
- read = gsp((j+7)%2048, i%2048, gs.srcbuf.bw);
- write = gdp((j2+7)%2048, i2%2048, gs.dstbuf.bw);
- pDstBuf[write] = (pDstBuf[write]&0x0f)|(pSrcBuf[read]&0xf0);
- }
- }
-}
-
-// dir depends on trxpos.dirx & trxpos.diry
-void TransferLocalLocal()
-{
- FUNCLOG
-
- //ZZLog::Error_Log("I'z in your code, transferring your memory...");
- assert(gs.imageTransfer == XFER_LOCAL_TO_LOCAL);
- assert(gs.trxpos.sx + gs.imageNew.w < 2048 && gs.trxpos.sy + gs.imageNew.h < 2048);
- assert(gs.trxpos.dx + gs.imageNew.w < 2048 && gs.trxpos.dy + gs.imageNew.h < 2048);
- assert((gs.srcbuf.psm&0x7) == (gs.dstbuf.psm&0x7));
-
- if (gs.trxpos.sx + gs.imageNew.w > gs.srcbuf.bw)
- ZZLog::Debug_Log("Transfer error, src width exceeded.(0x%x > 0x%x)", gs.trxpos.sx + gs.imageNew.w, gs.srcbuf.bw);
-
- if (gs.trxpos.dx + gs.imageNew.w > gs.dstbuf.bw)
- ZZLog::Debug_Log("Transfer error, dst width exceeded.(0x%x > 0x%x)", gs.trxpos.dx + gs.imageNew.w, gs.dstbuf.bw);
-
- int srcstart, srcend, dststart, dstend;
-
- GetRectMemAddress(srcstart, srcend, gs.srcbuf.psm, gs.trxpos.sx, gs.trxpos.sy, gs.imageNew, gs.srcbuf.bp, gs.srcbuf.bw);
- GetRectMemAddress(dststart, dstend, gs.dstbuf.psm, gs.trxpos.dx, gs.trxpos.dy, gs.imageNew, gs.dstbuf.bp, gs.dstbuf.bw);
-
- // resolve the targs
- ResolveInRange(srcstart, srcend);
-
- list listTargs;
-
- s_RTs.GetTargs(dststart, dstend, listTargs);
-
- for (list::iterator it = listTargs.begin(); it != listTargs.end(); ++it)
- {
- if (!((*it)->status & CRenderTarget::TS_Virtual))
- {
- (*it)->Resolve();
- //(*it)->status |= CRenderTarget::TS_NeedUpdate;
- }
- }
-
- if (PSMT_BITMODE(gs.srcbuf.psm) != 4)
- {
- _TransferLocalLocal();
- }
- else
- {
- _TransferLocalLocal_4();
- }
-
- g_MemTargs.ClearRange(dststart, dstend);
-
-#ifdef ZEROGS_DEVBUILD
-
- if (g_bSaveTrans)
- {
- tex0Info t;
- t.tbp0 = gs.dstbuf.bp;
- t.tw = gs.imageNew.w;
- t.th = gs.imageNew.h;
- t.tbw = gs.dstbuf.bw;
- t.psm = gs.dstbuf.psm;
- SaveTex(&t, 0);
-
- t.tbp0 = gs.srcbuf.bp;
- t.tw = gs.imageNew.w;
- t.th = gs.imageNew.h;
- t.tbw = gs.srcbuf.bw;
- t.psm = gs.srcbuf.psm;
- SaveTex(&t, 0);
- }
-
-#endif
-}
-
diff --git a/plugins/zzogl-pg/opengl/HostMemory.h b/plugins/zzogl-pg/opengl/HostMemory.h
deleted file mode 100644
index a49fe1eb81..0000000000
--- a/plugins/zzogl-pg/opengl/HostMemory.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* ZZ Open GL graphics plugin
- * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
- * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef HOSTMEMORY_H_INCLUDED
-#define HOSTMEMORY_H_INCLUDED
-
-#include "GLWin.h"
-
-#define MEMORY_END 0x00400000
-
-extern int GPU_TEXWIDTH;
-
-extern u8* g_pBasePS2Mem;
-extern u8* g_pbyGSMemory;
-
-class GSMemory
-{
- public:
- void init();
- void destroy();
- u8* get();
- u8* get(u32 addr);
- u8* get_raw(u32 addr);
-};
-
-extern u8* g_pbyGSClut; // the temporary clut buffer
-
-class GSClut
-{
- public:
- void init();
- void destroy();
- u8* get();
- u8* get(u32 addr);
- u8* get_raw(u32 addr);
-};
-
-class ZeroGSInit
-{
-
- public:
- ZeroGSInit()
- {
- const u32 mem_size = MEMORY_END + 0x10000; // leave some room for out of range accesses (saves on the checks)
- // clear
- g_pbyGSMemory = (u8*)_aligned_malloc(mem_size, 1024);
- memset(g_pbyGSMemory, 0, mem_size);
-
- g_pbyGSClut = (u8*)_aligned_malloc(256 * 8, 1024); // need 512 alignment!
- memset(g_pbyGSClut, 0, 256*8);
- memset(&GLWin, 0, sizeof(GLWin));
- }
-
- ~ZeroGSInit()
- {
- _aligned_free(g_pbyGSMemory);
- g_pbyGSMemory = NULL;
-
- _aligned_free(g_pbyGSClut);
- g_pbyGSClut = NULL;
- }
-};
-
-// The size in bytes of x strings (of texture).
-inline int MemorySize(int x)
-{
- return 4 * GPU_TEXWIDTH * x;
-}
-
-// Return the address in memory of data block for string x.
-inline u8* MemoryAddress(int x)
-{
- return g_pbyGSMemory + MemorySize(x);
-}
-
-template
-inline u8* _MemoryAddress(int x)
-{
- return g_pbyGSMemory + mult * x;
-}
-
-extern void GetRectMemAddress(int& start, int& end, int psm, int x, int y, int w, int h, int bp, int bw);
-extern void GetRectMemAddress(int& start, int& end, int psm, Point p, Size s, int bp, int bw);
-extern void GetRectMemAddress(int& start, int& end, int psm, int x, int y, Size s, int bp, int bw);
-extern void GetRectMemAddressZero(int& start, int& end, int psm, int w, int h, int bp, int bw);
-extern void GetRectMemAddressZero(int& start, int& end, int psm, Size s, int bp, int bw);
-
-// called when trxdir is accessed. If host is involved, transfers memory to temp buffer byTransferBuf.
-// Otherwise performs the transfer. TODO: Perhaps divide the transfers into chunks?
-extern void InitTransferHostLocal();
-extern void TransferHostLocal(const void* pbyMem, u32 nQWordSize);
-
-extern void InitTransferLocalHost();
-extern void TransferLocalHost(void* pbyMem, u32 nQWordSize);
-
-extern void TransferLocalLocal();
-
-#endif // HOSTMEMORY_H_INCLUDED
diff --git a/plugins/zzogl-pg/opengl/Linux/Conf.cpp b/plugins/zzogl-pg/opengl/Linux/Conf.cpp
deleted file mode 100644
index e3d62c589f..0000000000
--- a/plugins/zzogl-pg/opengl/Linux/Conf.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/* GSsoft
- * Copyright (C) 2002-2004 GSsoft Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include "GS.h"
-#include "Utilities/Path.h"
-
-void SaveConfig()
-{
- const wxString iniFile_s(Path::Combine(s_strIniPath, L"zzogl-pg.ini"));
- std::string iniFile = std::string(iniFile_s.mb_str());
-
- FILE* f = fopen(iniFile.c_str(), "w");
-
- if (f == NULL)
- {
- ZZLog::Error_Log("Failed to open '%s'", iniFile.c_str());
- return;
- }
-
- fprintf(f, "interlace = %hhx\n", conf.interlace);
-
- fprintf(f, "mrtdepth = %hhx\n", conf.mrtdepth);
- fprintf(f, "zzoptions = %x\n", conf.zz_options._u32);
- fprintf(f, "options = %x\n", conf.hacks._u32);
- fprintf(f, "bilinear = %hhx\n", conf.bilinear);
- fprintf(f, "aliasing = %hhx\n", conf.aa);
- fprintf(f, "width = %x\n", conf.width);
- fprintf(f, "height = %x\n", conf.height);
- fprintf(f, "x = %x\n", conf.x);
- fprintf(f, "y = %x\n", conf.y);
- fprintf(f, "log = %x\n", conf.log);
- fprintf(f, "skipdraw = %x\n", conf.SkipDraw);
- fprintf(f, "disablehacks = %x\n", conf.disableHacks);
- fclose(f);
-}
-
-void LoadConfig()
-{
- int err = 0;
- memset(&conf, 0, sizeof(conf));
- conf.interlace = 0; // on, mode 1
- conf.mrtdepth = 1;
- conf.bilinear = 1;
- conf.log = 1;
- conf.SkipDraw = 0;
- conf.width = 800;
- conf.height = 600;
- conf.disableHacks = 0;
-
- const wxString iniFile_s(Path::Combine(s_strIniPath, L"zzogl-pg.ini"));
- std::string iniFile = std::string(iniFile_s.mb_str());
-
- FILE* f = fopen(iniFile.c_str(), "r");
-
- if (f == NULL)
- {
- ZZLog::Error_Log("Failed to open '%s'", iniFile.c_str());
- SaveConfig();//save and return
- return;
- }
-
- err = fscanf(f, "interlace = %hhx\n", &conf.interlace);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "mrtdepth = %hhx\n", &conf.mrtdepth);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "zzoptions = %x\n", &conf.zz_options._u32);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "options = %x\n", &conf.hacks._u32);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "bilinear = %hhx\n", &conf.bilinear);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "aliasing = %hhx\n", &conf.aa);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "width = %x\n", &conf.width);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "height = %x\n", &conf.height);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "x = %x\n", &conf.x);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "y = %x\n", &conf.y);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "log = %x\n", &conf.log);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "skipdraw = %x\n", &conf.SkipDraw);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- err = fscanf(f, "disablehacks = %x\n", &conf.disableHacks);
- if (err != 1) ZZLog::Error_Log("Failed to read zzogl option");
- fclose(f);
-
- // turn off all hacks by default
- conf.setWireframe(false);
- conf.setCaptureAvi(false);
- conf.setLoaded(true);
-
- conf.isWideScreen = conf.widescreen();
-
- // filter bad files
- if (conf.interlace > 2) conf.interlace = 0;
- if (conf.aa > 4) conf.aa = 0;
- if (conf.width <= 0 || conf.height <= 0)
- {
- conf.width = 800;
- conf.height = 600;
- }
-
- if (conf.x < 0 || conf.y < 0)
- {
- conf.x = 0;
- conf.y = 0;
- }
-}
-
diff --git a/plugins/zzogl-pg/opengl/Linux/Linux.cpp b/plugins/zzogl-pg/opengl/Linux/Linux.cpp
deleted file mode 100644
index 8f7ea624b5..0000000000
--- a/plugins/zzogl-pg/opengl/Linux/Linux.cpp
+++ /dev/null
@@ -1,545 +0,0 @@
-/* ZeroGS
- * Copyright (C) 2002-2004 GSsoft Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include
-#include
-#include
-#include
-#include
-
-#include "GS.h"
-#include "Linux.h"
-#include "GLWin.h"
-
-#include