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.
This commit is contained in:
lightningterror
2020-08-21 20:41:45 -07:00
committed by GitHub
parent 328e358b21
commit f6c138ca7e
132 changed files with 21 additions and 66831 deletions
-1
View File
@@ -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
-4
View File
@@ -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
-2
View File
@@ -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)")
+1 -28
View File
@@ -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
#---------------------------------------
+1 -13
View File
@@ -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
-1
View File
@@ -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()
-1
View File
@@ -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/" | \
-116
View File
@@ -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 <http://www.gnu.org/licenses/>.
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 = <<EOS;
/*
* This file was generated by ./linux_various/glsl2h.pl script. Don't edit it manually !
*
* GLSL input directory: $in_dir
* GLSL input files: @$glsl_files
*
* 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
EOS
my $data = $header;
foreach my $file (@{$glsl_files}) {
my $name = $file;
$name =~ s/\./_/;
$data .= "\nstatic const char* const $name =\n";
open(my $GLSL, File::Spec->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;
}
}
+1 -9
View File
@@ -38,7 +38,6 @@ Help:
--input <file> : input glsl file (mandatory)
--macro <name> <value> : set a macro. Can be repeated
--entry <name> : 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
+18 -27
View File
@@ -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
-4
View File
@@ -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()
-237
View File
@@ -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)
-408
View File
@@ -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
-151
View File
@@ -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 <stdlib.h>
#include <X11/Xlib.h>
#ifdef EGL_API
#include <EGL/egl.h>
#include <EGL/eglext.h>
#else
#define GLX_API
#include <GL/glx.h>
#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
-435
View File
@@ -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
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-97
View File
@@ -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();
}
}
}
-65
View File
@@ -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;
@@ -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

Some files were not shown because too many files have changed in this diff Show More