diff --git a/CMakeLists.txt b/CMakeLists.txt index 7eb8aad694..fa982c6567 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,19 @@ # cmake_minimum_required(VERSION 2.6) +option(USE_GLES "Enables GLES, disables OGL" OFF) +option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF) + +option(FASTLOG "Enable all logs" OFF) +option(OPROFILING "Enable profiling" OFF) +option(OPENMP "Enable OpenMP parallelization" ON) +option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON) +######################################## +# Optional Targets +# TODO: Add DSPSpy and TestSuite. +option(DSPTOOL "Build dsptool" OFF) +option(UNITTESTS "Build unitests" OFF) + # Update compiler before calling project() if (APPLE) # Use clang compiler @@ -224,7 +237,6 @@ if(CMAKE_BUILD_TYPE STREQUAL Release) add_definitions(-fomit-frame-pointer) endif(CMAKE_BUILD_TYPE STREQUAL Release) -option(FASTLOG "Enable all logs" OFF) if(FASTLOG) add_definitions(-DDEBUGFAST) endif() @@ -237,7 +249,6 @@ endif(GDBSTUB) # For now GLES and EGL are tied to each other. # Enabling GLES also disables the OpenGL plugin. -option(USE_GLES "Enables GLES, disables OGL" OFF) if(USE_GLES) message("GLES rendering enabled") add_definitions(-DUSE_GLES) @@ -261,7 +272,6 @@ if(NOT OPENGL_GLU_FOUND) message(FATAL_ERROR "GLU is required but not found") endif() -option(OPENMP "Enable OpenMP parallelization" ON) if(OPENMP) include(FindOpenMP OPTIONAL) if(OPENMP_FOUND) @@ -344,7 +354,6 @@ else() add_definitions(-DHAVE_XRANDR=0) endif(XRANDR_FOUND) -option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON) if(ENCODE_FRAMEDUMPS) check_libav() endif() @@ -366,7 +375,6 @@ else() set(PORTAUDIO_FOUND FALSE) endif(PORTAUDIO) -option(OPROFILING "Enable profiling" OFF) if(OPROFILING) check_lib(OPROFILE opagent opagent.h) check_lib(BFD bfd bfd.h) @@ -536,7 +544,6 @@ else() add_subdirectory(Externals/CLRun) endif() -option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF) if(NOT DISABLE_WX) include(FindwxWidgets OPTIONAL) FIND_PACKAGE(wxWidgets COMPONENTS core aui adv) @@ -632,12 +639,6 @@ file(WRITE ${PROJECT_BINARY_DIR}/Source/Core/Common/Src/scmrev.h ) include_directories("${PROJECT_BINARY_DIR}/Source/Core/Common/Src") -######################################## -# Optional Targets -# TODO: Add DSPSpy and TestSuite. -option(DSPTOOL "Build dsptool" OFF) -option(UNITTESTS "Build unitests" OFF) - ######################################## # Start compiling our code # diff --git a/Data/User/GameConfig/G2TE52.ini b/Data/User/GameConfig/G2TE52.ini index 506768e485..b90db9f401 100644 --- a/Data/User/GameConfig/G2TE52.ini +++ b/Data/User/GameConfig/G2TE52.ini @@ -1,7 +1,16 @@ # G2TE52 - Tony Hawk's Underground 2 [Core] Values set here will override the main dolphin settings. -TLBHack=1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 1 +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/G3AP69.ini b/Data/User/GameConfig/G3AP69.ini index ed15e3bbba..04ea1cba46 100644 --- a/Data/User/GameConfig/G3AP69.ini +++ b/Data/User/GameConfig/G3AP69.ini @@ -1,4 +1,4 @@ -# G3AE69 - The Lord of the Rings, The Third Age +# G3AP69 - The Lord of the Rings, The Third Age [Core] Values set here will override the main dolphin settings. TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. diff --git a/Data/User/GameConfig/GAZD69.ini b/Data/User/GameConfig/GAZD69.ini new file mode 100644 index 0000000000..c8516a71ea --- /dev/null +++ b/Data/User/GameConfig/GAZD69.ini @@ -0,0 +1,16 @@ +# GAZD69 - Harry Potter : POA +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, skip them. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GAZE69.ini b/Data/User/GameConfig/GAZE69.ini index 5168f7c0a0..0e84a9479a 100644 --- a/Data/User/GameConfig/GAZE69.ini +++ b/Data/User/GameConfig/GAZE69.ini @@ -1,7 +1,16 @@ # GAZE69 - Harry Potter : POA [Core] Values set here will override the main dolphin settings. -TLBHack=1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 1 +EmulationStateId = 4 +EmulationIssues = Videos are messed up, skip them. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GAZF69.ini b/Data/User/GameConfig/GAZF69.ini new file mode 100644 index 0000000000..e933511c09 --- /dev/null +++ b/Data/User/GameConfig/GAZF69.ini @@ -0,0 +1,16 @@ +# GAZF69 - Harry Potter : POA +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, skip them. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GAZH69.ini b/Data/User/GameConfig/GAZH69.ini new file mode 100644 index 0000000000..f00c317941 --- /dev/null +++ b/Data/User/GameConfig/GAZH69.ini @@ -0,0 +1,16 @@ +# GAZH69 - Harry Potter : POA +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, skip them. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GAZI69.ini b/Data/User/GameConfig/GAZI69.ini new file mode 100644 index 0000000000..2e56ee50ec --- /dev/null +++ b/Data/User/GameConfig/GAZI69.ini @@ -0,0 +1,16 @@ +# GAZI69 - Harry Potter : POA +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, skip them. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GAZJ69.ini b/Data/User/GameConfig/GAZJ69.ini new file mode 100644 index 0000000000..91a6e20741 --- /dev/null +++ b/Data/User/GameConfig/GAZJ69.ini @@ -0,0 +1,16 @@ +# GAZJ69 - Harry Potter to Azkaban no Shuujin +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, skip them. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GAZM69.ini b/Data/User/GameConfig/GAZM69.ini new file mode 100644 index 0000000000..edcde989b1 --- /dev/null +++ b/Data/User/GameConfig/GAZM69.ini @@ -0,0 +1,16 @@ +# GAZM69 - Harry Potter : POA +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, skip them. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GAZP69.ini b/Data/User/GameConfig/GAZP69.ini new file mode 100644 index 0000000000..62e235c67b --- /dev/null +++ b/Data/User/GameConfig/GAZP69.ini @@ -0,0 +1,16 @@ +# GAZP69 - Harry Potter : POA +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, skip them. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GAZS69.ini b/Data/User/GameConfig/GAZS69.ini new file mode 100644 index 0000000000..493976126f --- /dev/null +++ b/Data/User/GameConfig/GAZS69.ini @@ -0,0 +1,16 @@ +# GAZS69 - Harry Potter : POA +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Videos are messed up, skip them. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GH4D69.ini b/Data/User/GameConfig/GH4D69.ini new file mode 100644 index 0000000000..aa043328ab --- /dev/null +++ b/Data/User/GameConfig/GH4D69.ini @@ -0,0 +1,16 @@ +# GH4D69 - Harry Potter and the Goblet of Fire +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GH4E69.ini b/Data/User/GameConfig/GH4E69.ini index 717593cf73..53f2bf092e 100644 --- a/Data/User/GameConfig/GH4E69.ini +++ b/Data/User/GameConfig/GH4E69.ini @@ -1,7 +1,16 @@ -# GH4E69 - Goblet Of Fire +# GH4E69 - Harry Potter and the Goblet of Fire [Core] Values set here will override the main dolphin settings. -TLBHack=1 +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 1 +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GH4F69.ini b/Data/User/GameConfig/GH4F69.ini new file mode 100644 index 0000000000..162bbcd94d --- /dev/null +++ b/Data/User/GameConfig/GH4F69.ini @@ -0,0 +1,16 @@ +# GH4F69 - Harry Potter and the Goblet of Fire +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GH4H69.ini b/Data/User/GameConfig/GH4H69.ini new file mode 100644 index 0000000000..f348f1f777 --- /dev/null +++ b/Data/User/GameConfig/GH4H69.ini @@ -0,0 +1,16 @@ +# GH4H69 - Harry Potter and the Goblet of Fire +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GH4I69.ini b/Data/User/GameConfig/GH4I69.ini new file mode 100644 index 0000000000..b3bb4acb13 --- /dev/null +++ b/Data/User/GameConfig/GH4I69.ini @@ -0,0 +1,16 @@ +# GH4I69 - Harry Potter and the Goblet of Fire +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GH4J69.ini b/Data/User/GameConfig/GH4J69.ini new file mode 100644 index 0000000000..8427cb7a75 --- /dev/null +++ b/Data/User/GameConfig/GH4J69.ini @@ -0,0 +1,16 @@ +# GH4J69 - Harry Potter to Honoo no Goblet +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GH4M69.ini b/Data/User/GameConfig/GH4M69.ini new file mode 100644 index 0000000000..d26c2c8bf7 --- /dev/null +++ b/Data/User/GameConfig/GH4M69.ini @@ -0,0 +1,16 @@ +# GH4M69 - Harry Potter and the Goblet of Fire +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GH4P69.ini b/Data/User/GameConfig/GH4P69.ini new file mode 100644 index 0000000000..7f59479c96 --- /dev/null +++ b/Data/User/GameConfig/GH4P69.ini @@ -0,0 +1,16 @@ +# GH4P69 - Harry Potter and the Goblet of Fire +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GH4S69.ini b/Data/User/GameConfig/GH4S69.ini new file mode 100644 index 0000000000..277c978f4a --- /dev/null +++ b/Data/User/GameConfig/GH4S69.ini @@ -0,0 +1,16 @@ +# GH4S69 - Harry Potter and the Goblet of Fire +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GHLE69.ini b/Data/User/GameConfig/GHLE69.ini index 2b8afab705..907ea760cb 100644 --- a/Data/User/GameConfig/GHLE69.ini +++ b/Data/User/GameConfig/GHLE69.ini @@ -1,7 +1,16 @@ # GHLE69 - Harry Potter and the Sorcerer's Stone [Core] Values set here will override the main dolphin settings. +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = Missing text sometimes +EmulationIssues = Text missing in D3D9, use D3D11 or Opengl instead. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GHLJ69.ini b/Data/User/GameConfig/GHLJ69.ini new file mode 100644 index 0000000000..5f9ecffaaa --- /dev/null +++ b/Data/User/GameConfig/GHLJ69.ini @@ -0,0 +1,16 @@ +# GHLJ69 - Harry Potter to Kenja no Ishi +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Text missing in D3D9, use D3D11 or Opengl instead. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GHLP69.ini b/Data/User/GameConfig/GHLP69.ini new file mode 100644 index 0000000000..9cc3ba9db2 --- /dev/null +++ b/Data/User/GameConfig/GHLP69.ini @@ -0,0 +1,16 @@ +# GHLP69 - Harry Potter and the Philosopher's Stone +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Text missing in D3D9, use D3D11 or Opengl instead. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GHLX69.ini b/Data/User/GameConfig/GHLX69.ini new file mode 100644 index 0000000000..5bf5d65db3 --- /dev/null +++ b/Data/User/GameConfig/GHLX69.ini @@ -0,0 +1,16 @@ +# GHLX69 - Harry Potter and the Sorcerer's Stone +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Text missing in D3D9, use D3D11 or Opengl instead. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GHLY69.ini b/Data/User/GameConfig/GHLY69.ini new file mode 100644 index 0000000000..b6ecff05dc --- /dev/null +++ b/Data/User/GameConfig/GHLY69.ini @@ -0,0 +1,16 @@ +# GHLY69 - Harry Potter and the Sorcerer's Stone +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Text missing in D3D9, use D3D11 or Opengl instead. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GHLZ69.ini b/Data/User/GameConfig/GHLZ69.ini new file mode 100644 index 0000000000..a84cd6a874 --- /dev/null +++ b/Data/User/GameConfig/GHLZ69.ini @@ -0,0 +1,16 @@ +# GHLZ69 - Harry Potter and the Sorcerer's Stone +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Text missing in D3D9, use D3D11 or Opengl instead. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GHSE69.ini b/Data/User/GameConfig/GHSE69.ini index 8640caac26..ca829d891b 100644 --- a/Data/User/GameConfig/GHSE69.ini +++ b/Data/User/GameConfig/GHSE69.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = HLE sound glitches, videos require real XFB +EmulationIssues = Needs Real Xfb for videos to display. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GHSJ69.ini b/Data/User/GameConfig/GHSJ69.ini new file mode 100644 index 0000000000..44b9d741fd --- /dev/null +++ b/Data/User/GameConfig/GHSJ69.ini @@ -0,0 +1,18 @@ +# GHSJ69 - Harry Potter to Himitsu no Heya +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Needs Real Xfb for videos to display. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Settings] +UseXFB = True +UseRealXFB = True diff --git a/Data/User/GameConfig/GHSP69.ini b/Data/User/GameConfig/GHSP69.ini new file mode 100644 index 0000000000..06ea951767 --- /dev/null +++ b/Data/User/GameConfig/GHSP69.ini @@ -0,0 +1,18 @@ +# GHSP69 - Harry Potter: Chamber Of Secrets +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Needs Real Xfb for videos to display. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Settings] +UseXFB = True +UseRealXFB = True diff --git a/Data/User/GameConfig/GHSX69.ini b/Data/User/GameConfig/GHSX69.ini new file mode 100644 index 0000000000..b030198aff --- /dev/null +++ b/Data/User/GameConfig/GHSX69.ini @@ -0,0 +1,18 @@ +# GHSX69 - Harry Potter: Chamber Of Secrets +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Needs Real Xfb for videos to display. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Settings] +UseXFB = True +UseRealXFB = True diff --git a/Data/User/GameConfig/GHSY69.ini b/Data/User/GameConfig/GHSY69.ini index 7fc51c7467..1d484a2598 100644 --- a/Data/User/GameConfig/GHSY69.ini +++ b/Data/User/GameConfig/GHSY69.ini @@ -2,7 +2,7 @@ [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 4 -EmulationIssues = HLE sound glitches, videos require real XFB +EmulationIssues = Needs Real Xfb for videos to display. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GKYE01.ini b/Data/User/GameConfig/GKYE01.ini index 36e4128b6c..bb79983dd3 100644 --- a/Data/User/GameConfig/GKYE01.ini +++ b/Data/User/GameConfig/GKYE01.ini @@ -6,5 +6,12 @@ EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] - +[Video_Hacks] +EFBEmulateFormatChanges = True diff --git a/Data/User/GameConfig/GKYJ01.ini b/Data/User/GameConfig/GKYJ01.ini new file mode 100644 index 0000000000..623a0be1e3 --- /dev/null +++ b/Data/User/GameConfig/GKYJ01.ini @@ -0,0 +1,17 @@ +# GKYJ01 - Kirby Air Ride +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 5 +EmulationIssues = +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Hacks] +EFBEmulateFormatChanges = True diff --git a/Data/User/GameConfig/GKYP01.ini b/Data/User/GameConfig/GKYP01.ini index f3bf060e4f..f5366146a0 100644 --- a/Data/User/GameConfig/GKYP01.ini +++ b/Data/User/GameConfig/GKYP01.ini @@ -1,6 +1,17 @@ # GKYP01 - Kirby Air Ride [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 4 +EmulationStateId = 5 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Hacks] +EFBEmulateFormatChanges = True diff --git a/Data/User/GameConfig/GM8E01.ini b/Data/User/GameConfig/GM8E01.ini index 122e83ccfe..0cc96edc53 100644 --- a/Data/User/GameConfig/GM8E01.ini +++ b/Data/User/GameConfig/GM8E01.ini @@ -38,7 +38,6 @@ $Have Wave Beam $Have Plasma Beam 4200183C 00230001 $Have Phazon Beam -01165C8D 08000000 70458245 00000080 087A55A9 000000C5 00458245 0000007C @@ -100,4 +99,3 @@ SafeTextureCacheColorSamples = 512 EFBCopyEnable = True EFBToTextureEnable = False [Video_Enhancements] - diff --git a/Data/User/GameConfig/GQWE69.ini b/Data/User/GameConfig/GQWE69.ini index 4bcef05b38..6fe5409d4f 100644 --- a/Data/User/GameConfig/GQWE69.ini +++ b/Data/User/GameConfig/GQWE69.ini @@ -1,7 +1,16 @@ # GQWE69 - Quidditch World Cup [Core] Values set here will override the main dolphin settings. +TLBHack = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Black screen -EmulationStateId = 1 +EmulationIssues = +EmulationStateId = 4 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GQWJ69.ini b/Data/User/GameConfig/GQWJ69.ini new file mode 100644 index 0000000000..5ab51bb3b7 --- /dev/null +++ b/Data/User/GameConfig/GQWJ69.ini @@ -0,0 +1,16 @@ +# GQWJ69 - Quidditch World Cup +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationIssues = +EmulationStateId = 4 +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GQWP69.ini b/Data/User/GameConfig/GQWP69.ini new file mode 100644 index 0000000000..b380c45e79 --- /dev/null +++ b/Data/User/GameConfig/GQWP69.ini @@ -0,0 +1,16 @@ +# GQWP69 - Quidditch World Cup +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationIssues = +EmulationStateId = 4 +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GQWX69.ini b/Data/User/GameConfig/GQWX69.ini new file mode 100644 index 0000000000..64692b9bc1 --- /dev/null +++ b/Data/User/GameConfig/GQWX69.ini @@ -0,0 +1,16 @@ +# GQWX69 - Quidditch World Cup +[Core] Values set here will override the main dolphin settings. +TLBHack = 1 +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationIssues = +EmulationStateId = 4 +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] diff --git a/Data/User/GameConfig/GUME52.ini b/Data/User/GameConfig/GUME52.ini index 396010c826..f53bfb3282 100644 --- a/Data/User/GameConfig/GUME52.ini +++ b/Data/User/GameConfig/GUME52.ini @@ -2,8 +2,8 @@ [Core] Values set here will override the main dolphin settings. MMU = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Needs MMU to run, it gives a black screen after the intro video though. -EmulationStateId = 2 +EmulationIssues = Needs MMU to run, and it runs slow. +EmulationStateId = 3 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/GUMP52.ini b/Data/User/GameConfig/GUMP52.ini index 4265749160..fc0867e23f 100644 --- a/Data/User/GameConfig/GUMP52.ini +++ b/Data/User/GameConfig/GUMP52.ini @@ -2,8 +2,8 @@ [Core] Values set here will override the main dolphin settings. MMU = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = Needs MMU to run, it gives a black screen after the intro video though. -EmulationStateId = 2 +EmulationIssues = Needs MMU to run, and it runs slow. +EmulationStateId = 3 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/R2GEXJ.ini b/Data/User/GameConfig/R2GEXJ.ini index e23427e158..40208d8153 100644 --- a/Data/User/GameConfig/R2GEXJ.ini +++ b/Data/User/GameConfig/R2GEXJ.ini @@ -1,7 +1,7 @@ # R2GEXJ - FRAGILE DREAMS [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = +EmulationIssues = Minimap needs emulate format changes to work. EmulationStateId = 4 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. @@ -18,3 +18,4 @@ UseXFB = True UseRealXFB = False [Video_Hacks] DlistCachingEnable = False +EFBEmulateFormatChanges = True diff --git a/Data/User/GameConfig/R2GJAF.ini b/Data/User/GameConfig/R2GJAF.ini index d93e14ce7a..ff4a1885cd 100644 --- a/Data/User/GameConfig/R2GJAF.ini +++ b/Data/User/GameConfig/R2GJAF.ini @@ -1,7 +1,7 @@ # R2GJAF - FRAGILE [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = +EmulationIssues = Minimap needs emulate format changes to work. EmulationStateId = 4 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. @@ -16,6 +16,6 @@ PH_ZFar = [Video_Settings] UseXFB = True UseRealXFB = False -[Video_Enhancements] [Video_Hacks] DlistCachingEnable = False +EFBEmulateFormatChanges = True diff --git a/Data/User/GameConfig/R2GP99.ini b/Data/User/GameConfig/R2GP99.ini index 6f2140a5c2..a35a2d475c 100644 --- a/Data/User/GameConfig/R2GP99.ini +++ b/Data/User/GameConfig/R2GP99.ini @@ -1,7 +1,7 @@ # R2GP99 - FRAGILE DREAMS [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationIssues = +EmulationIssues = Minimap needs emulate format changes to work. EmulationStateId = 4 [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. @@ -18,4 +18,4 @@ UseXFB = True UseRealXFB = False [Video_Hacks] DlistCachingEnable = False - +EFBEmulateFormatChanges = True diff --git a/Data/User/GameConfig/R3ME01.ini b/Data/User/GameConfig/R3ME01.ini index 28547c72d7..312d6a15f1 100644 --- a/Data/User/GameConfig/R3ME01.ini +++ b/Data/User/GameConfig/R3ME01.ini @@ -1,10 +1,20 @@ # R3ME01 - Metroid Prime Trilogy [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 1 -EmulationIssues = +EmulationStateId = 4 +EmulationIssues = Disable EuRGB60(PAL60) to avoid a black bar appearing. [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = [Gecko] +[Video_Hacks] +EFBToTextureEnable = False +EFBCopyEnable = True +[Wii] +DisableWiimoteSpeaker = 1 diff --git a/Data/User/GameConfig/R3MP01.ini b/Data/User/GameConfig/R3MP01.ini new file mode 100644 index 0000000000..291ac8df38 --- /dev/null +++ b/Data/User/GameConfig/R3MP01.ini @@ -0,0 +1,20 @@ +# R3MP01 - Metroid Prime Trilogy +[Core] Values set here will override the main dolphin settings. +[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. +EmulationStateId = 4 +EmulationIssues = Disable EuRGB60(PAL60) to avoid a black bar appearing. +[OnFrame] Add memory patches to be applied every frame here. +[ActionReplay] Add action replay cheats here. +[Video] +ProjectionHack = 0 +PH_SZNear = 0 +PH_SZFar = 0 +PH_ExtraParam = 0 +PH_ZNear = +PH_ZFar = +[Gecko] +[Video_Hacks] +EFBToTextureEnable = False +EFBCopyEnable = True +[Wii] +DisableWiimoteSpeaker = 1 diff --git a/Data/User/GameConfig/RBWE01.ini b/Data/User/GameConfig/RBWE01.ini index 60b08e73c4..9e8d586cf4 100644 --- a/Data/User/GameConfig/RBWE01.ini +++ b/Data/User/GameConfig/RBWE01.ini @@ -14,3 +14,5 @@ PH_ZNear = PH_ZFar = [Gecko] [Video_Enhancements] +[Wii] +DisableWiimoteSpeaker = 1 diff --git a/Data/User/GameConfig/RBWJ01.ini b/Data/User/GameConfig/RBWJ01.ini index 8efad9729f..bf95ff65c8 100644 --- a/Data/User/GameConfig/RBWJ01.ini +++ b/Data/User/GameConfig/RBWJ01.ini @@ -14,3 +14,5 @@ PH_ZNear = PH_ZFar = [Gecko] [Video_Enhancements] +[Wii] +DisableWiimoteSpeaker = 1 diff --git a/Data/User/GameConfig/RBWP01.ini b/Data/User/GameConfig/RBWP01.ini index 36b0b3bc98..f6282130a5 100644 --- a/Data/User/GameConfig/RBWP01.ini +++ b/Data/User/GameConfig/RBWP01.ini @@ -14,3 +14,5 @@ PH_ZNear = PH_ZFar = [Gecko] [Video_Enhancements] +[Wii] +DisableWiimoteSpeaker = 1 diff --git a/Data/User/GameConfig/RHDE8P.ini b/Data/User/GameConfig/RHDE8P.ini index 4a2fd1499c..b49ec93cb8 100644 --- a/Data/User/GameConfig/RHDE8P.ini +++ b/Data/User/GameConfig/RHDE8P.ini @@ -1,8 +1,8 @@ # RHDE8P - THE HOUSE OF THE DEAD 2 AND 3 RETURN [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Only Hotd 3 works. XFB is needed for dx9. +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/RHDJ8P.ini b/Data/User/GameConfig/RHDJ8P.ini index 784933d971..63e818f737 100644 --- a/Data/User/GameConfig/RHDJ8P.ini +++ b/Data/User/GameConfig/RHDJ8P.ini @@ -1,8 +1,8 @@ # RHDJ8P - THE HOUSE OF THE DEAD 2 AND 3 RETURN [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Only Hotd 3 works. XFB is needed for dx9. +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/RHDP8P.ini b/Data/User/GameConfig/RHDP8P.ini index f6a1f98430..e932c173fb 100644 --- a/Data/User/GameConfig/RHDP8P.ini +++ b/Data/User/GameConfig/RHDP8P.ini @@ -1,8 +1,8 @@ # RHDP8P - THE HOUSE OF THE DEAD 2 AND 3 RETURN [Core] Values set here will override the main dolphin settings. [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 3 -EmulationIssues = Only Hotd 3 works. XFB is needed for dx9. +EmulationStateId = 4 +EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. [Video] diff --git a/Data/User/GameConfig/SX3J01.ini b/Data/User/GameConfig/SX3J01.ini index c9a05a2493..276118af1a 100644 --- a/Data/User/GameConfig/SX3J01.ini +++ b/Data/User/GameConfig/SX3J01.ini @@ -15,3 +15,5 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCacheColorSamples = 0 +[Wii] +DisableWiimoteSpeaker = 1 diff --git a/Data/User/GameConfig/SX3P01.ini b/Data/User/GameConfig/SX3P01.ini index f75f762001..94b5c6ef16 100644 --- a/Data/User/GameConfig/SX3P01.ini +++ b/Data/User/GameConfig/SX3P01.ini @@ -15,3 +15,5 @@ PH_ZFar = [Gecko] [Video_Settings] SafeTextureCacheColorSamples = 0 +[Wii] +DisableWiimoteSpeaker = 1 diff --git a/Data/User/GameConfig/WZIPTW.ini b/Data/User/GameConfig/WZIPTW.ini index 5fb4a23c18..6e7cce2648 100644 --- a/Data/User/GameConfig/WZIPTW.ini +++ b/Data/User/GameConfig/WZIPTW.ini @@ -1,5 +1,6 @@ # WZIPTW - Rubik's: Rush [Core] Values set here will override the main dolphin settings. +DCBZ = 1 [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. EmulationStateId = 1 EmulationIssues = Requires data cache emulation diff --git a/Source/Core/AudioCommon/Src/aldlist.cpp b/Source/Core/AudioCommon/Src/aldlist.cpp index 5e2e072f7b..fa11fe3282 100644 --- a/Source/Core/AudioCommon/Src/aldlist.cpp +++ b/Source/Core/AudioCommon/Src/aldlist.cpp @@ -146,7 +146,7 @@ ALDeviceList::~ALDeviceList() { for (u32 i = 0; i < vDeviceInfo.size(); i++) { if (vDeviceInfo[i].pvstrExtensions) { - vDeviceInfo[i].pvstrExtensions->empty(); + vDeviceInfo[i].pvstrExtensions->clear(); delete vDeviceInfo[i].pvstrExtensions; } } diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 4120162e5c..edb2d9d484 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -512,12 +512,24 @@ bool DeleteDirRecursively(const std::string &directory) if (IsDirectory(newPath)) { if (!DeleteDirRecursively(newPath)) + { + #ifndef _WIN32 + closedir(dirp); + #endif + return false; + } } else { if (!File::Delete(newPath)) + { + #ifndef _WIN32 + closedir(dirp); + #endif + return false; + } } #ifdef _WIN32 diff --git a/Source/Core/Core/Src/BootManager.cpp b/Source/Core/Core/Src/BootManager.cpp index 50c5756178..b867052381 100644 --- a/Source/Core/Core/Src/BootManager.cpp +++ b/Source/Core/Core/Src/BootManager.cpp @@ -54,7 +54,7 @@ namespace BootManager // Apply fire liberally struct ConfigCache { - bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bMMUBAT, + bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bDCBZOFF, bVBeam, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bDisableWiimoteSpeaker, bHLE_BS2; int iTLBHack, iCPUCore; std::string strBackend; @@ -92,7 +92,7 @@ bool BootCore(const std::string& _rFilename) config_cache.iCPUCore = StartUp.iCPUCore; config_cache.bEnableFPRF = StartUp.bEnableFPRF; config_cache.bMMU = StartUp.bMMU; - config_cache.bMMUBAT = StartUp.bMMUBAT; + config_cache.bDCBZOFF = StartUp.bDCBZOFF; config_cache.iTLBHack = StartUp.iTLBHack; config_cache.bVBeam = StartUp.bVBeam; config_cache.bFastDiscSpeed = StartUp.bFastDiscSpeed; @@ -107,8 +107,8 @@ bool BootCore(const std::string& _rFilename) game_ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle); game_ini.Get("Core", "EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF); game_ini.Get("Core", "MMU", &StartUp.bMMU, StartUp.bMMU); - game_ini.Get("Core", "BAT", &StartUp.bMMUBAT, StartUp.bMMUBAT); game_ini.Get("Core", "TLBHack", &StartUp.iTLBHack, StartUp.iTLBHack); + game_ini.Get("Core", "DCBZ", &StartUp.bDCBZOFF, StartUp.bDCBZOFF); game_ini.Get("Core", "VBeam", &StartUp.bVBeam, StartUp.bVBeam); game_ini.Get("Core", "FastDiscSpeed", &StartUp.bFastDiscSpeed, StartUp.bFastDiscSpeed); game_ini.Get("Core", "BlockMerging", &StartUp.bMergeBlocks, StartUp.bMergeBlocks); @@ -167,7 +167,7 @@ void Stop() StartUp.iCPUCore = config_cache.iCPUCore; StartUp.bEnableFPRF = config_cache.bEnableFPRF; StartUp.bMMU = config_cache.bMMU; - StartUp.bMMUBAT = config_cache.bMMUBAT; + StartUp.bDCBZOFF = config_cache.bDCBZOFF; StartUp.iTLBHack = config_cache.iTLBHack; StartUp.bVBeam = config_cache.bVBeam; StartUp.bFastDiscSpeed = config_cache.bFastDiscSpeed; diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index 6874c1c114..a9f92c62e5 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -408,7 +408,7 @@ void SConfig::LoadSettings() ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.iTLBHack, 0); ini.Get("Core", "VBeam", &m_LocalCoreStartupParameter.bVBeam, false); ini.Get("Core", "FastDiscSpeed", &m_LocalCoreStartupParameter.bFastDiscSpeed, false); - ini.Get("Core", "BAT", &m_LocalCoreStartupParameter.bMMUBAT, false); + ini.Get("Core", "DCBZ", &m_LocalCoreStartupParameter.bDCBZOFF, false); ini.Get("Core", "FrameLimit", &m_Framelimit, 1); // auto frame limit by default ini.Get("Core", "UseFPS", &b_UseFPS, false); // use vps as default diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 2d3d6bd72b..a9e6c87329 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -313,8 +313,6 @@ void CpuThread() g_video_backend->Video_Prepare(); } - Common::SetCurrentThreadAffinity(1); // Force to first core - #if defined(_M_X64) EMM::InstallExceptionHandler(); // Let's run under memory watch #endif @@ -356,8 +354,6 @@ void FifoPlayerThread() Common::SetCurrentThreadName("FIFO-GPU thread"); } - Common::SetCurrentThreadAffinity(1); // Force to first core - g_bStarted = true; // Enter CPU run loop. When we leave it - we are done. @@ -382,13 +378,6 @@ void EmuThread() Common::SetCurrentThreadName("Emuthread - Starting"); - { - if (cpu_info.num_cores > 3) // Force to third, non-HT core - Common::SetCurrentThreadAffinity(4); - else // Force to second core - Common::SetCurrentThreadAffinity(2); - } - DisplayMessage(cpu_info.brand_string, 8000); DisplayMessage(cpu_info.Summarize(), 8000); DisplayMessage(_CoreParameter.m_strFilename, 3000); diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp index 8092f868e8..994501ff0c 100644 --- a/Source/Core/Core/Src/CoreParameter.cpp +++ b/Source/Core/Core/Src/CoreParameter.cpp @@ -49,7 +49,7 @@ SCoreStartupParameter::SCoreStartupParameter() bMergeBlocks(false), bDPL2Decoder(false), iLatency(14), bRunCompareServer(false), bRunCompareClient(false), - bMMU(false), bMMUBAT(false), iTLBHack(0), bVBeam(false), + bMMU(false), bDCBZOFF(false), iTLBHack(0), bVBeam(false), bFastDiscSpeed(false), SelectedLanguage(0), bWii(false), bDisableWiimoteSpeaker(false), bConfirmStop(false), bHideCursor(false), @@ -78,7 +78,7 @@ void SCoreStartupParameter::LoadDefaults() bDSPThread = true; bEnableFPRF = false; bMMU = false; - bMMUBAT = false; + bDCBZOFF = false; iTLBHack = 0; bVBeam = false; bFastDiscSpeed = false; @@ -351,7 +351,11 @@ void SCoreStartupParameter::CheckMemcardPath(std::string& memcardPath, std::stri { // Use default memcard path if there is no user defined name std::string defaultFilename = isSlotA ? GC_MEMCARDA : GC_MEMCARDB; - memcardPath = File::GetUserPath(D_GCUSER_IDX) + defaultFilename + ext; + #ifdef _WIN32 + memcardPath = "." + File::GetUserPath(D_GCUSER_IDX).substr(File::GetExeDirectory().size()) + defaultFilename + ext; + #else + memcardPath = File::GetUserPath(D_GCUSER_IDX) + defaultFilename + ext; + #endif } else { diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h index 776e22e724..8c52ba9521 100644 --- a/Source/Core/Core/Src/CoreParameter.h +++ b/Source/Core/Core/Src/CoreParameter.h @@ -116,7 +116,7 @@ struct SCoreStartupParameter bool bRunCompareClient; bool bMMU; - bool bMMUBAT; + bool bDCBZOFF; int iTLBHack; bool bVBeam; bool bFastDiscSpeed; diff --git a/Source/Core/Core/Src/DSP/DSPAccelerator.cpp b/Source/Core/Core/Src/DSP/DSPAccelerator.cpp index 2058a92f9d..dcb79b7ac5 100644 --- a/Source/Core/Core/Src/DSP/DSPAccelerator.cpp +++ b/Source/Core/Core/Src/DSP/DSPAccelerator.cpp @@ -165,10 +165,11 @@ u16 dsp_read_accelerator() // Somehow, YN1 and YN2 must be initialized with their "loop" values, // so yeah, it seems likely that we should raise an exception to let // the DSP program do that, at least if DSP_FORMAT == 0x0A. - if ((Address & ~0x1f) == (EndAddress & ~0x1f)) + if (Address >= EndAddress) { // Set address back to start address. - Address = (g_dsp.ifx_regs[DSP_ACSAH] << 16) | g_dsp.ifx_regs[DSP_ACSAL]; + if ((Address & ~0x1f) == (EndAddress & ~0x1f)) + Address = (g_dsp.ifx_regs[DSP_ACSAH] << 16) | g_dsp.ifx_regs[DSP_ACSAL]; DSPCore_SetException(EXP_ACCOV); } diff --git a/Source/Core/Core/Src/FifoPlayer/FifoPlayer.cpp b/Source/Core/Core/Src/FifoPlayer/FifoPlayer.cpp index 1873a91574..ff90736fec 100644 --- a/Source/Core/Core/Src/FifoPlayer/FifoPlayer.cpp +++ b/Source/Core/Core/Src/FifoPlayer/FifoPlayer.cpp @@ -20,7 +20,6 @@ #include "Common.h" #include "CoreTiming.h" -#include "Thread.h" #include "HW/GPFifo.h" #include "HW/Memmap.h" @@ -28,7 +27,6 @@ #include "PowerPC/PowerPC.h" #include "BPMemory.h" -#include "CommandProcessor.h" FifoPlayer::~FifoPlayer() { @@ -96,40 +94,7 @@ bool FifoPlayer::Play() if (m_EarlyMemoryUpdates && m_CurrentFrame == m_FrameRangeStart) WriteAllMemoryUpdates(); - // Stop Fifo processing until we've written the new frame - WriteCP(CommandProcessor::CTRL_REGISTER, 0x10); // disable read & breakpoints, enable GP link - - // Write frame data - WriteFrame(m_File->GetFrame(m_CurrentFrame), m_FrameInfo[m_CurrentFrame]); - - // Enable frame processing and break when done - u16 write_ptr_lo = ReadCP(CommandProcessor::FIFO_WRITE_POINTER_LO); - u16 write_ptr_hi = ReadCP(CommandProcessor::FIFO_WRITE_POINTER_HI); - WriteCP(CommandProcessor::FIFO_BP_LO, write_ptr_lo); - WriteCP(CommandProcessor::FIFO_BP_HI, write_ptr_hi); - WriteCP(CommandProcessor::CTRL_REGISTER, 0x13); // enable read, breakpoints & GP link - - // If necessary, wait until GP has reached the breakpoint to prevent fifo overflows - // TODO: Can this be done any better? Dual core mode is slower than single core mode even with these conditions.. - if (m_CurrentFrame < m_FrameRangeEnd) - { - // Check if FIFO would be overflown when writing the next frame - u32 CPRWDistance = (ReadCP(CommandProcessor::FIFO_RW_DISTANCE_HI)<<16) | ReadCP(CommandProcessor::FIFO_RW_DISTANCE_LO); - CPRWDistance += m_File->GetFrame(m_CurrentFrame+1).fifoDataSize + CommandProcessor::GATHER_PIPE_SIZE; - u32 CPFifoBase = (ReadCP(CommandProcessor::FIFO_BASE_HI)<<16) | ReadCP(CommandProcessor::FIFO_BASE_LO); - u32 CPFifoEnd = (ReadCP(CommandProcessor::FIFO_END_HI)<<16) | ReadCP(CommandProcessor::FIFO_END_LO); - - bool bWait = (CPRWDistance > CPFifoEnd - CPFifoBase); - while (bWait && (ReadCP(CommandProcessor::FIFO_READ_POINTER_LO) != write_ptr_lo || - ReadCP(CommandProcessor::FIFO_READ_POINTER_HI) != write_ptr_hi)) - { - Common::YieldCPU(); - CoreTiming::Advance(); // Process scheduled events (esp. PixelEngine::SetFinish!) - - if (PowerPC::GetState() == PowerPC::CPU_POWERDOWN) - break; - } - } + WriteFrame(m_File->GetFrame(m_CurrentFrame), m_FrameInfo[m_CurrentFrame]); ++m_CurrentFrame; } @@ -422,11 +387,6 @@ void FifoPlayer::LoadMemory() FlushWGP(); } -u16 FifoPlayer::ReadCP(u32 address) -{ - return Memory::Read_U16(0xCC000000 | address); -} - void FifoPlayer::WriteCP(u32 address, u16 value) { Memory::Write_U16(value, 0xCC000000 | address); diff --git a/Source/Core/Core/Src/FifoPlayer/FifoPlayer.h b/Source/Core/Core/Src/FifoPlayer/FifoPlayer.h index 838ac13f18..9db6c0d980 100644 --- a/Source/Core/Core/Src/FifoPlayer/FifoPlayer.h +++ b/Source/Core/Core/Src/FifoPlayer/FifoPlayer.h @@ -87,7 +87,6 @@ private: void LoadMemory(); - u16 ReadCP(u32 address); void WriteCP(u32 address, u16 value); void WritePI(u32 address, u32 value); diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h index e39b38b100..349dc7e03b 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h @@ -203,10 +203,12 @@ u16 AcceleratorGetSample() // // On real hardware, this would raise an interrupt that is handled by the // UCode. We simulate what this interrupt does here. - if ((*acc_cur_addr & ~0x1F) == (acc_end_addr & ~0x1F)) + if (*acc_cur_addr >= acc_end_addr) { - // If we are really at the end, loop back to loop_addr. - *acc_cur_addr = acc_loop_addr; + // If we are really at the end (and we don't simply have cur_addr > + // end_addr all the time), loop back to loop_addr. + if ((*acc_cur_addr & ~0x1F) == (acc_end_addr & ~0x1F)) + *acc_cur_addr = acc_loop_addr; if (acc_pb->audio_addr.looping) { diff --git a/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp b/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp index 0d2b375268..92053053de 100644 --- a/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp +++ b/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp @@ -104,26 +104,6 @@ void DSPLLE::dsp_thread(DSPLLE *dsp_lle) { Common::SetCurrentThreadName("DSP thread"); - { - if (cpu_info.num_cores > 3) - { - // HACK (delroth): there is no way to know where hyperthreads are in - // the current Dolphin version. - bool windows = false; -#ifdef _WIN32 - windows = true; -#endif - - u8 core_id; - if (windows && cpu_info.num_cores > 4) // Probably HT - core_id = 5; // 3rd non HT core - else - core_id = 3; // 3rd core - - Common::SetCurrentThreadAffinity(1 << (core_id - 1)); - } - } - while (dsp_lle->m_bIsRunning) { int cycles = (int)dsp_lle->m_cycle_count; diff --git a/Source/Core/Core/Src/HW/EXI.cpp b/Source/Core/Core/Src/HW/EXI.cpp index 8800ea6095..1e86bd1b90 100644 --- a/Source/Core/Core/Src/HW/EXI.cpp +++ b/Source/Core/Core/Src/HW/EXI.cpp @@ -25,6 +25,7 @@ #include "EXI.h" #include "Sram.h" +#include "../Movie.h" SRAM g_SRAM; namespace ExpansionInterface @@ -44,7 +45,12 @@ void Init() for (u32 i = 0; i < NUM_CHANNELS; i++) g_Channels[i] = new CEXIChannel(i); - g_Channels[0]->AddDevice(SConfig::GetInstance().m_EXIDevice[0], 0); // SlotA + if (Movie::IsPlayingInput() && Movie::IsUsingMemcard() && Movie::IsConfigSaved()) + g_Channels[0]->AddDevice(EXIDEVICE_MEMORYCARD, 0); // SlotA + else if(Movie::IsPlayingInput() && !Movie::IsUsingMemcard() && Movie::IsConfigSaved()) + g_Channels[0]->AddDevice(EXIDEVICE_NONE, 0); // SlotA + else + g_Channels[0]->AddDevice(SConfig::GetInstance().m_EXIDevice[0], 0); // SlotA g_Channels[0]->AddDevice(EXIDEVICE_MASKROM, 1); g_Channels[0]->AddDevice(SConfig::GetInstance().m_EXIDevice[2], 2); // Serial Port 1 g_Channels[1]->AddDevice(SConfig::GetInstance().m_EXIDevice[1], 0); // SlotB diff --git a/Source/Core/Core/Src/HW/MemmapFunctions.cpp b/Source/Core/Core/Src/HW/MemmapFunctions.cpp index 1b3a44f5d6..81f2700bdb 100644 --- a/Source/Core/Core/Src/HW/MemmapFunctions.cpp +++ b/Source/Core/Core/Src/HW/MemmapFunctions.cpp @@ -960,7 +960,7 @@ u32 TranslateAddress(const u32 _Address, const XCheckTLBFlag _Flag) // Check MSR[DR] bit before translating data addresses //if (((_Flag == FLAG_READ) || (_Flag == FLAG_WRITE)) && !(MSR & (1 << (31 - 27)))) return _Address; - u32 tlb_addr = Core::g_CoreStartupParameter.bMMUBAT?TranslateBlockAddress(_Address, _Flag):0; + u32 tlb_addr = TranslateBlockAddress(_Address, _Flag); if (tlb_addr == 0) { tlb_addr = TranslatePageAddress(_Address, _Flag); diff --git a/Source/Core/Core/Src/HW/VideoInterface.cpp b/Source/Core/Core/Src/HW/VideoInterface.cpp index cc2ce18ce0..95c06d1f88 100644 --- a/Source/Core/Core/Src/HW/VideoInterface.cpp +++ b/Source/Core/Core/Src/HW/VideoInterface.cpp @@ -144,8 +144,8 @@ void Preset(bool _bNTSC) m_HorizontalStepping.FbSteps = 40; m_HorizontalStepping.FieldSteps = 40; - m_HBeamPos = 1; - m_VBeamPos = 1; + m_HBeamPos = 0; + m_VBeamPos = 0; // 54MHz, capable of progressive scan m_Clock = Core::g_CoreStartupParameter.bProgressive; diff --git a/Source/Core/Core/Src/HW/WiimoteEmu/Attachment/Turntable.cpp b/Source/Core/Core/Src/HW/WiimoteEmu/Attachment/Turntable.cpp index 292d9c5a86..182170f501 100644 --- a/Source/Core/Core/Src/HW/WiimoteEmu/Attachment/Turntable.cpp +++ b/Source/Core/Core/Src/HW/WiimoteEmu/Attachment/Turntable.cpp @@ -97,8 +97,9 @@ void Turntable::GetState(u8* const data, const bool focus) // crossfade slider { - u8 cfs = 0; - m_crossfade->GetState(&cfs, 8, 7); + s8 cfs = 0; + m_crossfade->GetState(&cfs, focus ? 7 : 0); + cfs += 8; ttdata->slider = cfs; } diff --git a/Source/Core/Core/Src/HW/WiimoteEmu/WiimoteEmu.cpp b/Source/Core/Core/Src/HW/WiimoteEmu/WiimoteEmu.cpp index 61996d8e7c..6fe6b81613 100644 --- a/Source/Core/Core/Src/HW/WiimoteEmu/WiimoteEmu.cpp +++ b/Source/Core/Core/Src/HW/WiimoteEmu/WiimoteEmu.cpp @@ -41,6 +41,13 @@ inline double round(double x) { return (x-floor(x))>0.5 ? ceil(x) : floor(x); } #include "../../Movie.h" +namespace +{ +// :) +auto const TAU = 6.28318530717958647692; +auto const PI = TAU / 2.0; +} + namespace WiimoteEmu { @@ -124,7 +131,8 @@ void EmulateTilt(AccelData* const accel , const bool focus, const bool sideways, const bool upright) { float roll, pitch; - tilt_group->GetState( &roll, &pitch, 0, focus ? (PI / 2) : 0 ); // 90 degrees + // 180 degrees + tilt_group->GetState(&roll, &pitch, 0, focus ? PI : 0); unsigned int ud = 0, lr = 0, fb = 0; @@ -267,6 +275,9 @@ Wiimote::Wiimote( const unsigned int index ) for (unsigned int i=0; i < sizeof(named_buttons)/sizeof(*named_buttons); ++i) m_buttons->controls.push_back(new ControlGroup::Input( named_buttons[i])); + // udp + groups.push_back(m_udp = new UDPWrapper(m_index, _trans("UDP Wiimote"))); + // ir groups.push_back(m_ir = new Cursor(_trans("IR"))); @@ -276,9 +287,6 @@ Wiimote::Wiimote( const unsigned int index ) // tilt groups.push_back(m_tilt = new Tilt(_trans("Tilt"))); - // udp - groups.push_back(m_udp = new UDPWrapper(m_index, _trans("UDP Wiimote"))); - // shake groups.push_back(m_shake = new Buttons(_trans("Shake"))); m_shake->controls.push_back(new ControlGroup::Input("X")); diff --git a/Source/Core/Core/Src/HW/WiimoteEmu/WiimoteEmu.h b/Source/Core/Core/Src/HW/WiimoteEmu/WiimoteEmu.h index 2a773d8978..36f0da406b 100644 --- a/Source/Core/Core/Src/HW/WiimoteEmu/WiimoteEmu.h +++ b/Source/Core/Core/Src/HW/WiimoteEmu/WiimoteEmu.h @@ -30,13 +30,6 @@ #include #include -namespace -{ -// :) -auto const TAU = 6.28318530717958647692; -auto const PI = TAU / 2.0; -} - // Registry sizes #define WIIMOTE_EEPROM_SIZE (16*1024) #define WIIMOTE_EEPROM_FREE_SIZE 0x1700 diff --git a/Source/Core/Core/Src/Movie.cpp b/Source/Core/Core/Src/Movie.cpp index 316181d449..6c646f6870 100644 --- a/Source/Core/Core/Src/Movie.cpp +++ b/Source/Core/Core/Src/Movie.cpp @@ -736,16 +736,6 @@ bool PlayInput(const char *filename) goto cleanup; } - // Load savestate (and skip to frame data) - if(tmpHeader.bFromSaveState) - { - const std::string stateFilename = std::string(filename) + ".sav"; - if(File::Exists(stateFilename)) - Core::SetStateFileName(stateFilename); - g_bRecordingFromSaveState = true; - Movie::LoadInput(filename); - } - ReadHeader(); g_totalFrames = tmpHeader.frameCount; g_totalLagCount = tmpHeader.lagCount; @@ -762,6 +752,16 @@ bool PlayInput(const char *filename) g_currentByte = 0; g_recordfd.Close(); + // Load savestate (and skip to frame data) + if(tmpHeader.bFromSaveState) + { + const std::string stateFilename = std::string(filename) + ".sav"; + if(File::Exists(stateFilename)) + Core::SetStateFileName(stateFilename); + g_bRecordingFromSaveState = true; + Movie::LoadInput(filename); + } + return true; cleanup: @@ -786,7 +786,13 @@ void DoState(PointerWrap &p) void LoadInput(const char *filename) { - File::IOFile t_record(filename, "r+b"); + File::IOFile t_record; + if (!t_record.Open(filename, "r+b")) + { + PanicAlertT("Failed to read %s", filename); + EndPlayInput(false); + return; + } t_record.ReadArray(&tmpHeader, 1); @@ -849,7 +855,7 @@ void LoadInput(const char *filename) { // this is a "you did something wrong" alert for the user's benefit. // we'll try to say what's going on in excruciating detail, otherwise the user might not believe us. - if(Core::g_CoreStartupParameter.bWii) + if(IsUsingWiimote(0)) { // TODO: more detail PanicAlertT("Warning: You loaded a save whose movie mismatches on byte %d (0x%X). You should load another save before continuing, or load this state with read-only mode off. Otherwise you'll probably get a desync.", i+256, i+256); @@ -925,18 +931,6 @@ void PlayController(SPADStatus *PadStatus, int controllerID) if (!IsPlayingInput() || !IsUsingPad(controllerID) || tmpInput == NULL) return; - if (g_currentFrame == 1) - { - if (tmpHeader.bMemcard) - { - ExpansionInterface::ChangeDevice(0, EXIDEVICE_MEMORYCARD, 0); - } - else if (!tmpHeader.bMemcard) - { - ExpansionInterface::ChangeDevice(0, EXIDEVICE_NONE, 0); - } - } - if (g_currentByte + 8 > g_totalBytes) { PanicAlertT("Premature movie end in PlayController. %u + 8 > %u", (u32)g_currentByte, (u32)g_totalBytes); @@ -1194,9 +1188,13 @@ void GetSettings() g_bClearSave = !File::Exists(SConfig::GetInstance().m_strMemoryCardA); bMemcard = SConfig::GetInstance().m_EXIDevice[0] == EXIDEVICE_MEMORYCARD; - std::stringstream ss; - ss << std::hex << SCM_REV_STR; - ss >> revision; + int temp; + + for(int i = 0; i < 4; ++i ) + { + sscanf(SCM_REV_STR + 2 * i, "%2x", &temp ); + revision[i] = temp; + } } void CheckMD5() diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp index bc5cfc10e6..5e665eb38e 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp @@ -407,7 +407,7 @@ void Interpreter::dcbtst(UGeckoInstruction _inst) void Interpreter::dcbz(UGeckoInstruction _inst) { // HACK but works... we think - if (HID2.WPE || !HID0.DCFA) + if (!Core::g_CoreStartupParameter.bDCBZOFF) Memory::Memset(Helper_Get_EA_X(_inst) & (~31), 0, 32); if (!jit) PowerPC::CheckExceptions(); diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp index 9337f87b77..3042cfedba 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp @@ -90,6 +90,13 @@ const u8 *TrampolineCache::GetReadTrampoline(const InstructionInfo &info) case 4: CALL(thunks.ProtectFunction((void *)&Memory::Read_U32, 1)); break; + case 2: + CALL(thunks.ProtectFunction((void *)&Memory::Read_U16, 1)); + SHL(32, R(EAX), Imm8(16)); + break; + case 1: + CALL(thunks.ProtectFunction((void *)&Memory::Read_U8, 1)); + break; } ABI_PopAllCallerSavedRegsAndAdjustStack(); if (dataReg != EAX) { @@ -176,10 +183,6 @@ const u8 *JitBase::BackPatch(u8 *codePtr, int accessType, u32 emAddress, void *c codePtr, emAddress); }*/ - if (info.operandSize != 4) { - BackPatchError(StringFromFormat("BackPatch - no support for operand size %i", info.operandSize), codePtr, emAddress); - } - if (info.otherReg != RBX) PanicAlert("BackPatch : Base reg not RBX." "\n\nAttempted to access %08x.", emAddress); @@ -188,7 +191,6 @@ const u8 *JitBase::BackPatch(u8 *codePtr, int accessType, u32 emAddress, void *c PanicAlert("BackPatch : Currently only supporting reads." "\n\nAttempted to write to %08x.", emAddress); - // In the first iteration, we assume that all accesses are 32-bit. We also only deal with reads. if (accessType == 0) { XEmitter emitter(codePtr); diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp index 4cfc3ab934..cc1327c695 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp @@ -96,7 +96,11 @@ void EmuCodeBlock::UnsafeLoadToEAX(const Gen::OpArg & opAddress, int accessSize, MOVZX(32, accessSize, EAX, MDisp(EAX, (u32)Memory::base + offset)); } #endif - + + // Add a 2 bytes NOP to have some space for the backpatching + if (accessSize == 8) + NOP(2); + if (accessSize == 32) { BSWAP(32, EAX); @@ -120,12 +124,11 @@ void EmuCodeBlock::SafeLoadToEAX(const Gen::OpArg & opAddress, int accessSize, s { #if defined(_M_X64) #ifdef ENABLE_MEM_CHECK - if (accessSize == 32 && !Core::g_CoreStartupParameter.bMMU && !Core::g_CoreStartupParameter.bEnableDebugging) + if (!Core::g_CoreStartupParameter.bMMU && !Core::g_CoreStartupParameter.bEnableDebugging) #else - if (accessSize == 32 && !Core::g_CoreStartupParameter.bMMU) + if (!Core::g_CoreStartupParameter.bMMU) #endif { - // BackPatch only supports 32-bits accesses UnsafeLoadToEAX(opAddress, accessSize, offset, signExtend); } else diff --git a/Source/Core/DiscIO/Src/Volume.h b/Source/Core/DiscIO/Src/Volume.h index c90ee4a381..557c71c31f 100644 --- a/Source/Core/DiscIO/Src/Volume.h +++ b/Source/Core/DiscIO/Src/Volume.h @@ -43,6 +43,7 @@ public: virtual std::string GetApploaderDate() const = 0; virtual bool SupportsIntegrityCheck() const { return false; } virtual bool CheckIntegrity() const { return false; } + virtual bool IsDiscTwo() const { return false; } enum ECountry { diff --git a/Source/Core/DiscIO/Src/VolumeGC.cpp b/Source/Core/DiscIO/Src/VolumeGC.cpp index 51fac285fc..09e2c5eaa9 100644 --- a/Source/Core/DiscIO/Src/VolumeGC.cpp +++ b/Source/Core/DiscIO/Src/VolumeGC.cpp @@ -137,4 +137,11 @@ u64 CVolumeGC::GetSize() const return 0; } +bool CVolumeGC::IsDiscTwo() const +{ + bool discTwo; + Read(6,1, (u8*) &discTwo); + return discTwo; +} + } // namespace diff --git a/Source/Core/DiscIO/Src/VolumeGC.h b/Source/Core/DiscIO/Src/VolumeGC.h index 5fd18ea96a..4221df9493 100644 --- a/Source/Core/DiscIO/Src/VolumeGC.h +++ b/Source/Core/DiscIO/Src/VolumeGC.h @@ -39,6 +39,7 @@ public: std::string GetApploaderDate() const; ECountry GetCountry() const; u64 GetSize() const; + bool IsDiscTwo() const; private: IBlobReader* m_pReader; diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index 423885e0f2..4daf263b63 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -1064,6 +1064,13 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA) return; } } + #ifdef _WIN32 + if (!strncmp(File::GetExeDirectory().c_str(), filename.c_str(), File::GetExeDirectory().size())) + { + filename.erase(0, File::GetExeDirectory().size() +1); + filename = "./" + filename; + } + #endif // also check that the path isn't used for the other memcard... if (filename.compare(isSlotA ? SConfig::GetInstance().m_strMemoryCardB diff --git a/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp b/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp index 30ff4a31cf..cf68c0baa4 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp +++ b/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp @@ -18,6 +18,7 @@ #include "VideoConfig.h" #include "Host.h" #include "RenderBase.h" +#include "ConfigManager.h" #include "VertexShaderManager.h" #include "../GLInterface.h" @@ -90,13 +91,6 @@ bool cInterfaceAGL::Create(void *&window_handle) } bool cInterfaceAGL::MakeCurrent() -{ - [GLWin.cocoaCtx makeCurrentContext]; - return true; -} - -// Update window width, size and etc. Called from Render.cpp -void cInterfaceAGL::Update() { int width, height; @@ -110,6 +104,7 @@ void cInterfaceAGL::Update() [GLWin.cocoaCtx makeCurrentContext]; s_backbuffer_width = width; s_backbuffer_height = height; + return true; } // Close backend diff --git a/Source/Core/DolphinWX/Src/GLInterface/EGL.cpp b/Source/Core/DolphinWX/Src/GLInterface/EGL.cpp index b8716ab467..304eb92059 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/EGL.cpp +++ b/Source/Core/DolphinWX/Src/GLInterface/EGL.cpp @@ -26,6 +26,12 @@ void cInterfaceEGL::UpdateFPSDisplay(const char *text) { XStoreName(GLWin.dpy, GLWin.win, text); } + +void cInterfaceEGL::SwapInterval(int Interval) +{ + eglSwapInterval(GLWin.egl_dpy, Interval); +} + void cInterfaceEGL::Swap() { eglSwapBuffers(GLWin.egl_dpy, GLWin.egl_surf); @@ -42,38 +48,30 @@ bool cInterfaceEGL::Create(void *&window_handle) s_backbuffer_width = _twidth; s_backbuffer_height = _theight; - const char *s; - EGLint egl_major, egl_minor; + EGLint egl_major, egl_minor; - GLWin.dpy = XOpenDisplay(NULL); + GLWin.dpy = XOpenDisplay(NULL); - if (!GLWin.dpy) { - printf("Error: couldn't open display\n"); - return false; - } + if (!GLWin.dpy) { + ERROR_LOG(VIDEO, "Error: couldn't open display\n"); + return false; + } - GLWin.egl_dpy = eglGetDisplay(GLWin.dpy); - if (!GLWin.egl_dpy) { - printf("Error: eglGetDisplay() failed\n"); - return false; - } + GLWin.egl_dpy = eglGetDisplay(GLWin.dpy); + if (!GLWin.egl_dpy) { + ERROR_LOG(VIDEO, "Error: eglGetDisplay() failed\n"); + return false; + } - if (!eglInitialize(GLWin.egl_dpy, &egl_major, &egl_minor)) { - printf("Error: eglInitialize() failed\n"); - return false; - } + if (!eglInitialize(GLWin.egl_dpy, &egl_major, &egl_minor)) { + ERROR_LOG(VIDEO, "Error: eglInitialize() failed\n"); + return false; + } - s = eglQueryString(GLWin.egl_dpy, EGL_VERSION); - printf("EGL_VERSION = %s\n", s); - - s = eglQueryString(GLWin.egl_dpy, EGL_VENDOR); - printf("EGL_VENDOR = %s\n", s); - - s = eglQueryString(GLWin.egl_dpy, EGL_EXTENSIONS); - printf("EGL_EXTENSIONS = %s\n", s); - - s = eglQueryString(GLWin.egl_dpy, EGL_CLIENT_APIS); - printf("EGL_CLIENT_APIS = %s\n", s); + INFO_LOG(VIDEO, "EGL_VERSION = %s\n", eglQueryString(GLWin.egl_dpy, EGL_VERSION)); + INFO_LOG(VIDEO, "EGL_VENDOR = %s\n", eglQueryString(GLWin.egl_dpy, EGL_VENDOR)); + INFO_LOG(VIDEO, "EGL_EXTENSIONS = %s\n", eglQueryString(GLWin.egl_dpy, EGL_EXTENSIONS)); + INFO_LOG(VIDEO, "EGL_CLIENT_APIS = %s\n", eglQueryString(GLWin.egl_dpy, EGL_CLIENT_APIS)); // attributes for a visual in RGBA format with at least // 8 bits per color and a 24 bit depth buffer @@ -102,29 +100,29 @@ bool cInterfaceEGL::Create(void *&window_handle) if (GLWin.parent == 0) GLWin.parent = RootWindow(GLWin.dpy, GLWin.screen); - XVisualInfo visTemplate; - int num_visuals; - EGLConfig config; - EGLint num_configs; - EGLint vid; + XVisualInfo visTemplate; + int num_visuals; + EGLConfig config; + EGLint num_configs; + EGLint vid; - if (!eglChooseConfig( GLWin.egl_dpy, attribs, &config, 1, &num_configs)) { - printf("Error: couldn't get an EGL visual config\n"); - exit(1); - } + if (!eglChooseConfig( GLWin.egl_dpy, attribs, &config, 1, &num_configs)) { + ERROR_LOG(VIDEO, "Error: couldn't get an EGL visual config\n"); + return false; + } - if (!eglGetConfigAttrib(GLWin.egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) { - printf("Error: eglGetConfigAttrib() failed\n"); - exit(1); - } + if (!eglGetConfigAttrib(GLWin.egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) { + ERROR_LOG(VIDEO, "Error: eglGetConfigAttrib() failed\n"); + return false; + } - /* The X window visual must match the EGL config */ - visTemplate.visualid = vid; - GLWin.vi = XGetVisualInfo(GLWin.dpy, VisualIDMask, &visTemplate, &num_visuals); - if (!GLWin.vi) { - printf("Error: couldn't get X visual\n"); - exit(1); - } + /* The X window visual must match the EGL config */ + visTemplate.visualid = vid; + GLWin.vi = XGetVisualInfo(GLWin.dpy, VisualIDMask, &visTemplate, &num_visuals); + if (!GLWin.vi) { + ERROR_LOG(VIDEO, "Error: couldn't get X visual\n"); + return false; + } GLWin.x = _tx; GLWin.y = _ty; @@ -138,33 +136,26 @@ bool cInterfaceEGL::Create(void *&window_handle) eglBindAPI(EGL_OPENGL_API); #endif GLWin.egl_ctx = eglCreateContext(GLWin.egl_dpy, config, EGL_NO_CONTEXT, ctx_attribs ); - if (!GLWin.egl_ctx) { - printf("Error: eglCreateContext failed\n"); - exit(1); - } + if (!GLWin.egl_ctx) { + ERROR_LOG(VIDEO, "Error: eglCreateContext failed\n"); + return false; + } - GLWin.egl_surf = eglCreateWindowSurface(GLWin.egl_dpy, config, GLWin.win, NULL); - if (!GLWin.egl_surf) { - printf("Error: eglCreateWindowSurface failed\n"); - exit(1); - } + GLWin.egl_surf = eglCreateWindowSurface(GLWin.egl_dpy, config, GLWin.win, NULL); + if (!GLWin.egl_surf) { + ERROR_LOG(VIDEO, "Error: eglCreateWindowSurface failed\n"); + return false; + } - if (!eglMakeCurrent(GLWin.egl_dpy, GLWin.egl_surf, GLWin.egl_surf, GLWin.egl_ctx)) { - - printf("Error: eglMakeCurrent() failed\n"); - return false; - } + if (!eglMakeCurrent(GLWin.egl_dpy, GLWin.egl_surf, GLWin.egl_surf, GLWin.egl_ctx)) { + ERROR_LOG(VIDEO, "Error: eglMakeCurrent() failed\n"); + return false; + } - - printf("GL_VENDOR: %s\n", glGetString(GL_VENDOR)); - printf("GL_RENDERER: %s\n", glGetString(GL_RENDERER)); - printf("GL_VERSION: %s\n", glGetString(GL_VERSION)); - printf("GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS)); - /* Set initial projection/viewing transformation. - * We can't be sure we'll get a ConfigureNotify event when the window - * first appears. - */ - glViewport(0, 0, (GLint) _twidth, (GLint) _theight); + INFO_LOG(VIDEO, "GL_VENDOR: %s\n", glGetString(GL_VENDOR)); + INFO_LOG(VIDEO, "GL_RENDERER: %s\n", glGetString(GL_RENDERER)); + INFO_LOG(VIDEO, "GL_VERSION: %s\n", glGetString(GL_VERSION)); + INFO_LOG(VIDEO, "GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS)); window_handle = (void *)GLWin.win; return true; } diff --git a/Source/Core/DolphinWX/Src/GLInterface/EGL.h b/Source/Core/DolphinWX/Src/GLInterface/EGL.h index c4b6a00b6c..fe127fe0ba 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/EGL.h +++ b/Source/Core/DolphinWX/Src/GLInterface/EGL.h @@ -34,6 +34,7 @@ private: cX11Window XWindow; public: friend class cX11Window; + void SwapInterval(int Interval); void Swap(); void UpdateFPSDisplay(const char *Text); bool Create(void *&window_handle); diff --git a/Source/Core/DolphinWX/Src/GLInterface/GLX.cpp b/Source/Core/DolphinWX/Src/GLInterface/GLX.cpp index ef60873531..5745823cbf 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/GLX.cpp +++ b/Source/Core/DolphinWX/Src/GLInterface/GLX.cpp @@ -27,6 +27,15 @@ void cInterfaceGLX::UpdateFPSDisplay(const char *text) { XStoreName(GLWin.dpy, GLWin.win, text); } + +void cInterfaceGLX::SwapInterval(int Interval) +{ + if (glXSwapIntervalSGI) + glXSwapIntervalSGI(Interval); + else + ERROR_LOG(VIDEO, "No support for SwapInterval (framerate clamped to monitor refresh rate)."); +} + void cInterfaceGLX::Swap() { glXSwapBuffers(GLWin.dpy, GLWin.win); diff --git a/Source/Core/DolphinWX/Src/GLInterface/GLX.h b/Source/Core/DolphinWX/Src/GLInterface/GLX.h index 73a6690ec5..83bb14a507 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/GLX.h +++ b/Source/Core/DolphinWX/Src/GLInterface/GLX.h @@ -31,6 +31,7 @@ private: cX11Window XWindow; public: friend class cX11Window; + void SwapInterval(int Interval); void Swap(); void UpdateFPSDisplay(const char *Text); bool Create(void *&window_handle); diff --git a/Source/Core/DolphinWX/Src/GLInterface/InterfaceBase.h b/Source/Core/DolphinWX/Src/GLInterface/InterfaceBase.h index 3e4f10fcd4..c2d1ffc54b 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/InterfaceBase.h +++ b/Source/Core/DolphinWX/Src/GLInterface/InterfaceBase.h @@ -29,6 +29,7 @@ public: virtual bool MakeCurrent() = 0; virtual void Shutdown() = 0; + virtual void SwapInterval(int Interval) { } virtual u32 GetBackBufferWidth() { return s_backbuffer_width; } virtual u32 GetBackBufferHeight() { return s_backbuffer_height; } virtual void SetBackBufferDimensions(u32 W, u32 H) {s_backbuffer_width = W; s_backbuffer_height = H; } diff --git a/Source/Core/DolphinWX/Src/GLInterface/WGL.cpp b/Source/Core/DolphinWX/Src/GLInterface/WGL.cpp index c97cb48bdf..ce1bb3d946 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/WGL.cpp +++ b/Source/Core/DolphinWX/Src/GLInterface/WGL.cpp @@ -27,6 +27,13 @@ static HDC hDC = NULL; // Private GDI Device Context static HGLRC hRC = NULL; // Permanent Rendering Context +void cInterfaceWGL::SwapInterval(int Interval) +{ + if (WGLEW_EXT_swap_control) + wglSwapIntervalEXT(Interval); + else + ERROR_LOG(VIDEO, "No support for SwapInterval (framerate clamped to monitor refresh rate)."); +} void cInterfaceWGL::Swap() { SwapBuffers(hDC); diff --git a/Source/Core/DolphinWX/Src/GLInterface/WGL.h b/Source/Core/DolphinWX/Src/GLInterface/WGL.h index 184ddd475f..18b8b2afb0 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/WGL.h +++ b/Source/Core/DolphinWX/Src/GLInterface/WGL.h @@ -28,6 +28,7 @@ class cInterfaceWGL : public cInterfaceBase { public: + void SwapInterval(int Interval); void Swap(); void UpdateFPSDisplay(const char *Text); bool Create(void *&window_handle); diff --git a/Source/Core/DolphinWX/Src/GLInterface/WX.cpp b/Source/Core/DolphinWX/Src/GLInterface/WX.cpp index d5415c8ed9..16de6369a7 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/WX.cpp +++ b/Source/Core/DolphinWX/Src/GLInterface/WX.cpp @@ -23,6 +23,19 @@ #include "../GLInterface.h" #include "WX.h" +void cInterfaceWX::SwapInterval(int Interval) +{ + // WX interface only used on Apple +#ifdef __APPLE__ +#if defined USE_WX && USE_WX + NSOpenGLContext *ctx = GLWin.glCtxt->GetWXGLContext(); +#else + NSOpenGLContext *ctx = GLWin.cocoaCtx; +#endif + [ctx setValues: &Interval forParameter: NSOpenGLCPSwapInterval]; +#endif +} + void cInterfaceWX::Swap() { GLWin.glCanvas->SwapBuffers(); diff --git a/Source/Core/DolphinWX/Src/GLInterface/WX.h b/Source/Core/DolphinWX/Src/GLInterface/WX.h index 7772f864e5..82304942ea 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/WX.h +++ b/Source/Core/DolphinWX/Src/GLInterface/WX.h @@ -35,6 +35,7 @@ class cInterfaceWX : public cInterfaceBase { public: + void SwapInterval(int Interval); void Swap(); void UpdateFPSDisplay(const char *Text); bool Create(void *&window_handle); diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 2312d6afa3..51b5bb2554 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -94,6 +94,13 @@ static int CompareGameListItems(const GameListItem* iso1, const GameListItem* is switch(sortData) { case CGameListCtrl::COLUMN_TITLE: + if (!strcasecmp(iso1->GetName(indexOne).c_str(),iso2->GetName(indexOther).c_str())) + { + if (iso1->IsDiscTwo()) + return 1 * t; + else if (iso2->IsDiscTwo()) + return -1 * t; + } return strcasecmp(iso1->GetName(indexOne).c_str(), iso2->GetName(indexOther).c_str()) * t; case CGameListCtrl::COLUMN_NOTES: diff --git a/Source/Core/DolphinWX/Src/ISOFile.cpp b/Source/Core/DolphinWX/Src/ISOFile.cpp index 2d4b202272..1e4164b7aa 100644 --- a/Source/Core/DolphinWX/Src/ISOFile.cpp +++ b/Source/Core/DolphinWX/Src/ISOFile.cpp @@ -36,7 +36,7 @@ #include "ChunkFile.h" #include "../resources/no_banner.cpp" -#define CACHE_REVISION 0x10E +#define CACHE_REVISION 0x10F #define DVD_BANNER_WIDTH 96 #define DVD_BANNER_HEIGHT 32 @@ -91,6 +91,7 @@ GameListItem::GameListItem(const std::string& _rFileName) m_UniqueID = pVolume->GetUniqueID(); m_BlobCompressed = DiscIO::IsCompressedBlob(_rFileName.c_str()); + m_IsDiscTwo = pVolume->IsDiscTwo(); // check if we can get some infos from the banner file too DiscIO::IFileSystem* pFileSystem = DiscIO::CreateFileSystem(pVolume); @@ -235,6 +236,7 @@ void GameListItem::DoState(PointerWrap &p) p.Do(m_BlobCompressed); p.Do(m_pImage); p.Do(m_Platform); + p.Do(m_IsDiscTwo); } std::string GameListItem::CreateCacheFilename() diff --git a/Source/Core/DolphinWX/Src/ISOFile.h b/Source/Core/DolphinWX/Src/ISOFile.h index fe7d3d6c6c..e58dcf7713 100644 --- a/Source/Core/DolphinWX/Src/ISOFile.h +++ b/Source/Core/DolphinWX/Src/ISOFile.h @@ -48,6 +48,7 @@ public: bool IsCompressed() const {return m_BlobCompressed;} u64 GetFileSize() const {return m_FileSize;} u64 GetVolumeSize() const {return m_VolumeSize;} + bool IsDiscTwo() const {return m_IsDiscTwo;} #if defined(HAVE_WX) && HAVE_WX const wxImage& GetImage() const {return m_Image;} #endif @@ -87,6 +88,7 @@ private: bool m_BlobCompressed; std::vector m_pImage; u32 m_ImageSize; + bool m_IsDiscTwo; bool LoadFromCache(); void SaveToCache(); diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index f06b3daa8a..6a673b95d1 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -315,10 +315,10 @@ void CISOProperties::CreateGUIControls(bool IsWad) SkipIdle = new wxCheckBox(m_GameConfig, ID_IDLESKIP, _("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); MMU = new wxCheckBox(m_GameConfig, ID_MMU, _("Enable MMU"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); MMU->SetToolTip(_("Enables the Memory Management Unit, needed for some games. (ON = Compatible, OFF = Fast)")); - MMUBAT = new wxCheckBox(m_GameConfig, ID_MMUBAT, _("Enable BAT"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); - MMUBAT->SetToolTip(_("Enables Block Address Translation (BAT); a function of the Memory Management Unit. Accurate to the hardware, but slow to emulate. (ON = Compatible, OFF = Fast)")); TLBHack = new wxCheckBox(m_GameConfig, ID_TLBHACK, _("MMU Speed Hack"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); TLBHack->SetToolTip(_("Fast version of the MMU. Does not work for every game.")); + DCBZOFF = new wxCheckBox(m_GameConfig, ID_DCBZOFF, _("Skip DCBZ clearing"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); + DCBZOFF->SetToolTip(_("Bypass the clearing of the data cache by the DCBZ instruction. Usually leave this option disabled.")); VBeam = new wxCheckBox(m_GameConfig, ID_VBEAM, _("Accurate VBeam emulation"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); VBeam->SetToolTip(_("If the FPS is erratic, this option may help. (ON = Compatible, OFF = Fast)")); FastDiscSpeed = new wxCheckBox(m_GameConfig, ID_DISCSPEED, _("Speed up Disc Transfer Rate"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); @@ -364,7 +364,7 @@ void CISOProperties::CreateGUIControls(bool IsWad) sbCoreOverrides->Add(CPUThread, 0, wxLEFT, 5); sbCoreOverrides->Add(SkipIdle, 0, wxLEFT, 5); sbCoreOverrides->Add(MMU, 0, wxLEFT, 5); - sbCoreOverrides->Add(MMUBAT, 0, wxLEFT, 5); + sbCoreOverrides->Add(DCBZOFF, 0, wxLEFT, 5); sbCoreOverrides->Add(TLBHack, 0, wxLEFT, 5); sbCoreOverrides->Add(VBeam, 0, wxLEFT, 5); sbCoreOverrides->Add(FastDiscSpeed, 0, wxLEFT, 5); @@ -930,16 +930,16 @@ void CISOProperties::LoadGameConfig() else MMU->Set3StateValue(wxCHK_UNDETERMINED); - if (GameIni.Get("Core", "BAT", &bTemp)) - MMUBAT->Set3StateValue((wxCheckBoxState)bTemp); - else - MMUBAT->Set3StateValue(wxCHK_UNDETERMINED); - if (GameIni.Get("Core", "TLBHack", &bTemp)) TLBHack->Set3StateValue((wxCheckBoxState)bTemp); else TLBHack->Set3StateValue(wxCHK_UNDETERMINED); + if (GameIni.Get("Core", "DCBZ", &bTemp)) + DCBZOFF->Set3StateValue((wxCheckBoxState)bTemp); + else + DCBZOFF->Set3StateValue(wxCHK_UNDETERMINED); + if (GameIni.Get("Core", "VBeam", &bTemp)) VBeam->Set3StateValue((wxCheckBoxState)bTemp); else @@ -999,7 +999,6 @@ void CISOProperties::LoadGameConfig() if (!sTemp.empty()) { EmuIssues->SetValue(wxString(sTemp.c_str(), *wxConvCurrent)); - bRefreshList = true; } EmuIssues->Enable(EmuState->GetSelection() != 0); @@ -1025,16 +1024,16 @@ bool CISOProperties::SaveGameConfig() else GameIni.Set("Core", "MMU", MMU->Get3StateValue()); - if (MMUBAT->Get3StateValue() == wxCHK_UNDETERMINED) - GameIni.DeleteKey("Core", "BAT"); - else - GameIni.Set("Core", "BAT", MMUBAT->Get3StateValue()); - if (TLBHack->Get3StateValue() == wxCHK_UNDETERMINED) GameIni.DeleteKey("Core", "TLBHack"); else GameIni.Set("Core", "TLBHack", TLBHack->Get3StateValue()); + if (DCBZOFF->Get3StateValue() == wxCHK_UNDETERMINED) + GameIni.DeleteKey("Core", "DCBZ"); + else + GameIni.Set("Core", "DCBZ", DCBZOFF->Get3StateValue()); + if (VBeam->Get3StateValue() == wxCHK_UNDETERMINED) GameIni.DeleteKey("Core", "VBeam"); else @@ -1085,6 +1084,11 @@ bool CISOProperties::SaveGameConfig() GameIni.Set("Video", "PH_ZFar", PHack_Data.PHZFar); GameIni.Set("EmuState", "EmulationStateId", EmuState->GetSelection()); + + std::string sTemp; + GameIni.Get("EmuState","EmulationIssues", &sTemp); + if (EmuIssues->GetValue() != sTemp) + bRefreshList = true; GameIni.Set("EmuState", "EmulationIssues", (const char*)EmuIssues->GetValue().mb_str(*wxConvCurrent)); PatchList_Save(); diff --git a/Source/Core/DolphinWX/Src/ISOProperties.h b/Source/Core/DolphinWX/Src/ISOProperties.h index 9d71e675e2..4f03130ba7 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.h +++ b/Source/Core/DolphinWX/Src/ISOProperties.h @@ -69,7 +69,7 @@ private: DECLARE_EVENT_TABLE(); // Core - wxCheckBox *CPUThread, *SkipIdle, *MMU, *MMUBAT, *TLBHack; + wxCheckBox *CPUThread, *SkipIdle, *MMU, *DCBZOFF, *TLBHack; wxCheckBox *VBeam, *FastDiscSpeed, *BlockMerging, *DSPHLE; // Wii wxCheckBox *EnableWideScreen, *DisableWiimoteSpeaker; @@ -127,7 +127,7 @@ private: ID_USEDUALCORE, ID_IDLESKIP, ID_MMU, - ID_MMUBAT, + ID_DCBZOFF, ID_TLBHACK, ID_VBEAM, ID_DISCSPEED, diff --git a/Source/Core/DolphinWX/Src/X11Utils.cpp b/Source/Core/DolphinWX/Src/X11Utils.cpp index da21c41cb2..f032f81e96 100644 --- a/Source/Core/DolphinWX/Src/X11Utils.cpp +++ b/Source/Core/DolphinWX/Src/X11Utils.cpp @@ -124,12 +124,12 @@ void EWMH_Fullscreen(Display *dpy, int action) #if defined(HAVE_WX) && HAVE_WX Window XWindowFromHandle(void *Handle) { - return GDK_WINDOW_XID(GTK_WIDGET(Handle)->window); + return GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(Handle))); } Display *XDisplayFromHandle(void *Handle) { - return GDK_WINDOW_XDISPLAY(GTK_WIDGET(Handle)->window); + return GDK_WINDOW_XDISPLAY(gtk_widget_get_window(GTK_WIDGET(Handle))); } #endif diff --git a/Source/Core/InputCommon/Src/ControllerEmu.cpp b/Source/Core/InputCommon/Src/ControllerEmu.cpp index 9065888d7d..2e6ad10617 100644 --- a/Source/Core/InputCommon/Src/ControllerEmu.cpp +++ b/Source/Core/InputCommon/Src/ControllerEmu.cpp @@ -295,6 +295,7 @@ ControllerEmu::Tilt::Tilt(const char* const _name) settings.push_back(new Setting(_trans("Dead Zone"), 0, 0, 50)); settings.push_back(new Setting(_trans("Circle Stick"), 0)); + settings.push_back(new Setting(_trans("Angle"), 0.9f, 0, 180)); } ControllerEmu::Cursor::Cursor(const char* const _name) diff --git a/Source/Core/InputCommon/Src/ControllerEmu.h b/Source/Core/InputCommon/Src/ControllerEmu.h index 888e0c7fa9..6084a610a1 100644 --- a/Source/Core/InputCommon/Src/ControllerEmu.h +++ b/Source/Core/InputCommon/Src/ControllerEmu.h @@ -307,6 +307,7 @@ public: ControlState deadzone = settings[0]->value; ControlState circle = settings[1]->value; + auto const angle = settings[2]->value / 1.8f; ControlState m = controls[4]->control_ref->State(); // modifier code @@ -363,8 +364,8 @@ public: m_tilt[1] = std::max(m_tilt[1] - 0.1f, yy); } - *y = C(m_tilt[1] * range + base); - *x = C(m_tilt[0] * range + base); + *y = C(m_tilt[1] * angle * range + base); + *x = C(m_tilt[0] * angle * range + base); } private: float m_tilt[2]; diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index 9ba2afbbd1..af263235cd 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.cpp @@ -520,7 +520,7 @@ void BPWritten(const BPCmd& bp) for (u32 i = 0; i < tmem_cfg.preload_tile_info.count; ++i) { if (tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE || - tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE) + tmem_addr_odd + TMEM_LINE_SIZE > TMEM_SIZE) break; memcpy(texMem + tmem_addr_even, src_ptr, TMEM_LINE_SIZE); diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index c1ebdbcc89..448501aad0 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -158,10 +158,11 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo if (dstAlphaMode != DSTALPHA_ALPHA_PASS) { + ptr[0] |= bpmem.fog.c_proj_fsel.fsel << 13; // 3 if (bpmem.fog.c_proj_fsel.fsel != 0) { - ptr[0] |= bpmem.fog.c_proj_fsel.proj << 13; // 1 - ptr[0] |= bpmem.fogRange.Base.Enabled << 14; // 1 + ptr[0] |= bpmem.fog.c_proj_fsel.proj << 16; // 1 + ptr[0] |= bpmem.fogRange.Base.Enabled << 17; // 1 } } diff --git a/Source/Core/VideoCommon/Src/Statistics.h b/Source/Core/VideoCommon/Src/Statistics.h index 7238398b42..e173bfc682 100644 --- a/Source/Core/VideoCommon/Src/Statistics.h +++ b/Source/Core/VideoCommon/Src/Statistics.h @@ -43,7 +43,7 @@ struct Statistics int numUniquePixelShaders; - float proj_0, proj_1, proj_2, proj_3, proj_4, proj_5, proj_6; + float proj_0, proj_1, proj_2, proj_3, proj_4, proj_5; float gproj_0, gproj_1, gproj_2, gproj_3, gproj_4, gproj_5; float gproj_6, gproj_7, gproj_8, gproj_9, gproj_10, gproj_11, gproj_12, gproj_13, gproj_14, gproj_15; diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index 84340c6b98..1dce567b0d 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -350,26 +350,28 @@ void VertexShaderManager::SetConstants() if (bProjectionChanged) { bProjectionChanged = false; + + float *rawProjection = xfregs.projection.rawProjection; - if (xfregs.rawProjection[6] == 0) + switch(xfregs.projection.type) { - // Perspective + case GX_PERSPECTIVE: - g_fProjectionMatrix[0] = xfregs.rawProjection[0] * g_ActiveConfig.fAspectRatioHackW; + g_fProjectionMatrix[0] = rawProjection[0] * g_ActiveConfig.fAspectRatioHackW; g_fProjectionMatrix[1] = 0.0f; - g_fProjectionMatrix[2] = xfregs.rawProjection[1]; + g_fProjectionMatrix[2] = rawProjection[1]; g_fProjectionMatrix[3] = 0.0f; g_fProjectionMatrix[4] = 0.0f; - g_fProjectionMatrix[5] = xfregs.rawProjection[2] * g_ActiveConfig.fAspectRatioHackH; - g_fProjectionMatrix[6] = xfregs.rawProjection[3]; + g_fProjectionMatrix[5] = rawProjection[2] * g_ActiveConfig.fAspectRatioHackH; + g_fProjectionMatrix[6] = rawProjection[3]; g_fProjectionMatrix[7] = 0.0f; g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[9] = 0.0f; - g_fProjectionMatrix[10] = xfregs.rawProjection[4]; + g_fProjectionMatrix[10] = rawProjection[4]; - g_fProjectionMatrix[11] = xfregs.rawProjection[5]; + g_fProjectionMatrix[11] = rawProjection[5]; g_fProjectionMatrix[12] = 0.0f; g_fProjectionMatrix[13] = 0.0f; @@ -394,24 +396,24 @@ void VertexShaderManager::SetConstants() SETSTAT_FT(stats.gproj_13, g_fProjectionMatrix[13]); SETSTAT_FT(stats.gproj_14, g_fProjectionMatrix[14]); SETSTAT_FT(stats.gproj_15, g_fProjectionMatrix[15]); - } - else - { - // Orthographic Projection - g_fProjectionMatrix[0] = xfregs.rawProjection[0]; + break; + + case GX_ORTHOGRAPHIC: + + g_fProjectionMatrix[0] = rawProjection[0]; g_fProjectionMatrix[1] = 0.0f; g_fProjectionMatrix[2] = 0.0f; - g_fProjectionMatrix[3] = xfregs.rawProjection[1]; + g_fProjectionMatrix[3] = rawProjection[1]; g_fProjectionMatrix[4] = 0.0f; - g_fProjectionMatrix[5] = xfregs.rawProjection[2]; + g_fProjectionMatrix[5] = rawProjection[2]; g_fProjectionMatrix[6] = 0.0f; - g_fProjectionMatrix[7] = xfregs.rawProjection[3]; + g_fProjectionMatrix[7] = rawProjection[3]; g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[9] = 0.0f; - g_fProjectionMatrix[10] = (g_ProjHack1.value + xfregs.rawProjection[4]) * ((g_ProjHack1.sign == 0) ? 1.0f : g_ProjHack1.sign); - g_fProjectionMatrix[11] = (g_ProjHack2.value + xfregs.rawProjection[5]) * ((g_ProjHack2.sign == 0) ? 1.0f : g_ProjHack2.sign); + g_fProjectionMatrix[10] = (g_ProjHack1.value + rawProjection[4]) * ((g_ProjHack1.sign == 0) ? 1.0f : g_ProjHack1.sign); + g_fProjectionMatrix[11] = (g_ProjHack2.value + rawProjection[5]) * ((g_ProjHack2.sign == 0) ? 1.0f : g_ProjHack2.sign); g_fProjectionMatrix[12] = 0.0f; g_fProjectionMatrix[13] = 0.0f; @@ -424,7 +426,7 @@ void VertexShaderManager::SetConstants() */ g_fProjectionMatrix[14] = 0.0f; - g_fProjectionMatrix[15] = (g_ProjHack3 && xfregs.rawProjection[0] == 2.0f ? 0.0f : 1.0f); //causes either the efb copy or bloom layer not to show if proj hack enabled + g_fProjectionMatrix[15] = (g_ProjHack3 && rawProjection[0] == 2.0f ? 0.0f : 1.0f); //causes either the efb copy or bloom layer not to show if proj hack enabled SETSTAT_FT(stats.g2proj_0, g_fProjectionMatrix[0]); SETSTAT_FT(stats.g2proj_1, g_fProjectionMatrix[1]); @@ -442,18 +444,21 @@ void VertexShaderManager::SetConstants() SETSTAT_FT(stats.g2proj_13, g_fProjectionMatrix[13]); SETSTAT_FT(stats.g2proj_14, g_fProjectionMatrix[14]); SETSTAT_FT(stats.g2proj_15, g_fProjectionMatrix[15]); - SETSTAT_FT(stats.proj_0, xfregs.rawProjection[0]); - SETSTAT_FT(stats.proj_1, xfregs.rawProjection[1]); - SETSTAT_FT(stats.proj_2, xfregs.rawProjection[2]); - SETSTAT_FT(stats.proj_3, xfregs.rawProjection[3]); - SETSTAT_FT(stats.proj_4, xfregs.rawProjection[4]); - SETSTAT_FT(stats.proj_5, xfregs.rawProjection[5]); - SETSTAT_FT(stats.proj_6, xfregs.rawProjection[6]); + SETSTAT_FT(stats.proj_0, rawProjection[0]); + SETSTAT_FT(stats.proj_1, rawProjection[1]); + SETSTAT_FT(stats.proj_2, rawProjection[2]); + SETSTAT_FT(stats.proj_3, rawProjection[3]); + SETSTAT_FT(stats.proj_4, rawProjection[4]); + SETSTAT_FT(stats.proj_5, rawProjection[5]); + break; + + default: + ERROR_LOG(VIDEO, "unknown projection type: %d", xfregs.projection.type); } - PRIM_LOG("Projection: %f %f %f %f %f %f\n", xfregs.rawProjection[0], xfregs.rawProjection[1], xfregs.rawProjection[2], xfregs.rawProjection[3], xfregs.rawProjection[4], xfregs.rawProjection[5]); + PRIM_LOG("Projection: %f %f %f %f %f %f\n", rawProjection[0], rawProjection[1], rawProjection[2], rawProjection[3], rawProjection[4], rawProjection[5]); - if ((g_ActiveConfig.bFreeLook || g_ActiveConfig.bAnaglyphStereo ) && xfregs.rawProjection[6] == 0) + if ((g_ActiveConfig.bFreeLook || g_ActiveConfig.bAnaglyphStereo ) && xfregs.projection.type == GX_PERSPECTIVE) { Matrix44 mtxA; Matrix44 mtxB; diff --git a/Source/Core/VideoCommon/Src/XFMemory.h b/Source/Core/VideoCommon/Src/XFMemory.h index ee3c3b0fdc..fc199b8c32 100644 --- a/Source/Core/VideoCommon/Src/XFMemory.h +++ b/Source/Core/VideoCommon/Src/XFMemory.h @@ -61,6 +61,9 @@ #define LIGHTATTN_NONE 2 #define LIGHTATTN_DIR 3 +#define GX_PERSPECTIVE 0 +#define GX_ORTHOGRAPHIC 1 + #define XFMEM_SIZE 0x8000 #define XFMEM_POSMATRICES 0x000 #define XFMEM_POSMATRICES_END 0x100 @@ -235,6 +238,12 @@ struct Viewport float farZ; }; +struct Projection +{ + float rawProjection[6]; + u32 type; // only GX_PERSPECTIVE or GX_ORTHOGRAPHIC are allowed +}; + struct XFRegisters { u32 error; // 0x1000 @@ -257,10 +266,10 @@ struct XFRegisters u32 unk5; // 0x1015 u32 unk6; // 0x1016 u32 unk7; // 0x1017 - u32 MatrixIndexA; // 0x1018 - u32 MatrixIndexB; // 0x1019 + u32 MatrixIndexA; // 0x1018 + u32 MatrixIndexB; // 0x1019 Viewport viewport; // 0x101a - 0x101f - float rawProjection[7]; // 0x1020 - 0x1026 + Projection projection; // 0x1020 - 0x1026 u32 unk8[24]; // 0x1027 - 0x103e NumTexGen numTexGen; // 0x103f TexMtxInfo texMtxInfo[8]; // 0x1040 - 0x1047 diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index e3c35a6511..cd924acd8a 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -327,25 +327,8 @@ Renderer::Renderer() s_backbuffer_height = (int)GLInterface->GetBackBufferHeight(); // Handle VSync on/off -#ifdef __APPLE__ int swapInterval = g_ActiveConfig.bVSync ? 1 : 0; -#if defined USE_WX && USE_WX - NSOpenGLContext *ctx = GLWin.glCtxt->GetWXGLContext(); -#else - NSOpenGLContext *ctx = GLWin.cocoaCtx; -#endif - [ctx setValues: &swapInterval forParameter: NSOpenGLCPSwapInterval]; -#elif defined _WIN32 - if (WGLEW_EXT_swap_control) - wglSwapIntervalEXT(g_ActiveConfig.bVSync ? 1 : 0); - else - ERROR_LOG(VIDEO, "No support for SwapInterval (framerate clamped to monitor refresh rate)."); -#elif defined(HAVE_X11) && HAVE_X11 - if (glXSwapIntervalSGI) - glXSwapIntervalSGI(g_ActiveConfig.bVSync ? 1 : 0); - else - ERROR_LOG(VIDEO, "No support for SwapInterval (framerate clamped to monitor refresh rate)."); -#endif + GLInterface->SwapInterval(swapInterval); // check the max texture width and height GLint max_texture_size; diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/BPMemLoader.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/BPMemLoader.cpp index 6a17a40eb1..f05f9f8b57 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/BPMemLoader.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/BPMemLoader.cpp @@ -135,10 +135,10 @@ void SWBPWritten(int address, int newvalue) // AR and GB tiles are stored in separate TMEM banks => can't use a single memcpy for everything u32 tmem_addr_odd = tmem_cfg.preload_tmem_odd * TMEM_LINE_SIZE; - for (int i = 0; i < tmem_cfg.preload_tile_info.count; ++i) + for (unsigned int i = 0; i < tmem_cfg.preload_tile_info.count; ++i) { if (tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE || - tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE) + tmem_addr_odd + TMEM_LINE_SIZE > TMEM_SIZE) break; memcpy(texMem + tmem_addr_even, src_ptr, TMEM_LINE_SIZE); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp index 49739b7f6e..fb472cfdba 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp @@ -52,10 +52,10 @@ void CreateShaders() { static const char *fragShaderText = "varying " PREC " vec2 TexCoordOut;\n" - "uniform " TEXTYPE " Texture;\n" + "uniform sampler2D Texture;\n" "void main() {\n" " " PREC " vec4 tmpcolor;\n" - " tmpcolor = " TEXFUNC "(Texture, TexCoordOut);\n" + " tmpcolor = texture2D(Texture, TexCoordOut);\n" " gl_FragColor = tmpcolor;\n" "}\n"; static const char *vertShaderText = @@ -63,7 +63,7 @@ void CreateShaders() "attribute vec2 TexCoordIn;\n " "varying vec2 TexCoordOut;\n " "void main() {\n" - " gl_Position = pos;\n" + " gl_Position = pos;\n" " TexCoordOut = TexCoordIn;\n" "}\n"; @@ -74,6 +74,8 @@ void CreateShaders() uni_tex = glGetUniformLocation(program, "Texture"); attr_pos = glGetAttribLocation(program, "pos"); attr_tex = glGetAttribLocation(program, "TexCoordIn"); + + } void SWRenderer::Prepare() @@ -86,7 +88,7 @@ void SWRenderer::Prepare() // TODO: Enable for GLES once RasterFont supports GLES #ifndef USE_GLES s_pfont = new RasterFont(); - glEnable(GL_TEXTURE_RECTANGLE_ARB); + glEnable(GL_TEXTURE_2D); #endif GL_REPORT_ERRORD(); } @@ -142,48 +144,37 @@ void SWRenderer::DrawTexture(u8 *texture, int width, int height) glViewport(0, 0, glWidth, glHeight); glScissor(0, 0, glWidth, glHeight); - glBindTexture(TEX2D, s_RenderTarget); + glBindTexture(GL_TEXTURE_2D, s_RenderTarget); - glTexImage2D(TEX2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture); - glTexParameteri(TEX2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(TEX2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glUseProgram(program); static const GLfloat verts[4][2] = { { -1, -1}, // Left top { -1, 1}, // left bottom { 1, 1}, // right bottom { 1, -1} // right top }; - //Texture rectangle uses pixel coordinates -#ifndef USE_GLES - GLfloat u_max = (GLfloat)width; - GLfloat v_max = (GLfloat)height; - - static const GLfloat texverts[4][2] = { - {0, v_max}, - {0, 0}, - {u_max, 0}, - {u_max, v_max} - }; -#else static const GLfloat texverts[4][2] = { {0, 1}, {0, 0}, {1, 0}, {1, 1} }; -#endif + glVertexAttribPointer(attr_pos, 2, GL_FLOAT, GL_FALSE, 0, verts); glVertexAttribPointer(attr_tex, 2, GL_FLOAT, GL_FALSE, 0, texverts); glEnableVertexAttribArray(attr_pos); glEnableVertexAttribArray(attr_tex); - glActiveTexture(GL_TEXTURE0); glUniform1i(uni_tex, 0); + glActiveTexture(GL_TEXTURE0); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableVertexAttribArray(attr_pos); glDisableVertexAttribArray(attr_tex); - glBindTexture(TEX2D, 0); + glBindTexture(GL_TEXTURE_2D, 0); GL_REPORT_ERRORD(); } @@ -195,11 +186,8 @@ void SWRenderer::SwapBuffer() GLInterface->Swap(); - swstats.ResetFrame(); + swstats.ResetFrame(); -#ifndef USE_GLES - glClearDepth(1.0f); -#endif glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); GL_REPORT_ERRORD(); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWVideoConfig.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWVideoConfig.cpp index 7f7ef6b0f8..05a6cdddf2 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWVideoConfig.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWVideoConfig.cpp @@ -51,7 +51,7 @@ void SWVideoConfig::Load(const char* ini_file) iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); // Hardware iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, false); - iniFile.Get("Rendering", "HwRasterizer", &bHwRasterizer, true); + iniFile.Get("Rendering", "HwRasterizer", &bHwRasterizer, false); iniFile.Get("Info", "ShowStats", &bShowStats, false); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp index ae2a4db3f5..332e83d0e8 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp @@ -70,7 +70,7 @@ void VideoSoftware::ShowConfig(void *_hParent) bool VideoSoftware::Initialize(void *&window_handle) { - g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str()); + g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str()); InitInterface(); if (!GLInterface->Create(window_handle)) @@ -79,18 +79,16 @@ bool VideoSoftware::Initialize(void *&window_handle) return false; } - InitBPMemory(); - InitXFMemory(); - SWCommandProcessor::Init(); - SWPixelEngine::Init(); - OpcodeDecoder::Init(); - Clipper::Init(); - Rasterizer::Init(); - if (g_SWVideoConfig.bHwRasterizer) - HwRasterizer::Init(); - else - SWRenderer::Init(); - DebugUtil::Init(); + InitBPMemory(); + InitXFMemory(); + SWCommandProcessor::Init(); + SWPixelEngine::Init(); + OpcodeDecoder::Init(); + Clipper::Init(); + Rasterizer::Init(); + HwRasterizer::Init(); + SWRenderer::Init(); + DebugUtil::Init(); return true; } @@ -134,10 +132,8 @@ void VideoSoftware::EmuStateChange(EMUSTATE_CHANGE newState) void VideoSoftware::Shutdown() { - if (g_SWVideoConfig.bHwRasterizer) - HwRasterizer::Shutdown(); - else - SWRenderer::Shutdown(); + HwRasterizer::Shutdown(); + SWRenderer::Shutdown(); GLInterface->Shutdown(); } @@ -145,35 +141,21 @@ void VideoSoftware::Shutdown() void VideoSoftware::Video_Prepare() { GLInterface->MakeCurrent(); - // Init extension support. - { + // Init extension support. + // Required for WGL SwapInterval #ifndef USE_GLES if (glewInit() != GLEW_OK) { - ERROR_LOG(VIDEO, "glewInit() failed!Does your video card support OpenGL 2.x?"); - return; - } - - // Handle VSync on/off -#ifdef _WIN32 - if (WGLEW_EXT_swap_control) - wglSwapIntervalEXT(VSYNC_ENABLED); - else - ERROR_LOG(VIDEO, "no support for SwapInterval (framerate clamped to monitor refresh rate)Does your video card support OpenGL 2.x?"); -#elif defined(HAVE_X11) && HAVE_X11 - if (glXSwapIntervalSGI) - glXSwapIntervalSGI(VSYNC_ENABLED); - else - ERROR_LOG(VIDEO, "no support for SwapInterval (framerate clamped to monitor refresh rate)"); -#endif -#endif + ERROR_LOG(VIDEO, "glewInit() failed!Does your video card support OpenGL 2.x?"); + return; } +#endif + // Handle VSync on/off + GLInterface->SwapInterval(VSYNC_ENABLED); - if (g_SWVideoConfig.bHwRasterizer) - HwRasterizer::Prepare(); - else - SWRenderer::Prepare(); + HwRasterizer::Prepare(); + SWRenderer::Prepare(); - INFO_LOG(VIDEO, "Video backend initialized."); + INFO_LOG(VIDEO, "Video backend initialized."); } // Run from the CPU thread (from VideoInterface.cpp)