diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7646574728..518c0b59db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,9 @@ option(ENABLE_QT "Enable Qt (use the experimental Qt interface)" OFF)
option(ENABLE_PCH "Use PCH to speed up compilation" ON)
option(ENABLE_LTO "Enables Link Time Optimization" OFF)
option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" OFF)
+if(APPLE)
+ option(OSX_USE_DEFAULT_SEARCH_PATH "Don't prioritize system library paths" OFF)
+endif()
option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON)
@@ -45,6 +48,8 @@ endif()
project(dolphin-emu)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests)
set(DOLPHIN_IS_STABLE FALSE)
+# Libraries to link
+set(LIBS)
# Set up paths
if((${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
@@ -153,9 +158,7 @@ if(NOT ENABLE_GENERIC)
set(_M_ARM 1)
set(_M_ARM_32 1)
add_definitions(-D_M_ARM=1 -D_M_ARM_32=1)
- if(${ANDROID_NDK_ABI_NAME} MATCHES "armeabi-v7a")
- add_definitions(-marm -march=armv7-a)
- endif()
+ add_definitions(-marm -march=armv7-a)
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
# This option only applies to 64bit ARM
set(_M_ARM 1)
@@ -221,10 +224,18 @@ if(ENABLE_LTO)
endif()
if(APPLE)
- # Ignore MacPorts and Fink and any other locally installed packages that
- # might prevent building a distributable binary.
- set(CMAKE_SYSTEM_PREFIX_PATH /usr)
- set(ENV{PATH} /usr/bin:/bin:/usr/sbin:/sbin)
+ if(NOT OSX_USE_DEFAULT_SEARCH_PATH)
+ # Hack up the path to prioritize the path to built-in OS libraries to
+ # increase the chance of not depending on a bunch of copies of them
+ # installed by MacPorts, Fink, Homebrew, etc, and ending up copying
+ # them into the bundle. Since we optionally depend on libraries which
+ # are not part of OS X (ffmpeg, libusb, etc.), however, don't remove
+ # the default path entirely as was done in a previous version of this
+ # file. This is still kinda evil, since it defeats the user's path
+ # settings...
+ # See http://www.cmake.org/cmake/help/v3.0/command/find_program.html
+ set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr")
+ endif()
# Some of our code contains Objective C constructs.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x objective-c -stdlib=libc++")
@@ -280,6 +291,7 @@ if(APPLE)
find_library(COREAUDIO_LIBRARY CoreAudio)
find_library(COREFUND_LIBRARY CoreFoundation)
find_library(CORESERV_LIBRARY CoreServices)
+ find_library(FOUNDATION_LIBRARY foundation)
find_library(IOB_LIBRARY IOBluetooth)
find_library(IOK_LIBRARY IOKit)
find_library(QUICKTIME_LIBRARY QuickTime)
@@ -401,6 +413,7 @@ if(NOT ANDROID)
set(HAS_LLVM 1)
include_directories(${LLVM_INCLUDE_DIRS})
+ list(APPEND LIBS ${LLVM_LIBRARIES})
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
endif()
@@ -446,6 +459,10 @@ if(NOT ANDROID)
endif()
if(ENCODE_FRAMEDUMPS)
check_libav()
+ if(LIBAV_FOUND)
+ LIST(APPEND LIBS ${LIBAV_LIBRARIES})
+ endif()
+
endif()
set(CMAKE_REQUIRED_LIBRARIES portaudio)
@@ -525,6 +542,7 @@ else()
include_directories(Externals/LZO)
set(LZO lzo2)
endif()
+list(APPEND LIBS ${LZO})
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
check_lib(PNG png png.h QUIET)
@@ -609,6 +627,7 @@ if(USE_UPNP)
include_directories(Externals/miniupnpc/src)
endif()
add_definitions(-DUSE_UPNP)
+ list(APPEND LIBS miniupnpc)
endif()
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
@@ -639,6 +658,12 @@ if (ANDROID)
message("Using static iconv from Externals")
include_directories(Externals/libiconv-1.14/include)
add_subdirectory(Externals/libiconv-1.14)
+ list(APPEND LIBS iconv)
+else()
+ find_library(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
+ find_path(ICONV_INCLUDE_DIR NAMES iconv.h)
+ list(APPEND LIBS ${ICONV_LIBRARIES})
+ mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIBRARIES)
endif()
if(ENABLE_QT)
@@ -685,6 +710,9 @@ if(NOT DISABLE_WX AND NOT ANDROID)
include(FindGTK2)
if(GTK2_FOUND)
include_directories(${GTK2_INCLUDE_DIRS})
+ list(APPEND LIBS ${GTK2_LIBRARIES})
+ else()
+ message(FATAL_ERROR "GTK is required to build the WX UI. Please install the GTK development libraries.")
endif()
endif()
endif()
@@ -721,6 +749,23 @@ if(NOT DISABLE_WX AND NOT ANDROID)
add_definitions(-DHAVE_WX=1)
endif(NOT DISABLE_WX AND NOT ANDROID)
+if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
+ ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
+ set(LIBS ${LIBS} usbhid)
+endif()
+
+if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ # Link against OS X system frameworks.
+ list(APPEND LIBS
+ ${APPKIT_LIBRARY}
+ ${AU_LIBRARY}
+ ${COREAUDIO_LIBRARY}
+ ${COREFUND_LIBRARY}
+ ${CORESERV_LIBRARY}
+ ${IOK_LIBRARY}
+ ${FORCEFEEDBACK}
+ )
+endif()
########################################
# Pre-build events: Define configuration variables and write SCM info header
diff --git a/Contributing.md b/Contributing.md
index 5bcbdb65b1..d0a717e8a1 100644
--- a/Contributing.md
+++ b/Contributing.md
@@ -1,6 +1,8 @@
-# Dolphin Code Styling
+# Dolphin Coding Style & Licensing
-## Table of Contents
+If you make any contributions to Dolphin after December 1st, 2014, you are agreeing that any code you have contributed will be licensed under the GNU GPL version 2 (or any later version).
+
+## Coding Style
---
- [Introduction] (#introduction)
@@ -113,7 +115,7 @@ class ExampleClass : public SomeParent
{
public:
ExampleClass(int x, int y);
-
+
int GetX() const;
int GetY() const;
diff --git a/Data/Sys/GameSettings/301E01.ini b/Data/Sys/GameSettings/301E01.ini
new file mode 100644
index 0000000000..80a022bf81
--- /dev/null
+++ b/Data/Sys/GameSettings/301E01.ini
@@ -0,0 +1,20 @@
+# 301E01 - GameCube Service Disc
+
+[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 = Certain tests may soft-lock
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
diff --git a/Data/Sys/GameSettings/D85E01.ini b/Data/Sys/GameSettings/D85E01.ini
new file mode 100644
index 0000000000..656ae41ad9
--- /dev/null
+++ b/Data/Sys/GameSettings/D85E01.ini
@@ -0,0 +1,23 @@
+# D85E01 - Multi Game Demo Disk 12
+
+[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 = Videos run at low FPS
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+ProjectionHack = 0
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/DLSE64.ini b/Data/Sys/GameSettings/DLSE64.ini
index bfdaeca215..8a8b118f12 100644
--- a/Data/Sys/GameSettings/DLSE64.ini
+++ b/Data/Sys/GameSettings/DLSE64.ini
@@ -6,8 +6,8 @@ MMU = 1
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 3
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/DLSP64.ini b/Data/Sys/GameSettings/DLSP64.ini
index 0e89e0f28f..2ab4bcdbf4 100644
--- a/Data/Sys/GameSettings/DLSP64.ini
+++ b/Data/Sys/GameSettings/DLSP64.ini
@@ -6,8 +6,8 @@ MMU = 1
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 3
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/DTLX01.ini b/Data/Sys/GameSettings/DTLX01.ini
index 7fd49f3833..69a32f5feb 100644
--- a/Data/Sys/GameSettings/DTLX01.ini
+++ b/Data/Sys/GameSettings/DTLX01.ini
@@ -6,6 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 3
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/DVDXDV.ini b/Data/Sys/GameSettings/DVDXDV.ini
index 3495ea4509..d30f9d5d1e 100644
--- a/Data/Sys/GameSettings/DVDXDV.ini
+++ b/Data/Sys/GameSettings/DVDXDV.ini
@@ -5,6 +5,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
+EmulationStateId = 0
EmulationIssues =
[OnLoad]
diff --git a/Data/Sys/GameSettings/FA6E01.ini b/Data/Sys/GameSettings/FA6E01.ini
index a15c01589f..79d10feed7 100644
--- a/Data/Sys/GameSettings/FA6E01.ini
+++ b/Data/Sys/GameSettings/FA6E01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FA6P01.ini b/Data/Sys/GameSettings/FA6P01.ini
index ef70e2a974..e683d8923e 100644
--- a/Data/Sys/GameSettings/FA6P01.ini
+++ b/Data/Sys/GameSettings/FA6P01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FA7E01.ini b/Data/Sys/GameSettings/FA7E01.ini
index 90b2c65326..ac66ec7466 100644
--- a/Data/Sys/GameSettings/FA7E01.ini
+++ b/Data/Sys/GameSettings/FA7E01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FA7P01.ini b/Data/Sys/GameSettings/FA7P01.ini
index fb68cf087e..0345733c23 100644
--- a/Data/Sys/GameSettings/FA7P01.ini
+++ b/Data/Sys/GameSettings/FA7P01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FA8E01.ini b/Data/Sys/GameSettings/FA8E01.ini
index dc34ed4b51..f4b3e596ca 100644
--- a/Data/Sys/GameSettings/FA8E01.ini
+++ b/Data/Sys/GameSettings/FA8E01.ini
@@ -1,12 +1,12 @@
-# FA8E01 - Kirby's Adventure
+# FA8E01 - Kirby's Adventure [NES]
[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 = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FA8F01.ini b/Data/Sys/GameSettings/FA8F01.ini
index 8aaf9fc6cc..66b2728123 100644
--- a/Data/Sys/GameSettings/FA8F01.ini
+++ b/Data/Sys/GameSettings/FA8F01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FA8P01.ini b/Data/Sys/GameSettings/FA8P01.ini
index 898d3a0d6c..caef04d7c4 100644
--- a/Data/Sys/GameSettings/FA8P01.ini
+++ b/Data/Sys/GameSettings/FA8P01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FA9E01.ini b/Data/Sys/GameSettings/FA9E01.ini
index 0da22ac4be..6e7864d4f7 100644
--- a/Data/Sys/GameSettings/FA9E01.ini
+++ b/Data/Sys/GameSettings/FA9E01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FAAE01.ini b/Data/Sys/GameSettings/FAAE01.ini
index 1d0fbc89c0..9d03bee13d 100644
--- a/Data/Sys/GameSettings/FAAE01.ini
+++ b/Data/Sys/GameSettings/FAAE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FAAP01.ini b/Data/Sys/GameSettings/FAAP01.ini
index 17f9b2f5e1..272bb635d9 100644
--- a/Data/Sys/GameSettings/FAAP01.ini
+++ b/Data/Sys/GameSettings/FAAP01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FAGE01.ini b/Data/Sys/GameSettings/FAGE01.ini
index a8529a6f59..e0ea080786 100644
--- a/Data/Sys/GameSettings/FAGE01.ini
+++ b/Data/Sys/GameSettings/FAGE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FAGP01.ini b/Data/Sys/GameSettings/FAGP01.ini
index 8d5ce50ee5..0d56442f5d 100644
--- a/Data/Sys/GameSettings/FAGP01.ini
+++ b/Data/Sys/GameSettings/FAGP01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FAHE01.ini b/Data/Sys/GameSettings/FAHE01.ini
index aa5018208d..71388015d6 100644
--- a/Data/Sys/GameSettings/FAHE01.ini
+++ b/Data/Sys/GameSettings/FAHE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FANE01.ini b/Data/Sys/GameSettings/FANE01.ini
index 10a5fc4e56..930378a11c 100644
--- a/Data/Sys/GameSettings/FANE01.ini
+++ b/Data/Sys/GameSettings/FANE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FAQN01.ini b/Data/Sys/GameSettings/FAQN01.ini
index 1a3c11532e..29a991028d 100644
--- a/Data/Sys/GameSettings/FAQN01.ini
+++ b/Data/Sys/GameSettings/FAQN01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBCE01.ini b/Data/Sys/GameSettings/FBCE01.ini
index b545c4b6be..db0cbf847b 100644
--- a/Data/Sys/GameSettings/FBCE01.ini
+++ b/Data/Sys/GameSettings/FBCE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBDE01.ini b/Data/Sys/GameSettings/FBDE01.ini
index 4ceee83746..194d6960ed 100644
--- a/Data/Sys/GameSettings/FBDE01.ini
+++ b/Data/Sys/GameSettings/FBDE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBDP01.ini b/Data/Sys/GameSettings/FBDP01.ini
index 690a37d0fa..d423b54e23 100644
--- a/Data/Sys/GameSettings/FBDP01.ini
+++ b/Data/Sys/GameSettings/FBDP01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBEE01.ini b/Data/Sys/GameSettings/FBEE01.ini
index 6a5edb5197..29746c3a32 100644
--- a/Data/Sys/GameSettings/FBEE01.ini
+++ b/Data/Sys/GameSettings/FBEE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBEP01.ini b/Data/Sys/GameSettings/FBEP01.ini
index 5da1cc2bc3..4fa8c180f6 100644
--- a/Data/Sys/GameSettings/FBEP01.ini
+++ b/Data/Sys/GameSettings/FBEP01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBIE01.ini b/Data/Sys/GameSettings/FBIE01.ini
index 26dd5a9ae1..465c7f9e66 100644
--- a/Data/Sys/GameSettings/FBIE01.ini
+++ b/Data/Sys/GameSettings/FBIE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBIP01.ini b/Data/Sys/GameSettings/FBIP01.ini
index 14126f418b..47967b66aa 100644
--- a/Data/Sys/GameSettings/FBIP01.ini
+++ b/Data/Sys/GameSettings/FBIP01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBJE01.ini b/Data/Sys/GameSettings/FBJE01.ini
index d4ff42c84c..4df8d4f51f 100644
--- a/Data/Sys/GameSettings/FBJE01.ini
+++ b/Data/Sys/GameSettings/FBJE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBJP01.ini b/Data/Sys/GameSettings/FBJP01.ini
index 4665761dc0..34d60feb08 100644
--- a/Data/Sys/GameSettings/FBJP01.ini
+++ b/Data/Sys/GameSettings/FBJP01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBNE01.ini b/Data/Sys/GameSettings/FBNE01.ini
index 2a1c766135..a5b7bccb9a 100644
--- a/Data/Sys/GameSettings/FBNE01.ini
+++ b/Data/Sys/GameSettings/FBNE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBUE01.ini b/Data/Sys/GameSettings/FBUE01.ini
index 28495b98b3..c20629ee29 100644
--- a/Data/Sys/GameSettings/FBUE01.ini
+++ b/Data/Sys/GameSettings/FBUE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBUP01.ini b/Data/Sys/GameSettings/FBUP01.ini
index 2cf13dc70e..4eb9897ebf 100644
--- a/Data/Sys/GameSettings/FBUP01.ini
+++ b/Data/Sys/GameSettings/FBUP01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBYP01.ini b/Data/Sys/GameSettings/FBYP01.ini
index 1b80fc7bf1..5435c241a5 100644
--- a/Data/Sys/GameSettings/FBYP01.ini
+++ b/Data/Sys/GameSettings/FBYP01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FBZE01.ini b/Data/Sys/GameSettings/FBZE01.ini
index 047aed972f..ba6b00e298 100644
--- a/Data/Sys/GameSettings/FBZE01.ini
+++ b/Data/Sys/GameSettings/FBZE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FCAE01.ini b/Data/Sys/GameSettings/FCAE01.ini
index 7da7764115..d9c8227965 100644
--- a/Data/Sys/GameSettings/FCAE01.ini
+++ b/Data/Sys/GameSettings/FCAE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FCQE01.ini b/Data/Sys/GameSettings/FCQE01.ini
index ef72cf8264..afacca5408 100644
--- a/Data/Sys/GameSettings/FCQE01.ini
+++ b/Data/Sys/GameSettings/FCQE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FCWE01.ini b/Data/Sys/GameSettings/FCWE01.ini
index 2785c60059..eec135642e 100644
--- a/Data/Sys/GameSettings/FCWE01.ini
+++ b/Data/Sys/GameSettings/FCWE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FCWP01.ini b/Data/Sys/GameSettings/FCWP01.ini
index 0d85cc0610..ab0a919f3f 100644
--- a/Data/Sys/GameSettings/FCWP01.ini
+++ b/Data/Sys/GameSettings/FCWP01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FCYE01.ini b/Data/Sys/GameSettings/FCYE01.ini
index cc03b7a15d..cb59cfb4e0 100644
--- a/Data/Sys/GameSettings/FCYE01.ini
+++ b/Data/Sys/GameSettings/FCYE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FCYP01.ini b/Data/Sys/GameSettings/FCYP01.ini
index 1c0a435c54..84a0354cb2 100644
--- a/Data/Sys/GameSettings/FCYP01.ini
+++ b/Data/Sys/GameSettings/FCYP01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FCZE01.ini b/Data/Sys/GameSettings/FCZE01.ini
index c9aa9d7c3a..423e6f1f9d 100644
--- a/Data/Sys/GameSettings/FCZE01.ini
+++ b/Data/Sys/GameSettings/FCZE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FD2E01.ini b/Data/Sys/GameSettings/FD2E01.ini
index 14b2544995..523f5f4c1d 100644
--- a/Data/Sys/GameSettings/FD2E01.ini
+++ b/Data/Sys/GameSettings/FD2E01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FD2P01.ini b/Data/Sys/GameSettings/FD2P01.ini
index 26e9f2b07c..d4bfa87134 100644
--- a/Data/Sys/GameSettings/FD2P01.ini
+++ b/Data/Sys/GameSettings/FD2P01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FD6E01.ini b/Data/Sys/GameSettings/FD6E01.ini
index d9149a7a4e..fcbb621b45 100644
--- a/Data/Sys/GameSettings/FD6E01.ini
+++ b/Data/Sys/GameSettings/FD6E01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FDGE01.ini b/Data/Sys/GameSettings/FDGE01.ini
index 8745588c86..df6f7d5059 100644
--- a/Data/Sys/GameSettings/FDGE01.ini
+++ b/Data/Sys/GameSettings/FDGE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FDNE01.ini b/Data/Sys/GameSettings/FDNE01.ini
index afd073de97..817b374097 100644
--- a/Data/Sys/GameSettings/FDNE01.ini
+++ b/Data/Sys/GameSettings/FDNE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FDOE01.ini b/Data/Sys/GameSettings/FDOE01.ini
index 6c0e805124..a7781af772 100644
--- a/Data/Sys/GameSettings/FDOE01.ini
+++ b/Data/Sys/GameSettings/FDOE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FDQE01.ini b/Data/Sys/GameSettings/FDQE01.ini
index c7961b145c..0aaf0e7a00 100644
--- a/Data/Sys/GameSettings/FDQE01.ini
+++ b/Data/Sys/GameSettings/FDQE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FEMN01.ini b/Data/Sys/GameSettings/FEMN01.ini
index 112f91840d..fa2a9ddbc2 100644
--- a/Data/Sys/GameSettings/FEMN01.ini
+++ b/Data/Sys/GameSettings/FEMN01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/FFLE01.ini b/Data/Sys/GameSettings/FFLE01.ini
index c9de46a9de..50b99bfd68 100644
--- a/Data/Sys/GameSettings/FFLE01.ini
+++ b/Data/Sys/GameSettings/FFLE01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Texture filtering will cause glitches.
EmulationStateId = 4
+EmulationIssues = Texture filtering will cause glitches.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/G2CE52.ini b/Data/Sys/GameSettings/G2CE52.ini
index bb2545f745..25126b19ba 100644
--- a/Data/Sys/GameSettings/G2CE52.ini
+++ b/Data/Sys/GameSettings/G2CE52.ini
@@ -1,11 +1,12 @@
# G2CE52 - TC2 US
[Core]
-# Values set here will override the main dolphin settings.
+# 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 =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/G2MEAB.ini b/Data/Sys/GameSettings/G2MEAB.ini
new file mode 100644
index 0000000000..69d09bf6e3
--- /dev/null
+++ b/Data/Sys/GameSettings/G2MEAB.ini
@@ -0,0 +1,19 @@
+# G2MEAB - Metroid Prime 3 E3 Beta
+
+[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 = REALRAM_SIZE must be set to 0x8000000
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
diff --git a/Data/Sys/GameSettings/G2TP52.ini b/Data/Sys/GameSettings/G2TP52.ini
new file mode 100644
index 0000000000..6cbe0cab6f
--- /dev/null
+++ b/Data/Sys/GameSettings/G2TP52.ini
@@ -0,0 +1,27 @@
+# G2TP52 - Tony Hawk's Underground 2
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[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 =
+
diff --git a/Data/Sys/GameSettings/G3DP6L.ini b/Data/Sys/GameSettings/G3DP6L.ini
index 74aa1a9942..bf551fe24e 100644
--- a/Data/Sys/GameSettings/G3DP6L.ini
+++ b/Data/Sys/GameSettings/G3DP6L.ini
@@ -6,6 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/G4QP01.ini b/Data/Sys/GameSettings/G4QP01.ini
index 0bc6b1d43c..20ec0cda26 100644
--- a/Data/Sys/GameSettings/G4QP01.ini
+++ b/Data/Sys/GameSettings/G4QP01.ini
@@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
-EmulationIssues = Needs TLB Hack
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GAME5H.ini b/Data/Sys/GameSettings/GAME5H.ini
index 6682988aa1..ca44a9dd47 100644
--- a/Data/Sys/GameSettings/GAME5H.ini
+++ b/Data/Sys/GameSettings/GAME5H.ini
@@ -6,6 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GBLP52.ini b/Data/Sys/GameSettings/GBLP52.ini
index 1d2149350a..344f5b0669 100644
--- a/Data/Sys/GameSettings/GBLP52.ini
+++ b/Data/Sys/GameSettings/GBLP52.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Needs real xfb for videos to display.
EmulationStateId = 4
+EmulationIssues = Needs real xfb for videos to display.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GBMP7F.ini b/Data/Sys/GameSettings/GBMP7F.ini
index e2eb90fe8d..3be70cf047 100644
--- a/Data/Sys/GameSettings/GBMP7F.ini
+++ b/Data/Sys/GameSettings/GBMP7F.ini
@@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
-EmulationIssues = Needs real xfb for videos to show up.
+EmulationIssues = Needs real xfb for videos to display.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GBVE41.ini b/Data/Sys/GameSettings/GBVE41.ini
index 27305dff3e..24f36f885c 100644
--- a/Data/Sys/GameSettings/GBVE41.ini
+++ b/Data/Sys/GameSettings/GBVE41.ini
@@ -7,7 +7,7 @@ DSPHLE = False
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 3
-EmulationIssues = Needs Real xfb for videos to show up. Slow audio with HLE.
+EmulationIssues = Needs Real xfb for videos to display. Slow audio with HLE.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GBVP41.ini b/Data/Sys/GameSettings/GBVP41.ini
index a0f1bc68f4..a52e3a93f5 100644
--- a/Data/Sys/GameSettings/GBVP41.ini
+++ b/Data/Sys/GameSettings/GBVP41.ini
@@ -7,7 +7,7 @@ DSPHLE = False
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 3
-EmulationIssues = Needs Real xfb for videos to show up. Slow audio with HLE.
+EmulationIssues = Needs Real xfb for videos to display. Slow audio with HLE.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GDVP6L.ini b/Data/Sys/GameSettings/GDVP6L.ini
index ca75f8c5a3..2d07917be8 100644
--- a/Data/Sys/GameSettings/GDVP6L.ini
+++ b/Data/Sys/GameSettings/GDVP6L.ini
@@ -1,3 +1,4 @@
+
# GDVP6L - Driven
[Core]
diff --git a/Data/Sys/GameSettings/GDXEA4.ini b/Data/Sys/GameSettings/GDXEA4.ini
index 333f159d57..f14521a104 100644
--- a/Data/Sys/GameSettings/GDXEA4.ini
+++ b/Data/Sys/GameSettings/GDXEA4.ini
@@ -1,6 +1,10 @@
# GDXEA4 - Disney Sports Skateboarding
[Core]
-# This game does not work properly with large memorycards, use a 251 block card
-# see http://www.nintendo.com/consumer/memorycard1019.jsp
+# Values set here will override the main Dolphin settings.
MemoryCard251 = True
+
+[EmuState]
+# The Emulation State. 1 is worst, 5 is best, 0 is not set.
+EmulationStateId =
+EmulationIssues = This game does not work properly with large memorycards, use a 251 block card. See http://www.nintendo.com/consumer/memorycard1019.jsp
diff --git a/Data/Sys/GameSettings/GDXJA4.ini b/Data/Sys/GameSettings/GDXJA4.ini
index d2bb4ab662..813fc9f09c 100644
--- a/Data/Sys/GameSettings/GDXJA4.ini
+++ b/Data/Sys/GameSettings/GDXJA4.ini
@@ -1,6 +1,10 @@
# GDXJA4 - Disney Sports Skateboarding
[Core]
-# This game does not work properly with large memorycards, use a 251 block card
-# see http://www.nintendo.com/consumer/memorycard1019.jsp
+# Values set here will override the main Dolphin settings.
MemoryCard251 = True
+
+[EmuState]
+# The Emulation State. 1 is worst, 5 is best, 0 is not set.
+EmulationStateId =
+EmulationIssues = This game does not work properly with large memorycards, use a 251 block card. See http://www.nintendo.com/consumer/memorycard1019.jsp
diff --git a/Data/Sys/GameSettings/GDXPA4.ini b/Data/Sys/GameSettings/GDXPA4.ini
index 59d32e08a8..95429b8e4a 100644
--- a/Data/Sys/GameSettings/GDXPA4.ini
+++ b/Data/Sys/GameSettings/GDXPA4.ini
@@ -1,6 +1,10 @@
# GDXPA4 - Disney Sports Skateboarding
[Core]
-# This game does not work properly with large memorycards, use a 251 block card
-# see http://www.nintendo.com/consumer/memorycard1019.jsp
+# Values set here will override the main Dolphin settings.
MemoryCard251 = True
+
+[EmuState]
+# The Emulation State. 1 is worst, 5 is best, 0 is not set.
+EmulationStateId =
+EmulationIssues = This game does not work properly with large memorycards, use a 251 block card. See http://www.nintendo.com/consumer/memorycard1019.jsp
diff --git a/Data/Sys/GameSettings/GEME7F.ini b/Data/Sys/GameSettings/GEME7F.ini
index c082463de6..1f54dcf058 100644
--- a/Data/Sys/GameSettings/GEME7F.ini
+++ b/Data/Sys/GameSettings/GEME7F.ini
@@ -6,6 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GFZJ8P.ini b/Data/Sys/GameSettings/GFZJ8P.ini
new file mode 100644
index 0000000000..59ce9d7f58
--- /dev/null
+++ b/Data/Sys/GameSettings/GFZJ8P.ini
@@ -0,0 +1,24 @@
+# GFZJ8P - F-Zero AX
+
+[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 = Crashes on startup (Triforce game)
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+# Add memory patches to be applied every frame here.
+
+[Video_Settings]
+
diff --git a/Data/Sys/GameSettings/GGPE01.ini b/Data/Sys/GameSettings/GGPE01.ini
new file mode 100644
index 0000000000..83efda95ce
--- /dev/null
+++ b/Data/Sys/GameSettings/GGPE01.ini
@@ -0,0 +1,24 @@
+# GGPE01 - Mario Kart GP
+
+[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 = Crashes on startup (Triforce game)
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+# Add memory patches to be applied every frame here.
+
+[Video_Settings]
+
diff --git a/Data/Sys/GameSettings/GGPE02.ini b/Data/Sys/GameSettings/GGPE02.ini
new file mode 100644
index 0000000000..efb6e74996
--- /dev/null
+++ b/Data/Sys/GameSettings/GGPE02.ini
@@ -0,0 +1,24 @@
+# GGPE02 - Mario Kart GP 2
+
+[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 = Crashes on startup (Triforce game)
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+# Add memory patches to be applied every frame here.
+
+[Video_Settings]
+
diff --git a/Data/Sys/GameSettings/GICH78.ini b/Data/Sys/GameSettings/GICH78.ini
index c0f6cd238a..acca76bd0e 100644
--- a/Data/Sys/GameSettings/GICH78.ini
+++ b/Data/Sys/GameSettings/GICH78.ini
@@ -5,6 +5,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
+EmulationStateId =
EmulationIssues =
[OnLoad]
diff --git a/Data/Sys/GameSettings/GINX69.ini b/Data/Sys/GameSettings/GINX69.ini
index 29113828ca..8eb2072c70 100644
--- a/Data/Sys/GameSettings/GINX69.ini
+++ b/Data/Sys/GameSettings/GINX69.ini
@@ -6,6 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GIVE4Z.ini b/Data/Sys/GameSettings/GIVE4Z.ini
index 619c43b2ff..033f5c1af9 100644
--- a/Data/Sys/GameSettings/GIVE4Z.ini
+++ b/Data/Sys/GameSettings/GIVE4Z.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 3
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GJSJ18.ini b/Data/Sys/GameSettings/GJSJ18.ini
index bfc2673e72..a16cb202e5 100644
--- a/Data/Sys/GameSettings/GJSJ18.ini
+++ b/Data/Sys/GameSettings/GJSJ18.ini
@@ -6,6 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GK2D52.ini b/Data/Sys/GameSettings/GK2D52.ini
index d8267fbc92..424af0e29b 100644
--- a/Data/Sys/GameSettings/GK2D52.ini
+++ b/Data/Sys/GameSettings/GK2D52.ini
@@ -1,11 +1,15 @@
# GK2D52 - Spider-Man 2
[Core]
MMU = 1
+
[EmuState]
EmulationStateId = 4
EmulationIssues = Slow because it needs mmu to run.
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -13,6 +17,7 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Hacks]
EFBToTextureEnable = False
EFBCopyEnable = True
diff --git a/Data/Sys/GameSettings/GK2E52.ini b/Data/Sys/GameSettings/GK2E52.ini
index 23d53c182b..a1bd42e2b5 100644
--- a/Data/Sys/GameSettings/GK2E52.ini
+++ b/Data/Sys/GameSettings/GK2E52.ini
@@ -1,11 +1,16 @@
# GK2E52 - Spider-Man 2
+
[Core]
MMU = 1
+
[EmuState]
EmulationStateId = 4
EmulationIssues = Slow because it needs mmu to run.
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -13,6 +18,7 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Hacks]
EFBToTextureEnable = False
EFBCopyEnable = True
diff --git a/Data/Sys/GameSettings/GK2F52.ini b/Data/Sys/GameSettings/GK2F52.ini
index 0b05c6d201..e398a35c29 100644
--- a/Data/Sys/GameSettings/GK2F52.ini
+++ b/Data/Sys/GameSettings/GK2F52.ini
@@ -1,11 +1,15 @@
# GK2F52 - Spider-Man 2
[Core]
MMU = 1
+
[EmuState]
EmulationStateId = 4
EmulationIssues = Slow because it needs mmu to run.
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -13,6 +17,7 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Hacks]
EFBToTextureEnable = False
EFBCopyEnable = True
diff --git a/Data/Sys/GameSettings/GK2I52.ini b/Data/Sys/GameSettings/GK2I52.ini
index 0f733aac78..34aadec6c0 100644
--- a/Data/Sys/GameSettings/GK2I52.ini
+++ b/Data/Sys/GameSettings/GK2I52.ini
@@ -1,11 +1,16 @@
# GK2I52 - Spider-Man 2
+
[Core]
MMU = 1
+
[EmuState]
EmulationStateId = 4
EmulationIssues = Slow because it needs mmu to run.
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -13,6 +18,7 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Hacks]
EFBToTextureEnable = False
EFBCopyEnable = True
diff --git a/Data/Sys/GameSettings/GK2P52.ini b/Data/Sys/GameSettings/GK2P52.ini
index 32d0de3b03..e6799395e2 100644
--- a/Data/Sys/GameSettings/GK2P52.ini
+++ b/Data/Sys/GameSettings/GK2P52.ini
@@ -1,11 +1,16 @@
# GK2P52 - Spider-Man 2
+
[Core]
MMU = 1
+
[EmuState]
EmulationStateId = 4
EmulationIssues = Slow because it needs mmu to run.
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -13,6 +18,7 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Hacks]
EFBToTextureEnable = False
EFBCopyEnable = True
diff --git a/Data/Sys/GameSettings/GKAE8P.ini b/Data/Sys/GameSettings/GKAE8P.ini
index 4c9fbe6405..b4a9dafa40 100644
--- a/Data/Sys/GameSettings/GKAE8P.ini
+++ b/Data/Sys/GameSettings/GKAE8P.ini
@@ -6,6 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GKNEB2.ini b/Data/Sys/GameSettings/GKNEB2.ini
index 0c6156d707..1288967643 100644
--- a/Data/Sys/GameSettings/GKNEB2.ini
+++ b/Data/Sys/GameSettings/GKNEB2.ini
@@ -5,6 +5,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
+EmulationStateId =
EmulationIssues =
[OnLoad]
diff --git a/Data/Sys/GameSettings/GKSP52.ini b/Data/Sys/GameSettings/GKSP52.ini
index 29c1323038..39e9f710eb 100644
--- a/Data/Sys/GameSettings/GKSP52.ini
+++ b/Data/Sys/GameSettings/GKSP52.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Needs real xfb for the videos to work.
EmulationStateId = 4
+EmulationIssues = Needs real xfb for the videos to work.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GKSX52.ini b/Data/Sys/GameSettings/GKSX52.ini
index 44b7d4b6ac..aa22fa9280 100644
--- a/Data/Sys/GameSettings/GKSX52.ini
+++ b/Data/Sys/GameSettings/GKSX52.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Needs real xfb for the videos to work.
EmulationStateId = 4
+EmulationIssues = Needs real xfb for the videos to work.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GKTJA4.ini b/Data/Sys/GameSettings/GKTJA4.ini
index c0c4923a06..b037d638eb 100644
--- a/Data/Sys/GameSettings/GKTJA4.ini
+++ b/Data/Sys/GameSettings/GKTJA4.ini
@@ -6,6 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 2
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GKZP9G.ini b/Data/Sys/GameSettings/GKZP9G.ini
index 004c205099..554c6d5a0b 100644
--- a/Data/Sys/GameSettings/GKZP9G.ini
+++ b/Data/Sys/GameSettings/GKZP9G.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Needs real xfb for the videos to work.
EmulationStateId = 4
+EmulationIssues = Needs real xfb for the videos to work.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GLRE64.ini b/Data/Sys/GameSettings/GLRE64.ini
index 3b6c032167..465778899b 100644
--- a/Data/Sys/GameSettings/GLRE64.ini
+++ b/Data/Sys/GameSettings/GLRE64.ini
@@ -6,8 +6,8 @@ MMU = 1
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 3
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GM6EE9.ini b/Data/Sys/GameSettings/GM6EE9.ini
index 3dfba7cdb8..dd5928768a 100644
--- a/Data/Sys/GameSettings/GM6EE9.ini
+++ b/Data/Sys/GameSettings/GM6EE9.ini
@@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
-EmulationIssues = MMU speed hack is needed for balloon bombs or the game crashes.
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
@@ -21,7 +21,6 @@ EmulationIssues = MMU speed hack is needed for balloon bombs or the game crashes
ProjectionHack = 0
PH_SZNear = 0
PH_SZFar = 0
-PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
diff --git a/Data/Sys/GameSettings/GM6PE9.ini b/Data/Sys/GameSettings/GM6PE9.ini
index c83af736cc..6c11c8762d 100644
--- a/Data/Sys/GameSettings/GM6PE9.ini
+++ b/Data/Sys/GameSettings/GM6PE9.ini
@@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
-EmulationIssues = MMU speed hack is needed for balloon bombs or the game crashes.
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
@@ -21,7 +21,6 @@ EmulationIssues = MMU speed hack is needed for balloon bombs or the game crashes
ProjectionHack = 0
PH_SZNear = 0
PH_SZFar = 0
-PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
diff --git a/Data/Sys/GameSettings/GMBE8P.ini b/Data/Sys/GameSettings/GMBE8P.ini
index 735c212231..0bee51c94b 100644
--- a/Data/Sys/GameSettings/GMBE8P.ini
+++ b/Data/Sys/GameSettings/GMBE8P.ini
@@ -3,7 +3,6 @@
[Core]
# Values set here will override the main dolphin settings.
FPRF = True
-# Values set here will override the main dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GMSE01.ini b/Data/Sys/GameSettings/GMSE01.ini
index 5956579745..f23418aec4 100644
--- a/Data/Sys/GameSettings/GMSE01.ini
+++ b/Data/Sys/GameSettings/GMSE01.ini
@@ -16,10 +16,6 @@ EmulationIssues = Needs EFB to Ram and no texture filtering for the goo.
[ActionReplay]
# Add action replay cheats here.
-$All Shines (not working)
-045708E8 FFFFFFFF
-045708EC FFFFFFFF
-045708F0 FFFFFFFF
$Open all levels and nozzles (not working?)
04570958 FFFFFFFF
0457095C FFFFFFFF
diff --git a/Data/Sys/GameSettings/GPXE01.ini b/Data/Sys/GameSettings/GPXE01.ini
new file mode 100644
index 0000000000..9a0e2421b2
--- /dev/null
+++ b/Data/Sys/GameSettings/GPXE01.ini
@@ -0,0 +1,19 @@
+# GPXE01 - POKeMON BOX RUBY&SAPPHIRE
+
+[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 = 2
+EmulationIssues =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
diff --git a/Data/Sys/GameSettings/GPXP01.ini b/Data/Sys/GameSettings/GPXP01.ini
index e66ab1cbd0..e1c0fa2e15 100644
--- a/Data/Sys/GameSettings/GPXP01.ini
+++ b/Data/Sys/GameSettings/GPXP01.ini
@@ -6,6 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 2
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GVS46E.ini b/Data/Sys/GameSettings/GVS46E.ini
new file mode 100644
index 0000000000..36cdea121d
--- /dev/null
+++ b/Data/Sys/GameSettings/GVS46E.ini
@@ -0,0 +1,24 @@
+# GVS46E - Virtua Striker 4 Ver. 2006 (Export)
+
+[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 = Crashes on startup (Triforce game)
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+# Add memory patches to be applied every frame here.
+
+[Video_Settings]
+
diff --git a/Data/Sys/GameSettings/GVS46J.ini b/Data/Sys/GameSettings/GVS46J.ini
new file mode 100644
index 0000000000..f45ffca594
--- /dev/null
+++ b/Data/Sys/GameSettings/GVS46J.ini
@@ -0,0 +1,24 @@
+# GVS46J - Virtua Striker 4 Ver. 2006 (Japan)
+
+[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 = Crashes on startup (Triforce game)
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+# Add memory patches to be applied every frame here.
+
+[Video_Settings]
+
diff --git a/Data/Sys/GameSettings/GWYE41.ini b/Data/Sys/GameSettings/GWYE41.ini
index 27f5331895..9f04eb9332 100644
--- a/Data/Sys/GameSettings/GWYE41.ini
+++ b/Data/Sys/GameSettings/GWYE41.ini
@@ -2,11 +2,12 @@
[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.
-EmulationStateId = 3
-EmulationIssues = Requires MMUSH and ATC. Videos require real XFB.
+EmulationStateId = 4
+EmulationIssues = Videos require real XFB.
[OnLoad]
# Add memory patches to be loaded once on boot here.
@@ -18,15 +19,13 @@ EmulationIssues = Requires MMUSH and ATC. Videos require real XFB.
# Add action replay cheats here.
[Video]
-ProjectionHack = 0
-PH_SZNear = 0
-PH_SZFar = 0
-PH_ExtraParam = 0
-PH_ZNear =
-PH_ZFar =
[Video_Settings]
UseXFB = True
UseRealXFB = True
SafeTextureCacheColorSamples = 512
+[Video_Hacks]
+EFBToTextureEnable = False
+EFBCopyEnable = True
+
diff --git a/Data/Sys/GameSettings/GWYX41.ini b/Data/Sys/GameSettings/GWYX41.ini
index 2991a2b2c2..6f23ae152b 100644
--- a/Data/Sys/GameSettings/GWYX41.ini
+++ b/Data/Sys/GameSettings/GWYX41.ini
@@ -2,11 +2,12 @@
[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.
-EmulationStateId = 3
-EmulationIssues = Requires MMUSH and ATC. Videos require real XFB.
+EmulationStateId = 4
+EmulationIssues = Videos require real XFB.
[OnLoad]
# Add memory patches to be loaded once on boot here.
@@ -18,15 +19,12 @@ EmulationIssues = Requires MMUSH and ATC. Videos require real XFB.
# Add action replay cheats here.
[Video]
-ProjectionHack = 0
-PH_SZNear = 0
-PH_SZFar = 0
-PH_ExtraParam = 0
-PH_ZNear =
-PH_ZFar =
[Video_Settings]
UseXFB = True
UseRealXFB = True
SafeTextureCacheColorSamples = 512
+[Video_Hacks]
+EFBToTextureEnable = False
+EFBCopyEnable = True
diff --git a/Data/Sys/GameSettings/GXEE8P.ini b/Data/Sys/GameSettings/GXEE8P.ini
index 4e1c725408..5dd1dcacc6 100644
--- a/Data/Sys/GameSettings/GXEE8P.ini
+++ b/Data/Sys/GameSettings/GXEE8P.ini
@@ -1,12 +1,11 @@
-# GXEE8P - SonicRiders
+# GXEE8P - Sonic Riders
[Core]
# Values set here will override the main dolphin settings.
-FastDiscSpeed = True
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Crashes after the third story mode race without speed up disk transfer.
+EmulationIssues =
EmulationStateId = 4
[OnLoad]
diff --git a/Data/Sys/GameSettings/GXEJ8P.ini b/Data/Sys/GameSettings/GXEJ8P.ini
index 9ae50c21ba..64b2d648e0 100644
--- a/Data/Sys/GameSettings/GXEJ8P.ini
+++ b/Data/Sys/GameSettings/GXEJ8P.ini
@@ -1,12 +1,11 @@
-# GXEJ8P - SonicRiders
+# GXEJ8P - Sonic Riders
[Core]
# Values set here will override the main dolphin settings.
-FastDiscSpeed = True
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Crashes after the third story mode race without speed up disk transfer.
+EmulationIssues =
EmulationStateId = 4
[OnLoad]
diff --git a/Data/Sys/GameSettings/GXEP8P.ini b/Data/Sys/GameSettings/GXEP8P.ini
index db9c30ab53..a021d795d3 100644
--- a/Data/Sys/GameSettings/GXEP8P.ini
+++ b/Data/Sys/GameSettings/GXEP8P.ini
@@ -1,12 +1,11 @@
-# GXEP8P - SonicRiders
+# GXEP8P - Sonic Riders
[Core]
# Values set here will override the main dolphin settings.
-FastDiscSpeed = True
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Crashes after the third story mode race without speed up disk transfer.
+EmulationIssues =
EmulationStateId = 4
[OnLoad]
diff --git a/Data/Sys/GameSettings/GZ2E01.ini b/Data/Sys/GameSettings/GZ2E01.ini
index 914dc2860a..56f5219e12 100644
--- a/Data/Sys/GameSettings/GZ2E01.ini
+++ b/Data/Sys/GameSettings/GZ2E01.ini
@@ -1,4 +1,4 @@
-# GZ2E01 - The Legend of Zelda: Twilight Princess
+# GZ2E01 - The Legend of Zelda: Twilight Princess [GC]
[Core]
# Values set here will override the main dolphin settings.
@@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
-EmulationIssues = Enable the patch "Hyrule Field Speed Hack" in iso properties for a speed boost.
+EmulationIssues = Enable the "Hyrule Field Speed Hack" patch in iso properties for a speed boost.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/GZ2J01.ini b/Data/Sys/GameSettings/GZ2J01.ini
index 6c980dea6c..03727ce5d9 100644
--- a/Data/Sys/GameSettings/GZ2J01.ini
+++ b/Data/Sys/GameSettings/GZ2J01.ini
@@ -1,4 +1,4 @@
-# GZ2J01 - The Legend of Zelda: Twilight Princess
+# GZ2J01 - The Legend of Zelda: Twilight Princess [GC]
[Core]
# Values set here will override the main dolphin settings.
diff --git a/Data/Sys/GameSettings/GZ2P01.ini b/Data/Sys/GameSettings/GZ2P01.ini
index 05940a713e..79557d3294 100644
--- a/Data/Sys/GameSettings/GZ2P01.ini
+++ b/Data/Sys/GameSettings/GZ2P01.ini
@@ -1,4 +1,4 @@
-# GZ2P01 - The Legend of Zelda Twilight Princess
+# GZ2P01 - The Legend of Zelda: Twilight Princess [GC]
[Core]
# Values set here will override the main dolphin settings.
@@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
-EmulationIssues = Enable the patch "Hyrule Field Speed Hack" in iso properties for a speed boost.
+EmulationIssues = Enable the "Hyrule Field Speed Hack" patch in iso properties for a speed boost.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/HABA01.ini b/Data/Sys/GameSettings/HABA01.ini
new file mode 100644
index 0000000000..3bf145aaab
--- /dev/null
+++ b/Data/Sys/GameSettings/HABA01.ini
@@ -0,0 +1,22 @@
+# HABA01 - Wii Shop Channel
+
+[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 = Will not connect. Uses WiiConnect24.
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/HABK01.ini b/Data/Sys/GameSettings/HABK01.ini
new file mode 100644
index 0000000000..11f33e524f
--- /dev/null
+++ b/Data/Sys/GameSettings/HABK01.ini
@@ -0,0 +1,22 @@
+# HABK01 - Wii Shop Channel
+
+[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 = Will not connect. Uses WiiConnect24.
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/HADJ01.ini b/Data/Sys/GameSettings/HADJ01.ini
new file mode 100644
index 0000000000..eedaa60518
--- /dev/null
+++ b/Data/Sys/GameSettings/HADJ01.ini
@@ -0,0 +1,23 @@
+# HADJ01 - Internet Channel
+
+[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 = Low FPS on first run while save data is created
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+ProjectionHack = 0
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/HADP01.ini b/Data/Sys/GameSettings/HADP01.ini
new file mode 100644
index 0000000000..2bb5bcc8eb
--- /dev/null
+++ b/Data/Sys/GameSettings/HADP01.ini
@@ -0,0 +1,23 @@
+# HADP01 - Internet Channel
+
+[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 = Low FPS on first run while save data is created
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+ProjectionHack = 0
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/HATE01.ini b/Data/Sys/GameSettings/HATE01.ini
new file mode 100644
index 0000000000..4ff45b44fc
--- /dev/null
+++ b/Data/Sys/GameSettings/HATE01.ini
@@ -0,0 +1,24 @@
+# HATE01 - Nintendo Channel
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+UseXFB = True
+UseRealXFB = True
diff --git a/Data/Sys/GameSettings/HAWE01.ini b/Data/Sys/GameSettings/HAWE01.ini
new file mode 100644
index 0000000000..ffa8396fcc
--- /dev/null
+++ b/Data/Sys/GameSettings/HAWE01.ini
@@ -0,0 +1,22 @@
+# HAWE01 - Metroid Prime 3 Preview Channel
+
+[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 = Uses WiiConnect24
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+ProjectionHack = 0
+
diff --git a/Data/Sys/GameSettings/HCDJ01.ini b/Data/Sys/GameSettings/HCDJ01.ini
new file mode 100644
index 0000000000..864a137085
--- /dev/null
+++ b/Data/Sys/GameSettings/HCDJ01.ini
@@ -0,0 +1,22 @@
+# HCDJ01 - Digicam Print Channel
+
+[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 = 2
+EmulationIssues =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/HCFP01.ini b/Data/Sys/GameSettings/HCFP01.ini
new file mode 100644
index 0000000000..8aa22cd7d2
--- /dev/null
+++ b/Data/Sys/GameSettings/HCFP01.ini
@@ -0,0 +1,22 @@
+# HCFP01 - Wii Speak Channel
+
+[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 = No support for Wii Speak Microphone
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/HCLEXN.ini b/Data/Sys/GameSettings/HCLEXN.ini
new file mode 100644
index 0000000000..5fd4966ef5
--- /dev/null
+++ b/Data/Sys/GameSettings/HCLEXN.ini
@@ -0,0 +1,25 @@
+# HCLEXN - Netflix
+
+[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.
+EmulationStateId = 1
+EmulationIssues =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+UseXFB = True
+UseRealXFB = True
diff --git a/Data/Sys/GameSettings/HCQEXB.ini b/Data/Sys/GameSettings/HCQEXB.ini
new file mode 100644
index 0000000000..cc5d380d3a
--- /dev/null
+++ b/Data/Sys/GameSettings/HCQEXB.ini
@@ -0,0 +1,22 @@
+# HCQEXB - Hulu Plus
+
+[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 = Unable to connect to internet
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/HCSE01.ini b/Data/Sys/GameSettings/HCSE01.ini
new file mode 100644
index 0000000000..556f55760a
--- /dev/null
+++ b/Data/Sys/GameSettings/HCSE01.ini
@@ -0,0 +1,24 @@
+# HCSE01 - Wii U Transfer Tool
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+UseXFB = True
+UseRealXFB = True
diff --git a/Data/Sys/GameSettings/LACJ8P.ini b/Data/Sys/GameSettings/LACJ8P.ini
new file mode 100644
index 0000000000..69a25822ca
--- /dev/null
+++ b/Data/Sys/GameSettings/LACJ8P.ini
@@ -0,0 +1,24 @@
+# LACJ8P - Wonder Boy
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+ProjectionHack = 0
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 0
diff --git a/Data/Sys/GameSettings/LADJ8P.ini b/Data/Sys/GameSettings/LADJ8P.ini
new file mode 100644
index 0000000000..ef3df84597
--- /dev/null
+++ b/Data/Sys/GameSettings/LADJ8P.ini
@@ -0,0 +1,26 @@
+# LADJ8P - Phantasy Star
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+ProjectionHack = 0
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 0
+UseXFB = True
+UseRealXFB = False
diff --git a/Data/Sys/GameSettings/LAGJ8P.ini b/Data/Sys/GameSettings/LAGJ8P.ini
new file mode 100644
index 0000000000..bb93f7c9f8
--- /dev/null
+++ b/Data/Sys/GameSettings/LAGJ8P.ini
@@ -0,0 +1,24 @@
+# LAGJ8P - Sonic The Hedgehog
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+ProjectionHack = 0
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 0
diff --git a/Data/Sys/GameSettings/LAKJ8P.ini b/Data/Sys/GameSettings/LAKJ8P.ini
new file mode 100644
index 0000000000..bb9de331ed
--- /dev/null
+++ b/Data/Sys/GameSettings/LAKJ8P.ini
@@ -0,0 +1,26 @@
+# LAKJ8P - Wonder Boy II
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+ProjectionHack = 0
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 0
+UseXFB = True
+UseRealXFB = False
diff --git a/Data/Sys/GameSettings/LAMJ8P.ini b/Data/Sys/GameSettings/LAMJ8P.ini
new file mode 100644
index 0000000000..60bcbede0a
--- /dev/null
+++ b/Data/Sys/GameSettings/LAMJ8P.ini
@@ -0,0 +1,24 @@
+# LAMJ8P - Sonic Chaos
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+ProjectionHack = 0
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 0
diff --git a/Data/Sys/GameSettings/MCDE8P.ini b/Data/Sys/GameSettings/MCDE8P.ini
new file mode 100644
index 0000000000..ed7d8d2300
--- /dev/null
+++ b/Data/Sys/GameSettings/MCDE8P.ini
@@ -0,0 +1,27 @@
+# MCDE8P - Sonic & Knuckles
+
+[Core]
+# Values set here will override the main dolphin settings.
+ProgressiveScan = True
+
+[EmuState]
+# The Emulation State. 1 is worst, 5 is best, 0 is not set.
+EmulationStateId = 2
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+# Add memory patches to be applied every frame here.
+ProjectionHack = 0
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 0
+UseXFB = True
+UseRealXFB = False
diff --git a/Data/Sys/GameSettings/R3ME01.ini b/Data/Sys/GameSettings/R3ME01.ini
index b7e4af0f4d..a9006f9936 100644
--- a/Data/Sys/GameSettings/R3ME01.ini
+++ b/Data/Sys/GameSettings/R3ME01.ini
@@ -6,7 +6,7 @@
[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.
+EmulationIssues = Disable PAL60 (EuRGB60) to avoid a black bar appearing.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/R3MP01.ini b/Data/Sys/GameSettings/R3MP01.ini
index df74eae201..755355c2d1 100644
--- a/Data/Sys/GameSettings/R3MP01.ini
+++ b/Data/Sys/GameSettings/R3MP01.ini
@@ -6,7 +6,7 @@
[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.
+EmulationIssues = Disable PAL60 (EuRGB60) to avoid a black bar appearing.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/R6YPH3.ini b/Data/Sys/GameSettings/R6YPH3.ini
index fa5bc550a3..1ad74de5c1 100644
--- a/Data/Sys/GameSettings/R6YPH3.ini
+++ b/Data/Sys/GameSettings/R6YPH3.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 0
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/R7PE01.ini b/Data/Sys/GameSettings/R7PE01.ini
index 55e049a612..574c43ede6 100644
--- a/Data/Sys/GameSettings/R7PE01.ini
+++ b/Data/Sys/GameSettings/R7PE01.ini
@@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
-EmulationIssues = Disable "Use EuRGB60 (PAL60) mode" in the wii configuration tab for the game to run
+EmulationIssues = Disable "Use PAL60 (EuRGB60) mode" in the wii configuration tab for the game to run
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/R96EAF.ini b/Data/Sys/GameSettings/R96EAF.ini
index 8afd1bab3f..c9ef4aae15 100644
--- a/Data/Sys/GameSettings/R96EAF.ini
+++ b/Data/Sys/GameSettings/R96EAF.ini
@@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 5
-EmulationIssues = Disable use EuRGB60 mode in general settings-> wii tab for the game to run (r7446)
+EmulationIssues = Disable PAL60 (EuRGB60) mode in general settings-> wii tab for the game to run (r7446)
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/RGWX41.ini b/Data/Sys/GameSettings/RGWX41.ini
new file mode 100644
index 0000000000..fe8ca79dd1
--- /dev/null
+++ b/Data/Sys/GameSettings/RGWX41.ini
@@ -0,0 +1,22 @@
+# RGQX41 - Rabbids Channel
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/RZDE01.ini b/Data/Sys/GameSettings/RZDE01.ini
index 73f22b5952..8549dd3a50 100644
--- a/Data/Sys/GameSettings/RZDE01.ini
+++ b/Data/Sys/GameSettings/RZDE01.ini
@@ -1,4 +1,4 @@
-# RZDE01 - The Legend of Zelda: Twilight Princess
+# RZDE01 - The Legend of Zelda: Twilight Princess [Wii]
[Core]
# Values set here will override the main dolphin settings.
@@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
-EmulationIssues = Enable the patch "Hyrule Field Speed Hack" in iso properties for a speed boost.
+EmulationIssues = Enable the "Hyrule Field Speed Hack" patch in iso properties for a speed boost.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/RZDJ01.ini b/Data/Sys/GameSettings/RZDJ01.ini
index 2e3aa6fe29..248988d6c4 100644
--- a/Data/Sys/GameSettings/RZDJ01.ini
+++ b/Data/Sys/GameSettings/RZDJ01.ini
@@ -1,4 +1,4 @@
-# RZDJ01 - The Legend of Zelda: Twilight Princess
+# RZDJ01 - The Legend of Zelda: Twilight Princess [Wii]
[Core]
# Values set here will override the main dolphin settings.
diff --git a/Data/Sys/GameSettings/RZDK01.ini b/Data/Sys/GameSettings/RZDK01.ini
index 411989b871..716faa9b68 100644
--- a/Data/Sys/GameSettings/RZDK01.ini
+++ b/Data/Sys/GameSettings/RZDK01.ini
@@ -1,4 +1,4 @@
-# RZDK01 - The Legend of Zelda: Twilight Princess
+# RZDK01 - The Legend of Zelda: Twilight Princess [Wii]
[Core]
# Values set here will override the main dolphin settings.
diff --git a/Data/Sys/GameSettings/RZDP01.ini b/Data/Sys/GameSettings/RZDP01.ini
index 16d9626628..7ebbc167dd 100644
--- a/Data/Sys/GameSettings/RZDP01.ini
+++ b/Data/Sys/GameSettings/RZDP01.ini
@@ -1,4 +1,4 @@
-# RZDP01 - The Legend of Zelda Twilight Princess
+# RZDP01 - The Legend of Zelda: Twilight Princess [Wii]
[Core]
# Values set here will override the main dolphin settings.
@@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
-EmulationIssues = Enable the patch "Hyrule Field Speed Hack" in iso properties for a speed boost.
+EmulationIssues = Enable the "Hyrule Field Speed Hack" patch in iso properties for a speed boost.
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/SAWE52.ini b/Data/Sys/GameSettings/SAWE52.ini
new file mode 100644
index 0000000000..57817481ae
--- /dev/null
+++ b/Data/Sys/GameSettings/SAWE52.ini
@@ -0,0 +1,21 @@
+# SAWE52 - Angry Birds 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 =
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/SBXEWR.ini b/Data/Sys/GameSettings/SBXEWR.ini
new file mode 100644
index 0000000000..2091f4b1a4
--- /dev/null
+++ b/Data/Sys/GameSettings/SBXEWR.ini
@@ -0,0 +1,24 @@
+# SBXEWR - The Bachelor the Video Game
+
+[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 = Wiimote cursor misaligned
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+UseXFB = True
+UseRealXFB = False
diff --git a/Data/Sys/GameSettings/SDAE5G.ini b/Data/Sys/GameSettings/SDAE5G.ini
new file mode 100644
index 0000000000..5832d12fbb
--- /dev/null
+++ b/Data/Sys/GameSettings/SDAE5G.ini
@@ -0,0 +1,23 @@
+# WSDAE5G - Daring Game for Girls
+
+[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
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+# Add memory patches to be applied every frame here.
+
+[Video_Settings]
+
diff --git a/Data/Sys/GameSettings/SJBE52.ini b/Data/Sys/GameSettings/SJBE52.ini
index 28e5acc253..52c60579ab 100644
--- a/Data/Sys/GameSettings/SJBE52.ini
+++ b/Data/Sys/GameSettings/SJBE52.ini
@@ -6,8 +6,8 @@ BlockMerging = 1
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Disable the gamecube controller or the wiimote to not have conflicts (r6480)
EmulationStateId = 4
+EmulationIssues = Disable the gamecube controller or the wiimote to not have conflicts
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/SJBJ01.ini b/Data/Sys/GameSettings/SJBJ01.ini
index 4fe057a604..de8ce8357a 100644
--- a/Data/Sys/GameSettings/SJBJ01.ini
+++ b/Data/Sys/GameSettings/SJBJ01.ini
@@ -6,8 +6,8 @@ BlockMerging = 1
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Disable the gamecube controller or the wiimote to not have conflicts (r6480)
EmulationStateId = 4
+EmulationIssues = Disable the gamecube controller or the wiimote to not have conflicts
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/SJBP52.ini b/Data/Sys/GameSettings/SJBP52.ini
index da58fb081a..cca6c14da4 100644
--- a/Data/Sys/GameSettings/SJBP52.ini
+++ b/Data/Sys/GameSettings/SJBP52.ini
@@ -6,8 +6,8 @@ BlockMerging = 1
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Disable the gamecube controller or the wiimote to not have conflicts (r6480)
EmulationStateId = 4
+EmulationIssues = Disable the gamecube controller or the wiimote to not have conflicts
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/SJDY41.ini b/Data/Sys/GameSettings/SJDY41.ini
index df5b7b8fc4..754148366a 100644
--- a/Data/Sys/GameSettings/SJDY41.ini
+++ b/Data/Sys/GameSettings/SJDY41.ini
@@ -1,14 +1,20 @@
# SJDY41 - Just Dance 3
+
[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 =
+
[OnLoad]
# Add memory patches to be loaded once on boot here.
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -16,5 +22,6 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Enhancements]
MaxAnisotropy = 0
diff --git a/Data/Sys/GameSettings/SJXD41.ini b/Data/Sys/GameSettings/SJXD41.ini
index 31586b5e5d..b6d40ca302 100644
--- a/Data/Sys/GameSettings/SJXD41.ini
+++ b/Data/Sys/GameSettings/SJXD41.ini
@@ -1,14 +1,20 @@
# SJXD41 - Just Dance 4
+
[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 =
+
[OnLoad]
# Add memory patches to be loaded once on boot here.
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -16,5 +22,6 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Enhancements]
MaxAnisotropy = 0
diff --git a/Data/Sys/GameSettings/SKCE20.ini b/Data/Sys/GameSettings/SKCE20.ini
new file mode 100644
index 0000000000..2e190de764
--- /dev/null
+++ b/Data/Sys/GameSettings/SKCE20.ini
@@ -0,0 +1,24 @@
+# SKCE20 - Bigfoot - King of Crush
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+UseXFB = True
+UseRealXFB = False
diff --git a/Data/Sys/GameSettings/SL2J01.ini b/Data/Sys/GameSettings/SL2J01.ini
index c11d5e7298..629e1214e2 100644
--- a/Data/Sys/GameSettings/SL2J01.ini
+++ b/Data/Sys/GameSettings/SL2J01.ini
@@ -1,10 +1,19 @@
# SL2J01 - Zero: Shinku no Chou
-[Core] Values set here will override the main dolphin settings.
-[EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set.
+
+[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 =
-[OnFrame] Add memory patches to be applied every frame here.
-[ActionReplay] Add action replay cheats here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -12,7 +21,9 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Gecko]
+
[Video_Hacks]
EFBToTextureEnable = False
EFBCopyEnable = True
diff --git a/Data/Sys/GameSettings/SMNK01.ini b/Data/Sys/GameSettings/SMNK01.ini
index 6dfccb6269..af27e6c7a5 100644
--- a/Data/Sys/GameSettings/SMNK01.ini
+++ b/Data/Sys/GameSettings/SMNK01.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Enable EFB to RAM for the coins to spin (it will cause a big slowdown).
EmulationStateId = 4
+EmulationIssues = Enable EFB to RAM for the coins to spin (it will cause a big slowdown).
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/SNCE8P.ini b/Data/Sys/GameSettings/SNCE8P.ini
index 9bcc3be420..69212b2c2d 100644
--- a/Data/Sys/GameSettings/SNCE8P.ini
+++ b/Data/Sys/GameSettings/SNCE8P.ini
@@ -5,7 +5,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Integral efb scale has less graphical glitches. Enable "Use EuRGB60 mode" for proper brightness level.
+EmulationIssues = Integral efb scale has less graphical glitches. Enable "Use PAL60 (EuRGB60) mode" for proper brightness level.
EmulationStateId = 5
[OnLoad]
diff --git a/Data/Sys/GameSettings/SNCJ8P.ini b/Data/Sys/GameSettings/SNCJ8P.ini
index 30516fd356..b4f8237443 100644
--- a/Data/Sys/GameSettings/SNCJ8P.ini
+++ b/Data/Sys/GameSettings/SNCJ8P.ini
@@ -5,7 +5,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Integral efb scale has less graphical glitches. Enable "Use EuRGB60 mode" for proper brightness level.
+EmulationIssues = Integral efb scale has less graphical glitches. Enable "Use PAL60 (EuRGB60) mode" for proper brightness level.
EmulationStateId = 5
[OnLoad]
diff --git a/Data/Sys/GameSettings/SNCP8P.ini b/Data/Sys/GameSettings/SNCP8P.ini
index 1f54a916e0..ec16ea3fe9 100644
--- a/Data/Sys/GameSettings/SNCP8P.ini
+++ b/Data/Sys/GameSettings/SNCP8P.ini
@@ -5,7 +5,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues = Integral efb scale has less graphical glitches. Enable "Use EuRGB60 mode" for proper brightness level.
+EmulationIssues = Integral efb scale has less graphical glitches. Enable "Use PAL60 (EuRGB60) mode" for proper brightness level.
EmulationStateId = 5
[OnLoad]
diff --git a/Data/Sys/GameSettings/SOSEG9.ini b/Data/Sys/GameSettings/SOSEG9.ini
new file mode 100644
index 0000000000..422a99ab96
--- /dev/null
+++ b/Data/Sys/GameSettings/SOSEG9.ini
@@ -0,0 +1,24 @@
+# SOSEG9 - Turbo: Super Stunt Squad
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+UseXFB = True
+UseRealXFB = False
diff --git a/Data/Sys/GameSettings/SOSPAF.ini b/Data/Sys/GameSettings/SOSPAF.ini
new file mode 100644
index 0000000000..8e6caa5aa4
--- /dev/null
+++ b/Data/Sys/GameSettings/SOSPAF.ini
@@ -0,0 +1,24 @@
+# SOSPAF - Turbo: Super Stunt Squad
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+UseXFB = True
+UseRealXFB = False
diff --git a/Data/Sys/GameSettings/SOUJ01.ini b/Data/Sys/GameSettings/SOUJ01.ini
index dde7a09b18..c63bd034b4 100644
--- a/Data/Sys/GameSettings/SOUJ01.ini
+++ b/Data/Sys/GameSettings/SOUJ01.ini
@@ -1,14 +1,20 @@
# SOUJ01 - The Legend of Zelda Skyward Sword
+
[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 wiimote and motion plus. Time stone transition needs Fast Depth off.
+
[OnLoad]
# Add memory patches to be loaded once on boot here.
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -16,8 +22,10 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Hacks]
EFBAccessEnable = True
EFBEmulateFormatChanges = True
+
[Video_Settings]
FastDepthCalc = False
diff --git a/Data/Sys/GameSettings/SOUK01.ini b/Data/Sys/GameSettings/SOUK01.ini
index 18d3f4352e..b804346cb6 100644
--- a/Data/Sys/GameSettings/SOUK01.ini
+++ b/Data/Sys/GameSettings/SOUK01.ini
@@ -1,14 +1,19 @@
# SOUK01 - The Legend of Zelda Skyward Sword
[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 wiimote and motion plus. Time stone transition needs Fast Depth off.
+
[OnLoad]
# Add memory patches to be loaded once on boot here.
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -16,8 +21,10 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Hacks]
EFBAccessEnable = True
EFBEmulateFormatChanges = True
+
[Video_Settings]
FastDepthCalc = False
diff --git a/Data/Sys/GameSettings/SSTEG9.ini b/Data/Sys/GameSettings/SSTEG9.ini
new file mode 100644
index 0000000000..513d448abf
--- /dev/null
+++ b/Data/Sys/GameSettings/SSTEG9.ini
@@ -0,0 +1,24 @@
+# SSTEG9 - Kid Adventures Sky Captain
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+UseXFB = True
+UseRealXFB = False
diff --git a/Data/Sys/GameSettings/SSTPY5.ini b/Data/Sys/GameSettings/SSTPY5.ini
new file mode 100644
index 0000000000..b52daca744
--- /dev/null
+++ b/Data/Sys/GameSettings/SSTPY5.ini
@@ -0,0 +1,24 @@
+# SSTPY5 - Stunt Flyer: Hero of the Skies
+
+[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 =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+UseXFB = True
+UseRealXFB = False
diff --git a/Data/Sys/GameSettings/STSE4Q.ini b/Data/Sys/GameSettings/STSE4Q.ini
new file mode 100644
index 0000000000..8125789874
--- /dev/null
+++ b/Data/Sys/GameSettings/STSE4Q.ini
@@ -0,0 +1,24 @@
+# STSE4Q - Toy Story 3
+
+[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 =
+EmulationStateId = 3
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 512
diff --git a/Data/Sys/GameSettings/STSP4Q.ini b/Data/Sys/GameSettings/STSP4Q.ini
new file mode 100644
index 0000000000..19577fd983
--- /dev/null
+++ b/Data/Sys/GameSettings/STSP4Q.ini
@@ -0,0 +1,24 @@
+# STSP4Q - Toy Story 3
+
+[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 =
+EmulationStateId = 3
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 512
diff --git a/Data/Sys/GameSettings/STSX4Q.ini b/Data/Sys/GameSettings/STSX4Q.ini
new file mode 100644
index 0000000000..16b8528751
--- /dev/null
+++ b/Data/Sys/GameSettings/STSX4Q.ini
@@ -0,0 +1,24 @@
+# STSX4Q - Toy Story 3
+
+[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 =
+EmulationStateId = 3
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 512
diff --git a/Data/Sys/GameSettings/STSY4Q.ini b/Data/Sys/GameSettings/STSY4Q.ini
new file mode 100644
index 0000000000..60c064eacb
--- /dev/null
+++ b/Data/Sys/GameSettings/STSY4Q.ini
@@ -0,0 +1,24 @@
+# STSY4Q - Toy Story 3
+
+[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 =
+EmulationStateId = 3
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 512
diff --git a/Data/Sys/GameSettings/STSZ4Q.ini b/Data/Sys/GameSettings/STSZ4Q.ini
new file mode 100644
index 0000000000..149f1ba06c
--- /dev/null
+++ b/Data/Sys/GameSettings/STSZ4Q.ini
@@ -0,0 +1,24 @@
+# STSZ4Q - Toy Story 3: Toy Box Special Edition
+
+[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 =
+EmulationStateId = 3
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
+SafeTextureCacheColorSamples = 512
diff --git a/Data/Sys/GameSettings/WAIEHZ.ini b/Data/Sys/GameSettings/WAIEHZ.ini
new file mode 100644
index 0000000000..39f5fc5674
--- /dev/null
+++ b/Data/Sys/GameSettings/WAIEHZ.ini
@@ -0,0 +1,23 @@
+# WAIEHZ - 101-in-1 Explosive Megamix
+
+[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
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+# Add memory patches to be applied every frame here.
+
+[Video_Settings]
+
diff --git a/Data/Sys/GameSettings/WC6EUP.ini b/Data/Sys/GameSettings/WC6EUP.ini
index 62567fa8d1..241d502123 100644
--- a/Data/Sys/GameSettings/WC6EUP.ini
+++ b/Data/Sys/GameSettings/WC6EUP.ini
@@ -1,14 +1,20 @@
# WC6EUP - Chronos Twins DX
+
[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 mode
+EmulationIssues = Disable PAL60 (EuRGB60) mode
+
[OnLoad]
# Add memory patches to be loaded once on boot here.
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -16,6 +22,7 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Settings]
UseXFB = True
UseRealXFB = False
diff --git a/Data/Sys/GameSettings/WCHEJS.ini b/Data/Sys/GameSettings/WCHEJS.ini
index 2d36a7ca61..dc66ba9952 100644
--- a/Data/Sys/GameSettings/WCHEJS.ini
+++ b/Data/Sys/GameSettings/WCHEJS.ini
@@ -1,10 +1,15 @@
# WCHEJS - Chess Challenge!
+
[Core]
+
[EmuState]
EmulationStateId = 4
EmulationIssues =
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -12,10 +17,12 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Hacks]
EFBEmulateFormatChanges = True
EFBToTextureEnable = False
EFBCopyEnable = True
+
[Video_Settings]
UseXFB = True
UseRealXFB = False
diff --git a/Data/Sys/GameSettings/WCZEXK.ini b/Data/Sys/GameSettings/WCZEXK.ini
new file mode 100644
index 0000000000..73ccd76bbd
--- /dev/null
+++ b/Data/Sys/GameSettings/WCZEXK.ini
@@ -0,0 +1,22 @@
+# WCZEXK - ColorZ
+
+[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 = Wiimote cursor misaligned
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+
+[Video_Settings]
diff --git a/Data/Sys/GameSettings/WERP18.ini b/Data/Sys/GameSettings/WERP18.ini
index 62dc91427c..a5c80581f0 100644
--- a/Data/Sys/GameSettings/WERP18.ini
+++ b/Data/Sys/GameSettings/WERP18.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/WFLE01.ini b/Data/Sys/GameSettings/WFLE01.ini
index b5e7489086..c392bfbfc6 100644
--- a/Data/Sys/GameSettings/WFLE01.ini
+++ b/Data/Sys/GameSettings/WFLE01.ini
@@ -1,10 +1,15 @@
# WFLE01 - Fluidity
+
[Core]
+
[EmuState]
EmulationStateId = 5
EmulationIssues =
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -12,5 +17,6 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Settings]
SafeTextureCacheColorSamples = 0
diff --git a/Data/Sys/GameSettings/WKDEGN.ini b/Data/Sys/GameSettings/WKDEGN.ini
index 052138328f..823461b0cd 100644
--- a/Data/Sys/GameSettings/WKDEGN.ini
+++ b/Data/Sys/GameSettings/WKDEGN.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/WLEELU.ini b/Data/Sys/GameSettings/WLEELU.ini
index b09fbbb3bf..283245cc70 100644
--- a/Data/Sys/GameSettings/WLEELU.ini
+++ b/Data/Sys/GameSettings/WLEELU.ini
@@ -1,10 +1,15 @@
# WLEELU - PooYoos Episode 1
+
[Core]
+
[EmuState]
EmulationStateId = 4
EmulationIssues =
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -12,6 +17,7 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Settings]
UseXFB = True
UseRealXFB = False
diff --git a/Data/Sys/GameSettings/WLNELU.ini b/Data/Sys/GameSettings/WLNELU.ini
index dc755d3671..7b4f945b07 100644
--- a/Data/Sys/GameSettings/WLNELU.ini
+++ b/Data/Sys/GameSettings/WLNELU.ini
@@ -1,10 +1,15 @@
# WLNELU - PooYoos Episode 2
+
[Core]
+
[EmuState]
EmulationStateId = 4
EmulationIssues =
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -12,6 +17,7 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Settings]
UseXFB = True
UseRealXFB = False
diff --git a/Data/Sys/GameSettings/WPCE01.ini b/Data/Sys/GameSettings/WPCE01.ini
index 632a6849a1..4a3e65fd4f 100644
--- a/Data/Sys/GameSettings/WPCE01.ini
+++ b/Data/Sys/GameSettings/WPCE01.ini
@@ -4,7 +4,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
-EmulationIssues = Disable EuRGB60 mode
+EmulationIssues = Disable PAL60 (EuRGB60) mode
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
diff --git a/Data/Sys/GameSettings/WRIEGD.ini b/Data/Sys/GameSettings/WRIEGD.ini
index 58b8b25bfd..3109eb04d8 100644
--- a/Data/Sys/GameSettings/WRIEGD.ini
+++ b/Data/Sys/GameSettings/WRIEGD.ini
@@ -1,10 +1,15 @@
# WRIEGD - RAINBOW ISLANDS T.A.
+
[Core]
+
[EmuState]
EmulationStateId = 4
EmulationIssues =
+
[OnFrame]
+
[ActionReplay]
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -12,6 +17,7 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Hacks]
EFBToTextureEnable = False
EFBCopyEnable = True
diff --git a/Data/Sys/GameSettings/WSREQT.ini b/Data/Sys/GameSettings/WSREQT.ini
index d61c847438..8fad93f820 100644
--- a/Data/Sys/GameSettings/WSREQT.ini
+++ b/Data/Sys/GameSettings/WSREQT.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/WTEELU.ini b/Data/Sys/GameSettings/WTEELU.ini
index 289c72bd9d..78568029a1 100644
--- a/Data/Sys/GameSettings/WTEELU.ini
+++ b/Data/Sys/GameSettings/WTEELU.ini
@@ -1,10 +1,22 @@
# WTEELU - Tales of Elastic Boy Mission 1
+
[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 =
+EmulationIssues =
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
[OnFrame]
+# Add memory patches to be applied every frame here.
+
[ActionReplay]
+# Add action replay cheats here.
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -12,9 +24,11 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Settings]
UseXFB = True
UseRealXFB = False
+
[Video_Hacks]
EFBToTextureEnable = False
EFBCopyEnable = True
diff --git a/Data/Sys/GameSettings/WTKEGL.ini b/Data/Sys/GameSettings/WTKEGL.ini
index fffe3a11c2..bddc5c3441 100644
--- a/Data/Sys/GameSettings/WTKEGL.ini
+++ b/Data/Sys/GameSettings/WTKEGL.ini
@@ -1,14 +1,22 @@
# WTKEGL - TV Show King 2
+
[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 =
+
[OnLoad]
# Add memory patches to be loaded once on boot here.
+
[OnFrame]
+# Add memory patches to be applied every frame here.
+
[ActionReplay]
+# Add action replay cheats here.
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -16,5 +24,6 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Settings]
SafeTextureCacheColorSamples = 512
diff --git a/Data/Sys/GameSettings/WTXPJS.ini b/Data/Sys/GameSettings/WTXPJS.ini
index 70fb7a24f0..73ac9b78b3 100644
--- a/Data/Sys/GameSettings/WTXPJS.ini
+++ b/Data/Sys/GameSettings/WTXPJS.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/WWAEQT.ini b/Data/Sys/GameSettings/WWAEQT.ini
index ea83645cd2..6efac7e7ea 100644
--- a/Data/Sys/GameSettings/WWAEQT.ini
+++ b/Data/Sys/GameSettings/WWAEQT.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/WXBEA4.ini b/Data/Sys/GameSettings/WXBEA4.ini
index 6db7604fba..d5bd4e8dfb 100644
--- a/Data/Sys/GameSettings/WXBEA4.ini
+++ b/Data/Sys/GameSettings/WXBEA4.ini
@@ -1,10 +1,21 @@
# WXBEA4 - Ben 10 Alien Force
+
[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 =
+EmulationIssues =
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
[OnFrame]
+# Add memory patches to be applied every frame here.
+
[ActionReplay]
+# Add action replay cheats here.
+
[Video]
ProjectionHack = 0
PH_SZNear = 0
@@ -12,5 +23,6 @@ PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
+
[Video_Settings]
SafeTextureCacheColorSamples = 0
diff --git a/Data/Sys/GameSettings/WXPEYV.ini b/Data/Sys/GameSettings/WXPEYV.ini
index 1601e67d45..f462faf0e6 100644
--- a/Data/Sys/GameSettings/WXPEYV.ini
+++ b/Data/Sys/GameSettings/WXPEYV.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/WXREE9.ini b/Data/Sys/GameSettings/WXREE9.ini
index 42c04829ba..1e1d78494c 100644
--- a/Data/Sys/GameSettings/WXREE9.ini
+++ b/Data/Sys/GameSettings/WXREE9.ini
@@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
-EmulationIssues =
EmulationStateId = 4
+EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
diff --git a/Data/Sys/GameSettings/WYMEFJ.ini b/Data/Sys/GameSettings/WYMEFJ.ini
new file mode 100644
index 0000000000..887d4fbf9c
--- /dev/null
+++ b/Data/Sys/GameSettings/WYMEFJ.ini
@@ -0,0 +1,25 @@
+# WYMEFJ - Yummy Yummy Cooking Jam
+
+[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 = Crashes after warning screen
+
+[OnLoad]
+# Add memory patches to be loaded once on boot here.
+
+[OnFrame]
+# Add memory patches to be applied every frame here.
+
+[ActionReplay]
+# Add action replay cheats here.
+
+[Video]
+ProjectionHack = 0
+
+[Video_Settings]
+UseXFB = True
+UseRealXFB = False
diff --git a/Data/Sys/Resources/Flag_Australia.png b/Data/Sys/Resources/Flag_Australia.png
new file mode 100644
index 0000000000..aed07e509f
Binary files /dev/null and b/Data/Sys/Resources/Flag_Australia.png differ
diff --git a/Data/Sys/Resources/Flag_Europe.png b/Data/Sys/Resources/Flag_Europe.png
new file mode 100644
index 0000000000..e1b4dbba5a
Binary files /dev/null and b/Data/Sys/Resources/Flag_Europe.png differ
diff --git a/Data/Sys/Resources/Flag_France.png b/Data/Sys/Resources/Flag_France.png
new file mode 100644
index 0000000000..e04c5d2114
Binary files /dev/null and b/Data/Sys/Resources/Flag_France.png differ
diff --git a/Data/Sys/Resources/Flag_Germany.png b/Data/Sys/Resources/Flag_Germany.png
new file mode 100644
index 0000000000..7ae9671399
Binary files /dev/null and b/Data/Sys/Resources/Flag_Germany.png differ
diff --git a/Data/Sys/Resources/Flag_Italy.png b/Data/Sys/Resources/Flag_Italy.png
new file mode 100644
index 0000000000..9e87c615bf
Binary files /dev/null and b/Data/Sys/Resources/Flag_Italy.png differ
diff --git a/Data/Sys/Resources/Flag_Japan.png b/Data/Sys/Resources/Flag_Japan.png
new file mode 100644
index 0000000000..e25cd10948
Binary files /dev/null and b/Data/Sys/Resources/Flag_Japan.png differ
diff --git a/Data/Sys/Resources/Flag_Korea.png b/Data/Sys/Resources/Flag_Korea.png
new file mode 100644
index 0000000000..d1ae515358
Binary files /dev/null and b/Data/Sys/Resources/Flag_Korea.png differ
diff --git a/Data/Sys/Resources/Flag_Netherlands.png b/Data/Sys/Resources/Flag_Netherlands.png
new file mode 100644
index 0000000000..4f5cd1ab16
Binary files /dev/null and b/Data/Sys/Resources/Flag_Netherlands.png differ
diff --git a/Data/Sys/Resources/Flag_Russia.png b/Data/Sys/Resources/Flag_Russia.png
new file mode 100644
index 0000000000..b6e926a982
Binary files /dev/null and b/Data/Sys/Resources/Flag_Russia.png differ
diff --git a/Data/Sys/Resources/Flag_Spain.png b/Data/Sys/Resources/Flag_Spain.png
new file mode 100644
index 0000000000..1a89e7a198
Binary files /dev/null and b/Data/Sys/Resources/Flag_Spain.png differ
diff --git a/Data/Sys/Resources/Flag_Taiwan.png b/Data/Sys/Resources/Flag_Taiwan.png
new file mode 100644
index 0000000000..f9a5dffa28
Binary files /dev/null and b/Data/Sys/Resources/Flag_Taiwan.png differ
diff --git a/Data/Sys/Resources/Flag_USA.png b/Data/Sys/Resources/Flag_USA.png
new file mode 100644
index 0000000000..6e438c4b02
Binary files /dev/null and b/Data/Sys/Resources/Flag_USA.png differ
diff --git a/Data/Sys/Resources/Flag_Unknown.png b/Data/Sys/Resources/Flag_Unknown.png
new file mode 100644
index 0000000000..9177a7416c
Binary files /dev/null and b/Data/Sys/Resources/Flag_Unknown.png differ
diff --git a/Externals/wxWidgets3/CMakeLists.txt b/Externals/wxWidgets3/CMakeLists.txt
index c72a0dd395..68e35ae54a 100644
--- a/Externals/wxWidgets3/CMakeLists.txt
+++ b/Externals/wxWidgets3/CMakeLists.txt
@@ -862,6 +862,7 @@ set(SRCS
${SRCS_GENERIC})
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98")
add_definitions(-D__WXOSX_COCOA__)
set(SRCS
${SRCS}
@@ -882,6 +883,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
${OPENGL_LIBRARY}
${QUICKTIME_LIBRARY})
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
add_definitions(-D__WXGTK__)
set(SRCS
${SRCS}
@@ -904,7 +906,6 @@ endif()
add_definitions(-DWXBUILDING)
# wxWidgets warnings are not our problem.
add_definitions(-w)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98")
enable_precompiled_headers(include/wx/wxprec.h src/common/dummy.cpp SRCS)
add_library(wx STATIC ${PNG_SRCS} ${SRCS})
diff --git a/Installer/dolphin-emu.spec b/Installer/dolphin-emu.spec
index e7f992cee1..e666f3bd17 100644
--- a/Installer/dolphin-emu.spec
+++ b/Installer/dolphin-emu.spec
@@ -22,7 +22,7 @@ Version: 4.0.2
Release: 0%{?dist}
Group: System/Emulators/Other
License: GPL-2.0
-URL: http://www.dolphin-emu.org/
+URL: https://dolphin-emu.org/
BuildArch: x86_64 armv7l aarch64
# For this spec file to work, the Dolphin Emulator sources must be located
@@ -102,6 +102,17 @@ Translations into various languages for Dolphin Emulator
# ------------------------------------------------------
+%package nogui
+Summary: Dolphin Emulator without a graphical user interface
+
+%description nogui
+Dolphin Emulator without a graphical user interface
+
+%files nogui
+%{_bindir}/%{name}-nogui
+
+# ------------------------------------------------------
+
%prep
%setup -q
diff --git a/Readme.md b/Readme.md
index b0f31afa95..9b9224e94f 100644
--- a/Readme.md
+++ b/Readme.md
@@ -6,7 +6,7 @@ Dolphin is an emulator for running GameCube, Triforce and Wii games on
Windows/Linux/OS X systems and recent Android devices. It's licensed under
the terms of the GNU General Public License, version 2 (GPLv2).
-Please read the [FAQ](http://dolphin-emu.org/docs/faq/) before using Dolphin.
+Please read the [FAQ](https://dolphin-emu.org/docs/faq/) before using Dolphin.
## System Requirements
* OS
diff --git a/Source/Android/AndroidManifest.xml b/Source/Android/AndroidManifest.xml
index 12fa07c71b..e1c08cf332 100644
--- a/Source/Android/AndroidManifest.xml
+++ b/Source/Android/AndroidManifest.xml
@@ -6,8 +6,8 @@
android:installLocation="auto">
+ android:minSdkVersion="17"
+ android:targetSdkVersion="21" />
@@ -19,7 +19,8 @@
+ android:allowBackup="true"
+ android:supportsRtl="true">
@@ -18,7 +18,7 @@
android:id="@+id/AboutItemSubTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="15dip"
+ android:layout_marginStart="15dip"
android:textAppearance="?android:attr/textAppearanceSmall"/>
\ No newline at end of file
diff --git a/Source/Android/res/layout/folderbrowser_list_item.xml b/Source/Android/res/layout/folderbrowser_list_item.xml
index 15877bb64a..318efc75ec 100644
--- a/Source/Android/res/layout/folderbrowser_list_item.xml
+++ b/Source/Android/res/layout/folderbrowser_list_item.xml
@@ -14,7 +14,7 @@
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
- android:layout_marginRight="6dip"/>
+ android:layout_marginEnd="6dip"/>
+ android:layout_marginEnd="6dip"/>
+
+ android:layout_height="match_parent">
+
+
+
+
+
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java
index b66aa0a84f..f3317c9e8c 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java
@@ -53,6 +53,11 @@ public final class NativeLibrary
public static final int PRESSED = 1;
}
+ private NativeLibrary()
+ {
+ // Disallows instantiation.
+ }
+
/**
* Default touchscreen device
*/
@@ -105,14 +110,6 @@ public final class NativeLibrary
*/
public static native void SetFilename(String filename);
- /**
- * Sets the dimensions of the rendering window.
- *
- * @param width The new width of the rendering window (in pixels).
- * @param height The new height of the rendering window (in pixels).
- */
- public static native void SetDimensions(int width, int height);
-
/**
* Gets the embedded banner within the given ISO/ROM.
*
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/about/AboutActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/about/AboutActivity.java
index c19bc9f52b..33b30d9a43 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/about/AboutActivity.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/about/AboutActivity.java
@@ -9,13 +9,9 @@ package org.dolphinemu.dolphinemu.about;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.utils.EGLHelper;
-import android.app.ActionBar;
-import android.app.ActionBar.Tab;
-import android.app.ActionBar.TabListener;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
-import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v13.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
@@ -25,9 +21,8 @@ import android.support.v4.view.ViewPager;
* Activity for the about menu, which displays info
* related to the CPU and GPU. Along with misc other info.
*/
-public final class AboutActivity extends Activity implements TabListener
+public final class AboutActivity extends Activity
{
- private ViewPager viewPager;
private final EGLHelper eglHelper = new EGLHelper(EGLHelper.EGL_OPENGL_ES2_BIT);
@Override
@@ -37,32 +32,10 @@ public final class AboutActivity extends Activity implements TabListener
// Set the view pager
setContentView(R.layout.viewpager);
- viewPager = (ViewPager) findViewById(R.id.pager);
- // Initialize the ViewPager adapter.
- final ViewPagerAdapter adapter = new ViewPagerAdapter(getFragmentManager());
- viewPager.setAdapter(adapter);
-
- // Set up the ActionBar
- final ActionBar actionBar = getActionBar();
- actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
- actionBar.addTab(actionBar.newTab().setText(R.string.general).setTabListener(this));
- actionBar.addTab(actionBar.newTab().setText(R.string.cpu).setTabListener(this));
- actionBar.addTab(actionBar.newTab().setText(R.string.gles_two).setTabListener(this));
- if (eglHelper.supportsGLES3())
- actionBar.addTab(actionBar.newTab().setText(R.string.gles_three).setTabListener(this));
- if (eglHelper.supportsOpenGL())
- actionBar.addTab(actionBar.newTab().setText(R.string.desktop_gl).setTabListener(this));
-
- // Set the page change listener
- viewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener()
- {
- @Override
- public void onPageSelected(int position)
- {
- actionBar.setSelectedNavigationItem(position);
- }
- });
+ // Initialize the viewpager.
+ final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
+ viewPager.setAdapter(new ViewPagerAdapter(getFragmentManager()));
}
@Override
@@ -73,31 +46,20 @@ public final class AboutActivity extends Activity implements TabListener
eglHelper.closeHelper();
}
- @Override
- public void onTabSelected(Tab tab, FragmentTransaction ft)
- {
- // When the given tab is selected, switch to the corresponding page in the ViewPager.
- viewPager.setCurrentItem(tab.getPosition());
- }
-
- @Override
- public void onTabReselected(Tab tab, FragmentTransaction ft)
- {
- // Do nothing.
- }
-
- @Override
- public void onTabUnselected(Tab tab, FragmentTransaction ft)
- {
- // Do nothing.
- }
-
/**
* {@link FragmentPagerAdapter} subclass responsible for handling
* the individual {@link Fragment}s within the {@link ViewPager}.
*/
private final class ViewPagerAdapter extends FragmentPagerAdapter
{
+ private final String[] pageTitles = {
+ getString(R.string.general),
+ getString(R.string.cpu),
+ getString(R.string.gles_two),
+ getString(R.string.gles_three),
+ getString(R.string.desktop_gl),
+ };
+
public ViewPagerAdapter(FragmentManager fm)
{
super(fm);
@@ -154,26 +116,7 @@ public final class AboutActivity extends Activity implements TabListener
@Override
public CharSequence getPageTitle(int position)
{
- switch (position)
- {
- case 0:
- return getString(R.string.general);
-
- case 1:
- return getString(R.string.cpu);
-
- case 2:
- return getString(R.string.gles_two);
-
- case 3:
- return getString(R.string.gles_three);
-
- case 4:
- return getString(R.string.desktop_gl);
-
- default: // Should never happen
- return null;
- }
+ return pageTitles[position];
}
}
}
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/about/AboutFragmentItem.java b/Source/Android/src/org/dolphinemu/dolphinemu/about/AboutFragmentItem.java
index cc220ed4c3..ffc6c51c5a 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/about/AboutFragmentItem.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/about/AboutFragmentItem.java
@@ -7,8 +7,7 @@
package org.dolphinemu.dolphinemu.about;
/**
- * Represents an item within an info
- * {@list Fragment} in the About menu.
+ * Represents an item within an info fragment in the About menu.
*/
final class AboutFragmentItem
{
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java
index fb96bec559..41c523ed68 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java
@@ -15,19 +15,22 @@ import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.preference.PreferenceManager;
-import android.util.DisplayMetrics;
-import android.view.*;
+import android.view.InputDevice;
+import android.view.KeyEvent;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.Window;
import android.view.WindowManager.LayoutParams;
import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.settings.input.InputConfigFragment;
-import org.dolphinemu.dolphinemu.utils.EGLHelper;
import java.util.List;
-import javax.microedition.khronos.opengles.GL10;
-
/**
* This is the activity where all of the emulation handling happens.
* This activity is responsible for displaying the SurfaceView that we render to.
@@ -36,8 +39,6 @@ public final class EmulationActivity extends Activity
{
private boolean Running;
private boolean IsActionBarHidden = false;
- private float screenWidth;
- private float screenHeight;
private SharedPreferences sharedPrefs;
@Override
@@ -45,10 +46,7 @@ public final class EmulationActivity extends Activity
{
super.onCreate(savedInstanceState);
- // Retrieve screen dimensions.
- DisplayMetrics dm = getResources().getDisplayMetrics();
- this.screenHeight = dm.heightPixels;
- this.screenWidth = dm.widthPixels;
+ sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
// Request window features for the emulation view.
getWindow().addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON);
@@ -60,18 +58,6 @@ public final class EmulationActivity extends Activity
actionBarBackground.setAlpha(175);
getActionBar().setBackgroundDrawable(actionBarBackground);
- // Set the native rendering screen width/height.
- //
- // Due to a bug in Adreno, it renders the screen rotated 90 degrees when using OpenGL
- // Flip the width and height when on Adreno to work around this.
- // This bug is fixed in Qualcomm driver v53
- // Mali isn't affected by this bug.
- sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
- if (hasBuggedDriverDimensions())
- NativeLibrary.SetDimensions((int)screenHeight, (int)screenWidth);
- else
- NativeLibrary.SetDimensions((int)screenWidth, (int)screenHeight);
-
// Get the intent passed from the GameList when the game
// was selected. This is so the path of the game can be retrieved
// and set on the native side of the code so the emulator can actually
@@ -327,39 +313,4 @@ public final class EmulationActivity extends Activity
return true;
}
-
- // For handling bugged driver dimensions (applies mainly to Qualcomm devices)
- private boolean hasBuggedDriverDimensions()
- {
- final EGLHelper eglHelper = new EGLHelper(EGLHelper.EGL_OPENGL_ES2_BIT);
- final String vendor = eglHelper.getGL().glGetString(GL10.GL_VENDOR);
- final String version = eglHelper.getGL().glGetString(GL10.GL_VERSION);
- final String renderer = eglHelper.getGL().glGetString(GL10.GL_RENDERER);
-
- if (sharedPrefs.getString("gpuPref", "Software Rendering").equals("OGL")
- && eglHelper.supportsGLES3()
- && vendor.equals("Qualcomm")
- && renderer.equals("Adreno (TM) 3"))
- {
- final int start = version.indexOf("V@") + 2;
- final StringBuilder versionBuilder = new StringBuilder();
-
- for (int i = start; i < version.length(); i++)
- {
- char c = version.charAt(i);
-
- // End of numeric portion of version string.
- if (c == ' ')
- break;
-
- versionBuilder.append(c);
- }
-
- if (Float.parseFloat(versionBuilder.toString()) < 53.0f)
- return true;
- }
-
-
- return false;
- }
}
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java
index 97400c23b8..669ffe0094 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java
@@ -144,14 +144,7 @@ public final class FolderBrowser extends ListFragment
{
String isoPath = NativeLibrary.GetConfig("Dolphin.ini", "General", "ISOPath" + i, "");
- if (isoPath.equals(currentDir.getPath()))
- {
- pathNotPresent = false;
- }
- else
- {
- pathNotPresent = true;
- }
+ pathNotPresent = !isoPath.equals(currentDir.getPath());
}
// User doesn't have this path in the config, so add it.
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java
index 6459eda8d8..6e25a33804 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java
@@ -8,12 +8,8 @@ package org.dolphinemu.dolphinemu.gamelist;
import android.content.Context;
import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.util.Log;
import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
import org.dolphinemu.dolphinemu.NativeLibrary;
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/settings/PrefsActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/settings/PrefsActivity.java
index 41979ece46..0ffac65db9 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/settings/PrefsActivity.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/settings/PrefsActivity.java
@@ -11,12 +11,9 @@ import org.dolphinemu.dolphinemu.settings.cpu.CPUSettingsFragment;
import org.dolphinemu.dolphinemu.settings.input.InputConfigFragment;
import org.dolphinemu.dolphinemu.settings.video.VideoSettingsFragment;
-import android.app.ActionBar;
-import android.app.ActionBar.Tab;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
-import android.app.FragmentTransaction;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
@@ -28,66 +25,23 @@ import android.support.v4.view.ViewPager;
* Main activity that manages all of the preference fragments used to display
* the settings to the user.
*/
-public final class PrefsActivity extends Activity implements ActionBar.TabListener, OnSharedPreferenceChangeListener
+public final class PrefsActivity extends Activity implements OnSharedPreferenceChangeListener
{
- /**
- * The {@link ViewPager} that will host the section contents.
- */
- private ViewPager mViewPager;
-
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
-
- // Set the ViewPager.
setContentView(R.layout.viewpager);
- mViewPager = (ViewPager) findViewById(R.id.pager);
// Set the ViewPager adapter.
- final ViewPagerAdapter mSectionsPagerAdapter = new ViewPagerAdapter(getFragmentManager());
- mViewPager.setAdapter(mSectionsPagerAdapter);
+ final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
+ viewPager.setAdapter(new ViewPagerAdapter(getFragmentManager()));
// Register the preference change listener.
final SharedPreferences sPrefs = PreferenceManager.getDefaultSharedPreferences(this);
sPrefs.registerOnSharedPreferenceChangeListener(this);
-
- // Set up the action bar.
- final ActionBar actionBar = getActionBar();
- actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
- actionBar.addTab(actionBar.newTab().setText(R.string.cpu_settings).setTabListener(this));
- actionBar.addTab(actionBar.newTab().setText(R.string.input_settings).setTabListener(this));
- actionBar.addTab(actionBar.newTab().setText(R.string.video_settings).setTabListener(this));
-
- // When swiping between different sections, select the corresponding
- // tab. We can also use ActionBar.Tab#select() to do this if we have
- // a reference to the Tab.
- mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener()
- {
- @Override
- public void onPageSelected(int position)
- {
- actionBar.setSelectedNavigationItem(position);
- }
- } );
}
- public void onTabSelected(Tab tab, FragmentTransaction ft)
- {
- // When the given tab is selected, switch to the corresponding page in the ViewPager.
- mViewPager.setCurrentItem(tab.getPosition());
- }
-
- public void onTabReselected(Tab tab, FragmentTransaction ft)
- {
- // Do nothing.
- }
-
- public void onTabUnselected(Tab tab, FragmentTransaction ft)
- {
- // Do nothing.
- }
-
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
{
@@ -101,6 +55,12 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen
*/
private final class ViewPagerAdapter extends FragmentPagerAdapter
{
+ private final String[] pageTitles = {
+ getString(R.string.cpu_settings),
+ getString(R.string.input_settings),
+ getString(R.string.video_settings)
+ };
+
public ViewPagerAdapter(FragmentManager fm)
{
super(fm);
@@ -135,20 +95,7 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen
@Override
public CharSequence getPageTitle(int position)
{
- switch(position)
- {
- case 0:
- return getString(R.string.cpu_settings);
-
- case 1:
- return getString(R.string.input_settings);
-
- case 2:
- return getString(R.string.video_settings);
-
- default: // Should never happen.
- return null;
- }
+ return pageTitles[position];
}
}
}
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/settings/UserPreferences.java b/Source/Android/src/org/dolphinemu/dolphinemu/settings/UserPreferences.java
index 49ae2bfebd..d2ae56b40f 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/settings/UserPreferences.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/settings/UserPreferences.java
@@ -21,6 +21,11 @@ import android.preference.PreferenceManager;
*/
public final class UserPreferences
{
+ private UserPreferences()
+ {
+ // Disallows instantiation.
+ }
+
/**
* Loads the settings stored in the Dolphin ini config files to the shared preferences of this front-end.
*
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/settings/input/InputConfigFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/settings/input/InputConfigFragment.java
index b6251d1d54..82e2ffc44f 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/settings/input/InputConfigFragment.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/settings/input/InputConfigFragment.java
@@ -91,12 +91,12 @@ public final class InputConfigFragment extends PreferenceFragment
else
{
List motions = input.getMotionRanges();
- String fakeid = "";
+ StringBuilder fakeid = new StringBuilder();
for (InputDevice.MotionRange range : motions)
- fakeid += range.getAxis();
+ fakeid.append(range.getAxis());
- return fakeid;
+ return fakeid.toString();
}
}
}
diff --git a/Source/Core/AudioCommon/SoundStream.h b/Source/Core/AudioCommon/SoundStream.h
index e977180280..ff30f36f37 100644
--- a/Source/Core/AudioCommon/SoundStream.h
+++ b/Source/Core/AudioCommon/SoundStream.h
@@ -12,7 +12,7 @@ class SoundStream
{
protected:
- CMixer *m_mixer;
+ CMixer* m_mixer;
// We set this to shut down the sound thread.
// 0=keep playing, 1=stop playing NOW.
volatile int threadData;
@@ -21,11 +21,11 @@ protected:
bool m_muted;
public:
- SoundStream(CMixer *mixer) : m_mixer(mixer), threadData(0), m_logAudio(false), m_muted(false) {}
+ SoundStream(CMixer* mixer) : m_mixer(mixer), threadData(0), m_logAudio(false), m_muted(false) {}
virtual ~SoundStream() { delete m_mixer; }
static bool isValid() { return false; }
- virtual CMixer *GetMixer() const { return m_mixer; }
+ virtual CMixer* GetMixer() const { return m_mixer; }
virtual bool Start() { return false; }
virtual void SetVolume(int) {}
virtual void SoundLoop() {}
@@ -36,7 +36,7 @@ public:
virtual void StartLogAudio(const std::string& filename)
{
- if (! m_logAudio)
+ if (!m_logAudio)
{
m_logAudio = true;
g_wave_writer.Start(filename, m_mixer->GetSampleRate());
diff --git a/Source/Core/AudioCommon/XAudio2Stream.cpp b/Source/Core/AudioCommon/XAudio2Stream.cpp
index 81af045300..d0446cb4bb 100644
--- a/Source/Core/AudioCommon/XAudio2Stream.cpp
+++ b/Source/Core/AudioCommon/XAudio2Stream.cpp
@@ -174,7 +174,7 @@ bool XAudio2::Start()
{
HRESULT hr;
- // callback doesn't seem to run on a specific cpu anyways
+ // callback doesn't seem to run on a specific CPU anyways
IXAudio2* xaudptr;
if (FAILED(hr = ((XAudio2Create_t)PXAudio2Create)(&xaudptr, 0, XAUDIO2_DEFAULT_PROCESSOR)))
{
diff --git a/Source/Core/AudioCommon/XAudio2_7Stream.cpp b/Source/Core/AudioCommon/XAudio2_7Stream.cpp
index cce45d7942..ac75e7c433 100644
--- a/Source/Core/AudioCommon/XAudio2_7Stream.cpp
+++ b/Source/Core/AudioCommon/XAudio2_7Stream.cpp
@@ -162,7 +162,7 @@ bool XAudio2_7::Start()
{
HRESULT hr;
- // callback doesn't seem to run on a specific cpu anyways
+ // callback doesn't seem to run on a specific CPU anyways
IXAudio2* xaudptr;
if (FAILED(hr = XAudio2Create(&xaudptr, 0, XAUDIO2_DEFAULT_PROCESSOR)))
{
diff --git a/Source/Core/AudioCommon/aldlist.h b/Source/Core/AudioCommon/aldlist.h
index c24ce92651..ce8006fcc0 100644
--- a/Source/Core/AudioCommon/aldlist.h
+++ b/Source/Core/AudioCommon/aldlist.h
@@ -28,17 +28,17 @@ private:
s32 filterIndex;
public:
- ALDeviceList ();
- ~ALDeviceList ();
+ ALDeviceList();
+ ~ALDeviceList();
s32 GetNumDevices();
- char *GetDeviceName(s32 index);
- void GetDeviceVersion(s32 index, s32 *major, s32 *minor);
+ char* GetDeviceName(s32 index);
+ void GetDeviceVersion(s32 index, s32* major, s32* minor);
u32 GetMaxNumSources(s32 index);
- bool IsExtensionSupported(s32 index, char *szExtName);
+ bool IsExtensionSupported(s32 index, char* szExtName);
s32 GetDefaultDevice();
void FilterDevicesMinVer(s32 major, s32 minor);
void FilterDevicesMaxVer(s32 major, s32 minor);
- void FilterDevicesExtension(char *szExtName);
+ void FilterDevicesExtension(char* szExtName);
void ResetFilters();
s32 GetFirstFilteredDevice();
s32 GetNextFilteredDevice();
diff --git a/Source/Core/Common/ArmEmitter.cpp b/Source/Core/Common/ArmEmitter.cpp
index dda13cb4c1..15ef41044b 100644
--- a/Source/Core/Common/ArmEmitter.cpp
+++ b/Source/Core/Common/ArmEmitter.cpp
@@ -388,6 +388,28 @@ void ARMXEmitter::YIELD()
Write32(condition | 0x0320F001);
}
+void ARMXEmitter::MRC(u32 coproc, u32 opc1, ARMReg Rt, u32 CRn, u32 CRm, u32 opc2)
+{
+ _assert_msg_(DYNA_REC, coproc <= 0xF, "%s has co-processor that is %d when it must be under 16!", __FUNCTION__, coproc);
+ _assert_msg_(DYNA_REC, opc1 <= 7, "%s has opc1 that is %d when it must be under 8!", __FUNCTION__, opc1);
+ _assert_msg_(DYNA_REC, CRn <= 0xF, "%s has CRn that is %d when it must be under 16!", __FUNCTION__, CRn);
+ _assert_msg_(DYNA_REC, opc2 <= 7, "%s has opc2 that is %d when it must be under 8!", __FUNCTION__, opc2);
+
+ Write32(condition | (0b1110 << 24) | (opc1 << 21) | (1 << 20) | (CRn << 16) \
+ | (Rt << 12) | (coproc << 8) | (opc2 << 5) | (1 << 4) | CRm);
+}
+
+void ARMXEmitter::MCR(u32 coproc, u32 opc1, ARMReg Rt, u32 CRn, u32 CRm, u32 opc2)
+{
+ _assert_msg_(DYNA_REC, coproc <= 0xF, "%s has co-processor that is %d when it must be under 16!", __FUNCTION__, coproc);
+ _assert_msg_(DYNA_REC, opc1 <= 7, "%s has opc1 that is %d when it must be under 8!", __FUNCTION__, opc1);
+ _assert_msg_(DYNA_REC, CRn <= 0xF, "%s has CRn that is %d when it must be under 16!", __FUNCTION__, CRn);
+ _assert_msg_(DYNA_REC, opc2 <= 7, "%s has opc2 that is %d when it must be under 8!", __FUNCTION__, opc2);
+
+ Write32(condition | (0b1110 << 24) | (opc1 << 21) | (CRn << 16) \
+ | (Rt << 12) | (coproc << 8) | (opc2 << 5) | (1 << 4) | CRm);
+}
+
FixupBranch ARMXEmitter::B()
{
FixupBranch branch;
diff --git a/Source/Core/Common/ArmEmitter.h b/Source/Core/Common/ArmEmitter.h
index ed0376e9c8..c4139b67c7 100644
--- a/Source/Core/Common/ArmEmitter.h
+++ b/Source/Core/Common/ArmEmitter.h
@@ -348,7 +348,7 @@ protected:
inline void Write32(u32 value) {*(u32*)code = value; code+=4;}
public:
- ARMXEmitter() : code(0), startcode(0), lastCacheFlushEnd(0) {
+ ARMXEmitter() : code(nullptr), startcode(nullptr), lastCacheFlushEnd(nullptr) {
condition = CC_AL << 28;
}
ARMXEmitter(u8 *code_ptr) {
@@ -385,6 +385,10 @@ public:
// Hint instruction
void YIELD();
+ // System
+ void MRC(u32 coproc, u32 opc1, ARMReg Rt, u32 CRn, u32 CRm, u32 opc2 = 0);
+ void MCR(u32 coproc, u32 opc1, ARMReg Rt, u32 CRn, u32 CRm, u32 opc2 = 0);
+
// Do nothing
void NOP(int count = 1); //nop padding - TODO: fast nop slides, for amd and intel (check their manuals)
diff --git a/Source/Core/Common/CPUDetect.h b/Source/Core/Common/CPUDetect.h
index d66ace3c62..752d26afb2 100644
--- a/Source/Core/Common/CPUDetect.h
+++ b/Source/Core/Common/CPUDetect.h
@@ -3,7 +3,7 @@
// Refer to the license.txt file included.
-// Detect the cpu, so we'll know which optimizations to use
+// Detect the CPU, so we'll know which optimizations to use
#pragma once
#include
@@ -78,11 +78,11 @@ struct CPUInfo
// Call Detect()
explicit CPUInfo();
- // Turn the cpu info into a string we can show
+ // Turn the CPU info into a string we can show
std::string Summarize();
private:
- // Detects the various cpu features
+ // Detects the various CPU features
void Detect();
};
diff --git a/Source/Core/Common/ChunkFile.h b/Source/Core/Common/ChunkFile.h
index 98dafbeac6..69d0f659b7 100644
--- a/Source/Core/Common/ChunkFile.h
+++ b/Source/Core/Common/ChunkFile.h
@@ -323,6 +323,8 @@ private:
}
};
+// NOTE: this class is only used in DolphinWX/ISOFile.cpp for caching loaded
+// ISO data. It will be removed when DolphinWX is, so please don't use it.
class CChunkFileReader
{
public:
diff --git a/Source/Core/Common/GekkoDisassembler.cpp b/Source/Core/Common/GekkoDisassembler.cpp
index 15eb21e8bd..fe663d5d24 100644
--- a/Source/Core/Common/GekkoDisassembler.cpp
+++ b/Source/Core/Common/GekkoDisassembler.cpp
@@ -2285,7 +2285,7 @@ const char* GekkoDisassembler::GetGPRName(u32 index)
if (index < 32)
return gprnames[index];
- return 0;
+ return nullptr;
}
static const char* fprnames[] =
@@ -2301,5 +2301,5 @@ const char* GekkoDisassembler::GetFPRName(u32 index)
if (index < 32)
return fprnames[index];
- return 0;
+ return nullptr;
}
diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp
index dda5e1ff0e..413c5dc82b 100644
--- a/Source/Core/Common/IniFile.cpp
+++ b/Source/Core/Common/IniFile.cpp
@@ -2,7 +2,6 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
-
// see IniFile.h
#include
@@ -292,7 +291,6 @@ bool IniFile::GetLines(const std::string& sectionName, std::vector*
return true;
}
-
void IniFile::SortSections()
{
sections.sort();
diff --git a/Source/Core/Common/x64CPUDetect.cpp b/Source/Core/Common/x64CPUDetect.cpp
index 4150a4159f..31409685e8 100644
--- a/Source/Core/Common/x64CPUDetect.cpp
+++ b/Source/Core/Common/x64CPUDetect.cpp
@@ -81,7 +81,7 @@ CPUInfo::CPUInfo()
Detect();
}
-// Detects the various cpu features
+// Detects the various CPU features
void CPUInfo::Detect()
{
memset(this, 0, sizeof(*this));
@@ -104,7 +104,7 @@ void CPUInfo::Detect()
int cpu_id[4];
memset(brand_string, 0, sizeof(brand_string));
- // Detect CPU's CPUID capabilities, and grab cpu string
+ // Detect CPU's CPUID capabilities, and grab CPU string
__cpuid(cpu_id, 0x00000000);
u32 max_std_fn = cpu_id[0]; // EAX
*((int *)brand_string) = cpu_id[1];
@@ -225,7 +225,7 @@ void CPUInfo::Detect()
}
}
-// Turn the cpu info into a string we can show
+// Turn the CPU info into a string we can show
std::string CPUInfo::Summarize()
{
std::string sum(cpu_string);
diff --git a/Source/Core/Common/x64Emitter.cpp b/Source/Core/Common/x64Emitter.cpp
index cbdae83c91..e894a19e09 100644
--- a/Source/Core/Common/x64Emitter.cpp
+++ b/Source/Core/Common/x64Emitter.cpp
@@ -568,7 +568,7 @@ void XEmitter::NOP(size_t size)
}
}
-void XEmitter::PAUSE() {Write8(0xF3); NOP();} //use in tight spinloops for energy saving on some cpu
+void XEmitter::PAUSE() {Write8(0xF3); NOP();} //use in tight spinloops for energy saving on some CPU
void XEmitter::CLC() {CheckFlags(); Write8(0xF8);} //clear carry
void XEmitter::CMC() {CheckFlags(); Write8(0xF5);} //flip carry
void XEmitter::STC() {CheckFlags(); Write8(0xF9);} //set carry
diff --git a/Source/Core/Common/x64Emitter.h b/Source/Core/Common/x64Emitter.h
index 9df47e10eb..e67c763aaa 100644
--- a/Source/Core/Common/x64Emitter.h
+++ b/Source/Core/Common/x64Emitter.h
@@ -385,7 +385,7 @@ public:
void SetJumpTarget(const FixupBranch &branch);
void SETcc(CCFlags flag, OpArg dest);
- // Note: CMOV brings small if any benefit on current cpus.
+ // Note: CMOV brings small if any benefit on current CPUs.
void CMOVcc(int bits, X64Reg dest, OpArg src, CCFlags flag);
// Fences
diff --git a/Source/Core/Core/ArmMemTools.cpp b/Source/Core/Core/ArmMemTools.cpp
deleted file mode 100644
index 634c2a7bf8..0000000000
--- a/Source/Core/Core/ArmMemTools.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2013 Dolphin Emulator Project
-// Licensed under GPLv2
-// Refer to the license.txt file included.
-
-
-#include
-#include
-#ifdef ANDROID
-#include
-#else
-#include
-#include // Look in here for the context definition.
-#endif
-
-#include "Common/CommonFuncs.h"
-#include "Common/CommonTypes.h"
-#include "Core/MemTools.h"
-#include "Core/HW/Memmap.h"
-#include "Core/PowerPC/JitInterface.h"
-#include "Core/PowerPC/PowerPC.h"
-#include "Core/PowerPC/JitCommon/JitBase.h"
-
-namespace EMM
-{
-#ifdef ANDROID
-typedef struct sigcontext mcontext_t;
-typedef struct ucontext {
- uint32_t uc_flags;
- struct ucontext* uc_link;
- stack_t uc_stack;
- mcontext_t uc_mcontext;
- // Other fields are not used by Google Breakpad. Don't define them.
-} ucontext_t;
-#endif
-
-static void sigsegv_handler(int sig, siginfo_t *info, void *raw_context)
-{
- if (sig != SIGSEGV)
- {
- // We are not interested in other signals - handle it as usual.
- return;
- }
- ucontext_t *context = (ucontext_t *)raw_context;
- int sicode = info->si_code;
- if (sicode != SEGV_MAPERR && sicode != SEGV_ACCERR)
- {
- // Huh? Return.
- return;
- }
-
- // Get all the information we can out of the context.
- mcontext_t *ctx = &context->uc_mcontext;
-
- // comex says hello, and is most curious whether this is arm_r10 for a
- // reason as opposed to si_addr like the x64MemTools.cpp version. Is there
- // even a need for this file to be architecture specific?
- uintptr_t fault_memory_ptr = (uintptr_t)ctx->arm_r10;
-
- if (!JitInterface::HandleFault(fault_memory_ptr, ctx))
- {
- // retry and crash
- signal(SIGSEGV, SIG_DFL);
- }
-}
-
-void InstallExceptionHandler()
-{
- struct sigaction sa;
- sa.sa_handler = 0;
- sa.sa_sigaction = &sigsegv_handler;
- sa.sa_flags = SA_SIGINFO;
- sigemptyset(&sa.sa_mask);
- sigaction(SIGSEGV, &sa, nullptr);
-}
-
-void UninstallExceptionHandler() {}
-
-} // namespace
diff --git a/Source/Core/Core/Boot/Boot_BS2Emu.cpp b/Source/Core/Core/Boot/Boot_BS2Emu.cpp
index 71311abc1b..49915e41c1 100644
--- a/Source/Core/Core/Boot/Boot_BS2Emu.cpp
+++ b/Source/Core/Core/Boot/Boot_BS2Emu.cpp
@@ -305,7 +305,7 @@ bool CBoot::EmulatedBS2_Wii()
{
INFO_LOG(BOOT, "Faking Wii BS2...");
- // setup wii memory
+ // setup Wii memory
DiscIO::IVolume::ECountry CountryCode = DiscIO::IVolume::COUNTRY_UNKNOWN;
if (VolumeHandler::IsValid())
CountryCode = VolumeHandler::GetVolume()->GetCountry();
diff --git a/Source/Core/Core/Boot/Boot_WiiWAD.cpp b/Source/Core/Core/Boot/Boot_WiiWAD.cpp
index cd7ec48d1a..7c4cf2034f 100644
--- a/Source/Core/Core/Boot/Boot_WiiWAD.cpp
+++ b/Source/Core/Core/Boot/Boot_WiiWAD.cpp
@@ -86,7 +86,7 @@ bool CBoot::Boot_WiiWAD(const std::string& _pFilename)
if (titleID == TITLEID_SYSMENU)
HLE_IPC_CreateVirtualFATFilesystem();
- // setup wii mem
+ // setup Wii memory
if (!SetupWiiMemory(ContentLoader.GetCountry()))
return false;
diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp
index 75cda73223..95346d5735 100644
--- a/Source/Core/Core/BootManager.cpp
+++ b/Source/Core/Core/BootManager.cpp
@@ -88,7 +88,7 @@ bool BootCore(const std::string& _rFilename)
StartUp.bRunCompareClient = false;
StartUp.bRunCompareServer = false;
- // This is saved seperately from everything because it can be changed in SConfig::AutoSetup()
+ // This is saved separately from everything because it can be changed in SConfig::AutoSetup()
config_cache.bHLE_BS2 = StartUp.bHLE_BS2;
// If for example the ISO file is bad we return here
diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt
index 7b0e00a595..52ec66d4b8 100644
--- a/Source/Core/Core/CMakeLists.txt
+++ b/Source/Core/Core/CMakeLists.txt
@@ -9,6 +9,7 @@ set(SRCS ActionReplay.cpp
ec_wii.cpp
GeckoCodeConfig.cpp
GeckoCode.cpp
+ MemTools.cpp
Movie.cpp
NetPlayClient.cpp
NetPlayServer.cpp
@@ -179,7 +180,6 @@ set(SRCS ActionReplay.cpp
if(_M_X86)
set(SRCS ${SRCS}
- x64MemTools.cpp
PowerPC/Jit64IL/IR_X86.cpp
PowerPC/Jit64IL/JitIL.cpp
PowerPC/Jit64IL/JitIL_Tables.cpp
@@ -201,7 +201,6 @@ if(_M_X86)
PowerPC/JitCommon/TrampolineCache.cpp)
elseif(_M_ARM_32)
set(SRCS ${SRCS}
- ArmMemTools.cpp
PowerPC/JitArm32/Jit.cpp
PowerPC/JitArm32/JitAsm.cpp
PowerPC/JitArm32/JitArm_BackPatch.cpp
diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp
index a18af93913..2c74b423b4 100644
--- a/Source/Core/Core/ConfigManager.cpp
+++ b/Source/Core/Core/ConfigManager.cpp
@@ -69,6 +69,18 @@ static const struct
{ "ToggleThrottle", 9 /* '\t' */, 0 /* wxMOD_NONE */ },
{ "IncreaseFrameLimit", 0, 0 /* wxMOD_NONE */ },
{ "DecreaseFrameLimit", 0, 0 /* wxMOD_NONE */ },
+
+ { "FreelookIncreaseSpeed",49 /* '1' */, 4 /* wxMOD_SHIFT */ },
+ { "FreelookDecreaseSpeed",50 /* '2' */, 4 /* wxMOD_SHIFT */ },
+ { "FreelookResetSpeed", 70 /* 'F' */, 4 /* wxMOD_SHIFT */ },
+ { "FreelookUp", 69 /* 'E' */, 4 /* wxMOD_SHIFT */ },
+ { "FreelookDown", 81 /* 'Q' */, 4 /* wxMOD_SHIFT */ },
+ { "FreelookLeft", 65 /* 'A' */, 4 /* wxMOD_SHIFT */ },
+ { "FreelookRight", 68 /* 'D' */, 4 /* wxMOD_SHIFT */ },
+ { "FreelookZoomIn", 87 /* 'W' */, 4 /* wxMOD_SHIFT */ },
+ { "FreelookZoomOut", 83 /* 'S' */, 4 /* wxMOD_SHIFT */ },
+ { "FreelookReset", 82 /* 'R' */, 4 /* wxMOD_SHIFT */ },
+
{ "LoadStateSlot1", 340 /* WXK_F1 */, 0 /* wxMOD_NONE */ },
{ "LoadStateSlot2", 341 /* WXK_F2 */, 0 /* wxMOD_NONE */ },
{ "LoadStateSlot3", 342 /* WXK_F3 */, 0 /* wxMOD_NONE */ },
@@ -262,9 +274,15 @@ void SConfig::SaveGameListSettings(IniFile& ini)
gamelist->Set("ListJap", m_ListJap);
gamelist->Set("ListPal", m_ListPal);
gamelist->Set("ListUsa", m_ListUsa);
+ gamelist->Set("ListAustralia", m_ListAustralia);
gamelist->Set("ListFrance", m_ListFrance);
+ gamelist->Set("ListGermany", m_ListGermany);
+ gamelist->Set("ListInternational", m_ListInternational);
gamelist->Set("ListItaly", m_ListItaly);
gamelist->Set("ListKorea", m_ListKorea);
+ gamelist->Set("ListNetherlands", m_ListNetherlands);
+ gamelist->Set("ListRussia", m_ListRussia);
+ gamelist->Set("ListSpain", m_ListSpain);
gamelist->Set("ListTaiwan", m_ListTaiwan);
gamelist->Set("ListUnknown", m_ListUnknown);
gamelist->Set("ListSort", m_ListSort);
@@ -466,21 +484,27 @@ void SConfig::LoadGameListSettings(IniFile& ini)
{
IniFile::Section* gamelist = ini.GetOrCreateSection("GameList");
- gamelist->Get("ListDrives", &m_ListDrives, false);
- gamelist->Get("ListWad", &m_ListWad, true);
- gamelist->Get("ListWii", &m_ListWii, true);
- gamelist->Get("ListGC", &m_ListGC, true);
- gamelist->Get("ListJap", &m_ListJap, true);
- gamelist->Get("ListPal", &m_ListPal, true);
- gamelist->Get("ListUsa", &m_ListUsa, true);
+ gamelist->Get("ListDrives", &m_ListDrives, false);
+ gamelist->Get("ListWad", &m_ListWad, true);
+ gamelist->Get("ListWii", &m_ListWii, true);
+ gamelist->Get("ListGC", &m_ListGC, true);
+ gamelist->Get("ListJap", &m_ListJap, true);
+ gamelist->Get("ListPal", &m_ListPal, true);
+ gamelist->Get("ListUsa", &m_ListUsa, true);
- gamelist->Get("ListFrance", &m_ListFrance, true);
- gamelist->Get("ListItaly", &m_ListItaly, true);
- gamelist->Get("ListKorea", &m_ListKorea, true);
- gamelist->Get("ListTaiwan", &m_ListTaiwan, true);
- gamelist->Get("ListUnknown", &m_ListUnknown, true);
- gamelist->Get("ListSort", &m_ListSort, 3);
- gamelist->Get("ListSortSecondary",&m_ListSort2, 0);
+ gamelist->Get("ListAustralia", &m_ListAustralia, true);
+ gamelist->Get("ListFrance", &m_ListFrance, true);
+ gamelist->Get("ListGermany", &m_ListGermany, true);
+ gamelist->Get("ListInternational", &m_ListInternational, true);
+ gamelist->Get("ListItaly", &m_ListItaly, true);
+ gamelist->Get("ListKorea", &m_ListKorea, true);
+ gamelist->Get("ListNetherlands", &m_ListNetherlands, true);
+ gamelist->Get("ListRussia", &m_ListRussia, true);
+ gamelist->Get("ListSpain", &m_ListSpain, true);
+ gamelist->Get("ListTaiwan", &m_ListTaiwan, true);
+ gamelist->Get("ListUnknown", &m_ListUnknown, true);
+ gamelist->Get("ListSort", &m_ListSort, 3);
+ gamelist->Get("ListSortSecondary", &m_ListSort2, 0);
// Determines if compressed games display in blue
gamelist->Get("ColorCompressed", &m_ColorCompressed, true);
diff --git a/Source/Core/Core/ConfigManager.h b/Source/Core/Core/ConfigManager.h
index 8e4ca7fce2..7c14d9dfb8 100644
--- a/Source/Core/Core/ConfigManager.h
+++ b/Source/Core/Core/ConfigManager.h
@@ -63,9 +63,15 @@ struct SConfig : NonCopyable
bool m_ListPal;
bool m_ListUsa;
bool m_ListJap;
+ bool m_ListAustralia;
bool m_ListFrance;
+ bool m_ListGermany;
+ bool m_ListInternational;
bool m_ListItaly;
bool m_ListKorea;
+ bool m_ListNetherlands;
+ bool m_ListRussia;
+ bool m_ListSpain;
bool m_ListTaiwan;
bool m_ListUnknown;
int m_ListSort;
@@ -104,10 +110,10 @@ struct SConfig : NonCopyable
SysConf* m_SYSCONF;
- // save settings
+ // Save settings
void SaveSettings();
- // load settings
+ // Load settings
void LoadSettings();
// Return the permanent and somewhat globally used instance of this struct
diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp
index 5d2ff0ab96..396c5cc68a 100644
--- a/Source/Core/Core/Core.cpp
+++ b/Source/Core/Core/Core.cpp
@@ -255,10 +255,8 @@ static void CpuThread()
g_video_backend->Video_Prepare();
}
- #if _M_X86_64 || _M_ARM_32
if (_CoreParameter.bFastmem)
EMM::InstallExceptionHandler(); // Let's run under memory watch
- #endif
if (!s_state_filename.empty())
State::LoadAs(s_state_filename);
@@ -283,9 +281,7 @@ static void CpuThread()
if (!_CoreParameter.bCPUThread)
g_video_backend->Video_Cleanup();
- #if _M_X86_64 || _M_ARM_32
EMM::UninstallExceptionHandler();
- #endif
return;
}
@@ -358,7 +354,7 @@ void EmuThread()
}
Pad::Initialize(s_window_handle);
- // Load and Init Wiimotes - only if we are booting in wii mode
+ // Load and Init Wiimotes - only if we are booting in Wii mode
if (core_parameter.bWii)
{
Wiimote::Initialize(s_window_handle, !s_state_filename.empty());
@@ -398,7 +394,7 @@ void EmuThread()
Host_UpdateDisasmDialog();
Host_UpdateMainFrame();
- // Determine the cpu thread function
+ // Determine the CPU thread function
void (*cpuThreadFunc)(void);
if (core_parameter.m_BootType == SCoreStartupParameter::BOOT_DFF)
cpuThreadFunc = FifoPlayerThread;
@@ -582,15 +578,15 @@ bool PauseAndLock(bool doLock, bool unpauseOnUnlock)
if (doLock ? s_pause_and_lock_depth++ : --s_pause_and_lock_depth)
return true;
- // first pause or unpause the cpu
+ // first pause or unpause the CPU
bool wasUnpaused = CCPU::PauseAndLock(doLock, unpauseOnUnlock);
ExpansionInterface::PauseAndLock(doLock, unpauseOnUnlock);
- // audio has to come after cpu, because cpu thread can wait for audio thread (m_throttle).
+ // audio has to come after CPU, because CPU thread can wait for audio thread (m_throttle).
AudioCommon::PauseAndLock(doLock, unpauseOnUnlock);
DSP::GetDSPEmulator()->PauseAndLock(doLock, unpauseOnUnlock);
- // video has to come after cpu, because cpu thread can wait for video thread (s_efbAccessRequested).
+ // video has to come after CPU, because CPU thread can wait for video thread (s_efbAccessRequested).
g_video_backend->PauseAndLock(doLock, unpauseOnUnlock);
return wasUnpaused;
}
diff --git a/Source/Core/Core/Core.h b/Source/Core/Core/Core.h
index 08ed7f1081..341036bead 100644
--- a/Source/Core/Core/Core.h
+++ b/Source/Core/Core/Core.h
@@ -45,9 +45,9 @@ void Shutdown();
std::string StopMessage(bool, std::string);
bool IsRunning();
-bool IsRunningAndStarted(); // is running and the cpu loop has been entered
-bool IsRunningInCurrentThread(); // this tells us whether we are running in the cpu thread.
-bool IsCPUThread(); // this tells us whether we are the cpu thread.
+bool IsRunningAndStarted(); // is running and the CPU loop has been entered
+bool IsRunningInCurrentThread(); // this tells us whether we are running in the CPU thread.
+bool IsCPUThread(); // this tells us whether we are the CPU thread.
bool IsGPUThread();
void SetState(EState _State);
diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj
index b46357fd3d..611658f65f 100644
--- a/Source/Core/Core/Core.vcxproj
+++ b/Source/Core/Core/Core.vcxproj
@@ -187,6 +187,7 @@
+
@@ -240,7 +241,6 @@
-
@@ -383,6 +383,7 @@
+
@@ -403,7 +404,6 @@
-
diff --git a/Source/Core/Core/Core.vcxproj.filters b/Source/Core/Core/Core.vcxproj.filters
index faeb9bcd24..4ddaee9aa4 100644
--- a/Source/Core/Core/Core.vcxproj.filters
+++ b/Source/Core/Core/Core.vcxproj.filters
@@ -141,13 +141,13 @@
+
-
ActionReplay
@@ -631,9 +631,6 @@
PowerPC\JitCommon
-
- PowerPC\JitCommon
-
PowerPC\JitCommon
@@ -718,6 +715,7 @@
+
@@ -1176,9 +1174,6 @@
PowerPC\JitCommon
-
- PowerPC\JitCommon
-
PowerPC\JitCommon
diff --git a/Source/Core/Core/CoreParameter.cpp b/Source/Core/Core/CoreParameter.cpp
index bef3eb9f52..6907667b46 100644
--- a/Source/Core/Core/CoreParameter.cpp
+++ b/Source/Core/Core/CoreParameter.cpp
@@ -169,14 +169,19 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
Region = JAP_DIR;
break;
+ case DiscIO::IVolume::COUNTRY_AUSTRALIA:
case DiscIO::IVolume::COUNTRY_EUROPE:
case DiscIO::IVolume::COUNTRY_FRANCE:
+ case DiscIO::IVolume::COUNTRY_INTERNATIONAL:
case DiscIO::IVolume::COUNTRY_ITALY:
+ case DiscIO::IVolume::COUNTRY_NETHERLANDS:
case DiscIO::IVolume::COUNTRY_RUSSIA:
+ case DiscIO::IVolume::COUNTRY_SPAIN:
bNTSC = false;
Region = EUR_DIR;
break;
+ case DiscIO::IVolume::COUNTRY_UNKNOWN:
default:
if (PanicYesNoT("Your GCM/ISO file seems to be invalid (invalid country)."
"\nContinue with PAL region?"))
@@ -249,14 +254,17 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
Region = JAP_DIR;
break;
+ case DiscIO::IVolume::COUNTRY_AUSTRALIA:
case DiscIO::IVolume::COUNTRY_EUROPE:
case DiscIO::IVolume::COUNTRY_FRANCE:
+ case DiscIO::IVolume::COUNTRY_INTERNATIONAL:
case DiscIO::IVolume::COUNTRY_ITALY:
case DiscIO::IVolume::COUNTRY_RUSSIA:
bNTSC = false;
Region = EUR_DIR;
break;
+ case DiscIO::IVolume::COUNTRY_UNKNOWN:
default:
bNTSC = false;
Region = EUR_DIR;
diff --git a/Source/Core/Core/CoreParameter.h b/Source/Core/Core/CoreParameter.h
index 44b1458444..28686a55bc 100644
--- a/Source/Core/Core/CoreParameter.h
+++ b/Source/Core/Core/CoreParameter.h
@@ -43,6 +43,17 @@ enum Hotkey
HK_INCREASE_FRAME_LIMIT,
HK_DECREASE_FRAME_LIMIT,
+ HK_FREELOOK_INCREASE_SPEED,
+ HK_FREELOOK_DECREASE_SPEED,
+ HK_FREELOOK_RESET_SPEED,
+ HK_FREELOOK_UP,
+ HK_FREELOOK_DOWN,
+ HK_FREELOOK_LEFT,
+ HK_FREELOOK_RIGHT,
+ HK_FREELOOK_ZOOM_IN,
+ HK_FREELOOK_ZOOM_OUT,
+ HK_FREELOOK_RESET,
+
HK_LOAD_STATE_SLOT_1,
HK_LOAD_STATE_SLOT_2,
HK_LOAD_STATE_SLOT_3,
diff --git a/Source/Core/Core/CoreTiming.cpp b/Source/Core/Core/CoreTiming.cpp
index 30ac74585a..62ee5c6bf5 100644
--- a/Source/Core/Core/CoreTiming.cpp
+++ b/Source/Core/Core/CoreTiming.cpp
@@ -253,7 +253,7 @@ static void AddEventToQueue(Event* ne)
}
}
-// This must be run ONLY from within the cpu thread
+// This must be run ONLY from within the CPU thread
// cyclesIntoFuture may be VERY inaccurate if called from anything else
// than Advance
void ScheduleEvent(int cyclesIntoFuture, int event_type, u64 userdata)
diff --git a/Source/Core/Core/DSP/DSPAccelerator.cpp b/Source/Core/Core/DSP/DSPAccelerator.cpp
index 65b9d48e30..ad2d461b7f 100644
--- a/Source/Core/Core/DSP/DSPAccelerator.cpp
+++ b/Source/Core/Core/DSP/DSPAccelerator.cpp
@@ -153,7 +153,7 @@ u16 dsp_read_accelerator()
// TODO: Take GAIN into account
// adpcm = 0, pcm8 = 0x100, pcm16 = 0x800
// games using pcm8 : Phoenix Wright Ace Attorney (Wiiware), Megaman 9-10 (WiiWare)
- // games using pcm16: gc sega games, ...
+ // games using pcm16: GC Sega games, ...
// Check for loop.
// Somehow, YN1 and YN2 must be initialized with their "loop" values,
diff --git a/Source/Core/Core/DSP/DSPAssembler.cpp b/Source/Core/Core/DSP/DSPAssembler.cpp
index fb614af399..1406dd8194 100644
--- a/Source/Core/Core/DSP/DSPAssembler.cpp
+++ b/Source/Core/Core/DSP/DSPAssembler.cpp
@@ -880,9 +880,8 @@ bool DSPAssembler::AssembleFile(const char *fname, int pass)
}
}
- char *opcode = nullptr;
- opcode = strtok(ptr, " ");
- char *opcode_ext = nullptr;
+ char* opcode = strtok(ptr, " ");
+ char* opcode_ext = nullptr;
u32 params_count = 0;
u32 params_count_ext = 0;
diff --git a/Source/Core/Core/DSP/DSPCore.h b/Source/Core/Core/DSP/DSPCore.h
index f03b798f36..63d8e3ed21 100644
--- a/Source/Core/Core/DSP/DSPCore.h
+++ b/Source/Core/Core/DSP/DSPCore.h
@@ -182,7 +182,7 @@
#define EXP_4 4 // 0x0008
#define EXP_ACCOV 5 // 0x000a accelerator address overflow
#define EXP_6 6 // 0x000c
-#define EXP_INT 7 // 0x000e external int (message from cpu)
+#define EXP_INT 7 // 0x000e external int (message from CPU)
struct DSP_Regs
{
diff --git a/Source/Core/Core/HW/CPU.h b/Source/Core/Core/HW/CPU.h
index f9b7e922fc..9543bbee74 100644
--- a/Source/Core/Core/HW/CPU.h
+++ b/Source/Core/Core/HW/CPU.h
@@ -47,6 +47,6 @@ public:
// calls must be balanced and non-recursive (once with doLock true, then once with doLock false).
// intended (but not required) to be called from another thread,
// e.g. when the GUI thread wants to make sure everything is paused so that it can create a savestate.
- // the return value is whether the cpu was unpaused before the call.
+ // the return value is whether the CPU was unpaused before the call.
static bool PauseAndLock(bool doLock, bool unpauseOnUnlock=true);
};
diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp
index 422e20fba5..e111fc2ad9 100644
--- a/Source/Core/Core/HW/DSP.cpp
+++ b/Source/Core/Core/HW/DSP.cpp
@@ -135,10 +135,10 @@ struct ARAM_DMA
}
};
-// So we may abstract gc/wii differences a little
+// So we may abstract GC/Wii differences a little
struct ARAMInfo
{
- bool wii_mode; // wii EXRAM is managed in Memory:: so we need to skip statesaving, etc
+ bool wii_mode; // Wii EXRAM is managed in Memory:: so we need to skip statesaving, etc
u32 size;
u32 mask;
u8* ptr; // aka audio ram, auxiliary ram, MEM2, EXRAM, etc...
@@ -645,7 +645,7 @@ static void Do_ARAM_DMA()
}
// (shuffle2) I still don't believe that this hack is actually needed... :(
-// Maybe the wii sports ucode is processed incorrectly?
+// Maybe the Wii Sports ucode is processed incorrectly?
// (LM) It just means that dsp reads via '0xffdd' on WII can end up in EXRAM or main RAM
u8 ReadARAM(u32 _iAddress)
{
diff --git a/Source/Core/Core/HW/DSPHLE/DSPHLE.cpp b/Source/Core/Core/HW/DSPHLE/DSPHLE.cpp
index 574e56445a..70365583c9 100644
--- a/Source/Core/Core/HW/DSPHLE/DSPHLE.cpp
+++ b/Source/Core/Core/HW/DSPHLE/DSPHLE.cpp
@@ -185,7 +185,7 @@ void DSPHLE::DoState(PointerWrap &p)
m_MailHandler.DoState(p);
}
-// Mailbox fuctions
+// Mailbox functions
unsigned short DSPHLE::DSP_ReadMailBoxHigh(bool _CPUMailbox)
{
if (_CPUMailbox)
@@ -237,7 +237,7 @@ void DSPHLE::DSP_WriteMailBoxLow(bool _CPUMailbox, unsigned short _Value)
}
}
-// Other DSP fuctions
+// Other DSP functions
u16 DSPHLE::DSP_WriteControlRegister(unsigned short _Value)
{
DSP::UDSPControl Temp(_Value);
diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/AXStructs.h b/Source/Core/Core/HW/DSPHLE/UCodes/AXStructs.h
index ee0de1623d..099a0aabb9 100644
--- a/Source/Core/Core/HW/DSPHLE/UCodes/AXStructs.h
+++ b/Source/Core/Core/HW/DSPHLE/UCodes/AXStructs.h
@@ -312,7 +312,7 @@ struct AXPBWii
u16 pad[12]; // align us, captain! (32B)
};
-// TODO: All these enums have changed a lot for wii
+// TODO: All these enums have changed a lot for Wii
enum
{
AUDIOFORMAT_ADPCM = 0,
diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp
index 8b73d14d98..079a29d819 100644
--- a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp
+++ b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp
@@ -38,22 +38,22 @@ UCodeInterface* UCodeFactory(u32 crc, DSPHLE *dsphle, bool wii)
INFO_LOG(DSPHLE, "Switching to GBA ucode");
return new GBAUCode(dsphle, crc);
- case 0x3ad3b7ac: // Naruto3, Paper Mario - The Thousand Year Door
+ case 0x3ad3b7ac: // Naruto 3, Paper Mario - The Thousand Year Door
case 0x3daf59b9: // Alien Hominid
- case 0x4e8a8b21: // spdemo, ctaxi, 18 wheeler, disney, monkeyball 1/2,cubivore,puzzlecollection,wario,
- // capcom vs snk, naruto2, lost kingdoms, star fox, mario party 4, mortal kombat,
- // smugglers run warzone, smash brothers, sonic mega collection, ZooCube
- // nddemo, starfox
- case 0x07f88145: // bustamove, ikaruga, fzero, robotech battle cry, star soldier, soul calibur2,
- // Zelda:OOT, Tony hawk, viewtiful joe
- case 0xe2136399: // billy hatcher, dragonballz, mario party 5, TMNT, ava1080
+ case 0x4e8a8b21: // spdemo, Crazy Taxi, 18 Wheeler, Disney, Monkeyball 1/2, Cubivore, Nintendo Puzzle Collection, Wario,
+ // Capcom vs. SNK 2, Naruto 2, Lost Kingdoms, Star Fox, Mario Party 4, Mortal Kombat,
+ // Smugglers Run Warzone, Smash Brothers, Sonic Mega Collection, ZooCube
+ // nddemo, Star Fox
+ case 0x07f88145: // bustamove, Ikaruga, F-Zero GX, Robotech Battle Cry, Star Soldier, Soul Calibur 2,
+ // Zelda:OOT, Tony Hawk, Viewtiful Joe
+ case 0xe2136399: // Billy Hatcher, Dragon Ball Z, Mario Party 5, TMNT, 1080° Avalanche
case 0x3389a79e: // MP1/MP2 Wii (Metroid Prime Trilogy)
INFO_LOG(DSPHLE, "CRC %08x: AX ucode chosen", crc);
return new AXUCode(dsphle, crc);
case 0x6ba3b3ea: // IPL - PAL
case 0x24b22038: // IPL - NTSC/NTSC-JAP
- case 0x42f64ac4: // Luigi
+ case 0x42f64ac4: // Luigi's Mansion
case 0x4be6a5cb: // AC, Pikmin
INFO_LOG(DSPHLE, "CRC %08x: JAC (early Zelda) ucode chosen", crc);
return new ZeldaUCode(dsphle, crc);
@@ -61,7 +61,7 @@ UCodeInterface* UCodeFactory(u32 crc, DSPHLE *dsphle, bool wii)
case 0x6CA33A6D: // DK Jungle Beat
case 0x86840740: // Zelda WW - US
case 0x56d36052: // Mario Sunshine
- case 0x2fcdf1ec: // Mario Kart, zelda 4 swords
+ case 0x2fcdf1ec: // Mario Kart, Zelda 4 Swords
case 0x267fd05a: // Pikmin PAL
INFO_LOG(DSPHLE, "CRC %08x: Zelda ucode chosen", crc);
return new ZeldaUCode(dsphle, crc);
@@ -76,8 +76,8 @@ UCodeInterface* UCodeFactory(u32 crc, DSPHLE *dsphle, bool wii)
case 0x2ea36ce6: // Some Wii demos
case 0x5ef56da3: // AX demo
- case 0x347112ba: // raving rabbits
- case 0xfa450138: // wii sports - PAL
+ case 0x347112ba: // Raving Rabbids
+ case 0xfa450138: // Wii Sports - PAL
case 0xadbc06bd: // Elebits
case 0x4cc52064: // Bleach: Versus Crusade
case 0xd9c4bf34: // WiiMenu
diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.h b/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.h
index c6b68ed499..79efa69db3 100644
--- a/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.h
+++ b/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.h
@@ -146,7 +146,7 @@ public:
}
private:
- // These map CRC to behaviour.
+ // These map CRC to behavior.
// DMA version
// - sound data transferred using DMA instead of accelerator
@@ -173,7 +173,7 @@ private:
{
case 0x6ba3b3ea: // IPL - PAL
case 0x24b22038: // IPL - NTSC/NTSC-JAP
- case 0x42f64ac4: // Luigi
+ case 0x42f64ac4: // Luigi's Mansion
case 0x4be6a5cb: // AC, Pikmin NTSC
return true;
default:
diff --git a/Source/Core/Core/HW/DVDInterface.cpp b/Source/Core/Core/HW/DVDInterface.cpp
index 129ed3867d..95c26c5fb3 100644
--- a/Source/Core/Core/HW/DVDInterface.cpp
+++ b/Source/Core/Core/HW/DVDInterface.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include
+#include
#include "AudioCommon/AudioCommon.h"
@@ -23,18 +24,55 @@
#include "Core/HW/SystemTimers.h"
#include "Core/PowerPC/PowerPC.h"
-// A GameCube disc can be read at somewhere between
-// 2 and 3MB/sec, depending on the location on disk. Wii disks
-// not yet tested.
-static const u32 DISC_TRANSFER_RATE_GC = 3 * 1024 * 1024;
+static const double PI = 3.14159265358979323846264338328;
// Rate the drive can transfer data to main memory, given the data
-// is already buffered.
-static const u32 BUFFER_TRANSFER_RATE_GC = 16 * 1024 * 1024;
+// is already buffered. Measured in bytes per second.
+static const u32 BUFFER_TRANSFER_RATE = 1024 * 1024 * 16;
// Disc access time measured in milliseconds
static const u32 DISC_ACCESS_TIME_MS = 50;
+// The size of a Wii disc layer in bytes (is this correct?)
+static const u64 WII_DISC_LAYER_SIZE = 4699979776;
+
+// By knowing the disc read speed at two locations defined here,
+// the program can calulate the speed at arbitrary locations.
+// Offsets are in bytes, and speeds are in bytes per second.
+//
+// These speeds are approximate. Using exact speeds is not possible
+// because of how much variation there is between different hardware.
+
+static const u32 GC_DISC_LOCATION_1_OFFSET = 0; // The beginning of a GC disc
+static const u32 GC_DISC_LOCATION_1_READ_SPEED = 1024 * 1024 * 2;
+static const u32 GC_DISC_LOCATION_2_OFFSET = 1459978239; // The end of a GC disc
+static const u32 GC_DISC_LOCATION_2_READ_SPEED = (u32)(1024 * 1024 * 3.3);
+
+static const u32 WII_DISC_LOCATION_1_OFFSET = 0; // The beginning of a Wii disc
+static const u32 WII_DISC_LOCATION_1_READ_SPEED = (u32)(1024 * 1024 * 3.5);
+static const u64 WII_DISC_LOCATION_2_OFFSET = WII_DISC_LAYER_SIZE; // The end of a Wii disc
+static const u32 WII_DISC_LOCATION_2_READ_SPEED = 1024 * 1024 * 9;
+
+// These values are used for disc read speed calculations. Calculations
+// are done using an arbitrary length unit where the radius of a disc track
+// is the same as the read speed at that track in bytes per second.
+
+static const double GC_DISC_AREA_UP_TO_LOCATION_1 =
+ PI * GC_DISC_LOCATION_1_READ_SPEED * GC_DISC_LOCATION_1_READ_SPEED;
+static const double GC_DISC_AREA_UP_TO_LOCATION_2 =
+ PI * GC_DISC_LOCATION_2_READ_SPEED * GC_DISC_LOCATION_2_READ_SPEED;
+static const double GC_BYTES_PER_AREA_UNIT =
+ (GC_DISC_LOCATION_2_OFFSET - GC_DISC_LOCATION_1_OFFSET) /
+ (GC_DISC_AREA_UP_TO_LOCATION_2 - GC_DISC_AREA_UP_TO_LOCATION_1);
+
+static const double WII_DISC_AREA_UP_TO_LOCATION_1 =
+ PI * WII_DISC_LOCATION_1_READ_SPEED * WII_DISC_LOCATION_1_READ_SPEED;
+static const double WII_DISC_AREA_UP_TO_LOCATION_2 =
+ PI * WII_DISC_LOCATION_2_READ_SPEED * WII_DISC_LOCATION_2_READ_SPEED;
+static const double WII_BYTES_PER_AREA_UNIT =
+ (WII_DISC_LOCATION_2_OFFSET - WII_DISC_LOCATION_1_OFFSET) /
+ (WII_DISC_AREA_UP_TO_LOCATION_2 - WII_DISC_AREA_UP_TO_LOCATION_1);
+
namespace DVDInterface
{
@@ -230,6 +268,8 @@ void UpdateInterrupts();
void GenerateDIInterrupt(DI_InterruptType _DVDInterrupt);
void ExecuteCommand();
void FinishExecuteRead();
+u64 SimulateDiscReadTime();
+s64 CalculateRawDiscReadTime(u64 offset, s64 length);
void DoState(PointerWrap &p)
{
@@ -262,7 +302,12 @@ void DoState(PointerWrap &p)
static void TransferComplete(u64 userdata, int cyclesLate)
{
if (m_DICR.TSTART)
- FinishExecuteRead();
+ {
+ m_DICR.TSTART = 0;
+ m_DILENGTH.Length = 0;
+ GenerateDIInterrupt(INT_TCINT);
+ g_ErrorCode = 0;
+ }
}
static u32 ProcessDTKSamples(short *tempPCM, u32 num_samples)
@@ -564,6 +609,11 @@ void GenerateDIInterrupt(DI_InterruptType _DVDInterrupt)
void ExecuteCommand()
{
+ // This variable is used to simulate the time is takes to execute a command.
+ // 1 / 15000 seconds is just some arbitrary default value.
+ // Commands that implement more precise timing are supposed to overwrite this.
+ u64 ticks_until_TC = SystemTimers::GetTicksPerSecond() / 15000;
+
// _dbg_assert_(DVDINTERFACE, _DICR.RW == 0); // only DVD to Memory
int GCAM = ((SConfig::GetInstance().m_SIDevice[0] == SIDEVICE_AM_BASEBOARD) &&
(SConfig::GetInstance().m_EXIDevice[2] == EXIDEVICE_AM_BASEBOARD))
@@ -681,93 +731,13 @@ void ExecuteCommand()
}
}
- u64 ticksUntilTC = 0;
+ ticks_until_TC = SimulateDiscReadTime();
- // The drive buffers 1MB (?) of data after every read request;
- // if a read request is covered by this buffer (or if it's
- // faster to wait for the data to be buffered), the drive
- // doesn't seek; it returns buffered data. Data can be
- // transferred from the buffer at up to 16MB/sec.
- //
- // If the drive has to seek, the time this takes varies a lot.
- // A short seek is around 50ms; a long seek is around 150ms.
- // However, the time isn't purely dependent on the distance; the
- // pattern of previous seeks seems to matter in a way I'm
- // not sure how to explain.
- //
- // Metroid Prime is a good example of a game that's sensitive to
- // all of these details; if there isn't enough latency in the
- // right places, doors open too quickly, and if there's too
- // much latency in the wrong places, the video before the
- // save-file select screen lags.
- //
- // For now, just use a very rough approximation: 50ms seek
- // and 3MB/sec for reads outside 1MB, acceleated reads
- // within 1MB. We can refine this if someone comes up
- // with a more complete model for seek times.
-
- u64 cur_time = CoreTiming::GetTicks();
- // Number of ticks it takes to seek and read directly from the disk.
- u64 disk_read_duration = m_DILENGTH.Length *
- (SystemTimers::GetTicksPerSecond() / DISC_TRANSFER_RATE_GC) +
- SystemTimers::GetTicksPerSecond() / 1000 * DISC_ACCESS_TIME_MS;
-
- if (iDVDOffset + m_DILENGTH.Length - g_last_read_offset > 1024 * 1024)
+ // Here is the actual disc reading
+ if (!DVDRead(iDVDOffset, m_DIMAR.Address, m_DILENGTH.Length))
{
- // No buffer; just use the simple seek time + read time.
- DEBUG_LOG(DVDINTERFACE, "Seeking %" PRId64 " bytes", s64(g_last_read_offset) - s64(iDVDOffset));
- ticksUntilTC = disk_read_duration;
- g_last_read_time = cur_time + ticksUntilTC;
+ PanicAlertT("Can't read from DVD_Plugin - DVD-Interface: Fatal Error");
}
- else
- {
- // Possibly buffered; use the buffer if it saves time.
- // It's not proven that the buffer actually behaves like this, but
- // it appears to be a decent approximation.
-
- // Time at which the buffer will contain the data we need.
- u64 buffer_fill_time = (iDVDOffset + m_DILENGTH.Length - g_last_read_offset) *
- (SystemTimers::GetTicksPerSecond() / DISC_TRANSFER_RATE_GC) +
- g_last_read_time;
- // Number of ticks it takes to transfer the data from the buffer to memory.
- u64 buffer_read_duration = m_DILENGTH.Length *
- (SystemTimers::GetTicksPerSecond() / BUFFER_TRANSFER_RATE_GC);
-
- if (cur_time > buffer_fill_time)
- {
- DEBUG_LOG(DVDINTERFACE, "Fast buffer read at %" PRId64, s64(iDVDOffset));
- ticksUntilTC = buffer_read_duration;
- g_last_read_time = buffer_fill_time;
- }
- else if (cur_time + disk_read_duration > buffer_fill_time)
- {
- DEBUG_LOG(DVDINTERFACE, "Slow buffer read at %" PRId64, s64(iDVDOffset));
- ticksUntilTC = std::max(buffer_fill_time - cur_time, buffer_read_duration);
- g_last_read_time = buffer_fill_time;
- }
- else
- {
- DEBUG_LOG(DVDINTERFACE, "Short seek %" PRId64 " bytes", s64(g_last_read_offset) - s64(iDVDOffset));
- ticksUntilTC = disk_read_duration;
- g_last_read_time = cur_time + ticksUntilTC;
- }
- }
- g_last_read_offset = (iDVDOffset + m_DILENGTH.Length - 2048) & ~2047;
-
- if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastDiscSpeed)
- {
- // Make sure fast disc speed performs "instant" reads; in addition
- // to being used to speed up games, fast disc speed is used as a
- // workaround for crashes in certain games, including Star Wars
- // Rogue Leader.
- FinishExecuteRead();
- return;
- }
-
- CoreTiming::ScheduleEvent((int)ticksUntilTC, tc);
-
- // Early return; we'll finish executing the command in FinishExecuteRead.
- return;
}
break;
@@ -1076,27 +1046,161 @@ void ExecuteCommand()
break;
}
- // transfer is done
- m_DICR.TSTART = 0;
- m_DILENGTH.Length = 0;
- GenerateDIInterrupt(INT_TCINT);
- g_ErrorCode = 0;
+ if (ticks_until_TC)
+ {
+ // The transfer is finished after a delay
+ CoreTiming::ScheduleEvent((int)ticks_until_TC, tc);
+ }
+ else
+ {
+ // transfer is done
+ m_DICR.TSTART = 0;
+ m_DILENGTH.Length = 0;
+ GenerateDIInterrupt(INT_TCINT);
+ g_ErrorCode = 0;
+ }
}
-void FinishExecuteRead()
+// Simulates the timing aspects of reading data from a disc.
+// Sets g_last_read_offset and g_last_read_time, and returns ticks_until_TC.
+u64 SimulateDiscReadTime()
{
- u32 iDVDOffset = m_DICMDBUF[1].Hex << 2;
+ u64 DVD_offset = (u64)m_DICMDBUF[1].Hex << 2;
+ u64 current_time = CoreTiming::GetTicks();
+ u64 ticks_until_TC;
- if (!DVDRead(iDVDOffset, m_DIMAR.Address, m_DILENGTH.Length))
+ if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastDiscSpeed)
{
- PanicAlertT("Can't read from DVD_Plugin - DVD-Interface: Fatal Error");
+ // Make sure fast disc speed performs "instant" reads; in addition
+ // to being used to speed up games, fast disc speed is used as a
+ // workaround for crashes in certain games, including Star Wars
+ // Rogue Leader.
+ ticks_until_TC = 0;
+ g_last_read_time = current_time;
+ }
+ else
+ {
+ // The drive buffers 1 MiB (?) of data after every read request;
+ // if a read request is covered by this buffer (or if it's
+ // faster to wait for the data to be buffered), the drive
+ // doesn't seek; it returns buffered data. Data can be
+ // transferred from the buffer at up to 16 MiB/s.
+ //
+ // If the drive has to seek, the time this takes varies a lot.
+ // A short seek is around 50 ms; a long seek is around 150 ms.
+ // However, the time isn't purely dependent on the distance; the
+ // pattern of previous seeks seems to matter in a way I'm
+ // not sure how to explain.
+ //
+ // Metroid Prime is a good example of a game that's sensitive to
+ // all of these details; if there isn't enough latency in the
+ // right places, doors open too quickly, and if there's too
+ // much latency in the wrong places, the video before the
+ // save-file select screen lags.
+ //
+ // For now, just use a very rough approximation: 50 ms seek
+ // for reads outside 1 MiB, accelerated reads within 1 MiB.
+ // We can refine this if someone comes up with a more complete
+ // model for seek times.
+
+ // Number of ticks it takes to seek and read directly from the disk.
+ u64 disk_read_duration = CalculateRawDiscReadTime(DVD_offset, m_DILENGTH.Length) +
+ SystemTimers::GetTicksPerSecond() / 1000 * DISC_ACCESS_TIME_MS;
+
+ if (DVD_offset + m_DILENGTH.Length - g_last_read_offset > 1024 * 1024)
+ {
+ // No buffer; just use the simple seek time + read time.
+ DEBUG_LOG(DVDINTERFACE, "Seeking %" PRId64 " bytes",
+ s64(g_last_read_offset) - s64(DVD_offset));
+ ticks_until_TC = disk_read_duration;
+ g_last_read_time = current_time + ticks_until_TC;
+ }
+ else
+ {
+ // Possibly buffered; use the buffer if it saves time.
+ // It's not proven that the buffer actually behaves like this, but
+ // it appears to be a decent approximation.
+
+ // Time at which the buffer will contain the data we need.
+ u64 buffer_fill_time = g_last_read_time +
+ CalculateRawDiscReadTime(g_last_read_offset,
+ DVD_offset + m_DILENGTH.Length - g_last_read_offset);
+ // Number of ticks it takes to transfer the data from the buffer to memory.
+ u64 buffer_read_duration = m_DILENGTH.Length *
+ (SystemTimers::GetTicksPerSecond() / BUFFER_TRANSFER_RATE);
+
+ if (current_time > buffer_fill_time)
+ {
+ DEBUG_LOG(DVDINTERFACE, "Fast buffer read at %" PRId64, s64(DVD_offset));
+ ticks_until_TC = buffer_read_duration;
+ g_last_read_time = buffer_fill_time;
+ }
+ else if (current_time + disk_read_duration > buffer_fill_time)
+ {
+ DEBUG_LOG(DVDINTERFACE, "Slow buffer read at %" PRId64, s64(DVD_offset));
+ ticks_until_TC = std::max(buffer_fill_time - current_time,
+ buffer_read_duration);
+ g_last_read_time = buffer_fill_time;
+ }
+ else
+ {
+ DEBUG_LOG(DVDINTERFACE, "Short seek %" PRId64 " bytes",
+ s64(g_last_read_offset) - s64(DVD_offset));
+ ticks_until_TC = disk_read_duration;
+ g_last_read_time = current_time + ticks_until_TC;
+ }
+ }
}
- // transfer is done
- m_DICR.TSTART = 0;
- m_DILENGTH.Length = 0;
- GenerateDIInterrupt(INT_TCINT);
- g_ErrorCode = 0;
+ g_last_read_offset = (DVD_offset + m_DILENGTH.Length - 2048) & ~2047;
+
+ return ticks_until_TC;
+}
+
+// Returns the number of ticks it takes to read an amount of
+// data from a disc, ignoring factors such as seek times.
+// The result will be negative if the length is negative.
+s64 CalculateRawDiscReadTime(u64 offset, s64 length)
+{
+ // The speed will be calculated using the average offset. This is a bit
+ // inaccurate since the speed doesn't increase linearly with the offset,
+ // but since reads only span a small part of the disc, it's insignificant.
+ u64 average_offset = offset + (length / 2);
+
+ // Here, addresses on the second layer of Wii discs are replaced with equivalent
+ // addresses on the first layer so that the speed calculation works correctly.
+ // This is wrong for reads spanning two layers, but those should be rare.
+ average_offset %= WII_DISC_LAYER_SIZE;
+
+ // The area on the disc between position 1 and the arbitrary position X is:
+ // LOCATION_X_SPEED * LOCATION_X_SPEED * pi - AREA_UP_TO_LOCATION_1
+ //
+ // The number of bytes between position 1 and position X is:
+ // LOCATION_X_OFFSET - LOCATION_1_OFFSET
+ //
+ // This means that the following equation is true:
+ // (LOCATION_X_SPEED * LOCATION_X_SPEED * pi - AREA_UP_TO_LOCATION_1) *
+ // BYTES_PER_AREA_UNIT = LOCATION_X_OFFSET - LOCATION_1_OFFSET
+ //
+ // Solving this equation for LOCATION_X_SPEED results in this:
+ // LOCATION_X_SPEED = sqrt(((LOCATION_X_OFFSET - LOCATION_1_OFFSET) /
+ // BYTES_PER_AREA_UNIT + AREA_UP_TO_LOCATION_1) / pi)
+ //
+ // Note that the speed at a track (in bytes per second) is the same as
+ // the radius of that track because of the length unit used.
+ double speed;
+ if (VolumeHandler::IsWii())
+ {
+ speed = std::sqrt(((average_offset - WII_DISC_LOCATION_1_OFFSET) /
+ WII_BYTES_PER_AREA_UNIT + WII_DISC_AREA_UP_TO_LOCATION_1) / PI);
+ }
+ else
+ {
+ speed = std::sqrt(((average_offset - GC_DISC_LOCATION_1_OFFSET) /
+ GC_BYTES_PER_AREA_UNIT + GC_DISC_AREA_UP_TO_LOCATION_1) / PI);
+ }
+
+ return (s64)(SystemTimers::GetTicksPerSecond() / speed * length);
}
} // namespace
diff --git a/Source/Core/Core/HW/EXI_DeviceIPL.cpp b/Source/Core/Core/HW/EXI_DeviceIPL.cpp
index 0a3e5245f7..1bf361cc95 100644
--- a/Source/Core/Core/HW/EXI_DeviceIPL.cpp
+++ b/Source/Core/Core/HW/EXI_DeviceIPL.cpp
@@ -296,7 +296,7 @@ void CEXIIPL::TransferByte(u8& _uByte)
case REGION_WRTC0:
case REGION_WRTC1:
case REGION_WRTC2:
- // WII only RTC flags... afaik just the wii menu initialize it
+ // WII only RTC flags... afaik just the Wii menu initialize it
default:
if ((m_uAddress >> 6) < ROM_SIZE)
{
diff --git a/Source/Core/Core/HW/EXI_DeviceMic.h b/Source/Core/Core/HW/EXI_DeviceMic.h
index 883dc7feda..154016a6fe 100644
--- a/Source/Core/Core/HW/EXI_DeviceMic.h
+++ b/Source/Core/Core/HW/EXI_DeviceMic.h
@@ -60,7 +60,7 @@ private:
int ring_pos;
u8 ring_buffer[64 * sample_size];
- // 0 to disable interrupts, else it will be checked against current cpu ticks
+ // 0 to disable interrupts, else it will be checked against current CPU ticks
// to determine if interrupt should be raised
u64 next_int_ticks;
void UpdateNextInterruptTicks();
diff --git a/Source/Core/Core/HW/Memmap.cpp b/Source/Core/Core/HW/Memmap.cpp
index d89647592e..186ad67dd5 100644
--- a/Source/Core/Core/HW/Memmap.cpp
+++ b/Source/Core/Core/HW/Memmap.cpp
@@ -205,7 +205,7 @@ void CopyFromEmu(void* data, u32 address, size_t size)
{
if (!ValidCopyRange(address, size))
{
- PanicAlert("Invalid range in CopyFromEmu. %lx bytes from 0x%08x", size, address);
+ PanicAlert("Invalid range in CopyFromEmu. %lx bytes from 0x%08x", (unsigned long)size, address);
return;
}
memcpy(data, GetPointer(address), size);
@@ -215,7 +215,7 @@ void CopyToEmu(u32 address, const void* data, size_t size)
{
if (!ValidCopyRange(address, size))
{
- PanicAlert("Invalid range in CopyToEmu. %lx bytes to 0x%08x", size, address);
+ PanicAlert("Invalid range in CopyToEmu. %lx bytes to 0x%08x", (unsigned long)size, address);
return;
}
memcpy(GetPointer(address), data, size);
diff --git a/Source/Core/Core/HW/ProcessorInterface.cpp b/Source/Core/Core/HW/ProcessorInterface.cpp
index aeca565870..27306988d2 100644
--- a/Source/Core/Core/HW/ProcessorInterface.cpp
+++ b/Source/Core/Core/HW/ProcessorInterface.cpp
@@ -190,7 +190,7 @@ static const char *Debug_GetInterruptName(u32 _causemask)
void SetInterrupt(u32 _causemask, bool _bSet)
{
- // TODO(ector): add sanity check that current thread id is cpu thread
+ // TODO(ector): add sanity check that current thread id is CPU thread
if (_bSet && !(m_InterruptCause & _causemask))
{
diff --git a/Source/Core/Core/HW/SI.cpp b/Source/Core/Core/HW/SI.cpp
index 582632fada..0f6b14917c 100644
--- a/Source/Core/Core/HW/SI.cpp
+++ b/Source/Core/Core/HW/SI.cpp
@@ -270,7 +270,7 @@ void Init()
g_StatusReg.Hex = 0;
g_EXIClockCount.Hex = 0;
- //g_EXIClockCount.LOCK = 1; // Supposedly set on reset, but logs from real wii don't look like it is...
+ //g_EXIClockCount.LOCK = 1; // Supposedly set on reset, but logs from real Wii don't look like it is...
memset(g_SIBuffer, 0, 128);
changeDevice = CoreTiming::RegisterEvent("ChangeSIDevice", ChangeDeviceCallback);
diff --git a/Source/Core/Core/HW/SI_DeviceDanceMat.cpp b/Source/Core/Core/HW/SI_DeviceDanceMat.cpp
index 91ca7e6f43..8f64fc962c 100644
--- a/Source/Core/Core/HW/SI_DeviceDanceMat.cpp
+++ b/Source/Core/Core/HW/SI_DeviceDanceMat.cpp
@@ -14,7 +14,7 @@
#include "Core/HW/SI_DeviceDanceMat.h"
#include "Core/HW/SystemTimers.h"
-// --- Dance mat gamecube controller ---
+// --- Dance mat GameCube controller ---
CSIDevice_DanceMat::CSIDevice_DanceMat(SIDevices device, int _iDeviceNumber)
: ISIDevice(device, _iDeviceNumber)
, m_TButtonComboStart(0)
diff --git a/Source/Core/Core/HW/SI_DeviceDanceMat.h b/Source/Core/Core/HW/SI_DeviceDanceMat.h
index 6f79417fb0..3eaf5c4be8 100644
--- a/Source/Core/Core/HW/SI_DeviceDanceMat.h
+++ b/Source/Core/Core/HW/SI_DeviceDanceMat.h
@@ -7,7 +7,7 @@
#include "Core/HW/SI_Device.h"
#include "InputCommon/GCPadStatus.h"
-// standard gamecube controller
+// standard GameCube controller
class CSIDevice_DanceMat : public ISIDevice
{
private:
diff --git a/Source/Core/Core/HW/SI_DeviceGCController.cpp b/Source/Core/Core/HW/SI_DeviceGCController.cpp
index 474f7fbeee..f3c6efcbb0 100644
--- a/Source/Core/Core/HW/SI_DeviceGCController.cpp
+++ b/Source/Core/Core/HW/SI_DeviceGCController.cpp
@@ -14,7 +14,7 @@
#include "Core/HW/SI_DeviceGCController.h"
#include "Core/HW/SystemTimers.h"
-// --- standard gamecube controller ---
+// --- standard GameCube controller ---
CSIDevice_GCController::CSIDevice_GCController(SIDevices device, int _iDeviceNumber)
: ISIDevice(device, _iDeviceNumber)
, m_TButtonComboStart(0)
diff --git a/Source/Core/Core/HW/SI_DeviceGCController.h b/Source/Core/Core/HW/SI_DeviceGCController.h
index ed41875bc4..254df8d233 100644
--- a/Source/Core/Core/HW/SI_DeviceGCController.h
+++ b/Source/Core/Core/HW/SI_DeviceGCController.h
@@ -8,7 +8,7 @@
#include "InputCommon/GCPadStatus.h"
-// standard gamecube controller
+// standard GameCube controller
class CSIDevice_GCController : public ISIDevice
{
private:
diff --git a/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.cpp b/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.cpp
index 3c48711b74..bf803c5ce0 100644
--- a/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.cpp
+++ b/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.cpp
@@ -15,7 +15,7 @@
#include "Core/HW/SI_DeviceGCSteeringWheel.h"
#include "Core/HW/SystemTimers.h"
-// --- standard gamecube controller ---
+// --- standard GameCube controller ---
CSIDevice_GCSteeringWheel::CSIDevice_GCSteeringWheel(SIDevices device, int _iDeviceNumber)
: ISIDevice(device, _iDeviceNumber)
, m_TButtonComboStart(0)
diff --git a/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.h b/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.h
index c6c399c251..6e231436f8 100644
--- a/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.h
+++ b/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.h
@@ -7,7 +7,7 @@
#include "Core/HW/SI_Device.h"
#include "InputCommon/GCPadStatus.h"
-// standard gamecube controller
+// standard GameCube controller
class CSIDevice_GCSteeringWheel : public ISIDevice
{
private:
diff --git a/Source/Core/Core/HW/SystemTimers.cpp b/Source/Core/Core/HW/SystemTimers.cpp
index 186cd25772..3f79f2e39a 100644
--- a/Source/Core/Core/HW/SystemTimers.cpp
+++ b/Source/Core/Core/HW/SystemTimers.cpp
@@ -237,7 +237,7 @@ void Init()
// System internal sample rate is fixed at 32KHz * 4 (16bit Stereo) / 32 bytes DMA
AUDIO_DMA_PERIOD = CPU_CORE_CLOCK / (AudioInterface::GetAIDSampleRate() * 4 / 32);
- // Emulated gekko <-> flipper bus speed ratio (cpu clock / flipper clock)
+ // Emulated gekko <-> flipper bus speed ratio (CPU clock / flipper clock)
CP_PERIOD = GetTicksPerSecond() / 10000;
Common::Timer::IncreaseResolution();
diff --git a/Source/Core/Core/HW/VideoInterface.h b/Source/Core/Core/HW/VideoInterface.h
index daf068f3fc..78b966658c 100644
--- a/Source/Core/Core/HW/VideoInterface.h
+++ b/Source/Core/Core/HW/VideoInterface.h
@@ -21,7 +21,7 @@ namespace VideoInterface
#define NTSC_LINE_COUNT 525
// These line numbers indicate the beginning of the "active video" in a frame.
// An NTSC frame has the lower field first followed by the upper field.
-// TODO: Is this true for PAL-M? Is this true for EURGB60?
+// TODO: Is this true for PAL-M? Is this true for PAL60?
#define NTSC_LOWER_BEGIN 21
#define NTSC_UPPER_BEGIN 283
diff --git a/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp b/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp
index 85d36bff71..b6100e5234 100644
--- a/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp
+++ b/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp
@@ -784,12 +784,11 @@ void Wiimote::HidOutputReport(const wm_report* const sr, const bool send_ack)
break;
case WM_WRITE_SPEAKER_DATA : // 0x18
- {
//wm_speaker_data *spkz = (wm_speaker_data*)sr->data;
//ERROR_LOG(WIIMOTE, "WM_WRITE_SPEAKER_DATA len:%x %s", spkz->length,
// ArrayToString(spkz->data, spkz->length, 100, false).c_str());
- Wiimote::SpeakerData((wm_speaker_data*)sr->data);
- }
+ if (WIIMOTE_SRC_EMU & g_wiimote_sources[m_index])
+ Wiimote::SpeakerData((wm_speaker_data*) sr->data);
return; // no ack
break;
@@ -1085,7 +1084,7 @@ void Wiimote::ReadData(const wm_read_data* const rd)
file.close();
}
- // read mem to be sent to wii
+ // read memory to be sent to Wii
memcpy(block, m_eeprom + address, size);
}
break;
diff --git a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp
index da70164f70..bf20a1989a 100644
--- a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp
+++ b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp
@@ -331,7 +331,7 @@ bool Wiimote::Step()
if (!m_read_requests.empty())
{
ReadRequest& rr = m_read_requests.front();
- // send up to 16 bytes to the wii
+ // send up to 16 bytes to the Wii
SendReadDataReply(rr);
//SendReadDataReply(rr.channel, rr);
diff --git a/Source/Core/Core/HW/WiimoteEmu/WiimoteHid.h b/Source/Core/Core/HW/WiimoteEmu/WiimoteHid.h
index 40b11e05f4..bb1ce0d5c3 100644
--- a/Source/Core/Core/HW/WiimoteEmu/WiimoteHid.h
+++ b/Source/Core/Core/HW/WiimoteEmu/WiimoteHid.h
@@ -338,7 +338,7 @@ struct wm_report
struct wm_leds
{
u8 rumble : 1;
- // real wii also sets bit 0x2 (unknown purpose)
+ // real Wii also sets bit 0x2 (unknown purpose)
u8 : 3;
u8 leds : 4;
};
@@ -347,7 +347,7 @@ struct wm_leds
struct wm_report_mode
{
u8 rumble : 1;
- // unsure what "all_the_time" actually is, the real wii does set it (bit 0x2)
+ // unsure what "all_the_time" actually is, the real Wii does set it (bit 0x2)
u8 all_the_time : 1;
u8 continuous : 1;
u8 : 5;
diff --git a/Source/Core/Core/Host.h b/Source/Core/Core/Host.h
index 3d232aca8a..3bb2ec76b1 100644
--- a/Source/Core/Core/Host.h
+++ b/Source/Core/Core/Host.h
@@ -26,7 +26,6 @@
bool Host_UIHasFocus();
bool Host_RendererHasFocus();
void Host_ConnectWiimote(int wm_idx, bool connect);
-void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height);
void Host_Message(int Id);
void Host_NotifyMapLoaded();
void Host_RefreshDSPDebuggerWindow();
diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp
index 69c5022ef9..0042db0d75 100644
--- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp
+++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp
@@ -260,12 +260,8 @@ IWII_IPC_HLE_Device* AccessDeviceByID(u32 _ID)
IWII_IPC_HLE_Device* CreateFileIO(u32 _DeviceID, const std::string& _rDeviceName)
{
// scan device name and create the right one
- IWII_IPC_HLE_Device* pDevice = nullptr;
-
INFO_LOG(WII_IPC_FILEIO, "IOP: Create FileIO %s", _rDeviceName.c_str());
- pDevice = new CWII_IPC_HLE_Device_FileIO(_DeviceID, _rDeviceName);
-
- return pDevice;
+ return new CWII_IPC_HLE_Device_FileIO(_DeviceID, _rDeviceName);
}
diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp
index 9d2b13d5b4..0d38bba31f 100644
--- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp
+++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp
@@ -167,7 +167,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
{
case DVDLowInquiry:
{
- // (shuffle2) Taken from my wii
+ // (shuffle2) Taken from my Wii
Memory::Write_U32(0x00000002, _BufferOut);
Memory::Write_U32(0x20060526, _BufferOut + 4);
// This was in the oubuf even though this cmd is only supposed to reply with 64bits
diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp
index 1962abaf43..50f0a62db8 100644
--- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp
+++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp
@@ -84,7 +84,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
{
case IOCTLV_READ_DIR:
{
- // the wii uses this function to define the type (dir or file)
+ // the Wii uses this function to define the type (dir or file)
std::string DirName(HLE_IPC_BuildFilename(Memory::GetString(
CommandBuffer.InBuffer[0].m_Address, CommandBuffer.InBuffer[0].m_Size)));
diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp
index f8684474f3..495a252721 100644
--- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp
+++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp
@@ -172,7 +172,7 @@ bool CWII_IPC_HLE_Device_hid::IOCtl(u32 _CommandAddress)
{
/*
ERROR CODES:
- -4 Cant find device specified
+ -4 Can't find device specified
*/
u32 dev_num = Memory::Read_U32(BufferIn+0x10);
diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp
index 851497ea62..93a1837c04 100644
--- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp
+++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp
@@ -785,7 +785,7 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress)
optval[4], optval[5],optval[6], optval[7], optval[8], optval[9], optval[10], optval[11], optval[12], optval[13], optval[14],
optval[15], optval[16], optval[17], optval[18], optval[19]);
- //TODO: bug booto about this, 0x2005 most likely timeout related, default value on wii is , 0x2001 is most likely tcpnodelay
+ //TODO: bug booto about this, 0x2005 most likely timeout related, default value on Wii is , 0x2001 is most likely tcpnodelay
if (level == 6 && (optname == 0x2005 || optname == 0x2001))
{
ReturnValue = 0;
diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.h
index 854631c8f1..d99bcf474c 100644
--- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.h
+++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.h
@@ -531,14 +531,14 @@ private:
// Seconds between 1.1.1970 and 4.1.2008 16:00:38
static const u64 wii_bias = 0x477E5826;
- // Returns seconds since wii epoch
+ // Returns seconds since Wii epoch
// +/- any bias set from IOCTL_NW24_SET_UNIVERSAL_TIME
u64 GetAdjustedUTC() const
{
return Common::Timer::GetTimeSinceJan1970() - wii_bias + utcdiff;
}
- // Store the difference between what the wii thinks is UTC and
+ // Store the difference between what the Wii thinks is UTC and
// what the host OS thinks
void SetAdjustedUTC(u64 wii_utc)
{
diff --git a/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.h b/Source/Core/Core/MachineContext.h
similarity index 96%
rename from Source/Core/Core/PowerPC/JitCommon/JitBackpatch.h
rename to Source/Core/Core/MachineContext.h
index 6cc0bcdf42..889a014755 100644
--- a/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.h
+++ b/Source/Core/Core/MachineContext.h
@@ -87,9 +87,11 @@
#define CTX_RIP __ss.__rip
#elif defined(__linux__)
#include
+
+ #include
+ typedef mcontext_t SContext;
+
#if _M_X86_64
- #include
- typedef mcontext_t SContext;
#define CTX_RAX gregs[REG_RAX]
#define CTX_RBX gregs[REG_RBX]
#define CTX_RCX gregs[REG_RCX]
@@ -108,14 +110,11 @@
#define CTX_R15 gregs[REG_R15]
#define CTX_RIP gregs[REG_RIP]
#elif _M_ARM_64
- typedef struct sigcontext SContext;
#define CTX_REG(x) regs[x]
#define CTX_SP sp
#define CTX_PC pc
#elif _M_ARM_32
- #include
// Add others if required.
- typedef sigcontext SContext;
#define CTX_PC arm_pc
#else
#warning No context definition for OS
diff --git a/Source/Core/Core/x64MemTools.cpp b/Source/Core/Core/MemTools.cpp
similarity index 94%
rename from Source/Core/Core/x64MemTools.cpp
rename to Source/Core/Core/MemTools.cpp
index db7a307fc3..13029f245d 100644
--- a/Source/Core/Core/x64MemTools.cpp
+++ b/Source/Core/Core/MemTools.cpp
@@ -10,6 +10,7 @@
#include "Common/Thread.h"
#include "Common/x64Analyzer.h"
+#include "Core/MachineContext.h"
#include "Core/MemTools.h"
#include "Core/HW/Memmap.h"
#include "Core/PowerPC/JitInterface.h"
@@ -23,6 +24,8 @@ namespace EMM
#ifdef _WIN32
+const bool g_exception_handlers_supported = true;
+
LONG NTAPI Handler(PEXCEPTION_POINTERS pPtrs)
{
switch (pPtrs->ExceptionRecord->ExceptionCode)
@@ -91,6 +94,8 @@ void UninstallExceptionHandler() {}
#elif defined(__APPLE__) && !defined(USE_SIGACTION_ON_APPLE)
+const bool g_exception_handlers_supported = true;
+
static void CheckKR(const char* name, kern_return_t kr)
{
if (kr)
@@ -209,7 +214,9 @@ void InstallExceptionHandler()
void UninstallExceptionHandler() {}
-#elif defined(_POSIX_VERSION)
+#elif defined(_POSIX_VERSION) && !defined(_M_GENERIC)
+
+const bool g_exception_handlers_supported = true;
static void sigsegv_handler(int sig, siginfo_t *info, void *raw_context)
{
@@ -275,9 +282,11 @@ void UninstallExceptionHandler()
free(old_stack.ss_sp);
}
}
-#else
+#else // _M_GENERIC or unsupported platform
-#error Unsupported x86_64 platform! Report this if you support sigaction
+const bool g_exception_handlers_supported = false;
+void InstallExceptionHandler() {}
+void UninstallExceptionHandler() {}
#endif
diff --git a/Source/Core/Core/MemTools.h b/Source/Core/Core/MemTools.h
index fcc671b799..cd01d1ae60 100644
--- a/Source/Core/Core/MemTools.h
+++ b/Source/Core/Core/MemTools.h
@@ -9,7 +9,7 @@
namespace EMM
{
- typedef u32 EAddr;
+ extern const bool g_exception_handlers_supported;
void InstallExceptionHandler();
void UninstallExceptionHandler();
}
diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp
index 2866870af0..5fffcd2197 100644
--- a/Source/Core/Core/NetPlayClient.cpp
+++ b/Source/Core/Core/NetPlayClient.cpp
@@ -542,16 +542,16 @@ bool NetPlayClient::GetNetPads(const u8 pad_nb, GCPadStatus* pad_status)
{
// The interface for this is extremely silly.
//
- // Imagine a physical device that links three Gamecubes together
+ // Imagine a physical device that links three GameCubes together
// and emulates NetPlay that way. Which GameCube controls which
// in-game controllers can be configured on the device (m_pad_map)
// but which sockets on each individual GameCube should be used
// to control which players? The solution that Dolphin uses is
// that we hardcode the knowledge that they go in order, so if
- // you have a 3P game with three gamecubes, then every single
+ // you have a 3P game with three GameCubes, then every single
// controller should be plugged into slot 1.
//
- // If you have a 4P game, then one of the Gamecubes will have
+ // If you have a 4P game, then one of the GameCubes will have
// a controller plugged into slot 1, and another in slot 2.
//
// The slot number is the "local" pad number, and what player
diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Branch.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Branch.cpp
index 33c653c191..a7fe02bcb4 100644
--- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Branch.cpp
+++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Branch.cpp
@@ -120,7 +120,7 @@ void Interpreter::rfid(UGeckoInstruction _inst)
m_EndBlock = true;
}
-// sc isn't really used for anything important in gc games (just for a write barrier) so we really don't have to emulate it.
+// sc isn't really used for anything important in GameCube games (just for a write barrier) so we really don't have to emulate it.
// We do it anyway, though :P
void Interpreter::sc(UGeckoInstruction _inst)
{
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp
index 8de45ae981..044529b175 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp
@@ -543,10 +543,9 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
jit->js.numLoadStoreInst = 0;
jit->js.numFloatingPointInst = 0;
- u32 nextPC = em_address;
// Analyze the block, collect all instructions it is made of (including inlining,
// if that is enabled), reorder instructions for optimal performance, and join joinable instructions.
- nextPC = analyzer.Analyze(em_address, &code_block, code_buf, blockSize);
+ u32 nextPC = analyzer.Analyze(em_address, &code_block, code_buf, blockSize);
PPCAnalyst::CodeOp *ops = code_buf->codebuffer;
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.h b/Source/Core/Core/PowerPC/Jit64/Jit.h
index b1efdbd06d..5793d744c8 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit.h
+++ b/Source/Core/Core/PowerPC/Jit64/Jit.h
@@ -37,7 +37,6 @@
#include "Core/PowerPC/Jit64/JitAsm.h"
#include "Core/PowerPC/Jit64/JitRegCache.h"
#include "Core/PowerPC/JitCommon/Jit_Util.h"
-#include "Core/PowerPC/JitCommon/JitBackpatch.h"
#include "Core/PowerPC/JitCommon/JitBase.h"
#include "Core/PowerPC/JitCommon/JitCache.h"
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
index 0db3a3cca1..3381d8c57e 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
@@ -232,9 +232,13 @@ void Jit64::mfspr(UGeckoInstruction inst)
// cost of calling out to C for this is actually significant.
MOV(64, R(RAX), M(&CoreTiming::globalTimer));
SUB(64, R(RAX), M(&CoreTiming::fakeTBStartTicks));
- // The timer can change within a long block, so add in any difference
- if (js.downcountAmount)
- ADD(64, R(RAX), Imm32(js.downcountAmount));
+ // It might seem convenient to correct the timer for the block position here for even more accurate
+ // timing, but as of currently, this can break games. If we end up reading a time *after* the time
+ // at which an interrupt was supposed to occur, e.g. because we're 100 cycles into a block with only
+ // 50 downcount remaining, some games don't function correctly, such as Karaoke Party Revolution,
+ // which won't get past the loading screen.
+ //if (js.downcountAmount)
+ // ADD(64, R(RAX), Imm32(js.downcountAmount));
// a / 12 = (a * 0xAAAAAAAAAAAAAAAB) >> 67
MOV(64, R(RDX), Imm64(0xAAAAAAAAAAAAAAABULL));
MUL(64, R(RDX));
diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp
index 65f86d92cf..acb57f8a14 100644
--- a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp
+++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp
@@ -527,10 +527,9 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
jit->js.numLoadStoreInst = 0;
jit->js.numFloatingPointInst = 0;
- u32 nextPC = em_address;
// Analyze the block, collect all instructions it is made of (including inlining,
// if that is enabled), reorder instructions for optimal performance, and join joinable instructions.
- nextPC = analyzer.Analyze(em_address, &code_block, code_buf, blockSize);
+ u32 nextPC = analyzer.Analyze(em_address, &code_block, code_buf, blockSize);
PPCAnalyst::CodeOp *ops = code_buf->codebuffer;
diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL.h b/Source/Core/Core/PowerPC/Jit64IL/JitIL.h
index 8afa6d9ae5..bb3cce01bd 100644
--- a/Source/Core/Core/PowerPC/Jit64IL/JitIL.h
+++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL.h
@@ -30,7 +30,6 @@
#include "Core/PowerPC/PPCTables.h"
#include "Core/PowerPC/Jit64/JitAsm.h"
#include "Core/PowerPC/JitCommon/Jit_Util.h"
-#include "Core/PowerPC/JitCommon/JitBackpatch.h"
#include "Core/PowerPC/JitCommon/JitBase.h"
#include "Core/PowerPC/JitCommon/JitCache.h"
#include "Core/PowerPC/JitILCommon/IR.h"
diff --git a/Source/Core/Core/PowerPC/JitArm32/Jit.cpp b/Source/Core/Core/PowerPC/JitArm32/Jit.cpp
index de9abfa988..59ddf184e9 100644
--- a/Source/Core/Core/PowerPC/JitArm32/Jit.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/Jit.cpp
@@ -40,6 +40,7 @@ void JitArm::Init()
code_block.m_gpa = &js.gpa;
code_block.m_fpa = &js.fpa;
analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE);
+ InitBackpatch();
}
void JitArm::ClearCache()
@@ -150,6 +151,10 @@ void JitArm::WriteExitDestInR(ARMReg Reg)
STR(Reg, R9, PPCSTATE_OFF(pc));
Cleanup();
DoDownCount();
+
+ if (Profiler::g_ProfileBlocks)
+ EndTimeProfile(js.curBlock);
+
MOVI2R(Reg, (u32)asm_routines.dispatcher);
B(Reg);
gpr.Unlock(Reg);
@@ -160,6 +165,9 @@ void JitArm::WriteRfiExitDestInR(ARMReg Reg)
Cleanup();
DoDownCount();
+ if (Profiler::g_ProfileBlocks)
+ EndTimeProfile(js.curBlock);
+
ARMReg A = gpr.GetReg(false);
LDR(A, R9, PPCSTATE_OFF(pc));
@@ -177,6 +185,9 @@ void JitArm::WriteExceptionExit()
Cleanup();
DoDownCount();
+ if (Profiler::g_ProfileBlocks)
+ EndTimeProfile(js.curBlock);
+
ARMReg A = gpr.GetReg(false);
LDR(A, R9, PPCSTATE_OFF(pc));
@@ -193,6 +204,10 @@ void JitArm::WriteExit(u32 destination)
Cleanup();
DoDownCount();
+
+ if (Profiler::g_ProfileBlocks)
+ EndTimeProfile(js.curBlock);
+
//If nobody has taken care of this yet (this can be removed when all branches are done)
JitBlock *b = js.curBlock;
JitBlock::LinkData linkData;
@@ -273,6 +288,64 @@ void JitArm::Break(UGeckoInstruction inst)
BKPT(0x4444);
}
+void JitArm::BeginTimeProfile(JitBlock* b)
+{
+ b->ticCounter = 0;
+ b->ticStart = 0;
+ b->ticStop = 0;
+
+ // Performance counters are bit finnicky on ARM
+ // We must first enable and program the PMU before using it
+ // This is a per core operation so with thread scheduling we may jump to a core we haven't enabled PMU yet
+ // Work around this by enabling PMU each time at the start of a block
+ // Some ARM CPUs are getting absurd core counts(48+!)
+ // We have to reset counters at the start of every block anyway, so may as well.
+ // One thing to note about performance counters on ARM
+ // The kernel can block access to these co-processor registers
+ // In the case that this happens, these will generate a SIGILL
+
+ // Refer to the ARM ARM about PMCR for what these do exactly
+ enum
+ {
+ PERF_OPTION_ENABLE = (1 << 0),
+ PERF_OPTION_RESET_CR = (1 << 1),
+ PERF_OPTION_RESET_CCR = (1 << 2),
+ PERF_OPTION_DIVIDER_MODE = (1 << 3),
+ PERF_OPTION_EXPORT_ENABLE = (1 << 4),
+ };
+ const u32 perf_options =
+ PERF_OPTION_ENABLE |
+ PERF_OPTION_RESET_CR |
+ PERF_OPTION_RESET_CCR |
+ PERF_OPTION_EXPORT_ENABLE;
+ MOVI2R(R0, perf_options);
+ // Programs the PMCR
+ MCR(15, 0, R0, 9, 12, 0);
+
+ MOVI2R(R0, 0x8000000F);
+ // Enables all counters
+ MCR(15, 0, R0, 9, 12, 1);
+ // Clears all counter overflows
+ MCR(15, 0, R0, 9, 12, 3);
+
+ // Gets the cycle counter
+ MRC(15, 0, R1, 9, 13, 0);
+ MOVI2R(R0, (u32)&b->ticStart);
+ STR(R1, R0, 0);
+}
+
+void JitArm::EndTimeProfile(JitBlock* b)
+{
+ // Gets the cycle counter
+ MRC(15, 0, R1, 9, 13, 0);
+ MOVI2R(R0, (u32)&b->ticStop);
+ STR(R1, R0, 0);
+
+ MOVI2R(R0, (u32)&b->ticStart);
+ MOVI2R(R14, (u32)asm_routines.m_increment_profile_counter);
+ BL(R14);
+}
+
const u8* JitArm::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBlock *b)
{
int blockSize = code_buf->GetSize();
@@ -362,8 +435,7 @@ const u8* JitArm::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBlo
LDR(rB, rA); // Load the actual value in to R11.
ADD(rB, rB, 1); // Add one to the value
STR(rB, rA); // Now store it back in the memory location
- // get start tic
- PROFILER_QUERY_PERFORMANCE_COUNTER(&b->ticStart);
+ BeginTimeProfile(b);
gpr.Unlock(rA, rB);
}
gpr.Start(js.gpa);
@@ -390,16 +462,6 @@ const u8* JitArm::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBlo
// WARNING - cmp->branch merging will screw this up.
js.isLastInstruction = true;
js.next_inst = 0;
- if (Profiler::g_ProfileBlocks)
- {
- // CAUTION!!! push on stack regs you use, do your stuff, then pop
- PROFILER_VPUSH;
- // get end tic
- PROFILER_QUERY_PERFORMANCE_COUNTER(&b->ticStop);
- // tic counter += (end tic - start tic)
- PROFILER_UPDATE_TIME(&b);
- PROFILER_VPOP;
- }
}
else
{
@@ -416,26 +478,6 @@ const u8* JitArm::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBlo
POP(4, R0, R1, R2, R3);
}
- if (Profiler::g_ProfileBlocks)
- {
- // Add run count
- static const u64 One = 1;
- ARMReg RA = gpr.GetReg();
- ARMReg RB = gpr.GetReg();
- ARMReg VA = fpr.GetReg();
- ARMReg VB = fpr.GetReg();
- MOVI2R(RA, (u32)&opinfo->runCount);
- MOVI2R(RB, (u32)&One);
- VLDR(VA, RA, 0);
- VLDR(VB, RB, 0);
- NEONXEmitter nemit(this);
- nemit.VADD(I_64, VA, VA, VB);
- VSTR(VA, RA, 0);
- gpr.Unlock(RA, RB);
- fpr.Unlock(VA);
- fpr.Unlock(VB);
- }
-
if (!ops[i].skip)
{
if (js.memcheck && (opinfo->flags & FL_USE_FPU))
@@ -444,7 +486,13 @@ const u8* JitArm::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBlo
BKPT(0x7777);
}
JitArmTables::CompileInstruction(ops[i]);
- fpr.Flush();
+
+ // If we have a register that will never be used again, flush it.
+ for (int j : ~ops[i].gprInUse)
+ gpr.StoreFromRegister(j);
+ for (int j : ~ops[i].fprInUse)
+ fpr.StoreFromRegister(j);
+
if (js.memcheck && (opinfo->flags & FL_LOADSTORE))
{
// Don't do this yet
diff --git a/Source/Core/Core/PowerPC/JitArm32/Jit.h b/Source/Core/Core/PowerPC/JitArm32/Jit.h
index d4885d5229..1f8684bcc9 100644
--- a/Source/Core/Core/PowerPC/JitArm32/Jit.h
+++ b/Source/Core/Core/PowerPC/JitArm32/Jit.h
@@ -48,6 +48,26 @@ private:
ArmFPRCache fpr;
PPCAnalyst::CodeBuffer code_buffer;
+ struct BackPatchInfo
+ {
+ enum
+ {
+ FLAG_STORE = (1 << 0),
+ FLAG_LOAD = (1 << 1),
+ FLAG_SIZE_8 = (1 << 2),
+ FLAG_SIZE_16 = (1 << 3),
+ FLAG_SIZE_32 = (1 << 4),
+ FLAG_SIZE_F32 = (1 << 5),
+ FLAG_SIZE_F64 = (1 << 6),
+ FLAG_REVERSE = (1 << 7),
+ };
+
+ u32 m_fastmem_size;
+ u32 m_fastmem_trouble_inst_offset;
+ u32 m_slowmem_size;
+ };
+ // The key is the flags
+ std::map m_backpatch_info;
void DoDownCount();
@@ -57,7 +77,19 @@ private:
ArmGen::FixupBranch JumpIfCRFieldBit(int field, int bit, bool jump_if_set);
+ void BeginTimeProfile(JitBlock* b);
+ void EndTimeProfile(JitBlock* b);
+
bool BackPatch(SContext* ctx);
+ bool DisasmLoadStore(const u8* ptr, u32* flags, ArmGen::ARMReg* rD, ArmGen::ARMReg* V1);
+ // Initializes the information that backpatching needs
+ // This is required so we know the backpatch routine sizes and trouble offsets
+ void InitBackpatch();
+
+ // Returns the trouble instruction offset
+ // Zero if it isn't a fastmem routine
+ u32 EmitBackpatchRoutine(ARMXEmitter* emit, u32 flags, bool fastmem, bool do_padding, ArmGen::ARMReg RS, ArmGen::ARMReg V1 = ArmGen::ARMReg::INVALID_REG);
+
public:
JitArm() : code_buffer(32000) {}
~JitArm() {}
@@ -114,13 +146,8 @@ public:
void GetCarryAndClear(ArmGen::ARMReg reg);
void FinalizeCarry(ArmGen::ARMReg reg);
- // TODO: This shouldn't be here
- void UnsafeStoreFromReg(ArmGen::ARMReg dest, ArmGen::ARMReg value, int accessSize, s32 offset);
- void SafeStoreFromReg(bool fastmem, s32 dest, u32 value, s32 offsetReg, int accessSize, s32 offset);
-
- void UnsafeLoadToReg(ArmGen::ARMReg dest, ArmGen::ARMReg addr, int accessSize, s32 offsetReg, s32 offset);
- void SafeLoadToReg(bool fastmem, u32 dest, s32 addr, s32 offsetReg, int accessSize, s32 offset, bool signExtend, bool reverse);
-
+ void SafeStoreFromReg(s32 dest, u32 value, s32 offsetReg, int accessSize, s32 offset);
+ void SafeLoadToReg(ArmGen::ARMReg dest, s32 addr, s32 offsetReg, int accessSize, s32 offset, bool signExtend, bool reverse, bool update);
// OPCODES
void unknown_instruction(UGeckoInstruction _inst);
@@ -205,7 +232,6 @@ public:
// Floating point loadStore
void lfXX(UGeckoInstruction _inst);
void stfXX(UGeckoInstruction _inst);
- void stfs(UGeckoInstruction _inst);
// Paired Singles
void ps_add(UGeckoInstruction _inst);
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitArm_BackPatch.cpp b/Source/Core/Core/PowerPC/JitArm32/JitArm_BackPatch.cpp
index b3c77cdab4..c703e5a88d 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitArm_BackPatch.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitArm_BackPatch.cpp
@@ -9,7 +9,6 @@
#include "Core/HW/Memmap.h"
#include "Core/PowerPC/JitArm32/Jit.h"
-#include "Core/PowerPC/JitCommon/JitBackpatch.h"
using namespace ArmGen;
@@ -17,52 +16,167 @@ using namespace ArmGen;
// 1) It's really necessary. We don't know anything about the context.
// 2) It doesn't really hurt. Only instructions that access I/O will get these, and there won't be
// that many of them in a typical program/game.
-static bool DisamLoadStore(const u32 inst, ARMReg &rD, u8 &accessSize, bool &Store)
+bool JitArm::DisasmLoadStore(const u8* ptr, u32* flags, ARMReg* rD, ARMReg* V1)
{
+ u32 inst = *(u32*)ptr;
+ u32 prev_inst = *(u32*)(ptr - 4);
+ u32 next_inst = *(u32*)(ptr + 4);
u8 op = (inst >> 20) & 0xFF;
- rD = (ARMReg)((inst >> 12) & 0xF);
+ *rD = (ARMReg)((inst >> 12) & 0xF);
switch (op)
{
case 0x58: // STR
{
- Store = true;
- accessSize = 32;
+ *flags |=
+ BackPatchInfo::FLAG_STORE |
+ BackPatchInfo::FLAG_SIZE_32;
+ *rD = (ARMReg)(prev_inst & 0xF);
}
break;
case 0x59: // LDR
{
- Store = false;
- accessSize = 32;
+ *flags |=
+ BackPatchInfo::FLAG_LOAD |
+ BackPatchInfo::FLAG_SIZE_32;
+ // REV
+ if ((next_inst & 0x0FFF0FF0) != 0x06BF0F30)
+ *flags |= BackPatchInfo::FLAG_REVERSE;
}
break;
case 0x1D: // LDRH
{
- Store = false;
- accessSize = 16;
+ *flags |=
+ BackPatchInfo::FLAG_LOAD |
+ BackPatchInfo::FLAG_SIZE_16;
+ // REV16
+ if((next_inst & 0x0FFF0FF0) != 0x06BF0FB0)
+ *flags |= BackPatchInfo::FLAG_REVERSE;
}
break;
case 0x45 + 0x18: // LDRB
{
- Store = false;
- accessSize = 8;
+ *flags |=
+ BackPatchInfo::FLAG_LOAD |
+ BackPatchInfo::FLAG_SIZE_8;
}
break;
case 0x5C: // STRB
{
- Store = true;
- accessSize = 8;
+ *flags |=
+ BackPatchInfo::FLAG_STORE |
+ BackPatchInfo::FLAG_SIZE_8;
+ *rD = (ARMReg)((inst >> 12) & 0xF);
}
break;
case 0x1C: // STRH
{
- Store = true;
- accessSize = 16;
+ *flags |=
+ BackPatchInfo::FLAG_STORE |
+ BackPatchInfo::FLAG_SIZE_16;
+ *rD = (ARMReg)(prev_inst & 0xF);
}
break;
default:
- printf("Op is 0x%02x\n", op);
- return false;
+ {
+ // Could be a floating point loadstore
+ u8 op2 = (inst >> 24) & 0xF;
+ switch (op2)
+ {
+ case 0xD: // VLDR/VSTR
+ {
+ bool load = (inst >> 20) & 1;
+ bool single = !((inst >> 8) & 1);
+
+ if (load)
+ *flags |= BackPatchInfo::FLAG_LOAD;
+ else
+ *flags |= BackPatchInfo::FLAG_STORE;
+
+ if (single)
+ *flags |= BackPatchInfo::FLAG_SIZE_F32;
+ else
+ *flags |= BackPatchInfo::FLAG_SIZE_F64;
+ if (single)
+ {
+ if (!load)
+ {
+ u32 vcvt = *(u32*)(ptr - 8);
+ u32 src_register = vcvt & 0xF;
+ src_register |= (vcvt >> 1) & 0x10;
+ *rD = (ARMReg)(src_register + D0);
+ }
+ }
+ }
+ break;
+ case 0x4: // VST1/VLD1
+ {
+ u32 size = (inst >> 6) & 0x3;
+ bool load = (inst >> 21) & 1;
+ if (load)
+ *flags |= BackPatchInfo::FLAG_LOAD;
+ else
+ *flags |= BackPatchInfo::FLAG_STORE;
+
+
+ if (size == 2) // 32bit
+ {
+ if (load)
+ {
+ // For 32bit loads we are loading to a temporary
+ // So we need to read PC+8,PC+12 to get the two destination registers
+ u32 vcvt_1 = *(u32*)(ptr + 8);
+ u32 vcvt_2 = *(u32*)(ptr + 12);
+
+ u32 dest_register_1 = (vcvt_1 >> 12) & 0xF;
+ dest_register_1 |= (vcvt_1 >> 18) & 0x10;
+
+ u32 dest_register_2 = (vcvt_2 >> 12) & 0xF;
+ dest_register_2 |= (vcvt_2 >> 18) & 0x10;
+
+ // Make sure to encode the destination register to something our emitter understands
+ *rD = (ARMReg)(dest_register_1 + D0);
+ *V1 = (ARMReg)(dest_register_2 + D0);
+ }
+ else
+ {
+ // For 32bit stores we are storing from a temporary
+ // So we need to check the VCVT at PC-8 for the source register
+ u32 vcvt = *(u32*)(ptr - 8);
+ u32 src_register = vcvt & 0xF;
+ src_register |= (vcvt >> 1) & 0x10;
+ *rD = (ARMReg)(src_register + D0);
+ }
+ *flags |= BackPatchInfo::FLAG_SIZE_F32;
+ }
+ else if (size == 3) // 64bit
+ {
+ if (load)
+ {
+ // For 64bit loads we load directly in to the VFP register
+ u32 dest_register = (inst >> 12) & 0xF;
+ dest_register |= (inst >> 18) & 0x10;
+ // Make sure to encode the destination register to something our emitter understands
+ *rD = (ARMReg)(dest_register + D0);
+ }
+ else
+ {
+ // For 64bit stores we are storing from a temporary
+ // Check the previous VREV64 instruction for the real register
+ u32 src_register = prev_inst & 0xF;
+ src_register |= (prev_inst >> 1) & 0x10;
+ *rD = (ARMReg)(src_register + D0);
+ }
+ *flags |= BackPatchInfo::FLAG_SIZE_F64;
+ }
+ }
+ break;
+ default:
+ printf("Op is 0x%02x\n", op);
+ return false;
+ break;
+ }
+ }
}
return true;
}
@@ -70,10 +184,7 @@ static bool DisamLoadStore(const u32 inst, ARMReg &rD, u8 &accessSize, bool &Sto
bool JitArm::HandleFault(uintptr_t access_address, SContext* ctx)
{
if (access_address < (uintptr_t)Memory::base)
- {
- PanicAlertT("Exception handler - access below memory space. %08llx%08llx",
- access_address >> 32, access_address);
- }
+ PanicAlertT("Exception handler - access below memory space. 0x%08x", access_address);
return BackPatch(ctx);
}
@@ -84,70 +195,484 @@ bool JitArm::BackPatch(SContext* ctx)
// We need to get the destination register before we start
u8* codePtr = (u8*)ctx->CTX_PC;
u32 Value = *(u32*)codePtr;
- ARMReg rD;
- u8 accessSize;
- bool Store;
+ ARMReg rD = INVALID_REG;
+ ARMReg V1 = INVALID_REG;
+ u32 flags = 0;
- if (!DisamLoadStore(Value, rD, accessSize, Store))
+ if (!DisasmLoadStore(codePtr, &flags, &rD, &V1))
{
printf("Invalid backpatch at location 0x%08lx(0x%08x)\n", ctx->CTX_PC, Value);
exit(0);
}
- if (Store)
+ BackPatchInfo& info = m_backpatch_info[flags];
+ ARMXEmitter emitter(codePtr - info.m_fastmem_trouble_inst_offset * 4);
+ u32 new_pc = (u32)emitter.GetCodePtr();
+ EmitBackpatchRoutine(&emitter, flags, false, true, rD, V1);
+ emitter.FlushIcache();
+ ctx->CTX_PC = new_pc;
+ return true;
+}
+
+u32 JitArm::EmitBackpatchRoutine(ARMXEmitter* emit, u32 flags, bool fastmem, bool do_padding, ARMReg RS, ARMReg V1)
+{
+ ARMReg addr = R12;
+ ARMReg temp = R11;
+ u32 trouble_offset = 0;
+ const u8* code_base = emit->GetCodePtr();
+
+ if (fastmem)
{
- const u32 ARMREGOFFSET = 4 * 5;
- ARMXEmitter emitter(codePtr - ARMREGOFFSET);
- switch (accessSize)
+ ARMReg temp2 = R10;
+ Operand2 mask(2, 1); // ~(Memory::MEMVIEW32_MASK)
+ emit->BIC(temp, addr, mask); // 1
+ emit->MOVI2R(temp2, (u32)Memory::base); // 2-3
+ emit->ADD(temp, temp, temp2); // 4
+
+ if (flags & BackPatchInfo::FLAG_STORE &&
+ flags & (BackPatchInfo::FLAG_SIZE_F32 | BackPatchInfo::FLAG_SIZE_F64))
{
- case 8: // 8bit
- emitter.MOVI2R(R14, (u32)&Memory::Write_U8, false); // 1-2
- return 0;
- break;
- case 16: // 16bit
- emitter.MOVI2R(R14, (u32)&Memory::Write_U16, false); // 1-2
- return 0;
- break;
- case 32: // 32bit
- emitter.MOVI2R(R14, (u32)&Memory::Write_U32, false); // 1-2
- break;
+ NEONXEmitter nemit(emit);
+ if (flags & BackPatchInfo::FLAG_SIZE_F32)
+ {
+ emit->VCVT(S0, RS, 0);
+ nemit.VREV32(I_8, D0, D0);
+ trouble_offset = (emit->GetCodePtr() - code_base) / 4;
+ emit->VSTR(S0, temp, 0);
+ }
+ else
+ {
+ nemit.VREV64(I_8, D0, RS);
+ trouble_offset = (emit->GetCodePtr() - code_base) / 4;
+ nemit.VST1(I_64, D0, temp);
+ }
+ }
+ else if (flags & BackPatchInfo::FLAG_LOAD &&
+ flags & (BackPatchInfo::FLAG_SIZE_F32 | BackPatchInfo::FLAG_SIZE_F64))
+ {
+ NEONXEmitter nemit(emit);
+
+ trouble_offset = (emit->GetCodePtr() - code_base) / 4;
+ if (flags & BackPatchInfo::FLAG_SIZE_F32)
+ {
+ nemit.VLD1(F_32, D0, temp);
+ nemit.VREV32(I_8, D0, D0); // Byte swap to result
+ emit->VCVT(RS, S0, 0);
+ emit->VCVT(V1, S0, 0);
+ }
+ else
+ {
+ nemit.VLD1(I_64, RS, temp);
+ nemit.VREV64(I_8, RS, RS); // Byte swap to result
+ }
+ }
+ else if (flags & BackPatchInfo::FLAG_STORE)
+ {
+ if (flags & BackPatchInfo::FLAG_SIZE_32)
+ emit->REV(temp2, RS);
+ else if (flags & BackPatchInfo::FLAG_SIZE_16)
+ emit->REV16(temp2, RS);
+
+ trouble_offset = (emit->GetCodePtr() - code_base) / 4;
+
+ if (flags & BackPatchInfo::FLAG_SIZE_32)
+ emit->STR(temp2, temp);
+ else if (flags & BackPatchInfo::FLAG_SIZE_16)
+ emit->STRH(temp2, temp);
+ else
+ emit->STRB(RS, temp);
+ }
+ else
+ {
+ trouble_offset = (emit->GetCodePtr() - code_base) / 4;
+
+ if (flags & BackPatchInfo::FLAG_SIZE_32)
+ emit->LDR(RS, temp); // 5
+ else if (flags & BackPatchInfo::FLAG_SIZE_16)
+ emit->LDRH(RS, temp);
+ else if (flags & BackPatchInfo::FLAG_SIZE_8)
+ emit->LDRB(RS, temp);
+
+
+ if (!(flags & BackPatchInfo::FLAG_REVERSE))
+ {
+ if (flags & BackPatchInfo::FLAG_SIZE_32)
+ emit->REV(RS, RS); // 6
+ else if (flags & BackPatchInfo::FLAG_SIZE_16)
+ emit->REV16(RS, RS);
+ }
}
- emitter.PUSH(4, R0, R1, R2, R3); // 3
- emitter.MOV(R0, rD); // Value - 4
- emitter.MOV(R1, R10); // Addr- 5
- emitter.BL(R14); // 6
- emitter.POP(4, R0, R1, R2, R3); // 7
- u32 newPC = ctx->CTX_PC - (ARMREGOFFSET + 4 * 4);
- ctx->CTX_PC = newPC;
- emitter.FlushIcache();
- return true;
}
else
{
- const u32 ARMREGOFFSET = 4 * 4;
- ARMXEmitter emitter(codePtr - ARMREGOFFSET);
- switch (accessSize)
+ if (flags & BackPatchInfo::FLAG_STORE &&
+ flags & (BackPatchInfo::FLAG_SIZE_F32 | BackPatchInfo::FLAG_SIZE_F64))
{
- case 8: // 8bit
- emitter.MOVI2R(R14, (u32)&Memory::Read_U8, false); // 2
- break;
- case 16: // 16bit
- emitter.MOVI2R(R14, (u32)&Memory::Read_U16, false); // 2
- break;
- case 32: // 32bit
- emitter.MOVI2R(R14, (u32)&Memory::Read_U32, false); // 2
- break;
+ emit->PUSH(4, R0, R1, R2, R3);
+ if (flags & BackPatchInfo::FLAG_SIZE_F32)
+ {
+ emit->MOV(R1, addr);
+ emit->VCVT(S0, RS, 0);
+ emit->VMOV(R0, S0);
+ emit->MOVI2R(temp, (u32)&Memory::Write_U32);
+ emit->BL(temp);
+ }
+ else
+ {
+ emit->MOVI2R(temp, (u32)&Memory::Write_F64);
+#if !defined(__ARM_PCS_VFP) // SoftFP returns in R0 and R1
+ emit->VMOV(R0, RS);
+ emit->MOV(R2, addr);
+#else
+ emit->VMOV(D0, RS);
+ emit->MOV(R0, addr);
+#endif
+ emit->BL(temp);
+ }
+ emit->POP(4, R0, R1, R2, R3);
+ }
+ else if (flags & BackPatchInfo::FLAG_LOAD &&
+ flags & (BackPatchInfo::FLAG_SIZE_F32 | BackPatchInfo::FLAG_SIZE_F64))
+ {
+ emit->PUSH(4, R0, R1, R2, R3);
+ emit->MOV(R0, addr);
+ if (flags & BackPatchInfo::FLAG_SIZE_F32)
+ {
+ emit->MOVI2R(temp, (u32)&Memory::Read_U32);
+ emit->BL(temp);
+ emit->VMOV(S0, R0);
+ emit->VCVT(RS, S0, 0);
+ emit->VCVT(V1, S0, 0);
+ }
+ else
+ {
+ emit->MOVI2R(temp, (u32)&Memory::Read_F64);
+ emit->BL(temp);
+
+#if !defined(__ARM_PCS_VFP) // SoftFP returns in R0 and R1
+ emit->VMOV(RS, R0);
+#else
+ emit->VMOV(RS, D0);
+#endif
+ }
+ emit->POP(4, R0, R1, R2, R3);
+ }
+ else if (flags & BackPatchInfo::FLAG_STORE)
+ {
+ emit->PUSH(4, R0, R1, R2, R3);
+ emit->MOV(R0, RS);
+ emit->MOV(R1, addr);
+
+ if (flags & BackPatchInfo::FLAG_SIZE_32)
+ emit->MOVI2R(temp, (u32)&Memory::Write_U32);
+ else if (flags & BackPatchInfo::FLAG_SIZE_16)
+ emit->MOVI2R(temp, (u32)&Memory::Write_U16);
+ else
+ emit->MOVI2R(temp, (u32)&Memory::Write_U8);
+
+ emit->BL(temp);
+ emit->POP(4, R0, R1, R2, R3);
+ }
+ else
+ {
+ emit->PUSH(4, R0, R1, R2, R3);
+ emit->MOV(R0, addr);
+
+ if (flags & BackPatchInfo::FLAG_SIZE_32)
+ emit->MOVI2R(temp, (u32)&Memory::Read_U32);
+ else if (flags & BackPatchInfo::FLAG_SIZE_16)
+ emit->MOVI2R(temp, (u32)&Memory::Read_U16);
+ else if (flags & BackPatchInfo::FLAG_SIZE_8)
+ emit->MOVI2R(temp, (u32)&Memory::Read_U8);
+
+ emit->BL(temp);
+ emit->MOV(temp, R0);
+ emit->POP(4, R0, R1, R2, R3);
+
+ if (!(flags & BackPatchInfo::FLAG_REVERSE))
+ {
+ emit->MOV(RS, temp);
+ }
+ else
+ {
+ if (flags & BackPatchInfo::FLAG_SIZE_32)
+ emit->REV(RS, temp); // 6
+ else if (flags & BackPatchInfo::FLAG_SIZE_16)
+ emit->REV16(RS, temp);
+ }
}
- emitter.PUSH(4, R0, R1, R2, R3); // 3
- emitter.MOV(R0, R10); // 4
- emitter.BL(R14); // 5
- emitter.MOV(R14, R0); // 6
- emitter.POP(4, R0, R1, R2, R3); // 7
- emitter.MOV(rD, R14); // 8
- ctx->CTX_PC -= ARMREGOFFSET + (4 * 4);
- emitter.FlushIcache();
- return true;
}
- return 0;
+
+ if (do_padding)
+ {
+ BackPatchInfo& info = m_backpatch_info[flags];
+ u32 num_insts_max = std::max(info.m_fastmem_size, info.m_slowmem_size);
+
+ u32 code_size = emit->GetCodePtr() - code_base;
+ code_size /= 4;
+
+ emit->NOP(num_insts_max - code_size);
+ }
+
+ return trouble_offset;
}
+void JitArm::InitBackpatch()
+{
+ u32 flags = 0;
+ BackPatchInfo info;
+ u8* code_base = GetWritableCodePtr();
+ u8* code_end;
+
+ // Writes
+ {
+ // 8bit
+ {
+ flags =
+ BackPatchInfo::FLAG_STORE |
+ BackPatchInfo::FLAG_SIZE_8;
+ EmitBackpatchRoutine(this, flags, false, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+ // 16bit
+ {
+ flags =
+ BackPatchInfo::FLAG_STORE |
+ BackPatchInfo::FLAG_SIZE_16;
+ EmitBackpatchRoutine(this, flags, false, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+ // 32bit
+ {
+ flags =
+ BackPatchInfo::FLAG_STORE |
+ BackPatchInfo::FLAG_SIZE_32;
+ EmitBackpatchRoutine(this, flags, false, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+ // 32bit float
+ {
+ flags =
+ BackPatchInfo::FLAG_STORE |
+ BackPatchInfo::FLAG_SIZE_F32;
+ EmitBackpatchRoutine(this, flags, false, false, D0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, D0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+ // 64bit float
+ {
+ flags =
+ BackPatchInfo::FLAG_STORE |
+ BackPatchInfo::FLAG_SIZE_F64;
+ EmitBackpatchRoutine(this, flags, false, false, D0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, D0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+
+ }
+
+ // Loads
+ {
+ // 8bit
+ {
+ flags =
+ BackPatchInfo::FLAG_LOAD |
+ BackPatchInfo::FLAG_SIZE_8;
+ EmitBackpatchRoutine(this, flags, false, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+ // 16bit
+ {
+ flags =
+ BackPatchInfo::FLAG_LOAD |
+ BackPatchInfo::FLAG_SIZE_16;
+ EmitBackpatchRoutine(this, flags, false, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+ // 32bit
+ {
+ flags =
+ BackPatchInfo::FLAG_LOAD |
+ BackPatchInfo::FLAG_SIZE_32;
+ EmitBackpatchRoutine(this, flags, false, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+
+ // 16bit - reverse
+ {
+ flags =
+ BackPatchInfo::FLAG_LOAD |
+ BackPatchInfo::FLAG_SIZE_16 |
+ BackPatchInfo::FLAG_REVERSE;
+ EmitBackpatchRoutine(this, flags, false, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+ // 32bit - reverse
+ {
+ flags =
+ BackPatchInfo::FLAG_LOAD |
+ BackPatchInfo::FLAG_SIZE_32 |
+ BackPatchInfo::FLAG_REVERSE;
+ EmitBackpatchRoutine(this, flags, false, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, R0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+ // 32bit float
+ {
+ flags =
+ BackPatchInfo::FLAG_LOAD |
+ BackPatchInfo::FLAG_SIZE_F32;
+ EmitBackpatchRoutine(this, flags, false, false, D0, D1);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, D0, D1);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+ // 64bit float
+ {
+ flags =
+ BackPatchInfo::FLAG_LOAD |
+ BackPatchInfo::FLAG_SIZE_F64;
+ EmitBackpatchRoutine(this, flags, false, false, D0);
+ code_end = GetWritableCodePtr();
+ info.m_slowmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ info.m_fastmem_trouble_inst_offset =
+ EmitBackpatchRoutine(this, flags, true, false, D0);
+ code_end = GetWritableCodePtr();
+ info.m_fastmem_size = (code_end - code_base) / 4;
+
+ SetCodePtr(code_base);
+
+ m_backpatch_info[flags] = info;
+ }
+ }
+}
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitArm_FloatingPoint.cpp b/Source/Core/Core/PowerPC/JitArm32/JitArm_FloatingPoint.cpp
index af266e5c98..41a11a10c2 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitArm_FloatingPoint.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitArm_FloatingPoint.cpp
@@ -27,6 +27,7 @@ void JitArm::fctiwx(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITFloatingPointOff);
+ FALLBACK_IF(true);
u32 b = inst.FB;
u32 d = inst.FD;
@@ -134,6 +135,8 @@ void JitArm::fctiwzx(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITFloatingPointOff);
+ FALLBACK_IF(true);
+
u32 b = inst.FB;
u32 d = inst.FD;
@@ -493,6 +496,8 @@ void JitArm::frsqrtex(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITPairedOff);
+ FALLBACK_IF(true);
+
FALLBACK_IF(inst.Rc);
u32 b = inst.FB, d = inst.FD;
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStore.cpp b/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStore.cpp
index 602918615d..1f50c7fb49 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStore.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStore.cpp
@@ -18,114 +18,149 @@
using namespace ArmGen;
-void JitArm::UnsafeStoreFromReg(ARMReg dest, ARMReg value, int accessSize, s32 offset)
+void JitArm::SafeStoreFromReg(s32 dest, u32 value, s32 regOffset, int accessSize, s32 offset)
{
- // All this gets replaced on backpatch
- Operand2 mask(2, 1); // ~(Memory::MEMVIEW32_MASK)
- BIC(dest, dest, mask); // 1
- MOVI2R(R14, (u32)Memory::base, false); // 2-3
- ADD(dest, dest, R14); // 4
- switch (accessSize)
- {
- case 32:
- REV(value, value); // 5
- break;
- case 16:
- REV16(value, value);
- break;
- case 8:
- NOP(1);
- break;
- }
- switch (accessSize)
- {
- case 32:
- STR(value, dest); // 6
- break;
- case 16:
- STRH(value, dest);
- break;
- case 8:
- STRB(value, dest);
- break;
- }
- NOP(1); // 7
-}
+ // We want to make sure to not get LR as a temp register
+ ARMReg rA = R12;
-void JitArm::SafeStoreFromReg(bool fastmem, s32 dest, u32 value, s32 regOffset, int accessSize, s32 offset)
-{
- if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem && fastmem)
- {
- ARMReg RA;
- ARMReg RB;
- ARMReg RS = gpr.R(value);
+ u32 imm_addr = 0;
+ bool is_immediate = false;
- if (dest != -1)
- RA = gpr.R(dest);
-
- if (regOffset != -1)
- {
- RB = gpr.R(regOffset);
- MOV(R10, RB);
- NOP(1);
- }
- else
- {
- MOVI2R(R10, (u32)offset, false);
- }
-
- if (dest != -1)
- ADD(R10, R10, RA);
- else
- NOP(1);
-
- MOV(R12, RS);
- UnsafeStoreFromReg(R10, R12, accessSize, 0);
- return;
- }
- ARMReg rA = gpr.GetReg();
- ARMReg rB = gpr.GetReg();
- ARMReg rC = gpr.GetReg();
- ARMReg RA;
- ARMReg RB;
- if (dest != -1)
- RA = gpr.R(dest);
- if (regOffset != -1)
- RB = gpr.R(regOffset);
- ARMReg RS = gpr.R(value);
- switch (accessSize)
- {
- case 32:
- MOVI2R(rA, (u32)&Memory::Write_U32);
- break;
- case 16:
- MOVI2R(rA, (u32)&Memory::Write_U16);
- break;
- case 8:
- MOVI2R(rA, (u32)&Memory::Write_U8);
- break;
- }
- MOV(rB, RS);
if (regOffset == -1)
{
- MOVI2R(rC, offset);
if (dest != -1)
- ADD(rC, rC, RA);
+ {
+ if (gpr.IsImm(dest))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(dest) + offset;
+ }
+ else
+ {
+ Operand2 off;
+ if (TryMakeOperand2(offset, off))
+ {
+ ADD(rA, gpr.R(dest), off);
+ }
+ else
+ {
+ MOVI2R(rA, offset);
+ ADD(rA, rA, gpr.R(dest));
+ }
+ }
+ }
+ else
+ {
+ is_immediate = true;
+ imm_addr = offset;
+ }
}
else
{
if (dest != -1)
- ADD(rC, RA, RB);
+ {
+ if (gpr.IsImm(dest) && gpr.IsImm(regOffset))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(dest) + gpr.GetImm(regOffset);
+ }
+ else if (gpr.IsImm(dest) && !gpr.IsImm(regOffset))
+ {
+ Operand2 off;
+ if (TryMakeOperand2(gpr.GetImm(dest), off))
+ {
+ ADD(rA, gpr.R(regOffset), off);
+ }
+ else
+ {
+ MOVI2R(rA, gpr.GetImm(dest));
+ ADD(rA, rA, gpr.R(regOffset));
+ }
+ }
+ else if (!gpr.IsImm(dest) && gpr.IsImm(regOffset))
+ {
+ Operand2 off;
+ if (TryMakeOperand2(gpr.GetImm(regOffset), off))
+ {
+ ADD(rA, gpr.R(dest), off);
+ }
+ else
+ {
+ MOVI2R(rA, gpr.GetImm(regOffset));
+ ADD(rA, rA, gpr.R(dest));
+ }
+ }
+ else
+ {
+ ADD(rA, gpr.R(dest), gpr.R(regOffset));
+ }
+ }
else
- MOV(rC, RB);
+ {
+ if (gpr.IsImm(regOffset))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(regOffset);
+ }
+ else
+ {
+ MOV(rA, gpr.R(regOffset));
+ }
+ }
+ }
+ ARMReg RS = gpr.R(value);
+
+ u32 flags = BackPatchInfo::FLAG_STORE;
+ if (accessSize == 32)
+ flags |= BackPatchInfo::FLAG_SIZE_32;
+ else if (accessSize == 16)
+ flags |= BackPatchInfo::FLAG_SIZE_16;
+ else
+ flags |= BackPatchInfo::FLAG_SIZE_8;
+
+ if (is_immediate)
+ {
+ if ((imm_addr & 0xFFFFF000) == 0xCC008000 && jit->jo.optimizeGatherPipe)
+ {
+ MOVI2R(R14, (u32)&GPFifo::m_gatherPipeCount);
+ MOVI2R(R10, (u32)GPFifo::m_gatherPipe);
+ LDR(R11, R14);
+ if (accessSize == 32)
+ {
+ REV(RS, RS);
+ STR(RS, R10, R11);
+ REV(RS, RS);
+ }
+ else if (accessSize == 16)
+ {
+ REV16(RS, RS);
+ STRH(RS, R10, R11);
+ REV16(RS, RS);
+ }
+ else
+ {
+ STRB(RS, R10, R11);
+ }
+ ADD(R11, R11, accessSize >> 3);
+ STR(R11, R14);
+ jit->js.fifoBytesThisBlock += accessSize >> 3;
+ }
+ else if (Memory::IsRAMAddress(imm_addr))
+ {
+ MOVI2R(rA, imm_addr);
+ EmitBackpatchRoutine(this, flags, SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem, false, RS);
+ }
+ else
+ {
+ MOVI2R(rA, imm_addr);
+ EmitBackpatchRoutine(this, flags, false, false, RS);
+ }
+ }
+ else
+ {
+ EmitBackpatchRoutine(this, flags, SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem, true, RS);
}
- PUSH(4, R0, R1, R2, R3);
- MOV(R0, rB);
- MOV(R1, rC);
- BL(rA);
- POP(4, R0, R1, R2, R3);
- gpr.Unlock(rA, rB, rC);
}
void JitArm::stX(UGeckoInstruction inst)
@@ -138,7 +173,6 @@ void JitArm::stX(UGeckoInstruction inst)
u32 accessSize = 0;
s32 regOffset = -1;
bool update = false;
- bool fastmem = false;
switch (inst.OPCD)
{
case 45: // sthu
@@ -152,7 +186,6 @@ void JitArm::stX(UGeckoInstruction inst)
case 183: // stwux
update = true;
case 151: // stwx
- fastmem = true;
accessSize = 32;
regOffset = b;
break;
@@ -173,7 +206,6 @@ void JitArm::stX(UGeckoInstruction inst)
case 37: // stwu
update = true;
case 36: // stw
- fastmem = true;
accessSize = 32;
break;
case 39: // stbu
@@ -182,7 +214,9 @@ void JitArm::stX(UGeckoInstruction inst)
accessSize = 8;
break;
}
- SafeStoreFromReg(fastmem, update ? a : (a ? a : -1), s, regOffset, accessSize, offset);
+
+ SafeStoreFromReg(update ? a : (a ? a : -1), s, regOffset, accessSize, offset);
+
if (update)
{
ARMReg rA = gpr.GetReg();
@@ -193,143 +227,135 @@ void JitArm::stX(UGeckoInstruction inst)
// Check for DSI exception prior to writing back address
LDR(rA, R9, PPCSTATE_OFF(Exceptions));
TST(rA, EXCEPTION_DSI);
- FixupBranch DoNotWrite = B_CC(CC_NEQ);
- if (a)
+ SetCC(CC_EQ);
+ if (regOffset == -1)
{
- if (regOffset == -1)
- {
- MOVI2R(rA, offset);
- ADD(RA, RA, rA);
- }
- else
- {
- ADD(RA, RA, RB);
- }
+ MOVI2R(rA, offset);
+ ADD(RA, RA, rA);
}
else
{
- if (regOffset == -1)
- MOVI2R(RA, (u32)offset);
- else
- MOV(RA, RB);
+ ADD(RA, RA, RB);
}
- SetJumpTarget(DoNotWrite);
+ SetCC();
gpr.Unlock(rA);
}
}
-void JitArm::UnsafeLoadToReg(ARMReg dest, ARMReg addr, int accessSize, s32 offsetReg, s32 offset)
+void JitArm::SafeLoadToReg(ARMReg dest, s32 addr, s32 offsetReg, int accessSize, s32 offset, bool signExtend, bool reverse, bool update)
{
- ARMReg rA = gpr.GetReg();
+ // We want to make sure to not get LR as a temp register
+ ARMReg rA = R12;
+
+ u32 imm_addr = 0;
+ bool is_immediate = false;
+
if (offsetReg == -1)
{
- MOVI2R(rA, offset, false); // -3
- ADD(addr, addr, rA); // - 1
- }
- else
- {
- NOP(2); // -3, -2
- // offsetReg is preloaded here
- ADD(addr, addr, gpr.R(offsetReg)); // -1
- }
-
- // All this gets replaced on backpatch
- Operand2 mask(2, 1); // ~(Memory::MEMVIEW32_MASK)
- BIC(addr, addr, mask); // 1
- MOVI2R(rA, (u32)Memory::base, false); // 2-3
- ADD(addr, addr, rA); // 4
- switch (accessSize)
- {
- case 32:
- LDR(dest, addr); // 5
- break;
- case 16:
- LDRH(dest, addr);
- break;
- case 8:
- LDRB(dest, addr);
- break;
- }
- switch (accessSize)
- {
- case 32:
- REV(dest, dest); // 6
- break;
- case 16:
- REV16(dest, dest);
- break;
- case 8:
- NOP(1);
- break;
-
- }
- NOP(2); // 7-8
- gpr.Unlock(rA);
-}
-
-void JitArm::SafeLoadToReg(bool fastmem, u32 dest, s32 addr, s32 offsetReg, int accessSize, s32 offset, bool signExtend, bool reverse)
-{
- ARMReg RD = gpr.R(dest);
-
- if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem && fastmem)
- {
- // Preload for fastmem
- if (offsetReg != -1)
- gpr.R(offsetReg);
-
if (addr != -1)
- MOV(R10, gpr.R(addr));
+ {
+ if (gpr.IsImm(addr))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(addr) + offset;
+ }
+ else
+ {
+ Operand2 off;
+ if (TryMakeOperand2(offset, off))
+ {
+ ADD(rA, gpr.R(addr), off);
+ }
+ else
+ {
+ MOVI2R(rA, offset);
+ ADD(rA, rA, gpr.R(addr));
+ }
+ }
+ }
else
- MOV(R10, 0);
-
- UnsafeLoadToReg(RD, R10, accessSize, offsetReg, offset);
- return;
- }
- ARMReg rA = gpr.GetReg();
- ARMReg rB = gpr.GetReg();
-
- if (offsetReg == -1)
- {
- MOVI2R(rA, offset);
- if (addr != -1)
- ADD(rA, rA, gpr.R(addr));
+ {
+ is_immediate = true;
+ imm_addr = offset;
+ }
}
else
{
if (addr != -1)
- ADD(rA, gpr.R(addr), gpr.R(offsetReg));
+ {
+ if (gpr.IsImm(addr) && gpr.IsImm(offsetReg))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(addr) + gpr.GetImm(offsetReg);
+ }
+ else if (gpr.IsImm(addr) && !gpr.IsImm(offsetReg))
+ {
+ Operand2 off;
+ if (TryMakeOperand2(gpr.GetImm(addr), off))
+ {
+ ADD(rA, gpr.R(offsetReg), off);
+ }
+ else
+ {
+ MOVI2R(rA, gpr.GetImm(addr));
+ ADD(rA, rA, gpr.R(offsetReg));
+ }
+ }
+ else if (!gpr.IsImm(addr) && gpr.IsImm(offsetReg))
+ {
+ Operand2 off;
+ if (TryMakeOperand2(gpr.GetImm(offsetReg), off))
+ {
+ ADD(rA, gpr.R(addr), off);
+ }
+ else
+ {
+ MOVI2R(rA, gpr.GetImm(offsetReg));
+ ADD(rA, rA, gpr.R(addr));
+ }
+ }
+ else
+ {
+ ADD(rA, gpr.R(addr), gpr.R(offsetReg));
+ }
+ }
else
- MOV(rA, gpr.R(offsetReg));
+ {
+ if (gpr.IsImm(offsetReg))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(offsetReg);
+ }
+ else
+ {
+ MOV(rA, gpr.R(offsetReg));
+ }
+ }
}
- switch (accessSize)
- {
- case 8:
- MOVI2R(rB, (u32)&Memory::Read_U8);
- break;
- case 16:
- MOVI2R(rB, (u32)&Memory::Read_U16);
- break;
- case 32:
- MOVI2R(rB, (u32)&Memory::Read_U32);
- break;
- }
- PUSH(4, R0, R1, R2, R3);
- MOV(R0, rA);
- BL(rB);
- MOV(rA, R0);
- POP(4, R0, R1, R2, R3);
- MOV(RD, rA);
- if (signExtend) // Only on 16 loads
- SXTH(RD, RD);
+ if (is_immediate)
+ MOVI2R(rA, imm_addr);
+
+ u32 flags = BackPatchInfo::FLAG_LOAD;
+ if (accessSize == 32)
+ flags |= BackPatchInfo::FLAG_SIZE_32;
+ else if (accessSize == 16)
+ flags |= BackPatchInfo::FLAG_SIZE_16;
+ else
+ flags |= BackPatchInfo::FLAG_SIZE_8;
+
if (reverse)
- {
- if (accessSize == 32)
- REV(RD, RD);
- else if (accessSize == 16)
- REV16(RD, RD);
- }
- gpr.Unlock(rA, rB);
+ flags |= BackPatchInfo::FLAG_REVERSE;
+
+ EmitBackpatchRoutine(this, flags,
+ SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem,
+ !(is_immediate && Memory::IsRAMAddress(imm_addr)), dest);
+
+ if (signExtend) // Only on 16 loads
+ SXTH(dest, dest);
+
+ if (update)
+ MOV(gpr.R(addr), rA);
}
void JitArm::lXX(UGeckoInstruction inst)
@@ -344,7 +370,6 @@ void JitArm::lXX(UGeckoInstruction inst)
bool update = false;
bool signExtend = false;
bool reverse = false;
- bool fastmem = false;
switch (inst.OPCD)
{
@@ -354,21 +379,18 @@ void JitArm::lXX(UGeckoInstruction inst)
case 55: // lwzux
update = true;
case 23: // lwzx
- fastmem = true;
accessSize = 32;
offsetReg = b;
break;
case 119: //lbzux
update = true;
case 87: // lbzx
- fastmem = true;
accessSize = 8;
offsetReg = b;
break;
case 311: // lhzux
update = true;
case 279: // lhzx
- fastmem = true;
accessSize = 16;
offsetReg = b;
break;
@@ -392,19 +414,16 @@ void JitArm::lXX(UGeckoInstruction inst)
case 33: // lwzu
update = true;
case 32: // lwz
- fastmem = true;
accessSize = 32;
break;
case 35: // lbzu
update = true;
case 34: // lbz
- fastmem = true;
accessSize = 8;
break;
case 41: // lhzu
update = true;
case 40: // lhz
- fastmem = true;
accessSize = 16;
break;
case 43: // lhau
@@ -417,27 +436,13 @@ void JitArm::lXX(UGeckoInstruction inst)
// Check for exception before loading
ARMReg rA = gpr.GetReg(false);
+ ARMReg RD = gpr.R(d);
LDR(rA, R9, PPCSTATE_OFF(Exceptions));
TST(rA, EXCEPTION_DSI);
FixupBranch DoNotLoad = B_CC(CC_NEQ);
- SafeLoadToReg(fastmem, d, update ? a : (a ? a : -1), offsetReg, accessSize, offset, signExtend, reverse);
-
- if (update)
- {
- ARMReg RA = gpr.R(a);
- if (offsetReg == -1)
- {
- rA = gpr.GetReg(false);
- MOVI2R(rA, offset);
- ADD(RA, RA, rA);
- }
- else
- {
- ADD(RA, RA, gpr.R(offsetReg));
- }
- }
+ SafeLoadToReg(RD, update ? a : (a ? a : -1), offsetReg, accessSize, offset, signExtend, reverse, update);
SetJumpTarget(DoNotLoad);
@@ -449,8 +454,6 @@ void JitArm::lXX(UGeckoInstruction inst)
(SConfig::GetInstance().m_LocalCoreStartupParameter.bWii && Memory::ReadUnchecked_U32(js.compilerPC + 4) == 0x2C000000)) &&
Memory::ReadUnchecked_U32(js.compilerPC + 8) == 0x4182fff8)
{
- ARMReg RD = gpr.R(d);
-
// if it's still 0, we can wait until the next event
TST(RD, RD);
FixupBranch noIdle = B_CC(CC_NEQ);
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStoreFloating.cpp b/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStoreFloating.cpp
index f54b8ed635..e0c95152c1 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStoreFloating.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStoreFloating.cpp
@@ -24,16 +24,13 @@ void JitArm::lfXX(UGeckoInstruction inst)
INSTRUCTION_START
JITDISABLE(bJITLoadStoreFloatingOff);
- ARMReg rA = gpr.GetReg();
- ARMReg rB = gpr.GetReg();
ARMReg RA;
u32 a = inst.RA, b = inst.RB;
s32 offset = inst.SIMM_16;
- bool single = false;
+ u32 flags = BackPatchInfo::FLAG_LOAD;
bool update = false;
- bool zeroA = false;
s32 offsetReg = -1;
switch (inst.OPCD)
@@ -42,147 +39,152 @@ void JitArm::lfXX(UGeckoInstruction inst)
switch (inst.SUBOP10)
{
case 567: // lfsux
- single = true;
+ flags |= BackPatchInfo::FLAG_SIZE_F32;
update = true;
offsetReg = b;
break;
case 535: // lfsx
- single = true;
- zeroA = true;
+ flags |= BackPatchInfo::FLAG_SIZE_F32;
offsetReg = b;
break;
case 631: // lfdux
+ flags |= BackPatchInfo::FLAG_SIZE_F64;
update = true;
offsetReg = b;
break;
case 599: // lfdx
- zeroA = true;
+ flags |= BackPatchInfo::FLAG_SIZE_F64;
offsetReg = b;
break;
}
break;
case 49: // lfsu
+ flags |= BackPatchInfo::FLAG_SIZE_F32;
update = true;
- single = true;
break;
case 48: // lfs
- single = true;
- zeroA = true;
+ flags |= BackPatchInfo::FLAG_SIZE_F32;
break;
case 51: // lfdu
+ flags |= BackPatchInfo::FLAG_SIZE_F64;
update = true;
break;
case 50: // lfd
- zeroA = true;
+ flags |= BackPatchInfo::FLAG_SIZE_F64;
break;
}
- ARMReg v0 = fpr.R0(inst.FD), v1;
- if (single)
- v1 = fpr.R1(inst.FD);
+ ARMReg v0 = fpr.R0(inst.FD, false), v1 = INVALID_REG;
+ if (flags & BackPatchInfo::FLAG_SIZE_F32)
+ v1 = fpr.R1(inst.FD, false);
+ ARMReg rA = R11;
+ ARMReg addr = R12;
+
+ u32 imm_addr = 0;
+ bool is_immediate = false;
if (update)
{
- RA = gpr.R(a);
- // Update path /always/ uses RA
- if (offsetReg == -1) // uses SIMM_16
+ // Always uses RA
+ if (gpr.IsImm(a) && offsetReg == -1)
{
- MOVI2R(rB, offset);
- ADD(rB, rB, RA);
+ is_immediate = true;
+ imm_addr = offset + gpr.GetImm(a);
+ }
+ else if (gpr.IsImm(a) && offsetReg != -1 && gpr.IsImm(offsetReg))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(a) + gpr.GetImm(offsetReg);
}
else
- {
- ADD(rB, gpr.R(offsetReg), RA);
- }
- }
- else
- {
- if (zeroA)
{
if (offsetReg == -1)
{
- if (a)
+ Operand2 off;
+ if (TryMakeOperand2(offset, off))
{
- RA = gpr.R(a);
- MOVI2R(rB, offset);
- ADD(rB, rB, RA);
+ ADD(addr, gpr.R(a), off);
}
else
{
- MOVI2R(rB, (u32)offset);
+ MOVI2R(addr, offset);
+ ADD(addr, addr, gpr.R(a));
}
}
else
{
- ARMReg RB = gpr.R(offsetReg);
- if (a)
- {
- RA = gpr.R(a);
- ADD(rB, RB, RA);
- }
- else
- {
- MOV(rB, RB);
- }
+ ADD(addr, gpr.R(offsetReg), gpr.R(a));
}
}
}
+ else
+ {
+ if (offsetReg == -1)
+ {
+ if (a && gpr.IsImm(a))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(a) + offset;
+ }
+ else if (a)
+ {
+ Operand2 off;
+ if (TryMakeOperand2(offset, off))
+ {
+ ADD(addr, gpr.R(a), off);
+ }
+ else
+ {
+ MOVI2R(addr, offset);
+ ADD(addr, addr, gpr.R(a));
+ }
+ }
+ else
+ {
+ is_immediate = true;
+ imm_addr = offset;
+ }
+ }
+ else
+ {
+ if (a && gpr.IsImm(a) && gpr.IsImm(offsetReg))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(a) + gpr.GetImm(offsetReg);
+ }
+ else if (!a && gpr.IsImm(offsetReg))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(offsetReg);
+ }
+ else if (a)
+ {
+ ADD(addr, gpr.R(a), gpr.R(offsetReg));
+ }
+ else
+ {
+ MOV(addr, gpr.R(offsetReg));
+ }
+ }
+ }
+
+ if (update)
+ RA = gpr.R(a);
+
+ if (is_immediate)
+ MOVI2R(addr, imm_addr);
+
LDR(rA, R9, PPCSTATE_OFF(Exceptions));
CMP(rA, EXCEPTION_DSI);
FixupBranch DoNotLoad = B_CC(CC_EQ);
if (update)
- MOV(RA, rB);
+ MOV(RA, addr);
- if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem)
- {
- Operand2 mask(2, 1); // ~(Memory::MEMVIEW32_MASK)
- BIC(rB, rB, mask); // 1
- MOVI2R(rA, (u32)Memory::base, false); // 2-3
- ADD(rB, rB, rA); // 4
+ EmitBackpatchRoutine(this, flags,
+ SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem,
+ !(is_immediate && Memory::IsRAMAddress(imm_addr)), v0, v1);
- NEONXEmitter nemit(this);
- if (single)
- {
- VLDR(S0, rB, 0);
- nemit.VREV32(I_8, D0, D0); // Byte swap to result
- VCVT(v0, S0, 0);
- VCVT(v1, S0, 0);
- }
- else
- {
- VLDR(v0, rB, 0);
- nemit.VREV64(I_8, v0, v0); // Byte swap to result
- }
- }
- else
- {
- PUSH(4, R0, R1, R2, R3);
- MOV(R0, rB);
- if (single)
- {
- MOVI2R(rA, (u32)&Memory::Read_U32);
- BL(rA);
-
- VMOV(S0, R0);
-
- VCVT(v0, S0, 0);
- VCVT(v1, S0, 0);
- }
- else
- {
- MOVI2R(rA, (u32)&Memory::Read_F64);
- BL(rA);
-
-#if !defined(__ARM_PCS_VFP) // SoftFP returns in R0 and R1
- VMOV(v0, R0);
-#else
- VMOV(v0, D0);
-#endif
- }
- POP(4, R0, R1, R2, R3);
- }
- gpr.Unlock(rA, rB);
SetJumpTarget(DoNotLoad);
}
@@ -191,16 +193,13 @@ void JitArm::stfXX(UGeckoInstruction inst)
INSTRUCTION_START
JITDISABLE(bJITLoadStoreFloatingOff);
- ARMReg rA = gpr.GetReg();
- ARMReg rB = gpr.GetReg();
ARMReg RA;
u32 a = inst.RA, b = inst.RB;
s32 offset = inst.SIMM_16;
- bool single = false;
+ u32 flags = BackPatchInfo::FLAG_STORE;
bool update = false;
- bool zeroA = false;
s32 offsetReg = -1;
switch (inst.OPCD)
@@ -209,181 +208,196 @@ void JitArm::stfXX(UGeckoInstruction inst)
switch (inst.SUBOP10)
{
case 663: // stfsx
- single = true;
- zeroA = true;
+ flags |= BackPatchInfo::FLAG_SIZE_F32;
offsetReg = b;
break;
case 695: // stfsux
- single = true;
+ flags |= BackPatchInfo::FLAG_SIZE_F32;
offsetReg = b;
break;
case 727: // stfdx
- zeroA = true;
+ flags |= BackPatchInfo::FLAG_SIZE_F64;
offsetReg = b;
break;
case 759: // stfdux
+ flags |= BackPatchInfo::FLAG_SIZE_F64;
update = true;
offsetReg = b;
break;
}
break;
case 53: // stfsu
+ flags |= BackPatchInfo::FLAG_SIZE_F32;
update = true;
- single = true;
break;
case 52: // stfs
- single = true;
- zeroA = true;
+ flags |= BackPatchInfo::FLAG_SIZE_F32;
break;
case 55: // stfdu
+ flags |= BackPatchInfo::FLAG_SIZE_F64;
update = true;
break;
case 54: // stfd
- zeroA = true;
+ flags |= BackPatchInfo::FLAG_SIZE_F64;
break;
}
ARMReg v0 = fpr.R0(inst.FS);
+ ARMReg rA = R11;
+ ARMReg addr = R12;
+
+ u32 imm_addr = 0;
+ bool is_immediate = false;
if (update)
{
- RA = gpr.R(a);
- // Update path /always/ uses RA
- if (offsetReg == -1) // uses SIMM_16
+ // Always uses RA
+ if (gpr.IsImm(a) && offsetReg == -1)
{
- MOVI2R(rB, offset);
- ADD(rB, rB, RA);
+ is_immediate = true;
+ imm_addr = offset + gpr.GetImm(a);
+ }
+ else if (gpr.IsImm(a) && offsetReg != -1 && gpr.IsImm(offsetReg))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(a) + gpr.GetImm(offsetReg);
}
else
- {
- ADD(rB, gpr.R(offsetReg), RA);
- }
- }
- else
- {
- if (zeroA)
{
if (offsetReg == -1)
{
- if (a)
+ Operand2 off;
+ if (TryMakeOperand2(offset, off))
{
- RA = gpr.R(a);
- MOVI2R(rB, offset);
- ADD(rB, rB, RA);
+ ADD(addr, gpr.R(a), off);
}
else
{
- MOVI2R(rB, (u32)offset);
+ MOVI2R(addr, offset);
+ ADD(addr, addr, gpr.R(a));
}
}
else
{
- ARMReg RB = gpr.R(offsetReg);
- if (a)
+ ADD(addr, gpr.R(offsetReg), gpr.R(a));
+ }
+ }
+ }
+ else
+ {
+ if (offsetReg == -1)
+ {
+ if (a && gpr.IsImm(a))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(a) + offset;
+ }
+ else if (a)
+ {
+ Operand2 off;
+ if (TryMakeOperand2(offset, off))
{
- RA = gpr.R(a);
- ADD(rB, RB, RA);
+ ADD(addr, gpr.R(a), off);
}
else
{
- MOV(rB, RB);
+ MOVI2R(addr, offset);
+ ADD(addr, addr, gpr.R(a));
}
}
+ else
+ {
+ is_immediate = true;
+ imm_addr = offset;
+ }
+ }
+ else
+ {
+ if (a && gpr.IsImm(a) && gpr.IsImm(offsetReg))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(a) + gpr.GetImm(offsetReg);
+ }
+ else if (!a && gpr.IsImm(offsetReg))
+ {
+ is_immediate = true;
+ imm_addr = gpr.GetImm(offsetReg);
+ }
+ else if (a)
+ {
+ ADD(addr, gpr.R(a), gpr.R(offsetReg));
+ }
+ else
+ {
+ MOV(addr, gpr.R(offsetReg));
+ }
}
}
+ if (is_immediate)
+ MOVI2R(addr, imm_addr);
+
if (update)
{
+ RA = gpr.R(a);
LDR(rA, R9, PPCSTATE_OFF(Exceptions));
CMP(rA, EXCEPTION_DSI);
SetCC(CC_NEQ);
- MOV(RA, rB);
+ MOV(RA, addr);
SetCC();
}
- if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem)
- {
- Operand2 mask(2, 1); // ~(Memory::MEMVIEW32_MASK)
- BIC(rB, rB, mask); // 1
- MOVI2R(rA, (u32)Memory::base, false); // 2-3
- ADD(rB, rB, rA); // 4
- NEONXEmitter nemit(this);
- if (single)
+ if (is_immediate)
+ {
+ if ((imm_addr & 0xFFFFF000) == 0xCC008000 && jit->jo.optimizeGatherPipe)
{
- VCVT(S0, v0, 0);
- nemit.VREV32(I_8, D0, D0);
- VSTR(S0, rB, 0);
+ int accessSize;
+ if (flags & BackPatchInfo::FLAG_SIZE_F64)
+ accessSize = 64;
+ else
+ accessSize = 32;
+
+ MOVI2R(R14, (u32)&GPFifo::m_gatherPipeCount);
+ MOVI2R(R10, (u32)GPFifo::m_gatherPipe);
+ LDR(R11, R14);
+ ADD(R10, R10, R11);
+ NEONXEmitter nemit(this);
+ if (accessSize == 64)
+ {
+ PUSH(2, R0, R1);
+ nemit.VREV64(I_8, D0, v0);
+ VMOV(R0, D0);
+ STR(R0, R10, 0);
+ STR(R1, R10, 4);
+ POP(2, R0, R1);
+ }
+ else if (accessSize == 32)
+ {
+ VCVT(S0, v0, 0);
+ nemit.VREV32(I_8, D0, D0);
+ VMOV(addr, S0);
+ STR(addr, R10);
+ }
+ ADD(R11, R11, accessSize >> 3);
+ STR(R11, R14);
+ jit->js.fifoBytesThisBlock += accessSize >> 3;
+
+ }
+ else if (Memory::IsRAMAddress(imm_addr))
+ {
+ MOVI2R(addr, imm_addr);
+ EmitBackpatchRoutine(this, flags, SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem, false, v0);
}
else
{
- nemit.VREV64(I_8, D0, v0);
- VSTR(D0, rB, 0);
+ MOVI2R(addr, imm_addr);
+ EmitBackpatchRoutine(this, flags, false, false, v0);
}
}
else
{
- PUSH(4, R0, R1, R2, R3);
- if (single)
- {
- MOVI2R(rA, (u32)&Memory::Write_U32);
- VCVT(S0, v0, 0);
- VMOV(R0, S0);
- MOV(R1, rB);
-
- BL(rA);
- }
- else
- {
- MOVI2R(rA, (u32)&Memory::Write_F64);
-#if !defined(__ARM_PCS_VFP) // SoftFP returns in R0 and R1
- VMOV(R0, v0);
- MOV(R2, rB);
-#else
- VMOV(D0, v0);
- MOV(R0, rB);
-#endif
- BL(rA);
- }
- POP(4, R0, R1, R2, R3);
+ EmitBackpatchRoutine(this, flags, SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem, true, v0);
}
- gpr.Unlock(rA, rB);
-}
-
-// Some games use stfs as a way to quickly write to the gatherpipe and other hardware areas.
-// Keep it as a safe store until this can get optimized.
-// Look at the JIT64 implementation to see how it is done
-
-void JitArm::stfs(UGeckoInstruction inst)
-{
- INSTRUCTION_START
- JITDISABLE(bJITLoadStoreFloatingOff);
-
- ARMReg rA = gpr.GetReg();
- ARMReg rB = gpr.GetReg();
- ARMReg v0 = fpr.R0(inst.FS);
- VCVT(S0, v0, 0);
-
- if (inst.RA)
- {
- MOVI2R(rB, inst.SIMM_16);
- ARMReg RA = gpr.R(inst.RA);
- ADD(rB, rB, RA);
- }
- else
- {
- MOVI2R(rB, (u32)inst.SIMM_16);
- }
-
- MOVI2R(rA, (u32)&Memory::Write_U32);
- PUSH(4, R0, R1, R2, R3);
- VMOV(R0, S0);
- MOV(R1, rB);
-
- BL(rA);
-
- POP(4, R0, R1, R2, R3);
-
- gpr.Unlock(rA, rB);
}
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitArm_Paired.cpp b/Source/Core/Core/PowerPC/JitArm32/JitArm_Paired.cpp
index cd4a28cd00..eeeb743f69 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitArm_Paired.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitArm_Paired.cpp
@@ -21,6 +21,8 @@ void JitArm::ps_rsqrte(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITPairedOff);
+ FALLBACK_IF(true);
+
FALLBACK_IF(inst.Rc);
u32 b = inst.FB, d = inst.FD;
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitArm_Tables.cpp b/Source/Core/Core/PowerPC/JitArm32/JitArm_Tables.cpp
index 76e79da67f..198a73fba3 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitArm_Tables.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitArm_Tables.cpp
@@ -89,7 +89,7 @@ static GekkoOPTemplate primarytable[] =
{50, &JitArm::lfXX}, //"lfd", OPTYPE_LOADFP, FL_IN_A}},
{51, &JitArm::lfXX}, //"lfdu", OPTYPE_LOADFP, FL_OUT_A | FL_IN_A}},
- {52, &JitArm::stfs}, //"stfs", OPTYPE_STOREFP, FL_IN_A}},
+ {52, &JitArm::stfXX}, //"stfs", OPTYPE_STOREFP, FL_IN_A}},
{53, &JitArm::stfXX}, //"stfsu", OPTYPE_STOREFP, FL_OUT_A | FL_IN_A}},
{54, &JitArm::stfXX}, //"stfd", OPTYPE_STOREFP, FL_IN_A}},
{55, &JitArm::stfXX}, //"stfdu", OPTYPE_STOREFP, FL_OUT_A | FL_IN_A}},
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitAsm.cpp b/Source/Core/Core/PowerPC/JitArm32/JitAsm.cpp
index 6bbbefb744..bb19c300c4 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitAsm.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitAsm.cpp
@@ -609,4 +609,15 @@ void JitArmAsmRoutineManager::GenerateCommon()
pairedStoreQuantized[14] = storeSingleS8;
pairedStoreQuantized[15] = storeSingleS16;
+ m_increment_profile_counter = AlignCode16();
+
+ nemit.VLD1(I_64, D0, R0); // Start
+ ADD(R0, R0, 8);
+ nemit.VLD1(I_64, D1, R0); // End
+ ADD(R0, R0, 8);
+ nemit.VLD1(I_64, D2, R0); // Counter
+ nemit.VSUB(I_64, D1, D1, D0);
+ nemit.VADD(I_64, D2, D2, D1);
+ nemit.VST1(I_64, D2, R0);
+ MOV(_PC, _LR);
}
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitAsm.h b/Source/Core/Core/PowerPC/JitArm32/JitAsm.h
index 41cd248336..610b9c827c 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitAsm.h
+++ b/Source/Core/Core/PowerPC/JitArm32/JitAsm.h
@@ -14,6 +14,8 @@ private:
void GenerateCommon();
public:
+ const u8* m_increment_profile_counter;
+
void Init()
{
AllocCodeSpace(8192);
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitFPRCache.cpp b/Source/Core/Core/PowerPC/JitArm32/JitFPRCache.cpp
index 3d2af8453e..9bb2a3a774 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitFPRCache.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitFPRCache.cpp
@@ -9,7 +9,7 @@ using namespace ArmGen;
ArmFPRCache::ArmFPRCache()
{
- emit = 0;
+ emit = nullptr;
}
void ArmFPRCache::Init(ARMXEmitter *emitter)
@@ -161,7 +161,8 @@ ARMReg ArmFPRCache::GetPPCReg(u32 preg, bool PS1, bool preLoad)
ArmCRegs[regindex].PS1 = PS1;
_regs[preg][PS1].LoadToReg(regindex);
- emit->VLDR(ArmCRegs[regindex].Reg, R9, offset);
+ if (preLoad)
+ emit->VLDR(ArmCRegs[regindex].Reg, R9, offset);
return ArmCRegs[regindex].Reg;
}
@@ -178,7 +179,8 @@ ARMReg ArmFPRCache::GetPPCReg(u32 preg, bool PS1, bool preLoad)
ArmCRegs[lastRegIndex].PS1 = PS1;
_regs[preg][PS1].LoadToReg(lastRegIndex);
- emit->VLDR(ArmCRegs[lastRegIndex].Reg, R9, offsetNew);
+ if (preLoad)
+ emit->VLDR(ArmCRegs[lastRegIndex].Reg, R9, offsetNew);
return ArmCRegs[lastRegIndex].Reg;
}
@@ -225,3 +227,26 @@ void ArmFPRCache::Flush(FlushMode mode)
}
}
+void ArmFPRCache::StoreFromRegister(u32 preg)
+{
+ if (_regs[preg][0].GetType() != REG_NOTLOADED)
+ {
+ s16 offset = PPCSTATE_OFF(ps) + (preg * 16);
+ u32 regindex = _regs[preg][0].GetRegIndex();
+ emit->VSTR(ArmCRegs[regindex].Reg, R9, offset);
+
+ ArmCRegs[regindex].PPCReg = 33;
+ ArmCRegs[regindex].LastLoad = 0;
+ _regs[preg][0].Flush();
+ }
+ if (_regs[preg][1].GetType() != REG_NOTLOADED)
+ {
+ s16 offset = PPCSTATE_OFF(ps) + (preg * 16) + 8;
+ u32 regindex = _regs[preg][1].GetRegIndex();
+ emit->VSTR(ArmCRegs[regindex].Reg, R9, offset);
+
+ ArmCRegs[regindex].PPCReg = 33;
+ ArmCRegs[regindex].LastLoad = 0;
+ _regs[preg][1].Flush();
+ }
+}
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitFPRCache.h b/Source/Core/Core/PowerPC/JitArm32/JitFPRCache.h
index cf873eaa57..fd77b4da1b 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitFPRCache.h
+++ b/Source/Core/Core/PowerPC/JitArm32/JitFPRCache.h
@@ -45,4 +45,6 @@ public:
void Flush(FlushMode mode = FLUSH_ALL);
ArmGen::ARMReg R0(u32 preg, bool preLoad = true); // Returns a cached register
ArmGen::ARMReg R1(u32 preg, bool preLoad = true);
+
+ void StoreFromRegister(u32 preg);
};
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitRegCache.cpp b/Source/Core/Core/PowerPC/JitArm32/JitRegCache.cpp
index fc057fdc9e..8a7c2990a9 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitRegCache.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitRegCache.cpp
@@ -9,7 +9,7 @@ using namespace ArmGen;
ArmRegCache::ArmRegCache()
{
- emit = 0;
+ emit = nullptr;
}
void ArmRegCache::Init(ARMXEmitter *emitter)
@@ -300,3 +300,20 @@ void ArmRegCache::Flush(FlushMode mode)
}
}
+void ArmRegCache::StoreFromRegister(u32 preg)
+{
+ if (regs[preg].GetType() == REG_IMM)
+ {
+ // This changes the type over to a REG_REG and gets caught below.
+ BindToRegister(preg, true, true);
+ }
+ if (regs[preg].GetType() == REG_REG)
+ {
+ u32 regindex = regs[preg].GetRegIndex();
+ emit->STR(ArmCRegs[regindex].Reg, R9, PPCSTATE_OFF(gpr) + preg * 4);
+
+ ArmCRegs[regindex].PPCReg = 33;
+ ArmCRegs[regindex].LastLoad = 0;
+ regs[preg].Flush();
+ }
+}
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitRegCache.h b/Source/Core/Core/PowerPC/JitArm32/JitRegCache.h
index 7e7acaaf9a..7ccf8eae2c 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitRegCache.h
+++ b/Source/Core/Core/PowerPC/JitArm32/JitRegCache.h
@@ -135,4 +135,6 @@ public:
// Public function doesn't kill immediates
// In reality when you call R(u32) it'll bind an immediate there
void BindToRegister(u32 preg, bool doLoad = true);
+
+ void StoreFromRegister(u32 preg);
};
diff --git a/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp b/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp
index 64fd24ba73..38e298c2fd 100644
--- a/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp
+++ b/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp
@@ -6,7 +6,6 @@
#include "disasm.h"
-#include "Core/PowerPC/JitCommon/JitBackpatch.h"
#include "Core/PowerPC/JitCommon/JitBase.h"
using namespace Gen;
diff --git a/Source/Core/Core/PowerPC/JitCommon/JitBase.h b/Source/Core/Core/PowerPC/JitCommon/JitBase.h
index 22c4ac9d2b..845db78b01 100644
--- a/Source/Core/Core/PowerPC/JitCommon/JitBase.h
+++ b/Source/Core/Core/PowerPC/JitCommon/JitBase.h
@@ -16,6 +16,7 @@
#include "Core/Core.h"
#include "Core/CoreTiming.h"
+#include "Core/MachineContext.h"
#include "Core/HW/GPFifo.h"
#include "Core/HW/Memmap.h"
#include "Core/PowerPC/CPUCoreBase.h"
@@ -24,7 +25,6 @@
#include "Core/PowerPC/PPCTables.h"
#include "Core/PowerPC/JitCommon/Jit_Util.h"
#include "Core/PowerPC/JitCommon/JitAsmCommon.h"
-#include "Core/PowerPC/JitCommon/JitBackpatch.h"
#include "Core/PowerPC/JitCommon/JitCache.h"
#include "Core/PowerPC/JitCommon/TrampolineCache.h"
diff --git a/Source/Core/Core/PowerPC/JitILCommon/IR.h b/Source/Core/Core/PowerPC/JitILCommon/IR.h
index 851c3c70c9..baac14e052 100644
--- a/Source/Core/Core/PowerPC/JitILCommon/IR.h
+++ b/Source/Core/Core/PowerPC/JitILCommon/IR.h
@@ -160,7 +160,7 @@ enum Opcode
InterpreterBranch,
IdleBranch, // branch operation belonging to idle loop
- ShortIdleLoop, // Idle loop seen in homebrew like wii mahjong,
+ ShortIdleLoop, // Idle loop seen in homebrew like Wii mahjong,
// just a branch
// used for exception checking, at least until someone
diff --git a/Source/Core/Core/PowerPC/JitInterface.h b/Source/Core/Core/PowerPC/JitInterface.h
index cfa239d966..1fe8b85086 100644
--- a/Source/Core/Core/PowerPC/JitInterface.h
+++ b/Source/Core/Core/PowerPC/JitInterface.h
@@ -6,8 +6,8 @@
#include
#include "Common/ChunkFile.h"
+#include "Core/MachineContext.h"
#include "Core/PowerPC/CPUCoreBase.h"
-#include "Core/PowerPC/JitCommon/JitBackpatch.h"
namespace JitInterface
{
diff --git a/Source/Core/Core/State.h b/Source/Core/Core/State.h
index a9ce361ffb..3948b6e55c 100644
--- a/Source/Core/Core/State.h
+++ b/Source/Core/Core/State.h
@@ -34,8 +34,8 @@ void EnableCompression(bool compression);
bool ReadHeader(const std::string& filename, StateHeader& header);
// These don't happen instantly - they get scheduled as events.
-// ...But only if we're not in the main cpu thread.
-// If we're in the main cpu thread then they run immediately instead
+// ...But only if we're not in the main CPU thread.
+// If we're in the main CPU thread then they run immediately instead
// because some things (like Lua) need them to run immediately.
// Slots from 0-99.
void Save(int slot, bool wait = false);
diff --git a/Source/Core/DiscIO/CompressedBlob.h b/Source/Core/DiscIO/CompressedBlob.h
index 4a11559937..6f9b7cca3a 100644
--- a/Source/Core/DiscIO/CompressedBlob.h
+++ b/Source/Core/DiscIO/CompressedBlob.h
@@ -36,7 +36,7 @@ const u32 kBlobCookie = 0xB10BC001;
struct CompressedBlobHeader // 32 bytes
{
u32 magic_cookie; //0xB10BB10B
- u32 sub_type; // gc image, whatever
+ u32 sub_type; // GC image, whatever
u64 compressed_data_size;
u64 data_size;
u32 block_size;
diff --git a/Source/Core/DiscIO/DiscScrubber.h b/Source/Core/DiscIO/DiscScrubber.h
index 360c684dc3..0e5943ae2e 100644
--- a/Source/Core/DiscIO/DiscScrubber.h
+++ b/Source/Core/DiscIO/DiscScrubber.h
@@ -3,10 +3,10 @@
// Refer to the license.txt file included.
-// DiscScrubber removes the garbage data from discs (currently wii only) which
+// DiscScrubber removes the garbage data from discs (currently Wii only) which
// is on the disc due to encryption
-// It could be adapted to gc discs, but the gain is most likely negligible,
+// It could be adapted to GameCube discs, but the gain is most likely negligible,
// and having 1:1 backups of discs is always nice when they are reasonably sized
// Note: the technique is inspired by Wiiscrubber, but much simpler - intentionally :)
diff --git a/Source/Core/DiscIO/Volume.h b/Source/Core/DiscIO/Volume.h
index 0b10bf2387..c15be880ea 100644
--- a/Source/Core/DiscIO/Volume.h
+++ b/Source/Core/DiscIO/Volume.h
@@ -34,20 +34,23 @@ public:
virtual bool CheckIntegrity() const { return false; }
virtual bool IsDiscTwo() const { return false; }
+ // Increment CACHE_REVISION if values are changed (ISOFile.cpp)
enum ECountry
{
COUNTRY_EUROPE = 0,
- COUNTRY_FRANCE,
- COUNTRY_RUSSIA,
- COUNTRY_USA,
COUNTRY_JAPAN,
- COUNTRY_KOREA,
- COUNTRY_ITALY,
- COUNTRY_TAIWAN,
- COUNTRY_SDK,
- COUNTRY_UNKNOWN,
- COUNTRY_GERMANY,
+ COUNTRY_USA,
COUNTRY_AUSTRALIA,
+ COUNTRY_FRANCE,
+ COUNTRY_GERMANY,
+ COUNTRY_INTERNATIONAL,
+ COUNTRY_ITALY,
+ COUNTRY_KOREA,
+ COUNTRY_NETHERLANDS,
+ COUNTRY_RUSSIA,
+ COUNTRY_SPAIN,
+ COUNTRY_TAIWAN,
+ COUNTRY_UNKNOWN,
NUMBER_OF_COUNTRIES
};
diff --git a/Source/Core/DiscIO/VolumeCommon.cpp b/Source/Core/DiscIO/VolumeCommon.cpp
index 7da110403a..0956f119c9 100644
--- a/Source/Core/DiscIO/VolumeCommon.cpp
+++ b/Source/Core/DiscIO/VolumeCommon.cpp
@@ -15,24 +15,22 @@ IVolume::ECountry CountrySwitch(u8 CountryCode)
{
switch (CountryCode)
{
- // Region free - fall through to European defaults for now
+ // Region free - Uses European flag as placeholder
case 'A':
-
+ return IVolume::COUNTRY_INTERNATIONAL;
// PAL
- case 'D': // German
+ case 'D':
return IVolume::COUNTRY_GERMANY;
case 'X': // Used by a couple PAL games
- case 'Y': // German, french
-
+ case 'Y': // German, French
case 'L': // Japanese import to PAL regions
case 'M': // Japanese import to PAL regions
- case 'S': // Spanish-speaking regions
case 'P':
return IVolume::COUNTRY_EUROPE;
- case 'U': // Australia
+ case 'U':
return IVolume::COUNTRY_AUSTRALIA;
case 'F':
@@ -41,9 +39,15 @@ IVolume::ECountry CountrySwitch(u8 CountryCode)
case 'I':
return IVolume::COUNTRY_ITALY;
+ case 'H':
+ return IVolume::COUNTRY_NETHERLANDS;
+
case 'R':
return IVolume::COUNTRY_RUSSIA;
+ case 'S':
+ return IVolume::COUNTRY_SPAIN;
+
// NTSC
case 'E':
case 'N': // Japanese import to USA and other NTSC regions
@@ -54,13 +58,10 @@ IVolume::ECountry CountrySwitch(u8 CountryCode)
return IVolume::COUNTRY_JAPAN;
case 'K':
- case 'T': // Korea with English language
case 'Q': // Korea with Japanese language
+ case 'T': // Korea with English language
return IVolume::COUNTRY_KOREA;
- case 'O':
- return IVolume::COUNTRY_SDK;
-
case 'W':
return IVolume::COUNTRY_TAIWAN;
diff --git a/Source/Core/DiscIO/VolumeDirectory.h b/Source/Core/DiscIO/VolumeDirectory.h
index 6cfcd90004..9e0c8ba74c 100644
--- a/Source/Core/DiscIO/VolumeDirectory.h
+++ b/Source/Core/DiscIO/VolumeDirectory.h
@@ -86,7 +86,7 @@ private:
u32 m_totalNameSize;
- // gc has no shift, wii has 2 bit shift
+ // GameCube has no shift, Wii has 2 bit shift
u32 m_addressShift;
// first address on disk containing file data
diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp
index ef0e56a21d..57303b13e7 100644
--- a/Source/Core/DiscIO/VolumeGC.cpp
+++ b/Source/Core/DiscIO/VolumeGC.cpp
@@ -92,11 +92,11 @@ int CVolumeGC::GetRevision() const
if (!m_pReader)
return 0;
- u8 Revision;
- if (!Read(7, 1, &Revision))
+ u8 revision;
+ if (!Read(7, 1, &revision))
return 0;
- return Revision;
+ return revision;
}
std::vector CVolumeGC::GetNames() const
diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp
index 32313dd4c2..f756f88450 100644
--- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp
+++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp
@@ -46,18 +46,15 @@ bool CVolumeWiiCrypted::RAWRead( u64 _Offset, u64 _Length, u8* _pBuffer ) const
// Medal Of Honor Heroes 2 read this DVD offset for PartitionsInfo
// and, PartitionsInfo is not encrypted, let's read it directly.
if (!m_pReader->Read(_Offset, _Length, _pBuffer))
- {
return(false);
- }
- return true;
+ else
+ return true;
}
bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer) const
{
if (m_pReader == nullptr)
- {
return(false);
- }
while (_Length > 0)
{
@@ -118,16 +115,12 @@ void CVolumeWiiCrypted::GetTMD(u8* _pBuffer, u32 * _sz) const
std::string CVolumeWiiCrypted::GetUniqueID() const
{
if (m_pReader == nullptr)
- {
return std::string();
- }
char ID[7];
if (!Read(0, 6, (u8*)ID))
- {
return std::string();
- }
ID[6] = '\0';
@@ -149,22 +142,30 @@ IVolume::ECountry CVolumeWiiCrypted::GetCountry() const
std::string CVolumeWiiCrypted::GetMakerID() const
{
if (m_pReader == nullptr)
- {
return std::string();
- }
char makerID[3];
if (!Read(0x4, 0x2, (u8*)&makerID))
- {
return std::string();
- }
makerID[2] = '\0';
return makerID;
}
+int CVolumeWiiCrypted::GetRevision() const
+{
+ if (!m_pReader)
+ return 0;
+
+ u8 revision;
+ if (!m_pReader->Read(7, 1, &revision))
+ return 0;
+
+ return revision;
+}
+
std::vector CVolumeWiiCrypted::GetNames() const
{
std::vector names;
@@ -181,16 +182,12 @@ std::vector CVolumeWiiCrypted::GetNames() const
u32 CVolumeWiiCrypted::GetFSTSize() const
{
if (m_pReader == nullptr)
- {
return 0;
- }
u32 size;
if (!Read(0x428, 0x4, (u8*)&size))
- {
return 0;
- }
return size;
}
@@ -198,16 +195,12 @@ u32 CVolumeWiiCrypted::GetFSTSize() const
std::string CVolumeWiiCrypted::GetApploaderDate() const
{
if (m_pReader == nullptr)
- {
return std::string();
- }
char date[16];
if (!Read(0x2440, 0x10, (u8*)&date))
- {
return std::string();
- }
date[10] = '\0';
@@ -217,25 +210,17 @@ std::string CVolumeWiiCrypted::GetApploaderDate() const
u64 CVolumeWiiCrypted::GetSize() const
{
if (m_pReader)
- {
return m_pReader->GetDataSize();
- }
else
- {
return 0;
- }
}
u64 CVolumeWiiCrypted::GetRawSize() const
{
if (m_pReader)
- {
return m_pReader->GetRawSize();
- }
else
- {
return 0;
- }
}
bool CVolumeWiiCrypted::CheckIntegrity() const
diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.h b/Source/Core/DiscIO/VolumeWiiCrypted.h
index 6b1b3855ad..3dd09a08f5 100644
--- a/Source/Core/DiscIO/VolumeWiiCrypted.h
+++ b/Source/Core/DiscIO/VolumeWiiCrypted.h
@@ -36,6 +36,7 @@ public:
ECountry GetCountry() const override;
u64 GetSize() const override;
u64 GetRawSize() const override;
+ int GetRevision() const override;
bool SupportsIntegrityCheck() const override { return true; }
bool CheckIntegrity() const override;
diff --git a/Source/Core/DiscIO/WiiWad.cpp b/Source/Core/DiscIO/WiiWad.cpp
index 47e072c8fb..51ad67c627 100644
--- a/Source/Core/DiscIO/WiiWad.cpp
+++ b/Source/Core/DiscIO/WiiWad.cpp
@@ -62,7 +62,7 @@ u8* WiiWAD::CreateWADEntry(DiscIO::IBlobReader& _rReader, u32 _Size, u64 _Offset
if (_Size > 0)
{
u8* pTmpBuffer = new u8[_Size];
- _dbg_assert_msg_(BOOT, pTmpBuffer!=nullptr, "WiiWAD: Cant allocate memory for WAD entry");
+ _dbg_assert_msg_(BOOT, pTmpBuffer!=nullptr, "WiiWAD: Can't allocate memory for WAD entry");
if (!_rReader.Read(_Offset, _Size, pTmpBuffer))
{
@@ -123,7 +123,7 @@ bool WiiWAD::IsWiiWAD(const std::string& name)
CBlobBigEndianReader big_endian_reader(*blob_reader);
bool result = false;
- // check for wii wad
+ // check for Wii wad
if (big_endian_reader.Read32(0x00) == 0x20)
{
u32 wad_type = big_endian_reader.Read32(0x04);
diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt
index 48fd1cfa06..6f25f894b4 100644
--- a/Source/Core/DolphinQt/CMakeLists.txt
+++ b/Source/Core/DolphinQt/CMakeLists.txt
@@ -12,6 +12,10 @@ set(SRCS
MainWindow.cpp
MainWindow.h
SystemInfo.cpp
+ GameList/GameFile.cpp
+ GameList/GameGrid.cpp
+ GameList/GameTracker.cpp
+ GameList/GameTree.cpp
Utils/Resources.cpp
Utils/Utils.cpp
VideoInterface/RenderWidget.cpp
@@ -21,21 +25,13 @@ set(UIS
AboutDialog.ui
MainWindow.ui
SystemInfo.ui
+ GameList/GameGrid.ui
+ GameList/GameTree.ui
)
-set(LIBS core uicommon)
+list(APPEND LIBS core uicommon)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- # Link against OS X system frameworks.
- list(APPEND LIBS
- ${APPKIT_LIBRARY}
- ${AU_LIBRARY}
- ${COREAUDIO_LIBRARY}
- ${COREFUND_LIBRARY}
- ${CORESERV_LIBRARY}
- ${IOK_LIBRARY}
- ${FORCEFEEDBACK}
- )
set(DOLPHINQT_BINARY DolphinQt)
else()
set(DOLPHINQT_BINARY dolphin-emu-qt)
@@ -83,7 +79,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
COMMAND ln -nfs ${CMAKE_SOURCE_DIR}/Data/Sys ${BUNDLE_PATH}/Contents/Resources/Sys
VERBATIM
)
- add_custom_target(CopyDataIntoBundle ALL
+ add_custom_target(CopyDataIntoBundleQt ALL
DEPENDS ${BUNDLE_PATH}/Contents/Resources/Sys
)
endif()
diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj b/Source/Core/DolphinQt/DolphinQt.vcxproj
index bc5482a1b4..d60849aeae 100644
--- a/Source/Core/DolphinQt/DolphinQt.vcxproj
+++ b/Source/Core/DolphinQt/DolphinQt.vcxproj
@@ -49,7 +49,7 @@
iphlpapi.lib;winmm.lib;setupapi.lib;vfw32.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;%(AdditionalDependencies)
- $(ProjectDir)\VideoInterface;%(AdditionalIncludeDirectories)
+ $(ProjectDir)\VideoInterface;$(ProjectDir)\GameList;%(AdditionalIncludeDirectories)
@@ -58,6 +58,7 @@
+
@@ -66,6 +67,10 @@
+
+
+
+
@@ -73,6 +78,13 @@
+
+
+
+
+
+
+
@@ -155,6 +167,10 @@
+
+
+
+
diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj.filters b/Source/Core/DolphinQt/DolphinQt.vcxproj.filters
index e415c300a5..368869def9 100644
--- a/Source/Core/DolphinQt/DolphinQt.vcxproj.filters
+++ b/Source/Core/DolphinQt/DolphinQt.vcxproj.filters
@@ -27,6 +27,27 @@
Generated Files
+
+ GameList
+
+
+ GameList
+
+
+ GameList
+
+
+ GameList
+
+
+ Generated Files
+
+
+ Generated Files
+
+
+ Generated Files
+
@@ -36,6 +57,9 @@
+
+ GameList
+
@@ -50,6 +74,9 @@
{c18a1fb3-64ff-4249-b808-d73a56ea3a2d}
+
+ {be9925db-448c-46d8-a5a3-fb957490d3ef}
+
@@ -61,5 +88,17 @@
VideoInterface
+
+ GameList
+
+
+ GameList
+
+
+ GameList
+
+
+ GameList
+
\ No newline at end of file
diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj.user b/Source/Core/DolphinQt/DolphinQt.vcxproj.user
index 422ab248b9..5804e0cf2d 100644
--- a/Source/Core/DolphinQt/DolphinQt.vcxproj.user
+++ b/Source/Core/DolphinQt/DolphinQt.vcxproj.user
@@ -1,4 +1,4 @@
-
+
diff --git a/Source/Core/DolphinQt/GameList/GameFile.cpp b/Source/Core/DolphinQt/GameList/GameFile.cpp
new file mode 100644
index 0000000000..70cd91b64c
--- /dev/null
+++ b/Source/Core/DolphinQt/GameList/GameFile.cpp
@@ -0,0 +1,329 @@
+// Copyright 2014 Dolphin Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include "Common/Common.h"
+#include "Common/CommonPaths.h"
+#include "Common/FileUtil.h"
+#include "Common/Hash.h"
+#include "Common/IniFile.h"
+#include "Common/StringUtil.h"
+
+#include "Core/ConfigManager.h"
+
+#include "DiscIO/BannerLoader.h"
+#include "DiscIO/CompressedBlob.h"
+#include "DiscIO/Filesystem.h"
+
+#include "DolphinQt/GameList/GameFile.h"
+#include "DolphinQt/Utils/Resources.h"
+#include "DolphinQt/Utils/Utils.h"
+
+static const u32 CACHE_REVISION = 0x003;
+static const u32 DATASTREAM_REVISION = 15; // Introduced in Qt 5.2
+
+static QStringList VectorToStringList(std::vector vec, bool trim = false)
+{
+ QStringList result;
+ if (trim)
+ {
+ for (const std::string& member : vec)
+ result.append(QString::fromStdString(member).trimmed());
+ }
+ else
+ {
+ for (const std::string& member : vec)
+ result.append(QString::fromStdString(member));
+ }
+ return result;
+}
+
+GameFile::GameFile(const QString& fileName)
+ : m_file_name(fileName)
+{
+ bool hasBanner = false;
+
+ if (LoadFromCache())
+ {
+ m_valid = true;
+ hasBanner = true;
+ }
+ else
+ {
+ DiscIO::IVolume* volume = DiscIO::CreateVolumeFromFilename(fileName.toStdString());
+
+ if (volume != nullptr)
+ {
+ if (!DiscIO::IsVolumeWadFile(volume))
+ m_platform = DiscIO::IsVolumeWiiDisc(volume) ? WII_DISC : GAMECUBE_DISC;
+ else
+ m_platform = WII_WAD;
+
+ m_volume_names = VectorToStringList(volume->GetNames());
+
+ m_country = volume->GetCountry();
+ m_file_size = volume->GetRawSize();
+ m_volume_size = volume->GetSize();
+
+ m_unique_id = QString::fromStdString(volume->GetUniqueID());
+ m_compressed = DiscIO::IsCompressedBlob(fileName.toStdString());
+ m_is_disc_two = volume->IsDiscTwo();
+ m_revision = volume->GetRevision();
+
+ QFileInfo info(m_file_name);
+ m_folder_name = info.absoluteDir().dirName();
+
+ // check if we can get some info from the banner file too
+ DiscIO::IFileSystem* fileSystem = DiscIO::CreateFileSystem(volume);
+
+ if (fileSystem != nullptr || m_platform == WII_WAD)
+ {
+ std::unique_ptr bannerLoader(DiscIO::CreateBannerLoader(*fileSystem, volume));
+
+ if (bannerLoader != nullptr)
+ {
+ if (bannerLoader->IsValid())
+ {
+ if (m_platform != WII_WAD)
+ m_names = VectorToStringList(bannerLoader->GetNames());
+ m_company = QString::fromStdString(bannerLoader->GetCompany());
+ m_descriptions = VectorToStringList(bannerLoader->GetDescriptions(), true);
+
+ int width, height;
+ std::vector buffer = bannerLoader->GetBanner(&width, &height);
+ QImage banner(width, height, QImage::Format_RGB888);
+ for (int i = 0; i < width * height; i++)
+ {
+ int x = i % width, y = i / width;
+ banner.setPixel(x, y, qRgb((buffer[i] & 0xFF0000) >> 16,
+ (buffer[i] & 0x00FF00) >> 8,
+ (buffer[i] & 0x0000FF) >> 0));
+ }
+
+ if (!banner.isNull())
+ {
+ hasBanner = true;
+ m_banner = QPixmap::fromImage(banner);
+ }
+ }
+ }
+ delete fileSystem;
+ }
+ delete volume;
+
+ m_valid = true;
+ if (hasBanner)
+ SaveToCache();
+ }
+ }
+
+ if (m_valid)
+ {
+ IniFile ini;
+ ini.Load(File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + m_unique_id.toStdString() + ".ini");
+ ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + m_unique_id.toStdString() + ".ini", true);
+
+ std::string issues_temp;
+ ini.GetIfExists("EmuState", "EmulationStateId", &m_emu_state);
+ ini.GetIfExists("EmuState", "EmulationIssues", &issues_temp);
+ m_issues = QString::fromStdString(issues_temp);
+ }
+
+ if (!hasBanner)
+ m_banner = Resources::GetPixmap(Resources::BANNER_MISSING);
+}
+
+bool GameFile::LoadFromCache()
+{
+ QString filename = CreateCacheFilename();
+ if (filename.isEmpty())
+ return false;
+
+ QFile file(filename);
+ if (!file.exists())
+ return false;
+ if (!file.open(QFile::ReadOnly))
+ return false;
+
+ // If you modify the code below, you MUST bump the CACHE_REVISION!
+ QDataStream stream(&file);
+ stream.setVersion(DATASTREAM_REVISION);
+
+ u32 cache_rev;
+ stream >> cache_rev;
+ if (cache_rev != CACHE_REVISION)
+ return false;
+
+ int country;
+ stream >> m_folder_name
+ >> m_volume_names
+ >> m_company
+ >> m_descriptions
+ >> m_unique_id
+ >> m_file_size
+ >> m_volume_size
+ >> country
+ >> m_banner
+ >> m_compressed
+ >> m_platform
+ >> m_is_disc_two
+ >> m_revision;
+ m_country = (DiscIO::IVolume::ECountry)country;
+ file.close();
+ return true;
+}
+
+void GameFile::SaveToCache()
+{
+ if (!File::IsDirectory(File::GetUserPath(D_CACHE_IDX)))
+ File::CreateDir(File::GetUserPath(D_CACHE_IDX));
+
+ QString filename = CreateCacheFilename();
+ if (filename.isEmpty())
+ return;
+ if (QFile::exists(filename))
+ QFile::remove(filename);
+
+ QFile file(filename);
+ if (!file.open(QFile::WriteOnly))
+ return;
+
+ // If you modify the code below, you MUST bump the CACHE_REVISION!
+ QDataStream stream(&file);
+ stream.setVersion(DATASTREAM_REVISION);
+ stream << CACHE_REVISION;
+
+ stream << m_folder_name
+ << m_volume_names
+ << m_company
+ << m_descriptions
+ << m_unique_id
+ << m_file_size
+ << m_volume_size
+ << (int)m_country
+ << m_banner
+ << m_compressed
+ << m_platform
+ << m_is_disc_two
+ << m_revision;
+}
+
+QString GameFile::CreateCacheFilename()
+{
+ std::string filename, pathname, extension;
+ SplitPath(m_file_name.toStdString(), &pathname, &filename, &extension);
+
+ if (filename.empty())
+ return SL(""); // must be a disc drive
+
+ // Filename.extension_HashOfFolderPath_Size.cache
+ // Append hash to prevent ISO name-clashing in different folders.
+ filename.append(StringFromFormat("%s_%x_%lx.qcache",
+ extension.c_str(), HashFletcher((const u8*)pathname.c_str(), pathname.size()),
+ File::GetSize(m_file_name.toStdString())));
+
+ QString fullname = QString::fromStdString(File::GetUserPath(D_CACHE_IDX));
+ fullname += QString::fromStdString(filename);
+ return fullname;
+}
+
+QString GameFile::GetCompany() const
+{
+ if (m_company.isEmpty())
+ return QObject::tr("N/A");
+ else
+ return m_company;
+}
+
+// For all of the following functions that accept an "index" parameter,
+// (-1 = Japanese, 0 = English, etc)?
+
+QString GameFile::GetDescription(int index) const
+{
+ if (index < m_descriptions.size())
+ return m_descriptions[index];
+
+ if (!m_descriptions.empty())
+ return m_descriptions[0];
+
+ return SL("");
+}
+
+QString GameFile::GetVolumeName(int index) const
+{
+ if (index < m_volume_names.size() && !m_volume_names[index].isEmpty())
+ return m_volume_names[index];
+
+ if (!m_volume_names.isEmpty())
+ return m_volume_names[0];
+
+ return SL("");
+}
+
+QString GameFile::GetBannerName(int index) const
+{
+ if (index < m_names.size() && !m_names[index].isEmpty())
+ return m_names[index];
+
+ if (!m_names.isEmpty())
+ return m_names[0];
+
+ return SL("");
+}
+
+QString GameFile::GetName(int index) const
+{
+ // Prefer name from banner, fallback to name from volume, fallback to filename
+ QString name = GetBannerName(index);
+
+ if (name.isEmpty())
+ name = GetVolumeName(index);
+
+ if (name.isEmpty())
+ {
+ // No usable name, return filename (better than nothing)
+ std::string nametemp;
+ SplitPath(m_file_name.toStdString(), nullptr, &nametemp, nullptr);
+ name = QString::fromStdString(nametemp);
+ }
+
+ return name;
+}
+
+const QString GameFile::GetWiiFSPath() const
+{
+ DiscIO::IVolume* volume = DiscIO::CreateVolumeFromFilename(m_file_name.toStdString());
+ QString ret;
+
+ if (volume == nullptr)
+ return ret;
+
+ if (DiscIO::IsVolumeWiiDisc(volume) || DiscIO::IsVolumeWadFile(volume))
+ {
+ std::string path;
+ u64 title;
+
+ volume->GetTitleID((u8*)&title);
+ title = Common::swap64(title);
+
+ path = StringFromFormat("%stitle/%08x/%08x/data/", File::GetUserPath(D_WIIUSER_IDX).c_str(), (u32)(title >> 32), (u32)title);
+
+ if (!File::Exists(path))
+ File::CreateFullPath(path);
+
+ if (path[0] == '.')
+ ret = QDir::currentPath() + QString::fromStdString(path).mid((int)strlen(ROOT_DIR));
+ else
+ ret = QString::fromStdString(path);
+ }
+ delete volume;
+
+ return ret;
+}
diff --git a/Source/Core/DolphinQt/GameList/GameFile.h b/Source/Core/DolphinQt/GameList/GameFile.h
new file mode 100644
index 0000000000..bc6e0ea17a
--- /dev/null
+++ b/Source/Core/DolphinQt/GameList/GameFile.h
@@ -0,0 +1,83 @@
+// Copyright 2014 Dolphin Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include
+#include
+#include
+
+#include
+
+#include "DiscIO/Volume.h"
+#include "DiscIO/VolumeCreator.h"
+
+class GameFile final
+{
+public:
+ GameFile(const QString& fileName);
+ GameFile(const std::string& fileName) : GameFile(QString::fromStdString(fileName)) {}
+
+ bool IsValid() const { return m_valid; }
+ QString GetFileName() { return m_file_name; }
+ QString GetFolderName() { return m_folder_name; }
+ QString GetBannerName(int index) const;
+ QString GetVolumeName(int index) const;
+ QString GetName(int index) const;
+ QString GetCompany() const;
+ QString GetDescription(int index = 0) const;
+ int GetRevision() const { return m_revision; }
+ const QString GetUniqueID() const { return m_unique_id; }
+ const QString GetWiiFSPath() const;
+ DiscIO::IVolume::ECountry GetCountry() const { return m_country; }
+ int GetPlatform() const { return m_platform; }
+ const QString GetIssues() const { return m_issues; }
+ int GetEmuState() const { return m_emu_state; }
+ bool IsCompressed() const { return m_compressed; }
+ u64 GetFileSize() const { return m_file_size; }
+ u64 GetVolumeSize() const { return m_volume_size; }
+ bool IsDiscTwo() const { return m_is_disc_two; }
+ const QPixmap GetBitmap() const { return m_banner; }
+
+ enum
+ {
+ GAMECUBE_DISC = 0,
+ WII_DISC,
+ WII_WAD,
+ NUMBER_OF_PLATFORMS
+ };
+
+private:
+ QString m_file_name;
+ QString m_folder_name;
+
+ // TODO: eliminate this and overwrite with names from banner when available?
+ QStringList m_volume_names;
+
+ QString m_company;
+ QStringList m_names;
+ QStringList m_descriptions;
+
+ QString m_unique_id;
+
+ QString m_issues;
+ int m_emu_state = 0;
+
+ quint64 m_file_size = 0;
+ quint64 m_volume_size = 0;
+
+ DiscIO::IVolume::ECountry m_country;
+ int m_platform;
+ int m_revision = 0;
+
+ QPixmap m_banner;
+ bool m_valid = false;
+ bool m_compressed = false;
+ bool m_is_disc_two = false;
+
+ bool LoadFromCache();
+ void SaveToCache();
+
+ QString CreateCacheFilename();
+};
diff --git a/Source/Core/DolphinQt/GameList/GameGrid.cpp b/Source/Core/DolphinQt/GameList/GameGrid.cpp
new file mode 100644
index 0000000000..408fba7b03
--- /dev/null
+++ b/Source/Core/DolphinQt/GameList/GameGrid.cpp
@@ -0,0 +1,95 @@
+// Copyright 2014 Dolphin Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#include "ui_GameGrid.h"
+
+#include "Common/StdMakeUnique.h"
+
+#include "DolphinQt/GameList/GameGrid.h"
+
+// Game banner image size
+static const u32 GRID_BANNER_WIDTH = 144;
+static const u32 GRID_BANNER_HEIGHT = 48;
+
+static const u32 ICON_BANNER_WIDTH = 64;
+static const u32 ICON_BANNER_HEIGHT = 64;
+
+DGameGrid::DGameGrid(QWidget* parent_widget) :
+ QListWidget(parent_widget)
+{
+ m_ui = std::make_unique();
+ m_ui->setupUi(this);
+ SetViewStyle(STYLE_GRID);
+
+ connect(this, SIGNAL(itemActivated(QListWidgetItem*)), this, SIGNAL(StartGame()));
+}
+
+DGameGrid::~DGameGrid()
+{
+ for (QListWidgetItem* i : m_items.keys())
+ delete i;
+}
+
+GameFile* DGameGrid::SelectedGame()
+{
+ if (!selectedItems().empty())
+ return m_items.value(selectedItems().at(0));
+ else
+ return nullptr;
+}
+
+void DGameGrid::SelectGame(GameFile* game)
+{
+ if (game == nullptr)
+ return;
+ if (!selectedItems().empty())
+ selectedItems().at(0)->setSelected(false);
+ m_items.key(game)->setSelected(true);
+}
+
+void DGameGrid::SetViewStyle(GameListStyle newStyle)
+{
+ if (newStyle == STYLE_GRID)
+ {
+ m_current_style = STYLE_GRID;
+ setIconSize(QSize(GRID_BANNER_WIDTH, GRID_BANNER_HEIGHT));
+ setViewMode(QListView::IconMode);
+ }
+ else
+ {
+ m_current_style = STYLE_ICON;
+ setIconSize(QSize(ICON_BANNER_WIDTH, ICON_BANNER_HEIGHT));
+ setViewMode(QListView::ListMode);
+ }
+
+ // QListView resets this when you change the view mode, so let's set it again
+ setDragEnabled(false);
+}
+
+void DGameGrid::AddGame(GameFile* item)
+{
+ if (m_items.values().contains(item))
+ return;
+ m_items.values().append(item);
+
+ QListWidgetItem* i = new QListWidgetItem;
+ i->setIcon(QIcon(item->GetBitmap()
+ .scaled(GRID_BANNER_WIDTH, GRID_BANNER_HEIGHT, Qt::KeepAspectRatio, Qt::SmoothTransformation)));
+ i->setText(item->GetName(0));
+ if (item->IsCompressed())
+ i->setTextColor(QColor("#00F"));
+
+ addItem(i);
+ m_items.insert(i, item);
+}
+
+void DGameGrid::RemoveGame(GameFile* item)
+{
+ if (!m_items.values().contains(item))
+ return;
+
+ QListWidgetItem* i = m_items.key(item);
+ m_items.remove(i);
+ delete i;
+}
diff --git a/Source/Core/DolphinQt/GameList/GameGrid.h b/Source/Core/DolphinQt/GameList/GameGrid.h
new file mode 100644
index 0000000000..2c89ef94c4
--- /dev/null
+++ b/Source/Core/DolphinQt/GameList/GameGrid.h
@@ -0,0 +1,44 @@
+// Copyright 2014 Dolphin Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include
+
+#include
+
+#include "DolphinQt/GameList/GameTracker.h"
+
+// Predefinitions
+namespace Ui
+{
+class DGameGrid;
+}
+
+class DGameGrid : public QListWidget, public AbstractGameList
+{
+ Q_OBJECT
+
+public:
+ explicit DGameGrid(QWidget* parent_widget = nullptr);
+ ~DGameGrid();
+
+ // AbstractGameList stuff
+ virtual GameFile* SelectedGame();
+ virtual void SelectGame(GameFile* game);
+
+ virtual void SetViewStyle(GameListStyle newStyle);
+
+ virtual void AddGame(GameFile* item);
+ virtual void RemoveGame(GameFile* item);
+
+signals:
+ void StartGame();
+
+private:
+ std::unique_ptr m_ui;
+
+ QMap m_items;
+ GameListStyle m_current_style;
+};
diff --git a/Source/Core/DolphinQt/GameList/GameGrid.ui b/Source/Core/DolphinQt/GameList/GameGrid.ui
new file mode 100644
index 0000000000..742435b22a
--- /dev/null
+++ b/Source/Core/DolphinQt/GameList/GameGrid.ui
@@ -0,0 +1,22 @@
+
+
+ DGameGrid
+
+
+
+ 0
+ 0
+ 256
+ 192
+
+
+
+ true
+
+
+ QListView::Adjust
+
+
+
+
+
diff --git a/Source/Core/DolphinQt/GameList/GameTracker.cpp b/Source/Core/DolphinQt/GameList/GameTracker.cpp
new file mode 100644
index 0000000000..a3994548c6
--- /dev/null
+++ b/Source/Core/DolphinQt/GameList/GameTracker.cpp
@@ -0,0 +1,252 @@
+// Copyright 2014 Dolphin Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#include "Common/CDUtils.h"
+#include "Common/FileSearch.h"
+#include "Core/ConfigManager.h"
+
+#include "DolphinQt/GameList/GameGrid.h"
+#include "DolphinQt/GameList/GameTracker.h"
+#include "DolphinQt/GameList/GameTree.h"
+
+void AbstractGameList::AddGames(QList items)
+{
+ for (GameFile* o : items)
+ AddGame(o);
+}
+void AbstractGameList::RemoveGames(QList items)
+{
+ for (GameFile* o : items)
+ RemoveGame(o);
+}
+
+
+DGameTracker::DGameTracker(QWidget* parent_widget)
+ : QStackedWidget(parent_widget),
+ m_watcher(this)
+{
+ connect(&m_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(ScanForGames()));
+
+ m_tree_widget = new DGameTree(this);
+ addWidget(m_tree_widget);
+ connect(m_tree_widget, SIGNAL(StartGame()), this, SIGNAL(StartGame()));
+
+ m_grid_widget = new DGameGrid(this);
+ addWidget(m_grid_widget);
+ connect(m_grid_widget, SIGNAL(StartGame()), this, SIGNAL(StartGame()));
+
+ SetViewStyle(STYLE_LIST);
+}
+
+DGameTracker::~DGameTracker()
+{
+ for (GameFile* file : m_games.values())
+ delete file;
+}
+
+void DGameTracker::SetViewStyle(GameListStyle newStyle)
+{
+ if (newStyle == m_current_style)
+ return;
+ m_current_style = newStyle;
+
+ if (newStyle == STYLE_LIST || newStyle == STYLE_TREE)
+ {
+ m_tree_widget->SelectGame(SelectedGame());
+ setCurrentWidget(m_tree_widget);
+ m_tree_widget->SetViewStyle(newStyle);
+ }
+ else
+ {
+ m_grid_widget->SelectGame(SelectedGame());
+ setCurrentWidget(m_grid_widget);
+ m_grid_widget->SetViewStyle(newStyle);
+ }
+}
+
+GameFile* DGameTracker::SelectedGame()
+{
+ if (currentWidget() == m_grid_widget)
+ return m_grid_widget->SelectedGame();
+ else
+ return m_tree_widget->SelectedGame();
+}
+
+void DGameTracker::ScanForGames()
+{
+ setDisabled(true);
+
+ CFileSearch::XStringVector dirs(SConfig::GetInstance().m_ISOFolder);
+
+ if (SConfig::GetInstance().m_RecursiveISOFolder)
+ {
+ for (u32 i = 0; i < dirs.size(); i++)
+ {
+ File::FSTEntry FST_Temp;
+ File::ScanDirectoryTree(dirs[i], FST_Temp);
+ for (auto& entry : FST_Temp.children)
+ {
+ if (entry.isDirectory)
+ {
+ bool duplicate = false;
+ for (auto& dir : dirs)
+ {
+ if (dir == entry.physicalName)
+ {
+ duplicate = true;
+ break;
+ }
+ }
+ if (!duplicate)
+ dirs.push_back(entry.physicalName);
+ }
+ }
+ }
+ }
+
+ for (std::string& dir : dirs)
+ m_watcher.addPath(QString::fromStdString(dir));
+
+ CFileSearch::XStringVector exts;
+ if (SConfig::GetInstance().m_ListGC)
+ {
+ exts.push_back("*.gcm");
+ exts.push_back("*.gcz");
+ }
+ if (SConfig::GetInstance().m_ListWii || SConfig::GetInstance().m_ListGC)
+ {
+ exts.push_back("*.iso");
+ exts.push_back("*.ciso");
+ exts.push_back("*.wbfs");
+ }
+ if (SConfig::GetInstance().m_ListWad)
+ exts.push_back("*.wad");
+
+ CFileSearch FileSearch(exts, dirs);
+ const CFileSearch::XStringVector& rFilenames = FileSearch.GetFileNames();
+ QList newItems;
+ QStringList allItems;
+
+ if (!rFilenames.empty())
+ {
+ for (u32 i = 0; i < rFilenames.size(); i++)
+ {
+ std::string FileName;
+ SplitPath(rFilenames[i], nullptr, &FileName, nullptr);
+ QString NameAndPath = QString::fromStdString(rFilenames[i]);
+ allItems.append(NameAndPath);
+
+ if (m_games.keys().contains(NameAndPath))
+ continue;
+
+ GameFile* obj = new GameFile(rFilenames[i]);
+ if (obj->IsValid())
+ {
+ bool list = true;
+
+ switch(obj->GetCountry())
+ {
+ case DiscIO::IVolume::COUNTRY_AUSTRALIA:
+ if (!SConfig::GetInstance().m_ListAustralia)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_GERMANY:
+ if (!SConfig::GetInstance().m_ListGermany)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_RUSSIA:
+ if (!SConfig::GetInstance().m_ListRussia)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_UNKNOWN:
+ if (!SConfig::GetInstance().m_ListUnknown)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_TAIWAN:
+ if (!SConfig::GetInstance().m_ListTaiwan)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_KOREA:
+ if (!SConfig::GetInstance().m_ListKorea)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_JAPAN:
+ if (!SConfig::GetInstance().m_ListJap)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_USA:
+ if (!SConfig::GetInstance().m_ListUsa)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_FRANCE:
+ if (!SConfig::GetInstance().m_ListFrance)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_ITALY:
+ if (!SConfig::GetInstance().m_ListItaly)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_SPAIN:
+ if (!SConfig::GetInstance().m_ListSpain)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_NETHERLANDS:
+ if (!SConfig::GetInstance().m_ListNetherlands)
+ list = false;
+ break;
+ default:
+ if (!SConfig::GetInstance().m_ListPal)
+ list = false;
+ break;
+ }
+
+ if (list)
+ newItems.append(obj);
+ }
+ }
+ }
+
+ // Process all the new GameFiles
+ for (GameFile* o : newItems)
+ m_games.insert(o->GetFileName(), o);
+
+ // Check for games that were removed
+ QList removedGames;
+ for (QString& path : m_games.keys())
+ {
+ if (!allItems.contains(path))
+ {
+ removedGames.append(m_games.value(path));
+ m_games.remove(path);
+ }
+ }
+
+ m_tree_widget->AddGames(newItems);
+ m_grid_widget->AddGames(newItems);
+
+ m_tree_widget->RemoveGames(removedGames);
+ m_grid_widget->RemoveGames(removedGames);
+
+ for (GameFile* file : removedGames)
+ delete file;
+
+ setDisabled(false);
+}
+
+void DGameTracker::SelectLastBootedGame()
+{
+ if (!SConfig::GetInstance().m_LastFilename.empty() && File::Exists(SConfig::GetInstance().m_LastFilename))
+ {
+ QString lastfilename = QString::fromStdString(SConfig::GetInstance().m_LastFilename);
+ for (GameFile* game : m_games.values())
+ {
+ if (game->GetFileName() == lastfilename)
+ {
+ m_tree_widget->SelectGame(game);
+ break;
+ }
+
+ }
+ }
+}
diff --git a/Source/Core/DolphinQt/GameList/GameTracker.h b/Source/Core/DolphinQt/GameList/GameTracker.h
new file mode 100644
index 0000000000..770f197864
--- /dev/null
+++ b/Source/Core/DolphinQt/GameList/GameTracker.h
@@ -0,0 +1,68 @@
+// Copyright 2014 Dolphin Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include
+#include
+#include
+#include
+
+#include "DolphinQt/GameList/GameFile.h"
+
+// Predefinitions
+class DGameGrid;
+class DGameTree;
+
+enum GameListStyle
+{
+ STYLE_LIST,
+ STYLE_TREE,
+ STYLE_GRID,
+ STYLE_ICON
+};
+
+class AbstractGameList
+{
+public:
+ virtual GameFile* SelectedGame() = 0;
+ virtual void SelectGame(GameFile* game) = 0;
+
+ virtual void SetViewStyle(GameListStyle newStyle) = 0;
+
+ virtual void AddGame(GameFile* item) = 0;
+ void AddGames(QList items);
+
+ virtual void RemoveGame(GameFile* item) = 0;
+ void RemoveGames(QList items);
+};
+
+class DGameTracker : public QStackedWidget
+{
+ Q_OBJECT
+
+public:
+ DGameTracker(QWidget* parent_widget = nullptr);
+ ~DGameTracker();
+
+ GameListStyle ViewStyle() const { return m_current_style; }
+ void SetViewStyle(GameListStyle newStyle);
+
+ GameFile* SelectedGame();
+ void SelectLastBootedGame();
+
+signals:
+ void StartGame();
+
+public slots:
+ void ScanForGames();
+
+private:
+ QMap m_games;
+ QFileSystemWatcher m_watcher;
+
+ GameListStyle m_current_style;
+ DGameGrid* m_grid_widget = nullptr;
+ DGameTree* m_tree_widget = nullptr;
+};
diff --git a/Source/Core/DolphinQt/GameList/GameTree.cpp b/Source/Core/DolphinQt/GameList/GameTree.cpp
new file mode 100644
index 0000000000..fa3d5babe4
--- /dev/null
+++ b/Source/Core/DolphinQt/GameList/GameTree.cpp
@@ -0,0 +1,167 @@
+// Copyright 2014 Dolphin Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#include "ui_GameTree.h"
+
+#include "Common/StdMakeUnique.h"
+
+#include "DolphinQt/GameList/GameTree.h"
+
+#include "DolphinQt/Utils/Resources.h"
+#include "DolphinQt/Utils/Utils.h"
+
+// Game banner image size
+static const u32 BANNER_WIDTH = 96;
+static const u32 BANNER_HEIGHT = 32;
+
+DGameTree::DGameTree(QWidget* parent_widget) :
+ QTreeWidget(parent_widget)
+{
+ m_ui = std::make_unique();
+ m_ui->setupUi(this);
+
+ SetViewStyle(STYLE_TREE);
+ setIconSize(QSize(BANNER_WIDTH, BANNER_HEIGHT));
+ sortByColumn(COL_TITLE);
+
+ connect(this, SIGNAL(itemActivated(QTreeWidgetItem*, int)), this, SLOT(ItemActivated(QTreeWidgetItem*)));
+}
+
+DGameTree::~DGameTree()
+{
+ int count = topLevelItemCount();
+ for (int a = 0; a < count; a++)
+ takeTopLevelItem(0);
+
+ for (QTreeWidgetItem* i : m_path_nodes.values())
+ {
+ count = i->childCount();
+ for (int a = 0; a < count; a++)
+ i->takeChild(0);
+ }
+
+ for (QTreeWidgetItem* i : m_path_nodes.values())
+ delete i;
+ for (QTreeWidgetItem* i : m_items.keys())
+ delete i;
+}
+
+void DGameTree::ResizeAllCols()
+{
+ for (int i = 0; i < columnCount(); i++)
+ resizeColumnToContents(i);
+}
+
+void DGameTree::ItemActivated(QTreeWidgetItem* item)
+{
+ if (!m_path_nodes.values().contains(item))
+ emit StartGame();
+}
+
+GameFile* DGameTree::SelectedGame()
+{
+ if (!selectedItems().empty())
+ return m_items.value(selectedItems().at(0));
+ else
+ return nullptr;
+}
+
+void DGameTree::SelectGame(GameFile* game)
+{
+ if (game == nullptr)
+ return;
+ if (!selectedItems().empty())
+ selectedItems().at(0)->setSelected(false);
+ m_items.key(game)->setSelected(true);
+}
+
+void DGameTree::SetViewStyle(GameListStyle newStyle)
+{
+ if (newStyle == STYLE_LIST)
+ {
+ m_current_style = STYLE_LIST;
+ setIndentation(0);
+ RebuildTree();
+ }
+ else
+ {
+ m_current_style = STYLE_TREE;
+ setIndentation(20);
+ RebuildTree();
+ }
+}
+
+void DGameTree::AddGame(GameFile* item)
+{
+ if (m_items.values().contains(item))
+ return;
+
+ QString folder = item->GetFolderName();
+ if (!m_path_nodes.contains(folder))
+ {
+ QTreeWidgetItem* i = new QTreeWidgetItem;
+ i->setText(0, folder);
+ m_path_nodes.insert(folder, i);
+ if (m_current_style == STYLE_TREE)
+ addTopLevelItem(i);
+ }
+
+ QTreeWidgetItem* i = new QTreeWidgetItem;
+ i->setIcon(COL_TYPE, QIcon(Resources::GetPlatformPixmap(item->GetPlatform())));
+ i->setIcon(COL_BANNER, QIcon(item->GetBitmap()));
+ i->setText(COL_TITLE, item->GetName(0));
+ i->setText(COL_DESCRIPTION, item->GetDescription());
+ i->setIcon(COL_REGION, QIcon(Resources::GetRegionPixmap(item->GetCountry())));
+ i->setText(COL_SIZE, NiceSizeFormat(item->GetFileSize()));
+ if (item->IsCompressed())
+ {
+ for (int col = 0; col < columnCount(); col++)
+ i->setTextColor(col, QColor("#00F"));
+ }
+ m_items.insert(i, item);
+
+ RebuildTree(); // TODO: only call this once per group of items added
+}
+
+void DGameTree::RemoveGame(GameFile* item)
+{
+ if (!m_items.values().contains(item))
+ return;
+ QTreeWidgetItem* i = m_items.key(item);
+ m_items.remove(i);
+ delete i;
+}
+
+void DGameTree::RebuildTree()
+{
+ GameFile* currentGame = SelectedGame();
+
+ int count = topLevelItemCount();
+ for (int a = 0; a < count; a++)
+ takeTopLevelItem(0);
+
+ for (QTreeWidgetItem* i : m_path_nodes.values())
+ {
+ count = i->childCount();
+ for (int a = 0; a < count; a++)
+ i->takeChild(0);
+ }
+
+ if (m_current_style == STYLE_TREE)
+ {
+ for (QTreeWidgetItem* i : m_path_nodes.values())
+ addTopLevelItem(i);
+ for (QTreeWidgetItem* i : m_items.keys())
+ m_path_nodes.value(m_items.value(i)->GetFolderName())->addChild(i);
+ }
+ else
+ {
+ for (QTreeWidgetItem* i : m_items.keys())
+ addTopLevelItem(i);
+ }
+
+ expandAll();
+ ResizeAllCols();
+ SelectGame(currentGame);
+}
diff --git a/Source/Core/DolphinQt/GameList/GameTree.h b/Source/Core/DolphinQt/GameList/GameTree.h
new file mode 100644
index 0000000000..ef7708b554
--- /dev/null
+++ b/Source/Core/DolphinQt/GameList/GameTree.h
@@ -0,0 +1,62 @@
+// Copyright 2014 Dolphin Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include
+
+#include
+
+#include "DolphinQt/GameList/GameTracker.h"
+
+// Predefinitions
+namespace Ui
+{
+class DGameTree;
+}
+
+class DGameTree : public QTreeWidget, public AbstractGameList
+{
+ Q_OBJECT
+
+public:
+ explicit DGameTree(QWidget* parent_widget = nullptr);
+ ~DGameTree();
+
+ // AbstractGameList stuff
+ virtual GameFile* SelectedGame();
+ virtual void SelectGame(GameFile* game);
+
+ virtual void SetViewStyle(GameListStyle newStyle);
+
+ virtual void AddGame(GameFile* item);
+ virtual void RemoveGame(GameFile* item);
+
+signals:
+ void StartGame();
+
+private slots:
+ void ItemActivated(QTreeWidgetItem* item);
+
+private:
+ enum Columns
+ {
+ COL_TYPE = 0,
+ COL_BANNER = 1,
+ COL_TITLE = 2,
+ COL_DESCRIPTION = 3,
+ COL_REGION = 4,
+ COL_SIZE = 5,
+ COL_STATE = 6
+ };
+
+ std::unique_ptr m_ui;
+ GameListStyle m_current_style;
+
+ QMap m_items;
+ QMap m_path_nodes;
+
+ void RebuildTree();
+ void ResizeAllCols();
+};
diff --git a/Source/Core/DolphinQt/GameList/GameTree.ui b/Source/Core/DolphinQt/GameList/GameTree.ui
new file mode 100644
index 0000000000..22b63d82c3
--- /dev/null
+++ b/Source/Core/DolphinQt/GameList/GameTree.ui
@@ -0,0 +1,54 @@
+
+
+ DGameTree
+
+
+
+ 0
+ 0
+ 396
+ 296
+
+
+
+ true
+
+
+
+ Type
+
+
+
+
+ Banner
+
+
+
+
+ Title
+
+
+
+
+ Description
+
+
+
+
+ Region
+
+
+
+
+ Size
+
+
+
+
+ State
+
+
+
+
+
+
diff --git a/Source/Core/DolphinQt/Host.cpp b/Source/Core/DolphinQt/Host.cpp
index c26df6ea62..1969dad4fd 100644
--- a/Source/Core/DolphinQt/Host.cpp
+++ b/Source/Core/DolphinQt/Host.cpp
@@ -32,14 +32,6 @@ void* Host_GetRenderHandle()
return (void*)(g_main_window->GetRenderWidget()->winId());
}
-void Host_GetRenderWindowSize(int& x, int& y, int& w, int& h)
-{
- // TODO: Make it more clear what this is supposed to return.. i.e. WX always sets x=y=0
- g_main_window->RenderWidgetSize(x, y, w, h);
- x = 0;
- y = 0;
-}
-
void Host_RequestRenderWindowSize(int w, int h)
{
DRenderWidget* render_widget = g_main_window->GetRenderWidget();
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp
index 8ad50c2ffa..4bb13e29e2 100644
--- a/Source/Core/DolphinQt/MainWindow.cpp
+++ b/Source/Core/DolphinQt/MainWindow.cpp
@@ -2,6 +2,7 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
+#include
#include
#include
#include
@@ -28,20 +29,40 @@ DMainWindow::DMainWindow(QWidget* parent_widget)
{
m_ui = std::make_unique();
m_ui->setupUi(this);
-#ifdef Q_OS_MACX
- m_ui->toolbar->setMovable(false);
-#endif
Resources::Init();
UpdateIcons();
setWindowIcon(Resources::GetIcon(Resources::DOLPHIN_LOGO));
+ // Create the GameList
+ m_game_tracker = new DGameTracker(this);
+ m_ui->centralWidget->addWidget(m_game_tracker);
+ m_game_tracker->ScanForGames();
+ m_game_tracker->SelectLastBootedGame();
+
+ // Setup the GameList style switching actions
+ QActionGroup* gamelistGroup = new QActionGroup(this);
+ gamelistGroup->addAction(m_ui->actionListView);
+ gamelistGroup->addAction(m_ui->actionTreeView);
+ gamelistGroup->addAction(m_ui->actionGridView);
+ gamelistGroup->addAction(m_ui->actionIconView);
+
+ // TODO: save/load this from user prefs!
+ m_ui->actionListView->setChecked(true);
+ OnGameListStyleChanged();
+
// Connect all the signals/slots
connect(this, SIGNAL(CoreStateChanged(Core::EState)), this, SLOT(OnCoreStateChanged(Core::EState)));
connect(m_ui->actionOpen, SIGNAL(triggered()), this, SLOT(OnOpen()));
+ connect(m_ui->actionListView, SIGNAL(triggered()), this, SLOT(OnGameListStyleChanged()));
+ connect(m_ui->actionTreeView, SIGNAL(triggered()), this, SLOT(OnGameListStyleChanged()));
+ connect(m_ui->actionGridView, SIGNAL(triggered()), this, SLOT(OnGameListStyleChanged()));
+ connect(m_ui->actionIconView, SIGNAL(triggered()), this, SLOT(OnGameListStyleChanged()));
+
connect(m_ui->actionPlay, SIGNAL(triggered()), this, SLOT(OnPlay()));
+ connect(m_game_tracker, SIGNAL(StartGame()), this, SLOT(OnPlay()));
connect(m_ui->actionStop, SIGNAL(triggered()), this, SLOT(OnStop()));
connect(m_ui->actionWebsite, SIGNAL(triggered()), this, SLOT(OnOpenWebsite()));
@@ -52,6 +73,11 @@ DMainWindow::DMainWindow(QWidget* parent_widget)
// Update GUI items
emit CoreStateChanged(Core::CORE_UNINITIALIZED);
+
+ // Platform-specific stuff
+#ifdef Q_OS_MACX
+ m_ui->toolbar->setMovable(false);
+#endif
}
DMainWindow::~DMainWindow()
@@ -69,7 +95,7 @@ void DMainWindow::StartGame(const QString filename)
// TODO: When rendering to main, this won't resize the parent window..
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
{
- connect(m_render_widget.get(), SIGNAL(Closed()), this, SLOT(on_actStop_triggered()));
+ connect(m_render_widget.get(), SIGNAL(Closed()), this, SLOT(OnStop()));
m_render_widget->move(SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos,
SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowYPos);
m_render_widget->resize(SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth, // TODO: Make sure these are client sizes!
@@ -106,7 +132,8 @@ void DMainWindow::StartGame(const QString filename)
QString DMainWindow::RequestBootFilename()
{
// If a game is already selected, just return the filename
- // ... TODO
+ if (m_game_tracker->SelectedGame() != nullptr)
+ return m_game_tracker->SelectedGame()->GetFileName();
return ShowFileDialog();
}
@@ -198,6 +225,18 @@ void DMainWindow::OnStop()
m_isStopping = false;
}
+void DMainWindow::OnGameListStyleChanged()
+{
+ if (m_ui->actionListView->isChecked())
+ m_game_tracker->SetViewStyle(STYLE_LIST);
+ else if (m_ui->actionTreeView->isChecked())
+ m_game_tracker->SetViewStyle(STYLE_TREE);
+ else if (m_ui->actionGridView->isChecked())
+ m_game_tracker->SetViewStyle(STYLE_GRID);
+ else if (m_ui->actionIconView->isChecked())
+ m_game_tracker->SetViewStyle(STYLE_ICON);
+}
+
void DMainWindow::OnCoreStateChanged(Core::EState state)
{
bool is_not_initialized = (state == Core::CORE_UNINITIALIZED);
@@ -219,23 +258,7 @@ void DMainWindow::OnCoreStateChanged(Core::EState state)
m_ui->actionStop->setEnabled(!is_not_initialized);
m_ui->actionOpen->setEnabled(is_not_initialized);
-}
-
-// DRenderWidget
-void DMainWindow::RenderWidgetSize(int& x_pos, int& y_pos, int& w, int& h)
-{
- if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
- {
- x_pos = x();
- y_pos = y();
- }
- else
- {
- x_pos = m_render_widget->x();
- y_pos = m_render_widget->y();
- }
- w = m_render_widget->width();
- h = m_render_widget->height();
+ m_game_tracker->setEnabled(is_not_initialized);
}
bool DMainWindow::RenderWidgetHasFocus()
diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h
index 73817c2f5c..e8fa97c8ba 100644
--- a/Source/Core/DolphinQt/MainWindow.h
+++ b/Source/Core/DolphinQt/MainWindow.h
@@ -9,6 +9,7 @@
#include "Core/Core.h"
+#include "DolphinQt/GameList/GameTracker.h"
#include "DolphinQt/VideoInterface/RenderWidget.h"
// Predefinitions
@@ -26,7 +27,6 @@ public:
~DMainWindow();
// DRenderWidget
- void RenderWidgetSize(int& x_pos, int& y_pos, int& w, int& h);
bool RenderWidgetHasFocus();
DRenderWidget* GetRenderWidget() { return m_render_widget.get(); }
@@ -43,6 +43,9 @@ private slots:
void OnPlay();
void OnStop();
+ // View menu
+ void OnGameListStyleChanged();
+
// Help menu
void OnOpenWebsite();
void OnOpenDocs();
@@ -55,13 +58,14 @@ private slots:
private:
std::unique_ptr m_ui;
+ DGameTracker* m_game_tracker;
// Emulation
QString RequestBootFilename();
QString ShowFileDialog();
void DoStartPause();
- std::unique_ptr m_render_widget;
+ std::unique_ptr m_render_widget; // TODO: just create this once and reuse it
bool m_isStopping = false;
};
diff --git a/Source/Core/DolphinQt/MainWindow.ui b/Source/Core/DolphinQt/MainWindow.ui
index 4deb07dbc8..f0b65dee2e 100644
--- a/Source/Core/DolphinQt/MainWindow.ui
+++ b/Source/Core/DolphinQt/MainWindow.ui
@@ -60,6 +60,16 @@
&View
+
+
+
-
@@ -157,6 +167,38 @@
QAction::AboutQtRole
+
+
+ true
+
+
+ List view
+
+
+
+
+ true
+
+
+ Tree view
+
+
+
+
+ true
+
+
+ Grid view
+
+
+
+
+ true
+
+
+ Icon view
+
+
diff --git a/Source/Core/DolphinQt/Utils/Resources.cpp b/Source/Core/DolphinQt/Utils/Resources.cpp
index 0056f4f972..d730a788b6 100644
--- a/Source/Core/DolphinQt/Utils/Resources.cpp
+++ b/Source/Core/DolphinQt/Utils/Resources.cpp
@@ -21,15 +21,20 @@ void Resources::Init()
QString dir = QString::fromStdString(File::GetSysDirectory() + "Resources/");
m_regions.resize(DiscIO::IVolume::NUMBER_OF_COUNTRIES);
- m_regions[DiscIO::IVolume::COUNTRY_EUROPE].load(dir + SL("Flag_Europe.png"));
- m_regions[DiscIO::IVolume::COUNTRY_FRANCE].load(dir + SL("Flag_France.png"));
- m_regions[DiscIO::IVolume::COUNTRY_RUSSIA].load(dir + SL("Flag_Unknown.png")); // TODO
- m_regions[DiscIO::IVolume::COUNTRY_USA].load(dir + SL("Flag_USA.png"));
m_regions[DiscIO::IVolume::COUNTRY_JAPAN].load(dir + SL("Flag_Japan.png"));
- m_regions[DiscIO::IVolume::COUNTRY_KOREA].load(dir + SL("Flag_Korea.png"));
+ m_regions[DiscIO::IVolume::COUNTRY_EUROPE].load(dir + SL("Flag_Europe.png"));
+ m_regions[DiscIO::IVolume::COUNTRY_USA].load(dir + SL("Flag_USA.png"));
+
+ m_regions[DiscIO::IVolume::COUNTRY_AUSTRALIA].load(dir + SL("Flag_Australia.png"));
+ m_regions[DiscIO::IVolume::COUNTRY_FRANCE].load(dir + SL("Flag_France.png"));
+ m_regions[DiscIO::IVolume::COUNTRY_GERMANY].load(dir + SL("Flag_Germany.png"));
+ m_regions[DiscIO::IVolume::COUNTRY_INTERNATIONAL].load(dir + SL("Flag_Europe.png")); // Uses European flag as a placeholder
m_regions[DiscIO::IVolume::COUNTRY_ITALY].load(dir + SL("Flag_Italy.png"));
+ m_regions[DiscIO::IVolume::COUNTRY_KOREA].load(dir + SL("Flag_Korea.png"));
+ m_regions[DiscIO::IVolume::COUNTRY_NETHERLANDS].load(dir + SL("Flag_Netherlands.png"));
+ m_regions[DiscIO::IVolume::COUNTRY_RUSSIA].load(dir + SL("Flag_Russia.png"));
+ m_regions[DiscIO::IVolume::COUNTRY_SPAIN].load(dir + SL("Flag_Spain.png"));
m_regions[DiscIO::IVolume::COUNTRY_TAIWAN].load(dir + SL("Flag_Taiwan.png"));
- m_regions[DiscIO::IVolume::COUNTRY_SDK].load(dir + SL("Flag_SDK.png"));
m_regions[DiscIO::IVolume::COUNTRY_UNKNOWN].load(dir + SL("Flag_Unknown.png"));
m_platforms.resize(3);
diff --git a/Source/Core/DolphinWX/ARCodeAddEdit.cpp b/Source/Core/DolphinWX/ARCodeAddEdit.cpp
index 8e33167989..0206c2634c 100644
--- a/Source/Core/DolphinWX/ARCodeAddEdit.cpp
+++ b/Source/Core/DolphinWX/ARCodeAddEdit.cpp
@@ -33,7 +33,7 @@ CARCodeAddEdit::CARCodeAddEdit(int _selection, wxWindow* parent, wxWindowID id,
: wxDialog(parent, id, title, position, size, style)
, selection(_selection)
{
- Bind(wxEVT_BUTTON, &CARCodeAddEdit::SaveCheatData, this);
+ Bind(wxEVT_BUTTON, &CARCodeAddEdit::SaveCheatData, this, wxID_OK);
ActionReplay::ARCode tempEntries;
wxString currentName = _("Insert name here..");
diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt
index 945cb49164..7d70e0692b 100644
--- a/Source/Core/DolphinWX/CMakeLists.txt
+++ b/Source/Core/DolphinWX/CMakeLists.txt
@@ -1,18 +1,3 @@
-set(LIBS core
- uicommon
- ${LZO}
- ${GTK2_LIBRARIES})
-
-if(NOT ANDROID)
- link_directories(${CMAKE_PREFIX_PATH}/lib)
-else()
- set(LIBS ${LIBS} png iconv)
-endif()
-
-if(LIBAV_FOUND)
- set(LIBS ${LIBS} ${LIBAV_LIBRARIES})
-endif()
-
set(GUI_SRCS
ARCodeAddEdit.cpp
AboutDolphin.cpp
@@ -65,24 +50,21 @@ set(GUI_SRCS
set(WXLIBS ${wxWidgets_LIBRARIES} dl)
+list(APPEND LIBS core uicommon)
+
+if(ANDROID)
+ list(APPEND LIBS png)
+endif()
+
+
set(ANDROID_SRCS Android/ButtonManager.cpp
MainAndroid.cpp)
set(NOGUI_SRCS MainNoGUI.cpp)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- # Link against OS X system frameworks.
- list(APPEND LIBS
- ${APPKIT_LIBRARY}
- ${AU_LIBRARY}
- ${COREAUDIO_LIBRARY}
- ${COREFUND_LIBRARY}
- ${CORESERV_LIBRARY}
- ${IOK_LIBRARY}
- ${FORCEFEEDBACK}
- )
if(wxWidgets_FOUND)
- list(APPEND LIBS
+ list(APPEND WXLIBS
${APPSERV_LIBRARY}
${COCOA_LIBRARY}
)
@@ -94,11 +76,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
MACOSX_PACKAGE_LOCATION Resources)
endif()
-if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
- ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
- set(LIBS ${LIBS} usbhid)
-endif()
-
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DOLPHIN_EXE_BASE Dolphin)
else()
@@ -107,10 +84,6 @@ endif()
set(DOLPHIN_EXE ${DOLPHIN_EXE_BASE})
-if(USE_UPNP)
- set(LIBS ${LIBS} miniupnpc)
-endif()
-
include(FindGettext)
if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE AND wxWidgets_FOUND)
file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po)
@@ -145,7 +118,7 @@ if(ANDROID)
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE})
elseif(wxWidgets_FOUND)
add_executable(${DOLPHIN_EXE} ${SRCS} ${GUI_SRCS})
- target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS} ${LLVM_LIBRARIES})
+ target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS})
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include(BundleUtilities)
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHIN_EXE}.app)
@@ -181,7 +154,7 @@ elseif(wxWidgets_FOUND)
COMMAND ln -nfs ${CMAKE_SOURCE_DIR}/Data/Sys ${BUNDLE_PATH}/Contents/Resources/Sys
VERBATIM
)
- add_custom_target(CopyDataIntoBundle ALL
+ add_custom_target(CopyDataIntoBundleWx ALL
DEPENDS ${BUNDLE_PATH}/Contents/Resources/Sys
)
endif()
@@ -219,7 +192,7 @@ elseif(wxWidgets_FOUND)
${CMAKE_SOURCE_DIR}/Data/Sys
VERBATIM
)
- add_custom_target(CopyTranslationsIntoBundle ALL
+ add_custom_target(CopyTranslationsIntoBundleWx ALL
DEPENDS ${BUNDLE_PATH}/Contents/Resources/en.lproj
)
endif()
diff --git a/Source/Core/DolphinWX/ConfigMain.cpp b/Source/Core/DolphinWX/ConfigMain.cpp
index 835d6f6a8a..96c29f2d87 100644
--- a/Source/Core/DolphinWX/ConfigMain.cpp
+++ b/Source/Core/DolphinWX/ConfigMain.cpp
@@ -250,7 +250,7 @@ void CConfigMain::UpdateGUI()
// Disable stuff on WiiPage
WiiScreenSaver->Disable();
- WiiEuRGB60->Disable();
+ WiiPAL60->Disable();
WiiAspectRatio->Disable();
WiiSystemLang->Disable();
@@ -490,7 +490,7 @@ void CConfigMain::InitializeGUIValues()
// Wii - Misc
WiiScreenSaver->SetValue(!!SConfig::GetInstance().m_SYSCONF->GetData("IPL.SSV"));
- WiiEuRGB60->SetValue(!!SConfig::GetInstance().m_SYSCONF->GetData("IPL.E60"));
+ WiiPAL60->SetValue(!!SConfig::GetInstance().m_SYSCONF->GetData("IPL.E60"));
WiiAspectRatio->SetSelection(SConfig::GetInstance().m_SYSCONF->GetData("IPL.AR"));
WiiSystemLang->SetSelection(SConfig::GetInstance().m_SYSCONF->GetData("IPL.LNG"));
@@ -782,7 +782,7 @@ void CConfigMain::CreateGUIControls()
// Wii page
// Misc Settings
WiiScreenSaver = new wxCheckBox(WiiPage, ID_WII_IPL_SSV, _("Enable Screen Saver"));
- WiiEuRGB60 = new wxCheckBox(WiiPage, ID_WII_IPL_E60, _("Use EuRGB60 Mode (PAL60)"));
+ WiiPAL60 = new wxCheckBox(WiiPage, ID_WII_IPL_E60, _("Use PAL60 Mode (EuRGB60)"));
WiiAspectRatio = new wxChoice(WiiPage, ID_WII_IPL_AR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiAspectRatio);
WiiSystemLang = new wxChoice(WiiPage, ID_WII_IPL_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSystemLang);
@@ -793,7 +793,7 @@ void CConfigMain::CreateGUIControls()
// Populate the Wii Page
sWiiIPLSettings = new wxGridBagSizer();
sWiiIPLSettings->Add(WiiScreenSaver, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5);
- sWiiIPLSettings->Add(WiiEuRGB60, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
+ sWiiIPLSettings->Add(WiiPAL60, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
sWiiIPLSettings->Add(TEXT_BOX(WiiPage, _("Aspect Ratio:")),
wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5);
sWiiIPLSettings->Add(WiiAspectRatio, wxGBPosition(2, 1), wxDefaultSpan, wxALL, 5);
@@ -1203,7 +1203,7 @@ void CConfigMain::WiiSettingsChanged(wxCommandEvent& event)
SConfig::GetInstance().m_SYSCONF->SetData("IPL.SSV", WiiScreenSaver->IsChecked());
break;
case ID_WII_IPL_E60:
- SConfig::GetInstance().m_SYSCONF->SetData("IPL.E60", WiiEuRGB60->IsChecked());
+ SConfig::GetInstance().m_SYSCONF->SetData("IPL.E60", WiiPAL60->IsChecked());
break;
case ID_WII_IPL_AR:
SConfig::GetInstance().m_SYSCONF->SetData("IPL.AR", WiiAspectRatio->GetSelection());
diff --git a/Source/Core/DolphinWX/ConfigMain.h b/Source/Core/DolphinWX/ConfigMain.h
index 02791a1c74..23cd4714f0 100644
--- a/Source/Core/DolphinWX/ConfigMain.h
+++ b/Source/Core/DolphinWX/ConfigMain.h
@@ -195,7 +195,7 @@ private:
// Misc
wxCheckBox* WiiScreenSaver;
- wxCheckBox* WiiEuRGB60;
+ wxCheckBox* WiiPAL60;
wxChoice* WiiAspectRatio;
wxChoice* WiiSystemLang;
diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp
index 2a6f53fe5c..5d70d1f52a 100644
--- a/Source/Core/DolphinWX/Debugger/CodeView.cpp
+++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp
@@ -364,26 +364,26 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event)
{
bool isSymbol = m_symbol_db->GetSymbolFromAddr(m_selection) != nullptr;
// popup menu
- wxMenu* menu = new wxMenu;
+ wxMenu menu;
//menu->Append(IDM_GOTOINMEMVIEW, "&Goto in mem view");
- menu->Append(IDM_FOLLOWBRANCH, _("&Follow branch"))->Enable(AddrToBranch(m_selection) ? true : false);
- menu->AppendSeparator();
+ menu.Append(IDM_FOLLOWBRANCH, _("&Follow branch"))->Enable(AddrToBranch(m_selection) ? true : false);
+ menu.AppendSeparator();
#if wxUSE_CLIPBOARD
- menu->Append(IDM_COPYADDRESS, _("Copy &address"));
- menu->Append(IDM_COPYFUNCTION, _("Copy &function"))->Enable(isSymbol);
- menu->Append(IDM_COPYCODE, _("Copy &code line"));
- menu->Append(IDM_COPYHEX, _("Copy &hex"));
- menu->AppendSeparator();
+ menu.Append(IDM_COPYADDRESS, _("Copy &address"));
+ menu.Append(IDM_COPYFUNCTION, _("Copy &function"))->Enable(isSymbol);
+ menu.Append(IDM_COPYCODE, _("Copy &code line"));
+ menu.Append(IDM_COPYHEX, _("Copy &hex"));
+ menu.AppendSeparator();
#endif
- menu->Append(IDM_RENAMESYMBOL, _("Rename &symbol"))->Enable(isSymbol);
- menu->AppendSeparator();
- menu->Append(IDM_RUNTOHERE, _("&Run To Here"))->Enable(Core::IsRunning());
- menu->Append(IDM_ADDFUNCTION, _("&Add function"))->Enable(Core::IsRunning());
- menu->Append(IDM_JITRESULTS, _("PPC vs X86"))->Enable(Core::IsRunning());
- menu->Append(IDM_INSERTBLR, _("Insert &blr"))->Enable(Core::IsRunning());
- menu->Append(IDM_INSERTNOP, _("Insert &nop"))->Enable(Core::IsRunning());
- menu->Append(IDM_PATCHALERT, _("Patch alert"))->Enable(Core::IsRunning());
- PopupMenu(menu);
+ menu.Append(IDM_RENAMESYMBOL, _("Rename &symbol"))->Enable(isSymbol);
+ menu.AppendSeparator();
+ menu.Append(IDM_RUNTOHERE, _("&Run To Here"))->Enable(Core::IsRunning());
+ menu.Append(IDM_ADDFUNCTION, _("&Add function"))->Enable(Core::IsRunning());
+ menu.Append(IDM_JITRESULTS, _("PPC vs X86"))->Enable(Core::IsRunning());
+ menu.Append(IDM_INSERTBLR, _("Insert &blr"))->Enable(Core::IsRunning());
+ menu.Append(IDM_INSERTNOP, _("Insert &nop"))->Enable(Core::IsRunning());
+ menu.Append(IDM_PATCHALERT, _("Patch alert"))->Enable(Core::IsRunning());
+ PopupMenu(&menu);
event.Skip();
}
diff --git a/Source/Core/DolphinWX/Debugger/MemoryView.cpp b/Source/Core/DolphinWX/Debugger/MemoryView.cpp
index d690f1f56d..4f87ef7763 100644
--- a/Source/Core/DolphinWX/Debugger/MemoryView.cpp
+++ b/Source/Core/DolphinWX/Debugger/MemoryView.cpp
@@ -221,22 +221,22 @@ void CMemoryView::OnPopupMenu(wxCommandEvent& event)
void CMemoryView::OnMouseDownR(wxMouseEvent& event)
{
// popup menu
- wxMenu* menu = new wxMenu;
+ wxMenu menu;
//menu.Append(IDM_GOTOINMEMVIEW, _("&Goto in mem view"));
#if wxUSE_CLIPBOARD
- menu->Append(IDM_COPYADDRESS, _("Copy &address"));
- menu->Append(IDM_COPYHEX, _("Copy &hex"));
+ menu.Append(IDM_COPYADDRESS, _("Copy &address"));
+ menu.Append(IDM_COPYHEX, _("Copy &hex"));
#endif
- menu->Append(IDM_WATCHADDRESS, _("Add to &watch"));
- menu->Append(IDM_TOGGLEMEMORY, _("Toggle &memory"));
+ menu.Append(IDM_WATCHADDRESS, _("Add to &watch"));
+ menu.Append(IDM_TOGGLEMEMORY, _("Toggle &memory"));
wxMenu* viewAsSubMenu = new wxMenu;
viewAsSubMenu->Append(IDM_VIEWASFP, _("FP value"));
viewAsSubMenu->Append(IDM_VIEWASASCII, "ASCII");
viewAsSubMenu->Append(IDM_VIEWASHEX, _("Hex"));
- menu->AppendSubMenu(viewAsSubMenu, _("View As:"));
+ menu.AppendSubMenu(viewAsSubMenu, _("View As:"));
- PopupMenu(menu);
+ PopupMenu(&menu);
}
void CMemoryView::OnPaint(wxPaintEvent& event)
diff --git a/Source/Core/DolphinWX/Debugger/RegisterView.cpp b/Source/Core/DolphinWX/Debugger/RegisterView.cpp
index ca7cdc70ec..f7a268cad0 100644
--- a/Source/Core/DolphinWX/Debugger/RegisterView.cpp
+++ b/Source/Core/DolphinWX/Debugger/RegisterView.cpp
@@ -274,10 +274,10 @@ void CRegisterView::OnMouseDownR(wxGridEvent& event)
wxString strNewVal = GetValueByRowCol(row, col);
TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress);
- wxMenu* menu = new wxMenu;
- menu->Append(IDM_WATCHADDRESS, _("Add to &watch"));
- menu->Append(IDM_VIEWMEMORY, _("View &memory"));
- PopupMenu(menu);
+ wxMenu menu;
+ menu.Append(IDM_WATCHADDRESS, _("Add to &watch"));
+ menu.Append(IDM_VIEWMEMORY, _("View &memory"));
+ PopupMenu(&menu);
}
void CRegisterView::OnPopupMenu(wxCommandEvent& event)
diff --git a/Source/Core/DolphinWX/Debugger/WatchView.cpp b/Source/Core/DolphinWX/Debugger/WatchView.cpp
index 8bf1d0b14b..13baf3660a 100644
--- a/Source/Core/DolphinWX/Debugger/WatchView.cpp
+++ b/Source/Core/DolphinWX/Debugger/WatchView.cpp
@@ -56,7 +56,7 @@ static void UpdateWatchAddr(int count, u32 value)
PowerPC::watches.Update(count - 1, value);
}
-static void SetWatchName(int count, const std::string value)
+static void SetWatchName(int count, const std::string& value)
{
if ((count - 1) < (int)PowerPC::watches.GetWatches().size())
{
@@ -247,18 +247,18 @@ void CWatchView::OnMouseDownR(wxGridEvent& event)
TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress);
}
- wxMenu* menu = new wxMenu;
+ wxMenu menu;
if (row != 0 && row != (int)(PowerPC::watches.GetWatches().size() + 1))
- menu->Append(IDM_DELETEWATCH, _("&Delete watch"));
+ menu.Append(IDM_DELETEWATCH, _("&Delete watch"));
if (row != 0 && row != (int)(PowerPC::watches.GetWatches().size() + 1) && (col == 1 || col == 2))
{
#ifdef ENABLE_MEM_CHECK
- menu->Append(IDM_ADDMEMCHECK, _("Add memory &breakpoint"));
+ menu.Append(IDM_ADDMEMCHECK, _("Add memory &breakpoint"));
#endif
- menu->Append(IDM_VIEWMEMORY, _("View &memory"));
+ menu.Append(IDM_VIEWMEMORY, _("View &memory"));
}
- PopupMenu(menu);
+ PopupMenu(&menu);
}
void CWatchView::OnPopupMenu(wxCommandEvent& event)
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index e2e0651cab..3784ae4bc9 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -748,23 +748,6 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
}
}
-void CFrame::GetRenderWindowSize(int& x, int& y, int& width, int& height)
-{
-#ifdef __WXGTK__
- if (!wxIsMainThread())
- wxMutexGuiEnter();
-#endif
- wxRect client_rect = m_RenderParent->GetClientRect();
- width = client_rect.width;
- height = client_rect.height;
- x = client_rect.x;
- y = client_rect.y;
-#ifdef __WXGTK__
- if (!wxIsMainThread())
- wxMutexGuiLeave();
-#endif
-}
-
void CFrame::OnRenderWindowSizeRequest(int width, int height)
{
if (!Core::IsRunning() ||
@@ -853,17 +836,32 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
(SConfig::GetInstance().m_ListJap &&
SConfig::GetInstance().m_ListUsa &&
SConfig::GetInstance().m_ListPal &&
+ SConfig::GetInstance().m_ListAustralia &&
SConfig::GetInstance().m_ListFrance &&
+ SConfig::GetInstance().m_ListGermany &&
SConfig::GetInstance().m_ListItaly &&
SConfig::GetInstance().m_ListKorea &&
+ SConfig::GetInstance().m_ListNetherlands &&
+ SConfig::GetInstance().m_ListRussia &&
+ SConfig::GetInstance().m_ListSpain &&
SConfig::GetInstance().m_ListTaiwan &&
SConfig::GetInstance().m_ListUnknown)))
{
- SConfig::GetInstance().m_ListGC = SConfig::GetInstance().m_ListWii =
- SConfig::GetInstance().m_ListWad = SConfig::GetInstance().m_ListJap =
- SConfig::GetInstance().m_ListUsa = SConfig::GetInstance().m_ListPal =
- SConfig::GetInstance().m_ListFrance = SConfig::GetInstance().m_ListItaly =
- SConfig::GetInstance().m_ListKorea = SConfig::GetInstance().m_ListTaiwan =
+ SConfig::GetInstance().m_ListGC =
+ SConfig::GetInstance().m_ListWii =
+ SConfig::GetInstance().m_ListWad =
+ SConfig::GetInstance().m_ListJap =
+ SConfig::GetInstance().m_ListUsa =
+ SConfig::GetInstance().m_ListPal =
+ SConfig::GetInstance().m_ListAustralia =
+ SConfig::GetInstance().m_ListFrance =
+ SConfig::GetInstance().m_ListGermany =
+ SConfig::GetInstance().m_ListItaly =
+ SConfig::GetInstance().m_ListKorea =
+ SConfig::GetInstance().m_ListNetherlands =
+ SConfig::GetInstance().m_ListRussia =
+ SConfig::GetInstance().m_ListSpain =
+ SConfig::GetInstance().m_ListTaiwan =
SConfig::GetInstance().m_ListUnknown = true;
GetMenuBar()->FindItem(IDM_LISTGC)->Check(true);
@@ -872,9 +870,14 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
GetMenuBar()->FindItem(IDM_LISTJAP)->Check(true);
GetMenuBar()->FindItem(IDM_LISTUSA)->Check(true);
GetMenuBar()->FindItem(IDM_LISTPAL)->Check(true);
+ GetMenuBar()->FindItem(IDM_LISTAUSTRALIA)->Check(true);
GetMenuBar()->FindItem(IDM_LISTFRANCE)->Check(true);
+ GetMenuBar()->FindItem(IDM_LISTGERMANY)->Check(true);
GetMenuBar()->FindItem(IDM_LISTITALY)->Check(true);
GetMenuBar()->FindItem(IDM_LISTKOREA)->Check(true);
+ GetMenuBar()->FindItem(IDM_LISTNETHERLANDS)->Check(true);
+ GetMenuBar()->FindItem(IDM_LISTRUSSIA)->Check(true);
+ GetMenuBar()->FindItem(IDM_LISTSPAIN)->Check(true);
GetMenuBar()->FindItem(IDM_LISTTAIWAN)->Check(true);
GetMenuBar()->FindItem(IDM_LIST_UNK)->Check(true);
@@ -972,6 +975,17 @@ int GetCmdForHotkey(unsigned int key)
case HK_SELECT_STATE_SLOT_10: return IDM_SELECTSLOT10;
case HK_SAVE_STATE_SLOT_SELECTED: return IDM_SAVESELECTEDSLOT;
case HK_LOAD_STATE_SLOT_SELECTED: return IDM_LOADSELECTEDSLOT;
+
+ case HK_FREELOOK_INCREASE_SPEED: return IDM_FREELOOK_INCREASE_SPEED;
+ case HK_FREELOOK_DECREASE_SPEED: return IDM_FREELOOK_DECREASE_SPEED;
+ case HK_FREELOOK_RESET_SPEED: return IDM_FREELOOK_RESET_SPEED;
+ case HK_FREELOOK_LEFT: return IDM_FREELOOK_LEFT;
+ case HK_FREELOOK_RIGHT: return IDM_FREELOOK_RIGHT;
+ case HK_FREELOOK_UP: return IDM_FREELOOK_UP;
+ case HK_FREELOOK_DOWN: return IDM_FREELOOK_DOWN;
+ case HK_FREELOOK_ZOOM_IN: return IDM_FREELOOK_ZOOM_IN;
+ case HK_FREELOOK_ZOOM_OUT: return IDM_FREELOOK_ZOOM_OUT;
+ case HK_FREELOOK_RESET: return IDM_FREELOOK_RESET;
}
return -1;
@@ -1165,41 +1179,30 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
ConnectWiimote(WiimoteId, connect);
}
- if (g_Config.bFreeLook && event.GetModifiers() == wxMOD_SHIFT)
+ if (g_Config.bFreeLook)
{
static float debugSpeed = 1.0f;
- switch (event.GetKeyCode())
- {
- case '9':
- debugSpeed /= 2.0f;
- break;
- case '0':
+
+ if (IsHotkey(event, HK_FREELOOK_INCREASE_SPEED))
debugSpeed *= 2.0f;
- break;
- case 'W':
- VertexShaderManager::TranslateView(0.0f, debugSpeed);
- break;
- case 'S':
- VertexShaderManager::TranslateView(0.0f, -debugSpeed);
- break;
- case 'A':
- VertexShaderManager::TranslateView(debugSpeed, 0.0f);
- break;
- case 'D':
- VertexShaderManager::TranslateView(-debugSpeed, 0.0f);
- break;
- case 'Q':
- VertexShaderManager::TranslateView(0.0f, 0.0f, debugSpeed);
- break;
- case 'E':
+ else if (IsHotkey(event, HK_FREELOOK_DECREASE_SPEED))
+ debugSpeed /= 2.0f;
+ else if (IsHotkey(event, HK_FREELOOK_RESET_SPEED))
+ debugSpeed = 1.0f;
+ else if (IsHotkey(event, HK_FREELOOK_UP))
VertexShaderManager::TranslateView(0.0f, 0.0f, -debugSpeed);
- break;
- case 'R':
+ else if (IsHotkey(event, HK_FREELOOK_DOWN))
+ VertexShaderManager::TranslateView(0.0f, 0.0f, debugSpeed);
+ else if (IsHotkey(event, HK_FREELOOK_LEFT))
+ VertexShaderManager::TranslateView(debugSpeed, 0.0f);
+ else if (IsHotkey(event, HK_FREELOOK_RIGHT))
+ VertexShaderManager::TranslateView(-debugSpeed, 0.0f);
+ else if (IsHotkey(event, HK_FREELOOK_ZOOM_IN))
+ VertexShaderManager::TranslateView(0.0f, debugSpeed);
+ else if (IsHotkey(event, HK_FREELOOK_ZOOM_OUT))
+ VertexShaderManager::TranslateView(0.0f, -debugSpeed);
+ else if (IsHotkey(event, HK_FREELOOK_RESET))
VertexShaderManager::ResetView();
- break;
- default:
- break;
- }
}
}
else
diff --git a/Source/Core/DolphinWX/Frame.h b/Source/Core/DolphinWX/Frame.h
index e54acf8dc6..91486f53cc 100644
--- a/Source/Core/DolphinWX/Frame.h
+++ b/Source/Core/DolphinWX/Frame.h
@@ -113,7 +113,6 @@ public:
void PostEvent(wxCommandEvent& event);
void StatusBarMessage(const char * Text, ...);
void ClearStatusBar();
- void GetRenderWindowSize(int& x, int& y, int& width, int& height);
void OnRenderWindowSizeRequest(int width, int height);
void BootGame(const std::string& filename);
void OnRenderParentClose(wxCloseEvent& event);
diff --git a/Source/Core/DolphinWX/FrameAui.cpp b/Source/Core/DolphinWX/FrameAui.cpp
index 43e3f86043..ab95432bd8 100644
--- a/Source/Core/DolphinWX/FrameAui.cpp
+++ b/Source/Core/DolphinWX/FrameAui.cpp
@@ -333,21 +333,21 @@ void CFrame::OnTab(wxAuiNotebookEvent& event)
if (!g_pCodeWindow) return;
// Create the popup menu
- wxMenu* MenuPopup = new wxMenu;
+ wxMenu MenuPopup;
- wxMenuItem* Item = new wxMenuItem(MenuPopup, wxID_ANY, _("Select floating windows"));
- MenuPopup->Append(Item);
+ wxMenuItem* Item = new wxMenuItem(&MenuPopup, wxID_ANY, _("Select floating windows"));
+ MenuPopup.Append(Item);
Item->Enable(false);
- MenuPopup->Append(new wxMenuItem(MenuPopup));
+ MenuPopup.Append(new wxMenuItem(&MenuPopup));
for (int i = IDM_LOGWINDOW; i <= IDM_CODEWINDOW; i++)
{
wxWindow *Win = FindWindowById(i);
if (Win && Win->IsEnabled())
{
- Item = new wxMenuItem(MenuPopup, i + IDM_FLOAT_LOGWINDOW - IDM_LOGWINDOW,
+ Item = new wxMenuItem(&MenuPopup, i + IDM_FLOAT_LOGWINDOW - IDM_LOGWINDOW,
Win->GetName(), "", wxITEM_CHECK);
- MenuPopup->Append(Item);
+ MenuPopup.Append(Item);
Item->Check(!!FindWindowById(i + IDM_LOGWINDOW_PARENT - IDM_LOGWINDOW));
}
}
@@ -357,7 +357,7 @@ void CFrame::OnTab(wxAuiNotebookEvent& event)
Pt = ScreenToClient(Pt);
// Show
- PopupMenu(MenuPopup, Pt);
+ PopupMenu(&MenuPopup, Pt);
}
void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event)
@@ -930,11 +930,11 @@ wxFrame* CFrame::CreateParentFrame(wxWindowID Id, const wxString& Title, wxWindo
wxAuiNotebook* CFrame::CreateEmptyNotebook()
{
const long NOTEBOOK_STYLE = wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT |
+ wxAUI_NB_TAB_MOVE |
wxAUI_NB_TAB_EXTERNAL_MOVE | wxAUI_NB_SCROLL_BUTTONS |
wxAUI_NB_WINDOWLIST_BUTTON | wxNO_BORDER;
- wxAuiNotebook* NB = new wxAuiNotebook(this, wxID_ANY,
- wxDefaultPosition, wxDefaultSize, NOTEBOOK_STYLE);
- return NB;
+
+ return new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, NOTEBOOK_STYLE);
}
void CFrame::AddRemoveBlankPage()
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index dc129c693e..b9aa252275 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -328,16 +328,29 @@ wxMenuBar* CFrame::CreateMenu()
regionMenu->AppendCheckItem(IDM_LISTUSA, _("Show USA"));
regionMenu->Check(IDM_LISTUSA, SConfig::GetInstance().m_ListUsa);
regionMenu->AppendSeparator();
+ regionMenu->AppendCheckItem(IDM_LISTAUSTRALIA, _("Show Australia"));
+ regionMenu->Check(IDM_LISTAUSTRALIA, SConfig::GetInstance().m_ListAustralia);
regionMenu->AppendCheckItem(IDM_LISTFRANCE, _("Show France"));
regionMenu->Check(IDM_LISTFRANCE, SConfig::GetInstance().m_ListFrance);
+ regionMenu->AppendCheckItem(IDM_LISTGERMANY, _("Show Germany"));
+ regionMenu->Check(IDM_LISTGERMANY, SConfig::GetInstance().m_ListGermany);
+ regionMenu->AppendCheckItem(IDM_LISTINTERNATIONAL, _("Show International"));
+ regionMenu->Check(IDM_LISTINTERNATIONAL, SConfig::GetInstance().m_ListInternational);
regionMenu->AppendCheckItem(IDM_LISTITALY, _("Show Italy"));
regionMenu->Check(IDM_LISTITALY, SConfig::GetInstance().m_ListItaly);
regionMenu->AppendCheckItem(IDM_LISTKOREA, _("Show Korea"));
regionMenu->Check(IDM_LISTKOREA, SConfig::GetInstance().m_ListKorea);
+ regionMenu->AppendCheckItem(IDM_LISTNETHERLANDS, _("Show Netherlands"));
+ regionMenu->Check(IDM_LISTNETHERLANDS, SConfig::GetInstance().m_ListNetherlands);
+ regionMenu->AppendCheckItem(IDM_LISTRUSSIA, _("Show Russia"));
+ regionMenu->Check(IDM_LISTRUSSIA, SConfig::GetInstance().m_ListRussia);
+ regionMenu->AppendCheckItem(IDM_LISTSPAIN, _("Show Spain"));
+ regionMenu->Check(IDM_LISTSPAIN, SConfig::GetInstance().m_ListSpain);
regionMenu->AppendCheckItem(IDM_LISTTAIWAN, _("Show Taiwan"));
regionMenu->Check(IDM_LISTTAIWAN, SConfig::GetInstance().m_ListTaiwan);
- regionMenu->AppendCheckItem(IDM_LIST_UNK, _("Show unknown"));
+ regionMenu->AppendCheckItem(IDM_LIST_UNK, _("Show Unknown"));
regionMenu->Check(IDM_LIST_UNK, SConfig::GetInstance().m_ListUnknown);
+
viewMenu->AppendCheckItem(IDM_LISTDRIVES, _("Show Drives"));
viewMenu->Check(IDM_LISTDRIVES, SConfig::GetInstance().m_ListDrives);
viewMenu->Append(IDM_PURGECACHE, _("Purge Cache"));
@@ -1771,7 +1784,8 @@ void CFrame::UpdateGUI()
{
if (GetCmdForHotkey(i) == -1)
continue;
- GetMenuBar()->FindItem(GetCmdForHotkey(i))->SetItemLabel(GetMenuLabel(i));
+ if (GetMenuBar()->FindItem(GetCmdForHotkey(i)))
+ GetMenuBar()->FindItem(GetCmdForHotkey(i))->SetItemLabel(GetMenuLabel(i));
}
GetMenuBar()->FindItem(IDM_LOADSTATE)->Enable(Initialized);
@@ -1935,15 +1949,30 @@ void CFrame::GameListChanged(wxCommandEvent& event)
case IDM_LISTUSA:
SConfig::GetInstance().m_ListUsa = event.IsChecked();
break;
+ case IDM_LISTAUSTRALIA:
+ SConfig::GetInstance().m_ListAustralia = event.IsChecked();
+ break;
case IDM_LISTFRANCE:
SConfig::GetInstance().m_ListFrance = event.IsChecked();
break;
+ case IDM_LISTGERMANY:
+ SConfig::GetInstance().m_ListGermany = event.IsChecked();
+ break;
case IDM_LISTITALY:
SConfig::GetInstance().m_ListItaly = event.IsChecked();
break;
case IDM_LISTKOREA:
SConfig::GetInstance().m_ListKorea = event.IsChecked();
break;
+ case IDM_LISTNETHERLANDS:
+ SConfig::GetInstance().m_ListNetherlands = event.IsChecked();
+ break;
+ case IDM_LISTRUSSIA:
+ SConfig::GetInstance().m_ListRussia = event.IsChecked();
+ break;
+ case IDM_LISTSPAIN:
+ SConfig::GetInstance().m_ListSpain = event.IsChecked();
+ break;
case IDM_LISTTAIWAN:
SConfig::GetInstance().m_ListTaiwan = event.IsChecked();
break;
diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp
index 7d7a6d6b4b..ede17e799f 100644
--- a/Source/Core/DolphinWX/GameListCtrl.cpp
+++ b/Source/Core/DolphinWX/GameListCtrl.cpp
@@ -72,8 +72,9 @@
#include "DolphinWX/resources/Flag_Italy.xpm"
#include "DolphinWX/resources/Flag_Japan.xpm"
#include "DolphinWX/resources/Flag_Korea.xpm"
+#include "DolphinWX/resources/Flag_Netherlands.xpm"
#include "DolphinWX/resources/Flag_Russia.xpm"
-#include "DolphinWX/resources/Flag_SDK.xpm"
+#include "DolphinWX/resources/Flag_Spain.xpm"
#include "DolphinWX/resources/Flag_Taiwan.xpm"
#include "DolphinWX/resources/Flag_Unknown.xpm"
#include "DolphinWX/resources/Flag_USA.xpm"
@@ -223,18 +224,20 @@ void CGameListCtrl::InitBitmaps()
SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL);
m_FlagImageIndex.resize(DiscIO::IVolume::NUMBER_OF_COUNTRIES);
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_EUROPE] = m_imageListSmall->Add(wxBitmap(Flag_Europe_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_GERMANY] = m_imageListSmall->Add(wxBitmap(Flag_Germany_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_FRANCE] = m_imageListSmall->Add(wxBitmap(Flag_France_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_USA] = m_imageListSmall->Add(wxBitmap(Flag_USA_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_JAPAN] = m_imageListSmall->Add(wxBitmap(Flag_Japan_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_KOREA] = m_imageListSmall->Add(wxBitmap(Flag_Korea_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_ITALY] = m_imageListSmall->Add(wxBitmap(Flag_Italy_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_TAIWAN] = m_imageListSmall->Add(wxBitmap(Flag_Taiwan_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_RUSSIA] = m_imageListSmall->Add(wxBitmap(Flag_Russia_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_AUSTRALIA] = m_imageListSmall->Add(wxBitmap(Flag_Australia_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_SDK] = m_imageListSmall->Add(wxBitmap(Flag_SDK_xpm));
- m_FlagImageIndex[DiscIO::IVolume::COUNTRY_UNKNOWN] = m_imageListSmall->Add(wxBitmap(Flag_Unknown_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_JAPAN] = m_imageListSmall->Add(wxBitmap(Flag_Japan_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_EUROPE] = m_imageListSmall->Add(wxBitmap(Flag_Europe_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_USA] = m_imageListSmall->Add(wxBitmap(Flag_USA_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_AUSTRALIA] = m_imageListSmall->Add(wxBitmap(Flag_Australia_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_FRANCE] = m_imageListSmall->Add(wxBitmap(Flag_France_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_GERMANY] = m_imageListSmall->Add(wxBitmap(Flag_Germany_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_INTERNATIONAL] = m_imageListSmall->Add(wxBitmap(Flag_Europe_xpm)); // Uses European flag as a placeholder
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_ITALY] = m_imageListSmall->Add(wxBitmap(Flag_Italy_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_KOREA] = m_imageListSmall->Add(wxBitmap(Flag_Korea_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_NETHERLANDS] = m_imageListSmall->Add(wxBitmap(Flag_Netherlands_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_RUSSIA] = m_imageListSmall->Add(wxBitmap(Flag_Russia_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_SPAIN] = m_imageListSmall->Add(wxBitmap(Flag_Spain_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_TAIWAN] = m_imageListSmall->Add(wxBitmap(Flag_Taiwan_xpm));
+ m_FlagImageIndex[DiscIO::IVolume::COUNTRY_UNKNOWN] = m_imageListSmall->Add(wxBitmap(Flag_Unknown_xpm));
m_PlatformImageIndex.resize(3);
m_PlatformImageIndex[0] = m_imageListSmall->Add(wxBitmap(Platform_Gamecube_xpm));
@@ -307,8 +310,8 @@ void CGameListCtrl::Update()
InsertColumn(COLUMN_TITLE, _("Title"));
// Instead of showing the notes + the company, which is unknown with
- // wii titles We show in the same column : company for GC games and
- // description for wii/wad games
+ // Wii titles We show in the same column : company for GC games and
+ // description for Wii/wad games
InsertColumn(COLUMN_NOTES, _("Notes"));
InsertColumn(COLUMN_ID, _("ID"));
InsertColumn(COLUMN_COUNTRY, "");
@@ -448,14 +451,13 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
std::string line;
if (!std::getline(titlestxt, line) && titlestxt.eof())
- break;
+ break;
if (line.substr(0,rISOFile.GetUniqueID().size()) == rISOFile.GetUniqueID())
{
name = line.substr(rISOFile.GetUniqueID().size() + 3);
break;
}
-
}
titlestxt.close();
}
@@ -626,6 +628,22 @@ void CGameListCtrl::ScanForISOs()
switch(iso_file->GetCountry())
{
+ case DiscIO::IVolume::COUNTRY_AUSTRALIA:
+ if (!SConfig::GetInstance().m_ListAustralia)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_GERMANY:
+ if (!SConfig::GetInstance().m_ListGermany)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_RUSSIA:
+ if (!SConfig::GetInstance().m_ListRussia)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_UNKNOWN:
+ if (!SConfig::GetInstance().m_ListUnknown)
+ list = false;
+ break;
case DiscIO::IVolume::COUNTRY_TAIWAN:
if (!SConfig::GetInstance().m_ListTaiwan)
list = false;
@@ -650,6 +668,14 @@ void CGameListCtrl::ScanForISOs()
if (!SConfig::GetInstance().m_ListItaly)
list = false;
break;
+ case DiscIO::IVolume::COUNTRY_SPAIN:
+ if (!SConfig::GetInstance().m_ListSpain)
+ list = false;
+ break;
+ case DiscIO::IVolume::COUNTRY_NETHERLANDS:
+ if (!SConfig::GetInstance().m_ListNetherlands)
+ list = false;
+ break;
default:
if (!SConfig::GetInstance().m_ListPal)
list = false;
@@ -684,7 +710,7 @@ void CGameListCtrl::OnColBeginDrag(wxListEvent& event)
event.Veto();
}
-const GameListItem *CGameListCtrl::GetISO(size_t index) const
+const GameListItem* CGameListCtrl::GetISO(size_t index) const
{
if (index < m_ISOFiles.size())
return m_ISOFiles[index];
@@ -692,14 +718,14 @@ const GameListItem *CGameListCtrl::GetISO(size_t index) const
return nullptr;
}
-static CGameListCtrl *caller;
+static CGameListCtrl* caller;
static int wxCALLBACK wxListCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData)
{
// return 1 if item1 > item2
// return -1 if item1 < item2
// return 0 for identity
- const GameListItem *iso1 = caller->GetISO(item1);
- const GameListItem *iso2 = caller->GetISO(item2);
+ const GameListItem* iso1 = caller->GetISO(item1);
+ const GameListItem* iso2 = caller->GetISO(item2);
return CompareGameListItems(iso1, iso2, sortData);
}
@@ -900,60 +926,60 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
}
if (GetSelectedItemCount() == 1)
{
- const GameListItem *selected_iso = GetSelectedISO();
+ const GameListItem* selected_iso = GetSelectedISO();
if (selected_iso)
{
- wxMenu* popupMenu = new wxMenu;
- popupMenu->Append(IDM_PROPERTIES, _("&Properties"));
- popupMenu->Append(IDM_GAMEWIKI, _("&Wiki"));
- popupMenu->AppendSeparator();
+ wxMenu popupMenu;
+ popupMenu.Append(IDM_PROPERTIES, _("&Properties"));
+ popupMenu.Append(IDM_GAMEWIKI, _("&Wiki"));
+ popupMenu.AppendSeparator();
if (selected_iso->GetPlatform() != GameListItem::GAMECUBE_DISC)
{
- popupMenu->Append(IDM_OPENSAVEFOLDER, _("Open Wii &save folder"));
- popupMenu->Append(IDM_EXPORTSAVE, _("Export Wii save (Experimental)"));
+ popupMenu.Append(IDM_OPENSAVEFOLDER, _("Open Wii &save folder"));
+ popupMenu.Append(IDM_EXPORTSAVE, _("Export Wii save (Experimental)"));
}
- popupMenu->Append(IDM_OPENCONTAININGFOLDER, _("Open &containing folder"));
- popupMenu->AppendCheckItem(IDM_SETDEFAULTISO, _("Set as &default ISO"));
+ popupMenu.Append(IDM_OPENCONTAININGFOLDER, _("Open &containing folder"));
+ popupMenu.AppendCheckItem(IDM_SETDEFAULTISO, _("Set as &default ISO"));
// First we have to decide a starting value when we append it
if (selected_iso->GetFileName() == SConfig::GetInstance().
m_LocalCoreStartupParameter.m_strDefaultISO)
- popupMenu->FindItem(IDM_SETDEFAULTISO)->Check();
+ popupMenu.FindItem(IDM_SETDEFAULTISO)->Check();
- popupMenu->AppendSeparator();
- popupMenu->Append(IDM_DELETEISO, _("&Delete ISO..."));
+ popupMenu.AppendSeparator();
+ popupMenu.Append(IDM_DELETEISO, _("&Delete ISO..."));
if (selected_iso->GetPlatform() != GameListItem::WII_WAD)
{
if (selected_iso->IsCompressed())
- popupMenu->Append(IDM_COMPRESSISO, _("Decompress ISO..."));
+ popupMenu.Append(IDM_COMPRESSISO, _("Decompress ISO..."));
else if (selected_iso->GetFileName().substr(selected_iso->GetFileName().find_last_of(".")) != ".ciso" &&
selected_iso->GetFileName().substr(selected_iso->GetFileName().find_last_of(".")) != ".wbfs")
- popupMenu->Append(IDM_COMPRESSISO, _("Compress ISO..."));
+ popupMenu.Append(IDM_COMPRESSISO, _("Compress ISO..."));
}
else
{
- popupMenu->Append(IDM_LIST_INSTALLWAD, _("Install to Wii Menu"));
+ popupMenu.Append(IDM_LIST_INSTALLWAD, _("Install to Wii Menu"));
}
if (selected_iso->GetPlatform() == GameListItem::GAMECUBE_DISC ||
selected_iso->GetPlatform() == GameListItem::WII_DISC)
{
- wxMenuItem* changeDiscItem = popupMenu->Append(IDM_LIST_CHANGEDISC, _("Change &Disc"));
+ wxMenuItem* changeDiscItem = popupMenu.Append(IDM_LIST_CHANGEDISC, _("Change &Disc"));
changeDiscItem->Enable(Core::IsRunning());
}
- PopupMenu(popupMenu);
+ PopupMenu(&popupMenu);
}
}
else if (GetSelectedItemCount() > 1)
{
- wxMenu* popupMenu = new wxMenu;
- popupMenu->Append(IDM_DELETEISO, _("&Delete selected ISOs..."));
- popupMenu->AppendSeparator();
- popupMenu->Append(IDM_MULTICOMPRESSISO, _("Compress selected ISOs..."));
- popupMenu->Append(IDM_MULTIDECOMPRESSISO, _("Decompress selected ISOs..."));
- PopupMenu(popupMenu);
+ wxMenu popupMenu;
+ popupMenu.Append(IDM_DELETEISO, _("&Delete selected ISOs..."));
+ popupMenu.AppendSeparator();
+ popupMenu.Append(IDM_MULTICOMPRESSISO, _("Compress selected ISOs..."));
+ popupMenu.Append(IDM_MULTIDECOMPRESSISO, _("Decompress selected ISOs..."));
+ PopupMenu(&popupMenu);
}
}
@@ -990,7 +1016,7 @@ const GameListItem * CGameListCtrl::GetSelectedISO()
void CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event))
{
- const GameListItem *iso = GetSelectedISO();
+ const GameListItem* iso = GetSelectedISO();
if (!iso)
return;
@@ -1001,7 +1027,7 @@ void CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event))
void CGameListCtrl::OnOpenSaveFolder(wxCommandEvent& WXUNUSED (event))
{
- const GameListItem *iso = GetSelectedISO();
+ const GameListItem* iso = GetSelectedISO();
if (!iso)
return;
std::string path = iso->GetWiiFSPath();
@@ -1011,7 +1037,7 @@ void CGameListCtrl::OnOpenSaveFolder(wxCommandEvent& WXUNUSED (event))
void CGameListCtrl::OnExportSave(wxCommandEvent& WXUNUSED (event))
{
- const GameListItem *iso = GetSelectedISO();
+ const GameListItem* iso = GetSelectedISO();
if (!iso)
return;
@@ -1027,7 +1053,7 @@ void CGameListCtrl::OnExportSave(wxCommandEvent& WXUNUSED (event))
// Save this file as the default file
void CGameListCtrl::OnSetDefaultISO(wxCommandEvent& event)
{
- const GameListItem *iso = GetSelectedISO();
+ const GameListItem* iso = GetSelectedISO();
if (!iso) return;
if (event.IsChecked())
@@ -1049,7 +1075,7 @@ void CGameListCtrl::OnDeleteISO(wxCommandEvent& WXUNUSED (event))
{
if (GetSelectedItemCount() == 1)
{
- const GameListItem *iso = GetSelectedISO();
+ const GameListItem* iso = GetSelectedISO();
if (!iso)
return;
if (wxMessageBox(_("Are you sure you want to delete this file? It will be gone forever!"),
@@ -1068,7 +1094,7 @@ void CGameListCtrl::OnDeleteISO(wxCommandEvent& WXUNUSED (event))
for (int i = 0; i < selected; i++)
{
- const GameListItem *iso = GetSelectedISO();
+ const GameListItem* iso = GetSelectedISO();
File::Delete(iso->GetFileName());
}
Update();
@@ -1078,7 +1104,7 @@ void CGameListCtrl::OnDeleteISO(wxCommandEvent& WXUNUSED (event))
void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event))
{
- const GameListItem *iso = GetSelectedISO();
+ const GameListItem* iso = GetSelectedISO();
if (!iso)
return;
@@ -1089,7 +1115,7 @@ void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event))
void CGameListCtrl::OnWiki(wxCommandEvent& WXUNUSED (event))
{
- const GameListItem *iso = GetSelectedISO();
+ const GameListItem* iso = GetSelectedISO();
if (!iso)
return;
@@ -1130,23 +1156,23 @@ void CGameListCtrl::CompressSelection(bool _compress)
bool all_good = true;
{
- wxProgressDialog progressDialog(
- _compress ? _("Compressing ISO") : _("Decompressing ISO"),
- _("Working..."),
- 1000,
- this,
- wxPD_APP_MODAL |
- wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME |
- wxPD_SMOOTH
- );
+ wxProgressDialog progressDialog(
+ _compress ? _("Compressing ISO") : _("Decompressing ISO"),
+ _("Working..."),
+ 1000,
+ this,
+ wxPD_APP_MODAL |
+ wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME |
+ wxPD_SMOOTH
+ );
- m_currentItem = 0;
- m_numberItem = GetSelectedItemCount();
- for (u32 i=0; i < m_numberItem; i++)
- {
- const GameListItem *iso = GetSelectedISO();
- if (iso->GetPlatform() == GameListItem::WII_WAD || iso->GetFileName().rfind(".wbfs") != std::string::npos)
- continue;
+ m_currentItem = 0;
+ m_numberItem = GetSelectedItemCount();
+ for (u32 i=0; i < m_numberItem; i++)
+ {
+ const GameListItem* iso = GetSelectedISO();
+ if (iso->GetPlatform() == GameListItem::WII_WAD || iso->GetFileName().rfind(".wbfs") != std::string::npos)
+ continue;
if (!iso->IsCompressed() && _compress)
{
@@ -1200,7 +1226,7 @@ void CGameListCtrl::CompressSelection(bool _compress)
OutputFileName.c_str(), &MultiCompressCB, &progressDialog);
}
m_currentItem++;
- }
+ }
}
if (!all_good)
@@ -1217,7 +1243,7 @@ void CGameListCtrl::CompressCB(const std::string& text, float percent, void* arg
void CGameListCtrl::OnCompressISO(wxCommandEvent& WXUNUSED (event))
{
- const GameListItem *iso = GetSelectedISO();
+ const GameListItem* iso = GetSelectedISO();
if (!iso)
return;
@@ -1297,7 +1323,7 @@ void CGameListCtrl::OnCompressISO(wxCommandEvent& WXUNUSED (event))
void CGameListCtrl::OnChangeDisc(wxCommandEvent& WXUNUSED(event))
{
- const GameListItem *iso = GetSelectedISO();
+ const GameListItem* iso = GetSelectedISO();
if (!iso || !Core::IsRunning())
return;
DVDInterface::ChangeDisc(WxStrToStr(iso->GetFileName()));
@@ -1324,7 +1350,6 @@ void CGameListCtrl::AutomaticColumnWidth()
}
else if (GetColumnCount() > 0)
{
-
int resizable = rc.GetWidth() - (
GetColumnWidth(COLUMN_PLATFORM)
+ GetColumnWidth(COLUMN_BANNER)
diff --git a/Source/Core/DolphinWX/Globals.h b/Source/Core/DolphinWX/Globals.h
index 26a8157098..edbd89bf6a 100644
--- a/Source/Core/DolphinWX/Globals.h
+++ b/Source/Core/DolphinWX/Globals.h
@@ -127,9 +127,15 @@ enum
IDM_LISTJAP,
IDM_LISTPAL,
IDM_LISTUSA,
+ IDM_LISTAUSTRALIA,
IDM_LISTFRANCE,
+ IDM_LISTGERMANY,
+ IDM_LISTINTERNATIONAL,
IDM_LISTITALY,
IDM_LISTKOREA,
+ IDM_LISTNETHERLANDS,
+ IDM_LISTRUSSIA,
+ IDM_LISTSPAIN,
IDM_LISTTAIWAN,
IDM_LIST_UNK,
IDM_LISTDRIVES,
@@ -280,6 +286,17 @@ enum
IDM_MPANEL, ID_STATUSBAR,
+ IDM_FREELOOK_INCREASE_SPEED,
+ IDM_FREELOOK_DECREASE_SPEED,
+ IDM_FREELOOK_RESET_SPEED,
+ IDM_FREELOOK_UP,
+ IDM_FREELOOK_DOWN,
+ IDM_FREELOOK_LEFT,
+ IDM_FREELOOK_RIGHT,
+ IDM_FREELOOK_ZOOM_IN,
+ IDM_FREELOOK_ZOOM_OUT,
+ IDM_FREELOOK_RESET,
+
ID_TOOLBAR = 500,
};
diff --git a/Source/Core/DolphinWX/HotkeyDlg.cpp b/Source/Core/DolphinWX/HotkeyDlg.cpp
index 790503299b..2be49b904d 100644
--- a/Source/Core/DolphinWX/HotkeyDlg.cpp
+++ b/Source/Core/DolphinWX/HotkeyDlg.cpp
@@ -227,6 +227,17 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls()
_("Increase Frame limit"),
_("Decrease Frame limit"),
+ _("Freelook Increase Speed"),
+ _("Freelook Decrease Speed"),
+ _("Freelook Reset Speed"),
+ _("Freelook Move Up"),
+ _("Freelook Move Down"),
+ _("Freelook Move Left"),
+ _("Freelook Move Right"),
+ _("Freelook Zoom In"),
+ _("Freelook Zoom Out"),
+ _("Freelook Reset"),
+
_("Load State Slot 1"),
_("Load State Slot 2"),
_("Load State Slot 3"),
diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp
index 5bbfaa7f40..41345ccdcb 100644
--- a/Source/Core/DolphinWX/ISOFile.cpp
+++ b/Source/Core/DolphinWX/ISOFile.cpp
@@ -5,13 +5,16 @@
#include
#include
#include
+#include
#include
#include
+#include
#include
#include
#include
#include
#include
+#include
#include "Common/ChunkFile.h"
#include "Common/CommonPaths.h"
@@ -34,7 +37,7 @@
#include "DolphinWX/ISOFile.h"
#include "DolphinWX/WxUtils.h"
-static const u32 CACHE_REVISION = 0x115;
+static const u32 CACHE_REVISION = 0x117;
#define DVD_BANNER_WIDTH 96
#define DVD_BANNER_HEIGHT 32
@@ -62,9 +65,7 @@ GameListItem::GameListItem(const std::string& _rFileName)
if (!DiscIO::IsVolumeWadFile(pVolume))
m_Platform = DiscIO::IsVolumeWiiDisc(pVolume) ? WII_DISC : GAMECUBE_DISC;
else
- {
m_Platform = WII_WAD;
- }
m_volume_names = pVolume->GetNames();
@@ -82,30 +83,26 @@ GameListItem::GameListItem(const std::string& _rFileName)
if (pFileSystem != nullptr || m_Platform == WII_WAD)
{
- DiscIO::IBannerLoader* pBannerLoader = DiscIO::CreateBannerLoader(*pFileSystem, pVolume);
+ std::unique_ptr pBannerLoader(DiscIO::CreateBannerLoader(*pFileSystem, pVolume));
- if (pBannerLoader != nullptr)
+ if (pBannerLoader != nullptr && pBannerLoader->IsValid())
{
- if (pBannerLoader->IsValid())
+ if (m_Platform != WII_WAD)
+ m_banner_names = pBannerLoader->GetNames();
+ m_company = pBannerLoader->GetCompany();
+ m_descriptions = pBannerLoader->GetDescriptions();
+
+ std::vector Buffer = pBannerLoader->GetBanner(&m_ImageWidth, &m_ImageHeight);
+ u32* pData = &Buffer[0];
+ // resize vector to image size
+ m_pImage.resize(m_ImageWidth * m_ImageHeight * 3);
+
+ for (int i = 0; i < m_ImageWidth * m_ImageHeight; i++)
{
- if (m_Platform != WII_WAD)
- m_banner_names = pBannerLoader->GetNames();
- m_company = pBannerLoader->GetCompany();
- m_descriptions = pBannerLoader->GetDescriptions();
-
- std::vector Buffer = pBannerLoader->GetBanner(&m_ImageWidth, &m_ImageHeight);
- u32* pData = &Buffer[0];
- // resize vector to image size
- m_pImage.resize(m_ImageWidth * m_ImageHeight * 3);
-
- for (int i = 0; i < m_ImageWidth * m_ImageHeight; i++)
- {
- m_pImage[i * 3 + 0] = (pData[i] & 0xFF0000) >> 16;
- m_pImage[i * 3 + 1] = (pData[i] & 0x00FF00) >> 8;
- m_pImage[i * 3 + 2] = (pData[i] & 0x0000FF) >> 0;
- }
+ m_pImage[i * 3 + 0] = (pData[i] & 0xFF0000) >> 16;
+ m_pImage[i * 3 + 1] = (pData[i] & 0x00FF00) >> 8;
+ m_pImage[i * 3 + 2] = (pData[i] & 0x0000FF) >> 0;
}
- delete pBannerLoader;
}
delete pFileSystem;
@@ -136,7 +133,7 @@ GameListItem::GameListItem(const std::string& _rFileName)
if (!m_pImage.empty())
{
wxImage Image(m_ImageWidth, m_ImageHeight, &m_pImage[0], true);
- double Scale = WxUtils::GetCurrentBitmapLogicalScale();
+ double Scale = wxTheApp->GetTopWindow()->GetContentScaleFactor();
// Note: This uses nearest neighbor, which subjectively looks a lot
// better for GC banners than smooths caling.
Image.Rescale(DVD_BANNER_WIDTH * Scale, DVD_BANNER_HEIGHT * Scale);
@@ -165,9 +162,7 @@ bool GameListItem::LoadFromCache()
void GameListItem::SaveToCache()
{
if (!File::IsDirectory(File::GetUserPath(D_CACHE_IDX)))
- {
File::CreateDir(File::GetUserPath(D_CACHE_IDX));
- }
CChunkFileReader::Save(CreateCacheFilename(), CACHE_REVISION, *this);
}
diff --git a/Source/Core/DolphinWX/ISOProperties.cpp b/Source/Core/DolphinWX/ISOProperties.cpp
index e2df94075b..691c0a8e5e 100644
--- a/Source/Core/DolphinWX/ISOProperties.cpp
+++ b/Source/Core/DolphinWX/ISOProperties.cpp
@@ -196,18 +196,33 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
m_GameID->SetValue(StrToWxStr(OpenISO->GetUniqueID()));
switch (OpenISO->GetCountry())
{
+ case DiscIO::IVolume::COUNTRY_AUSTRALIA:
+ m_Country->SetValue(_("AUSTRALIA"));
+ break;
case DiscIO::IVolume::COUNTRY_EUROPE:
m_Country->SetValue(_("EUROPE"));
break;
case DiscIO::IVolume::COUNTRY_FRANCE:
m_Country->SetValue(_("FRANCE"));
break;
+ case DiscIO::IVolume::COUNTRY_INTERNATIONAL:
+ m_Country->SetValue(_("INTERNATIONAL"));
+ break;
case DiscIO::IVolume::COUNTRY_ITALY:
m_Country->SetValue(_("ITALY"));
break;
+ case DiscIO::IVolume::COUNTRY_GERMANY:
+ m_Country->SetValue(_("GERMANY"));
+ break;
+ case DiscIO::IVolume::COUNTRY_NETHERLANDS:
+ m_Country->SetValue(_("NETHERLANDS"));
+ break;
case DiscIO::IVolume::COUNTRY_RUSSIA:
m_Country->SetValue(_("RUSSIA"));
break;
+ case DiscIO::IVolume::COUNTRY_SPAIN:
+ m_Country->SetValue(_("SPAIN"));
+ break;
case DiscIO::IVolume::COUNTRY_USA:
m_Country->SetValue(_("USA"));
if (!IsWad) // For (non wad) NTSC Games, there's no multi lang
@@ -238,15 +253,13 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
m_Lang->Disable();
}
break;
- case DiscIO::IVolume::COUNTRY_SDK:
- m_Country->SetValue(_("No Country (SDK)"));
- break;
+ case DiscIO::IVolume::COUNTRY_UNKNOWN:
default:
m_Country->SetValue(_("UNKNOWN"));
break;
}
- if (IsWiiDisc) // Only one language with wii banners
+ if (IsWiiDisc) // Only one language with Wii banners
{
m_Lang->SetSelection(0);
m_Lang->Disable();
@@ -402,6 +415,16 @@ void CISOProperties::CreateGUIControls(bool IsWad)
BlockMerging = new wxCheckBox(m_GameConfig, ID_MERGEBLOCKS, _("Enable Block Merging"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "BlockMerging"));
DSPHLE = new wxCheckBox(m_GameConfig, ID_AUDIO_DSP_HLE, _("DSP HLE emulation (fast)"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "DSPHLE"));
+ wxBoxSizer* const sGPUDeterminism = new wxBoxSizer(wxHORIZONTAL);
+ wxStaticText* const GPUDeterminismText = new wxStaticText(m_GameConfig, wxID_ANY, _("Deterministic dual core: "));
+ arrayStringFor_GPUDeterminism.Add(_("Not Set"));
+ arrayStringFor_GPUDeterminism.Add(_("auto"));
+ arrayStringFor_GPUDeterminism.Add(_("none"));
+ arrayStringFor_GPUDeterminism.Add(_("fake-completion"));
+ GPUDeterminism = new wxChoice(m_GameConfig, ID_EMUSTATE, wxDefaultPosition, wxDefaultSize, arrayStringFor_GPUDeterminism);
+ sGPUDeterminism->Add(GPUDeterminismText);
+ sGPUDeterminism->Add(GPUDeterminism);
+
// Wii Console
EnableWideScreen = new wxCheckBox(m_GameConfig, ID_ENABLEWIDESCREEN, _("Enable WideScreen"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Wii", "Widescreen"));
@@ -430,6 +453,7 @@ void CISOProperties::CreateGUIControls(bool IsWad)
sbCoreOverrides->Add(FastDiscSpeed, 0, wxLEFT, 5);
sbCoreOverrides->Add(BlockMerging, 0, wxLEFT, 5);
sbCoreOverrides->Add(DSPHLE, 0, wxLEFT, 5);
+ sbCoreOverrides->Add(sGPUDeterminism, 0, wxEXPAND|wxALL, 5);
wxStaticBoxSizer * const sbWiiOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Wii Console"));
if (!DiscIO::IsVolumeWiiDisc(OpenISO) && !DiscIO::IsVolumeWadFile(OpenISO))
@@ -645,9 +669,9 @@ void CISOProperties::OnCloseClick(wxCommandEvent& WXUNUSED (event))
void CISOProperties::RightClickOnBanner(wxMouseEvent& event)
{
- wxMenu* popupMenu = new wxMenu;
- popupMenu->Append(IDM_BNRSAVEAS, _("Save as..."));
- PopupMenu(popupMenu);
+ wxMenu popupMenu;
+ popupMenu.Append(IDM_BNRSAVEAS, _("Save as..."));
+ PopupMenu(&popupMenu);
event.Skip();
}
@@ -668,41 +692,41 @@ void CISOProperties::OnRightClickOnTree(wxTreeEvent& event)
{
m_Treectrl->SelectItem(event.GetItem());
- wxMenu* popupMenu = new wxMenu;
+ wxMenu popupMenu;
if (m_Treectrl->GetItemImage(m_Treectrl->GetSelection()) == 0 &&
m_Treectrl->GetFirstVisibleItem() != m_Treectrl->GetSelection())
{
- popupMenu->Append(IDM_EXTRACTDIR, _("Extract Partition..."));
+ popupMenu.Append(IDM_EXTRACTDIR, _("Extract Partition..."));
}
else if (m_Treectrl->GetItemImage(m_Treectrl->GetSelection()) == 1)
{
- popupMenu->Append(IDM_EXTRACTDIR, _("Extract Directory..."));
+ popupMenu.Append(IDM_EXTRACTDIR, _("Extract Directory..."));
}
else if (m_Treectrl->GetItemImage(m_Treectrl->GetSelection()) == 2)
{
- popupMenu->Append(IDM_EXTRACTFILE, _("Extract File..."));
+ popupMenu.Append(IDM_EXTRACTFILE, _("Extract File..."));
}
- popupMenu->Append(IDM_EXTRACTALL, _("Extract All Files..."));
+ popupMenu.Append(IDM_EXTRACTALL, _("Extract All Files..."));
if (!DiscIO::IsVolumeWiiDisc(OpenISO) ||
(m_Treectrl->GetItemImage(m_Treectrl->GetSelection()) == 0 &&
m_Treectrl->GetFirstVisibleItem() != m_Treectrl->GetSelection()))
{
- popupMenu->AppendSeparator();
- popupMenu->Append(IDM_EXTRACTAPPLOADER, _("Extract Apploader..."));
- popupMenu->Append(IDM_EXTRACTDOL, _("Extract DOL..."));
+ popupMenu.AppendSeparator();
+ popupMenu.Append(IDM_EXTRACTAPPLOADER, _("Extract Apploader..."));
+ popupMenu.Append(IDM_EXTRACTDOL, _("Extract DOL..."));
}
if (m_Treectrl->GetItemImage(m_Treectrl->GetSelection()) == 0 &&
m_Treectrl->GetFirstVisibleItem() != m_Treectrl->GetSelection())
{
- popupMenu->AppendSeparator();
- popupMenu->Append(IDM_CHECKINTEGRITY, _("Check Partition Integrity"));
+ popupMenu.AppendSeparator();
+ popupMenu.Append(IDM_CHECKINTEGRITY, _("Check Partition Integrity"));
}
- PopupMenu(popupMenu);
+ PopupMenu(&popupMenu);
event.Skip();
}
@@ -1049,6 +1073,19 @@ void CISOProperties::LoadGameConfig()
EmuIssues->Enable(EmuState->GetSelection() != 0);
+ sTemp = "";
+ if (!GameIniLocal.GetIfExists("Core", "GPUDeterminismMode", &sTemp))
+ GameIniDefault.GetIfExists("Core", "GPUDeterminismMode", &sTemp);
+
+ if (sTemp == "")
+ GPUDeterminism->SetSelection(0);
+ else if (sTemp == "auto")
+ GPUDeterminism->SetSelection(1);
+ else if (sTemp == "none")
+ GPUDeterminism->SetSelection(2);
+ else if (sTemp == "fake-completion")
+ GPUDeterminism->SetSelection(3);
+
PatchList_Load();
ActionReplayList_Load();
m_geckocode_panel->LoadCodes(GameIniDefault, GameIniLocal, OpenISO->GetUniqueID());
@@ -1114,6 +1151,18 @@ bool CISOProperties::SaveGameConfig()
std::string emu_issues = EmuIssues->GetValue().ToStdString();
SAVE_IF_NOT_DEFAULT("EmuState", "EmulationIssues", emu_issues, "");
+ std::string tmp;
+ if (GPUDeterminism->GetSelection() == 0)
+ tmp = "Not Set";
+ else if (GPUDeterminism->GetSelection() == 1)
+ tmp = "auto";
+ else if (GPUDeterminism->GetSelection() == 2)
+ tmp = "none";
+ else if (GPUDeterminism->GetSelection() == 3)
+ tmp = "fake-completion";
+
+ SAVE_IF_NOT_DEFAULT("Core", "GPUDeterminismMode", tmp, "Not Set");
+
PatchList_Save();
ActionReplayList_Save();
Gecko::SaveCodes(GameIniLocal, m_geckocode_panel->GetCodes());
@@ -1328,7 +1377,7 @@ void CISOProperties::PatchButtonClicked(wxCommandEvent& event)
break;
case ID_REMOVEPATCH:
onFrame.erase(onFrame.begin() + Patches->GetSelection());
- Patches->Delete(Cheats->GetSelection());
+ Patches->Delete(Patches->GetSelection());
break;
}
diff --git a/Source/Core/DolphinWX/ISOProperties.h b/Source/Core/DolphinWX/ISOProperties.h
index acc7692a68..b77bb55115 100644
--- a/Source/Core/DolphinWX/ISOProperties.h
+++ b/Source/Core/DolphinWX/ISOProperties.h
@@ -69,46 +69,49 @@ private:
// Core
wxCheckBox *CPUThread, *SkipIdle, *MMU, *BAT, *DCBZOFF, *FPRF;
wxCheckBox *VBeam, *SyncGPU, *FastDiscSpeed, *BlockMerging, *DSPHLE;
+
+ wxArrayString arrayStringFor_GPUDeterminism;
+ wxChoice* GPUDeterminism;
// Wii
- wxCheckBox *EnableWideScreen;
+ wxCheckBox* EnableWideScreen;
wxArrayString arrayStringFor_EmuState;
- wxChoice *EmuState;
- wxTextCtrl *EmuIssues;
+ wxChoice* EmuState;
+ wxTextCtrl* EmuIssues;
wxArrayString arrayStringFor_Patches;
- wxCheckListBox *Patches;
- wxButton *EditPatch;
- wxButton *RemovePatch;
+ wxCheckListBox* Patches;
+ wxButton* EditPatch;
+ wxButton* RemovePatch;
wxArrayString arrayStringFor_Cheats;
- wxCheckListBox *Cheats;
- wxButton *EditCheat;
- wxButton *RemoveCheat;
+ wxCheckListBox* Cheats;
+ wxButton* EditCheat;
+ wxButton* RemoveCheat;
wxArrayString arrayStringFor_Speedhacks;
- wxCheckListBox *Speedhacks;
- wxButton *EditSpeedhack;
- wxButton *AddSpeedhack;
- wxButton *RemoveSpeedhack;
+ wxCheckListBox* Speedhacks;
+ wxButton* EditSpeedhack;
+ wxButton* AddSpeedhack;
+ wxButton* RemoveSpeedhack;
- wxTextCtrl *m_Name;
- wxTextCtrl *m_GameID;
- wxTextCtrl *m_Country;
- wxTextCtrl *m_MakerID;
- wxTextCtrl *m_Revision;
- wxTextCtrl *m_Date;
- wxTextCtrl *m_FST;
- wxTextCtrl *m_MD5Sum;
- wxButton *m_MD5SumCompute;
+ wxTextCtrl* m_Name;
+ wxTextCtrl* m_GameID;
+ wxTextCtrl* m_Country;
+ wxTextCtrl* m_MakerID;
+ wxTextCtrl* m_Revision;
+ wxTextCtrl* m_Date;
+ wxTextCtrl* m_FST;
+ wxTextCtrl* m_MD5Sum;
+ wxButton* m_MD5SumCompute;
wxArrayString arrayStringFor_Lang;
- wxChoice *m_Lang;
- wxTextCtrl *m_ShortName;
- wxTextCtrl *m_Maker;
- wxTextCtrl *m_Comment;
- wxStaticBitmap *m_Banner;
+ wxChoice* m_Lang;
+ wxTextCtrl* m_ShortName;
+ wxTextCtrl* m_Maker;
+ wxTextCtrl* m_Comment;
+ wxStaticBitmap* m_Banner;
- wxTreeCtrl *m_Treectrl;
+ wxTreeCtrl* m_Treectrl;
wxTreeItemId RootId;
- Gecko::CodeConfigPanel *m_geckocode_panel;
+ Gecko::CodeConfigPanel* m_geckocode_panel;
enum
{
@@ -193,10 +196,10 @@ private:
void SetRefresh(wxCommandEvent& event);
void OnChangeBannerLang(wxCommandEvent& event);
- GameListItem *OpenGameListItem;
+ GameListItem* OpenGameListItem;
- std::vector GCFiles;
- typedef std::vector::iterator fileIter;
+ std::vector GCFiles;
+ typedef std::vector::iterator fileIter;
size_t CreateDirectoryTree(wxTreeItemId& parent,
std::vector fileInfos,
diff --git a/Source/Core/DolphinWX/InputConfigDiag.cpp b/Source/Core/DolphinWX/InputConfigDiag.cpp
index d4ec43641e..745417845e 100644
--- a/Source/Core/DolphinWX/InputConfigDiag.cpp
+++ b/Source/Core/DolphinWX/InputConfigDiag.cpp
@@ -128,7 +128,7 @@ void PadSettingSpin::UpdateGUI()
void PadSettingSpin::UpdateValue()
{
- setting->SetValue(float(((wxSpinCtrl*)wxcontrol)->GetValue()) / 100);
+ setting->SetValue(ControlState(((wxSpinCtrl*)wxcontrol)->GetValue()) / 100);
}
ControlDialog::ControlDialog(GamepadPage* const parent, InputConfig& config, ControllerInterface::ControlReference* const ref)
@@ -490,7 +490,7 @@ void GamepadPage::ClearControl(wxEvent& event)
{
ControlButton* const btn = (ControlButton*)event.GetEventObject();
btn->control_reference->expression.clear();
- btn->control_reference->range = 1.0f;
+ btn->control_reference->range = 1.0;
std::lock_guard lk(m_config.controls_lock);
controller->UpdateReferences(g_controller_interface);
diff --git a/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp b/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp
index 6f6278d83e..4b838a8ab6 100644
--- a/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp
+++ b/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp
@@ -163,7 +163,7 @@ static void DrawControlGroupBox(wxDC &dc, ControlGroupBox *g)
}
// adjusted dot
- if (x != 0 && y != 0)
+ if (x != 0 || y != 0)
{
dc.SetPen(*wxRED_PEN);
dc.SetBrush(*wxRED_BRUSH);
diff --git a/Source/Core/DolphinWX/LogWindow.cpp b/Source/Core/DolphinWX/LogWindow.cpp
index 501b18cc3a..4771c1d594 100644
--- a/Source/Core/DolphinWX/LogWindow.cpp
+++ b/Source/Core/DolphinWX/LogWindow.cpp
@@ -49,12 +49,13 @@ CLogWindow::CLogWindow(CFrame *parent, wxWindowID id, const wxPoint& pos,
, m_Log(nullptr), m_cmdline(nullptr), m_FontChoice(nullptr)
{
Bind(wxEVT_CLOSE_WINDOW, &CLogWindow::OnClose, this);
+ Bind(wxEVT_TIMER, &CLogWindow::OnLogTimer, this);
+
m_LogManager = LogManager::GetInstance();
CreateGUIControls();
m_LogTimer = new wxTimer(this);
- m_LogTimer->Bind(wxEVT_TIMER, &CLogWindow::OnLogTimer, this);
m_LogTimer->Start(UPDATETIME);
}
diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp
index 5212887ae0..28be496fc2 100644
--- a/Source/Core/DolphinWX/Main.cpp
+++ b/Source/Core/DolphinWX/Main.cpp
@@ -167,7 +167,7 @@ bool DolphinApp::OnInit()
},
{
wxCMD_LINE_OPTION, "e", "exec",
- "Loads the specified file (DOL,ELF,GCM,ISO,WAD)",
+ "Loads the specified file (ELF, DOL, GCM, ISO, WBFS, CISO, GCZ, WAD)",
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{
@@ -396,7 +396,7 @@ void DolphinApp::InitLanguageSupport()
void DolphinApp::OnEndSession(wxCloseEvent& event)
{
- // Close if we've recieved wxEVT_END_SESSION (ignore wxEVT_QUERY_END_SESSION)
+ // Close if we've received wxEVT_END_SESSION (ignore wxEVT_QUERY_END_SESSION)
if (!event.CanVeto())
{
main_frame->Close(true);
@@ -464,7 +464,7 @@ void* Host_GetRenderHandle()
return main_frame->GetRenderHandle();
}
-// OK, this thread boundary is DANGEROUS on linux
+// OK, this thread boundary is DANGEROUS on Linux
// wxPostEvent / wxAddPendingEvent is the solution.
void Host_NotifyMapLoaded()
{
@@ -506,11 +506,6 @@ void Host_UpdateTitle(const std::string& title)
main_frame->GetEventHandler()->AddPendingEvent(event);
}
-void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
-{
- main_frame->GetRenderWindowSize(x, y, width, height);
-}
-
void Host_RequestRenderWindowSize(int width, int height)
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_WINDOWSIZEREQUEST);
diff --git a/Source/Core/DolphinWX/MainAndroid.cpp b/Source/Core/DolphinWX/MainAndroid.cpp
index 2189fae5db..273b0c4664 100644
--- a/Source/Core/DolphinWX/MainAndroid.cpp
+++ b/Source/Core/DolphinWX/MainAndroid.cpp
@@ -48,7 +48,6 @@
#include "VideoCommon/VideoBackendBase.h"
ANativeWindow* surf;
-int g_width, g_height;
std::string g_filename;
#define DOLPHIN_TAG "Dolphinemu"
@@ -77,14 +76,6 @@ void Host_UpdateMainFrame()
{
}
-void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
-{
- x = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos;
- y = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowYPos;
- width = g_width;
- height = g_height;
-}
-
void Host_RequestRenderWindowSize(int width, int height) {}
void Host_RequestFullscreen(bool enable_fullscreen) {}
@@ -311,11 +302,6 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetFilename(
{
g_filename = GetJString(env, jFile);
}
-JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetDimensions(JNIEnv *env, jobject obj, jint _width, jint _height)
-{
- g_width = (int)_width;
- g_height = (int)_height;
-}
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JNIEnv *env, jobject obj, jint slot)
{
@@ -348,6 +334,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CreateUserFo
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj, jobject _surf)
{
surf = ANativeWindow_fromSurface(env, _surf);
+
// Install our callbacks
OSD::AddCallback(OSD::OSD_INIT, ButtonManager::Init);
OSD::AddCallback(OSD::OSD_SHUTDOWN, ButtonManager::Shutdown);
diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinWX/MainNoGUI.cpp
index 5049351bba..0b8f4b1099 100644
--- a/Source/Core/DolphinWX/MainNoGUI.cpp
+++ b/Source/Core/DolphinWX/MainNoGUI.cpp
@@ -72,14 +72,6 @@ void Host_UpdateMainFrame()
updateMainFrameEvent.Set();
}
-void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
-{
- x = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos;
- y = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowYPos;
- width = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth;
- height = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight;
-}
-
void Host_RequestRenderWindowSize(int width, int height) {}
void Host_RequestFullscreen(bool enable_fullscreen) {}
diff --git a/Source/Core/DolphinWX/MemcardManager.cpp b/Source/Core/DolphinWX/MemcardManager.cpp
index 1d222cd9dd..9dbbd7143d 100644
--- a/Source/Core/DolphinWX/MemcardManager.cpp
+++ b/Source/Core/DolphinWX/MemcardManager.cpp
@@ -807,7 +807,7 @@ void CMemcardManager::CMemcardListCtrl::OnRightClick(wxMouseEvent& event)
int flags;
long item = HitTest(event.GetPosition(), flags);
- wxMenu* popupMenu = new wxMenu;
+ wxMenu popupMenu;
if (item != wxNOT_FOUND)
{
@@ -818,41 +818,41 @@ void CMemcardManager::CMemcardListCtrl::OnRightClick(wxMouseEvent& event)
SetItemState(item, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
int slot = GetId() - ID_MEMCARDLIST_A;
- popupMenu->Append(ID_COPYFROM_A + slot, wxString::Format(_("Copy to Memcard %c"), 'B' - slot));
- popupMenu->Append(ID_DELETE_A + slot, _("Delete Save"));
- popupMenu->Append(ID_SAVEIMPORT_A + slot, _("Import Save"));
- popupMenu->Append(ID_SAVEEXPORT_A + slot, _("Export Save"));
- popupMenu->Append(ID_EXPORTALL_A + slot, _("Export all saves"));
+ popupMenu.Append(ID_COPYFROM_A + slot, wxString::Format(_("Copy to Memcard %c"), 'B' - slot));
+ popupMenu.Append(ID_DELETE_A + slot, _("Delete Save"));
+ popupMenu.Append(ID_SAVEIMPORT_A + slot, _("Import Save"));
+ popupMenu.Append(ID_SAVEEXPORT_A + slot, _("Export Save"));
+ popupMenu.Append(ID_EXPORTALL_A + slot, _("Export all saves"));
- popupMenu->FindItem(ID_COPYFROM_A + slot)->Enable(__mcmSettings.twoCardsLoaded);
+ popupMenu.FindItem(ID_COPYFROM_A + slot)->Enable(__mcmSettings.twoCardsLoaded);
- popupMenu->AppendSeparator();
+ popupMenu.AppendSeparator();
- popupMenu->Append(ID_FIXCHECKSUM_A + slot, _("Fix Checksums"));
- popupMenu->Append(ID_PREVPAGE_A + slot, _("Previous Page"));
- popupMenu->Append(ID_NEXTPAGE_A + slot, _("Next Page"));
- popupMenu->Append(ID_MEMCARDPATH_A + slot, wxString::Format(_("Set as default Memcard %c"), 'A' + slot));
- popupMenu->AppendCheckItem(ID_USEPAGES, _("Enable pages"));
+ popupMenu.Append(ID_FIXCHECKSUM_A + slot, _("Fix Checksums"));
+ popupMenu.Append(ID_PREVPAGE_A + slot, _("Previous Page"));
+ popupMenu.Append(ID_NEXTPAGE_A + slot, _("Next Page"));
+ popupMenu.Append(ID_MEMCARDPATH_A + slot, wxString::Format(_("Set as default Memcard %c"), 'A' + slot));
+ popupMenu.AppendCheckItem(ID_USEPAGES, _("Enable pages"));
- popupMenu->FindItem(ID_PREVPAGE_A + slot)->Enable(prevPage && __mcmSettings.usePages);
- popupMenu->FindItem(ID_NEXTPAGE_A + slot)->Enable(nextPage && __mcmSettings.usePages);
- popupMenu->FindItem(ID_USEPAGES)->Check(__mcmSettings.usePages);
+ popupMenu.FindItem(ID_PREVPAGE_A + slot)->Enable(prevPage && __mcmSettings.usePages);
+ popupMenu.FindItem(ID_NEXTPAGE_A + slot)->Enable(nextPage && __mcmSettings.usePages);
+ popupMenu.FindItem(ID_USEPAGES)->Check(__mcmSettings.usePages);
- popupMenu->AppendSeparator();
+ popupMenu.AppendSeparator();
// popupMenu->AppendCheckItem(COLUMN_BANNER, _("Show save banner"));
- popupMenu->AppendCheckItem(COLUMN_TITLE, _("Show save title"));
- popupMenu->AppendCheckItem(COLUMN_COMMENT, _("Show save comment"));
- popupMenu->AppendCheckItem(COLUMN_ICON, _("Show save icon"));
- popupMenu->AppendCheckItem(COLUMN_BLOCKS, _("Show save blocks"));
- popupMenu->AppendCheckItem(COLUMN_FIRSTBLOCK, _("Show first block"));
+ popupMenu.AppendCheckItem(COLUMN_TITLE, _("Show save title"));
+ popupMenu.AppendCheckItem(COLUMN_COMMENT, _("Show save comment"));
+ popupMenu.AppendCheckItem(COLUMN_ICON, _("Show save icon"));
+ popupMenu.AppendCheckItem(COLUMN_BLOCKS, _("Show save blocks"));
+ popupMenu.AppendCheckItem(COLUMN_FIRSTBLOCK, _("Show first block"));
// for (int i = COLUMN_BANNER; i <= COLUMN_FIRSTBLOCK; i++)
for (int i = COLUMN_TITLE; i <= COLUMN_FIRSTBLOCK; i++)
{
- popupMenu->FindItem(i)->Check(__mcmSettings.column[i]);
+ popupMenu.FindItem(i)->Check(__mcmSettings.column[i]);
}
}
- PopupMenu(popupMenu);
+ PopupMenu(&popupMenu);
}
diff --git a/Source/Core/DolphinWX/NetWindow.cpp b/Source/Core/DolphinWX/NetWindow.cpp
index e925b19dc5..7e8f08e507 100644
--- a/Source/Core/DolphinWX/NetWindow.cpp
+++ b/Source/Core/DolphinWX/NetWindow.cpp
@@ -123,7 +123,6 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl*
wxStaticText* const alert_lbl = new wxStaticText(connect_tab, wxID_ANY,
_("ALERT:\n\n"
"Netplay will only work with the following settings:\n"
- " - Enable Dual Core [OFF]\n"
" - DSP Emulator Engine Must be the same on all computers!\n"
" - DSP on Dedicated Thread [OFF]\n"
" - Manually set the extensions for each wiimote\n"
@@ -475,7 +474,7 @@ void NetPlayDiag::StopGame()
// NetPlayUI methods called from ---NETPLAY--- thread
void NetPlayDiag::Update()
{
- wxCommandEvent evt(wxEVT_THREAD, 1);
+ wxThreadEvent evt(wxEVT_THREAD, 1);
GetEventHandler()->AddPendingEvent(evt);
}
@@ -488,15 +487,14 @@ void NetPlayDiag::AppendChat(const std::string& msg)
void NetPlayDiag::OnMsgChangeGame(const std::string& filename)
{
- wxCommandEvent evt(wxEVT_THREAD, NP_GUI_EVT_CHANGE_GAME);
- // TODO: using a wxString in AddPendingEvent from another thread is unsafe i guess?
- evt.SetString(StrToWxStr(filename));
- GetEventHandler()->AddPendingEvent(evt);
+ wxThreadEvent* evt = new wxThreadEvent(wxEVT_THREAD, NP_GUI_EVT_CHANGE_GAME);
+ evt->SetString(StrToWxStr(filename));
+ GetEventHandler()->QueueEvent(evt);
}
void NetPlayDiag::OnMsgStartGame()
{
- wxCommandEvent evt(wxEVT_THREAD, NP_GUI_EVT_START_GAME);
+ wxThreadEvent evt(wxEVT_THREAD, NP_GUI_EVT_START_GAME);
GetEventHandler()->AddPendingEvent(evt);
if (m_start_btn)
m_start_btn->Disable();
@@ -505,7 +503,7 @@ void NetPlayDiag::OnMsgStartGame()
void NetPlayDiag::OnMsgStopGame()
{
- wxCommandEvent evt(wxEVT_THREAD, NP_GUI_EVT_STOP_GAME);
+ wxThreadEvent evt(wxEVT_THREAD, NP_GUI_EVT_STOP_GAME);
GetEventHandler()->AddPendingEvent(evt);
if (m_start_btn)
m_start_btn->Enable();
diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp
index bbf1eae04c..454fbb5cd5 100644
--- a/Source/Core/DolphinWX/VideoConfigDiag.cpp
+++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp
@@ -144,7 +144,7 @@ static wxString dump_efb_desc = wxTRANSLATE("Dump the contents of EFB copies to
#if !defined WIN32 && defined HAVE_LIBAV
static wxString use_ffv1_desc = wxTRANSLATE("Encode frame dumps using the FFV1 codec.\n\nIf unsure, leave this unchecked.");
#endif
-static wxString free_look_desc = wxTRANSLATE("This feature allows you to change the game's camera.\nMove the mouse while holding the right mouse button to pan and while holding the middle button to move.\nHold SHIFT and press one of the WASD keys to move the camera by a certain step distance (SHIFT+0 to move faster and SHIFT+9 to move slower). Press SHIFT+R to reset the camera.\n\nIf unsure, leave this unchecked.");
+static wxString free_look_desc = wxTRANSLATE("This feature allows you to change the game's camera.\nMove the mouse while holding the right mouse button to pan and while holding the middle button to move.\nHold SHIFT and press one of the WASD keys to move the camera by a certain step distance (SHIFT+2 to move faster and SHIFT+1 to move slower). Press SHIFT+R to reset the camera and SHIFT+F to reset the speed.\n\nIf unsure, leave this unchecked.");
static wxString crop_desc = wxTRANSLATE("Crop the picture from 4:3 to 5:4 or from 16:9 to 16:10.\n\nIf unsure, leave this unchecked.");
static wxString ppshader_desc = wxTRANSLATE("Apply a post-processing effect after finishing a frame.\n\nIf unsure, select (off).");
static wxString cache_efb_copies_desc = wxTRANSLATE("Slightly speeds up EFB to RAM copies by sacrificing emulation accuracy.\nSometimes also increases visual quality.\nIf you're experiencing any issues, try raising texture cache accuracy or disable this option.\n\nIf unsure, leave this unchecked.");
diff --git a/Source/Core/DolphinWX/WxUtils.cpp b/Source/Core/DolphinWX/WxUtils.cpp
index 3a2f2674ac..1926a5e016 100644
--- a/Source/Core/DolphinWX/WxUtils.cpp
+++ b/Source/Core/DolphinWX/WxUtils.cpp
@@ -58,18 +58,6 @@ void ShowErrorDialog(const wxString& error_msg)
wxMessageBox(error_msg, _("Error"), wxOK | wxICON_ERROR);
}
-double GetCurrentBitmapLogicalScale()
-{
-#ifdef __APPLE__
- // wx doesn't expose this itself, unfortunately.
- if ([[NSScreen mainScreen] respondsToSelector:@selector(backingScaleFactor)])
- {
- return [[NSScreen mainScreen] backingScaleFactor];
- }
-#endif
- return 1.0;
-}
-
wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length)
{
wxMemoryInputStream is(data, length);
diff --git a/Source/Core/DolphinWX/WxUtils.h b/Source/Core/DolphinWX/WxUtils.h
index 6338b0051b..09da7bfed8 100644
--- a/Source/Core/DolphinWX/WxUtils.h
+++ b/Source/Core/DolphinWX/WxUtils.h
@@ -25,8 +25,6 @@ void Explore(const std::string& path);
// Displays a wxMessageBox geared for errors
void ShowErrorDialog(const wxString& error_msg);
-double GetCurrentBitmapLogicalScale();
-
wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length);
// From a wxBitmap, creates the corresponding disabled version for toolbar buttons
diff --git a/Source/Core/DolphinWX/resources/Flag_Netherlands.xpm b/Source/Core/DolphinWX/resources/Flag_Netherlands.xpm
new file mode 100644
index 0000000000..c02e098412
--- /dev/null
+++ b/Source/Core/DolphinWX/resources/Flag_Netherlands.xpm
@@ -0,0 +1,43 @@
+/* XPM */
+static const char * Flag_Netherlands_xpm[] = {
+"96 32 8 1",
+" c None",
+". c #000000",
+"+ c #AE1C28",
+"@ c #C3565F",
+"# c #FFFFFF",
+"$ c #526EA5",
+"% c #1F448A",
+"& c #21468B",
+" ",
+" ",
+" ",
+" ",
+"................................ ",
+".++++++++++++++++++++++++++++++. ",
+".++++++++++++++++++++++++++++++. ",
+".++++++++++++++++++++++++++++++. ",
+".++++++++++++++++++++++++++++++. ",
+".++++++++++++++++++++++++++++++. ",
+".++++++++++++++++++++++++++++++. ",
+".@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. ",
+".##############################. ",
+".##############################. ",
+".##############################. ",
+".##############################. ",
+".##############################. ",
+".##############################. ",
+".$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$. ",
+".%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%. ",
+".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&. ",
+".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&. ",
+".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&. ",
+".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&. ",
+".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&. ",
+"................................ ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "};
diff --git a/Source/Core/DolphinWX/resources/Flag_SDK.xpm b/Source/Core/DolphinWX/resources/Flag_Spain.xpm
similarity index 58%
rename from Source/Core/DolphinWX/resources/Flag_SDK.xpm
rename to Source/Core/DolphinWX/resources/Flag_Spain.xpm
index 169caacdcc..09d1cffb4b 100644
--- a/Source/Core/DolphinWX/resources/Flag_SDK.xpm
+++ b/Source/Core/DolphinWX/resources/Flag_Spain.xpm
@@ -1,85 +1,65 @@
/* XPM */
-static const char * Flag_SDK_xpm[] = {
-"96 32 79 1",
+static const char * Flag_Spain_xpm[] = {
+"96 32 59 1",
" c None",
". c #000000",
-"+ c #FFFFFF",
-"@ c #E9E9FE",
-"# c #5959FE",
-"$ c #1515FE",
-"% c #0505FE",
-"& c #1313FE",
-"* c #3232FE",
-"= c #0000FF",
-"- c #0202FE",
-"; c #0C0CFE",
-"> c #2B2BFE",
-", c #7676FE",
-"' c #EEEEFE",
-") c #D4D4FE",
-"! c #1C1CFE",
-"~ c #0303FE",
-"{ c #9292FE",
-"] c #5151FE",
-"^ c #B1B1FE",
-"/ c #F8F8FE",
-"( c #CCCCFE",
-"_ c #E5E5FE",
-": c #9393FE",
-"< c #0A0AFE",
-"[ c #2424FE",
-"} c #EAEAFE",
-"| c #C2C2FE",
-"1 c #1010FE",
-"2 c #0D0DFE",
-"3 c #B6B6FE",
-"4 c #0F0FFE",
-"5 c #8989FE",
-"6 c #6767FE",
-"7 c #ACACFE",
-"8 c #0808FE",
-"9 c #1E1EFE",
-"0 c #D2D2FE",
-"a c #5F5FFE",
-"b c #9C9CFE",
-"c c #E8E8FE",
-"d c #DDDDFE",
-"e c #1A1AFE",
-"f c #9494FE",
-"g c #3636FE",
-"h c #E7E7FE",
-"i c #B7B7FE",
-"j c #0707FE",
-"k c #A4A4FE",
-"l c #F7F7FE",
-"m c #B0B0FE",
-"n c #FCFCFE",
-"o c #C4C4FE",
-"p c #8181FE",
-"q c #2020FE",
-"r c #1B1BFE",
-"s c #0101FE",
-"t c #0606FE",
-"u c #AEAEFE",
-"v c #E2E2FE",
-"w c #8787FE",
-"x c #0404FE",
-"y c #A2A2FE",
-"z c #3E3EFE",
-"A c #A8A8FE",
-"B c #F9F9FE",
-"C c #5656FE",
-"D c #E6E6FE",
-"E c #B4B4FE",
-"F c #0909FE",
-"G c #9696FE",
-"H c #4D4DFE",
-"I c #2222FE",
-"J c #1D1DFE",
-"K c #6969FE",
-"L c #0E0EFE",
-"M c #2D2DFE",
-"N c #7575FE",
+"+ c #C60B1E",
+"@ c #FFC400",
+"# c #E8B707",
+"$ c #E6B709",
+"% c #FAC006",
+"& c #C08113",
+"* c #B9720D",
+"= c #B9720E",
+"- c #BF8113",
+"; c #FAC005",
+"> c #D99F03",
+", c #D69A03",
+"' c #C47F08",
+") c #A37D0A",
+"! c #AB7D0A",
+"~ c #C58109",
+"{ c #DDA102",
+"] c #E3B91B",
+"^ c #DCB41F",
+"/ c #A73C12",
+"( c #A83D11",
+"_ c #B59BA2",
+": c #C5A6A9",
+"< c #DDB420",
+"[ c #DFB61E",
+"} c #CE872D",
+"| c #C67C30",
+"1 c #925318",
+"2 c #854523",
+"3 c #A17C89",
+"4 c #C6A0B1",
+"5 c #C77F2F",
+"6 c #C8822E",
+"7 c #D59433",
+"8 c #CD8D39",
+"9 c #A64D1B",
+"0 c #7C423D",
+"a c #7D4443",
+"b c #B9572A",
+"c c #CC8C39",
+"d c #D08E35",
+"e c #E3B72C",
+"f c #DDB632",
+"g c #A7560E",
+"h c #AB580D",
+"i c #B44C15",
+"j c #B34C13",
+"k c #DDB52E",
+"l c #DEB32E",
+"m c #C7AA2D",
+"n c #C6AD31",
+"o c #C4872C",
+"p c #B58955",
+"q c #B9885E",
+"r c #CF8932",
+"s c #C6AC2F",
+"t c #C4AA2E",
" ",
" ",
" ",
@@ -90,16 +70,16 @@ static const char * Flag_SDK_xpm[] = {
".++++++++++++++++++++++++++++++. ",
".++++++++++++++++++++++++++++++. ",
".++++++++++++++++++++++++++++++. ",
-".+@#$%&*+++==-;>,'+++==+++)!~{+. ",
-".+]=^/(]+++==+_:<[}++==++|123++. ",
-".+4=_++++++==+++5=6++==+7890+++. ",
-".+9=&abc+++==+++d=e++==f-gh++++. ",
-".+ie===jk++==+++l=%++====m+++++. ",
-".++nopq=!++==+++d=r++==:stu++++. ",
-".+++++v=1++==+++w=6++==+kx~y+++. ",
-".+zAcB7=C++==+D:<[}++==++EFsG++. ",
-".+HI;%JK'++==~LMN'+++==+++|4=w+. ",
-".++++++++++++++++++++++++++++++. ",
+".@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. ",
+".@@@@@@@@@#$@@@@@@@@@@@@@@@@@@@. ",
+".@@@@@@@%&*=-;@@@@@@@@@@@@@@@@@. ",
+".@@@@@@>,')!~{{@@@@@@@@@@@@@@@@. ",
+".@@@@@@]^/(_:<[@@@@@@@@@@@@@@@@. ",
+".@@@@@@}|123456@@@@@@@@@@@@@@@@. ",
+".@@@@@@7890abcd@@@@@@@@@@@@@@@@. ",
+".@@@@@@efghijkl@@@@@@@@@@@@@@@@. ",
+".@@@@@@mnopqrst@@@@@@@@@@@@@@@@. ",
+".@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. ",
".++++++++++++++++++++++++++++++. ",
".++++++++++++++++++++++++++++++. ",
".++++++++++++++++++++++++++++++. ",
diff --git a/Source/Core/InputCommon/ControllerEmu.cpp b/Source/Core/InputCommon/ControllerEmu.cpp
index f7de12c2e7..df82bc0970 100644
--- a/Source/Core/InputCommon/ControllerEmu.cpp
+++ b/Source/Core/InputCommon/ControllerEmu.cpp
@@ -155,12 +155,12 @@ ControllerEmu::AnalogStick::AnalogStick(const char* const _name, ControlState de
ControllerEmu::Buttons::Buttons(const std::string& _name) : ControlGroup(_name, GROUP_TYPE_BUTTONS)
{
- settings.emplace_back(new Setting(_trans("Threshold"), 0.5f));
+ settings.emplace_back(new Setting(_trans("Threshold"), 0.5));
}
ControllerEmu::MixedTriggers::MixedTriggers(const std::string& _name) : ControlGroup(_name, GROUP_TYPE_MIXED_TRIGGERS)
{
- settings.emplace_back(new Setting(_trans("Threshold"), 0.9f));
+ settings.emplace_back(new Setting(_trans("Threshold"), 0.9));
}
ControllerEmu::Triggers::Triggers(const std::string& _name) : ControlGroup(_name, GROUP_TYPE_TRIGGERS)
@@ -203,7 +203,7 @@ ControllerEmu::Tilt::Tilt(const std::string& _name) : ControlGroup(_name, GROUP_
settings.emplace_back(new Setting(_trans("Dead Zone"), 0, 0, 50));
settings.emplace_back(new Setting(_trans("Circle Stick"), 0));
- settings.emplace_back(new Setting(_trans("Angle"), 0.9f, 0, 180));
+ settings.emplace_back(new Setting(_trans("Angle"), 0.9, 0, 180));
}
ControllerEmu::Cursor::Cursor(const std::string& _name)
@@ -216,9 +216,9 @@ ControllerEmu::Cursor::Cursor(const std::string& _name)
controls.emplace_back(new Input("Backward"));
controls.emplace_back(new Input(_trans("Hide")));
- settings.emplace_back(new Setting(_trans("Center"), 0.5f));
- settings.emplace_back(new Setting(_trans("Width"), 0.5f));
- settings.emplace_back(new Setting(_trans("Height"), 0.5f));
+ settings.emplace_back(new Setting(_trans("Center"), 0.5));
+ settings.emplace_back(new Setting(_trans("Width"), 0.5));
+ settings.emplace_back(new Setting(_trans("Height"), 0.5));
}
diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
index ec2973f3d3..e75df76a36 100644
--- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
@@ -31,7 +31,7 @@ using namespace ciface::ExpressionParser;
namespace
{
-const float INPUT_DETECT_THRESHOLD = 0.55f;
+const ControlState INPUT_DETECT_THRESHOLD = 0.55;
}
ControllerInterface g_controller_interface;
@@ -194,7 +194,7 @@ ControlState ControllerInterface::InputReference::State( const ControlState igno
if (parsed_expression)
return parsed_expression->GetValue() * range;
else
- return 0.0f;
+ return 0.0;
}
//
@@ -208,7 +208,7 @@ ControlState ControllerInterface::OutputReference::State(const ControlState stat
{
if (parsed_expression)
parsed_expression->SetValue(state);
- return 0.0f;
+ return 0.0;
}
//
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
index d9728dcbac..05f28c79ae 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
@@ -136,7 +136,7 @@ KeyboardMouse::KeyboardMouse(const LPDIRECTINPUTDEVICE8 kb_device, const LPDIREC
AddInput(new Cursor(!!(i&2), (&m_state_in.cursor.x)[i/2], !!(i&1)));
}
-void GetMousePos(float* const x, float* const y)
+void GetMousePos(ControlState* const x, ControlState* const y)
{
POINT point = { 1, 1 };
GetCursorPos(&point);
@@ -151,8 +151,8 @@ void GetMousePos(float* const x, float* const y)
unsigned int win_height = rect.bottom - rect.top;
// Return the mouse position as a range from -1 to 1
- *x = (float)point.x / (float)win_width * 2 - 1;
- *y = (float)point.y / (float)win_height * 2 - 1;
+ *x = (ControlState)point.x / (ControlState)win_width * 2 - 1;
+ *y = (ControlState)point.y / (ControlState)win_height * 2 - 1;
}
bool KeyboardMouse::UpdateInput()
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h
index 8f7ac67452..f4ad99db2d 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h
@@ -25,7 +25,7 @@ private:
DIMOUSESTATE2 mouse;
struct
{
- float x, y;
+ ControlState x, y;
} cursor;
};
@@ -68,10 +68,10 @@ private:
public:
std::string GetName() const;
bool IsDetectable() { return false; }
- Cursor(u8 index, const float& axis, const bool positive) : m_index(index), m_axis(axis), m_positive(positive) {}
+ Cursor(u8 index, const ControlState& axis, const bool positive) : m_index(index), m_axis(axis), m_positive(positive) {}
ControlState GetState() const;
private:
- const float& m_axis;
+ const ControlState& m_axis;
const u8 m_index;
const bool m_positive;
};
diff --git a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
index e93b22826d..8c9060e69c 100644
--- a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
@@ -317,7 +317,7 @@ public:
switch (op)
{
case TOK_NOT:
- return 1.0f - value;
+ return 1.0 - value;
default:
assert(false);
return 0;
@@ -329,7 +329,7 @@ public:
switch (op)
{
case TOK_NOT:
- inner->SetValue(1.0f - value);
+ inner->SetValue(1.0 - value);
default:
assert(false);
}
diff --git a/Source/Core/VideoBackends/D3D/LineGeometryShader.cpp b/Source/Core/VideoBackends/D3D/LineGeometryShader.cpp
index 7f1040a716..fabe6ed91a 100644
--- a/Source/Core/VideoBackends/D3D/LineGeometryShader.cpp
+++ b/Source/Core/VideoBackends/D3D/LineGeometryShader.cpp
@@ -83,7 +83,7 @@ static const char LINE_GS_COMMON[] =
"#endif\n"
// Apply TexOffset to all tex coordinates in the vertex.
- // They can each be enabled seperately.
+ // They can each be enabled separately.
"#if NUM_TEXCOORDS >= 1\n"
"r0.tex0.x += Params.TexOffset * Params.TexOffsetEnable[0];\n"
"r1.tex0.x += Params.TexOffset * Params.TexOffsetEnable[0];\n"
diff --git a/Source/Core/VideoBackends/D3D/Render.h b/Source/Core/VideoBackends/D3D/Render.h
index 99e682d410..8b9fe9d87f 100644
--- a/Source/Core/VideoBackends/D3D/Render.h
+++ b/Source/Core/VideoBackends/D3D/Render.h
@@ -34,6 +34,8 @@ public:
void RenderText(const std::string& text, int left, int top, u32 color) override;
u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override;
+ u16 BBoxRead(int index) override { return 0; };
+ void BBoxWrite(int index, u16 value) override {};
void ResetAPIState() override;
void RestoreAPIState() override;
diff --git a/Source/Core/VideoBackends/D3D/main.cpp b/Source/Core/VideoBackends/D3D/main.cpp
index e78d809e1b..296936d8a7 100644
--- a/Source/Core/VideoBackends/D3D/main.cpp
+++ b/Source/Core/VideoBackends/D3D/main.cpp
@@ -77,6 +77,7 @@ void InitBackendInfo()
g_Config.backend_info.bSupportsDualSourceBlend = true;
g_Config.backend_info.bSupportsPrimitiveRestart = true;
g_Config.backend_info.bSupportsOversizedViewports = false;
+ g_Config.backend_info.bSupportsBBox = false; // TODO: not implemented
IDXGIFactory* factory;
IDXGIAdapter* ad;
diff --git a/Source/Core/VideoBackends/OGL/BoundingBox.cpp b/Source/Core/VideoBackends/OGL/BoundingBox.cpp
new file mode 100644
index 0000000000..91fedb2a2d
--- /dev/null
+++ b/Source/Core/VideoBackends/OGL/BoundingBox.cpp
@@ -0,0 +1,54 @@
+// Copyright 2014 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#include "VideoBackends/OGL/BoundingBox.h"
+#include "VideoBackends/OGL/GLUtil.h"
+
+#include "VideoCommon/VideoConfig.h"
+
+static GLuint s_bbox_buffer_id;
+
+namespace OGL
+{
+
+void BoundingBox::Init()
+{
+ if (g_ActiveConfig.backend_info.bSupportsBBox)
+ {
+ int initial_values[4] = {0,0,0,0};
+ glGenBuffers(1, &s_bbox_buffer_id);
+ glBindBuffer(GL_SHADER_STORAGE_BUFFER, s_bbox_buffer_id);
+ glBufferData(GL_SHADER_STORAGE_BUFFER, 4 * sizeof(s32), initial_values, GL_DYNAMIC_DRAW);
+ glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 3, s_bbox_buffer_id);
+ }
+}
+
+void BoundingBox::Shutdown()
+{
+ if (g_ActiveConfig.backend_info.bSupportsBBox)
+ glDeleteBuffers(1, &s_bbox_buffer_id);
+}
+
+void BoundingBox::Set(int index, int value)
+{
+ glBindBuffer(GL_SHADER_STORAGE_BUFFER, s_bbox_buffer_id);
+ glBufferSubData(GL_SHADER_STORAGE_BUFFER, index * sizeof(int), sizeof(int), &value);
+ glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
+}
+
+int BoundingBox::Get(int index)
+{
+ int data = 0;
+ glBindBuffer(GL_SHADER_STORAGE_BUFFER, s_bbox_buffer_id);
+ void* ptr = glMapBufferRange(GL_SHADER_STORAGE_BUFFER, index * sizeof(int), sizeof(int), GL_MAP_READ_BIT);
+ if (ptr)
+ {
+ data = *(int*)ptr;
+ glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
+ }
+ glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
+ return data;
+}
+
+};
diff --git a/Source/Core/VideoBackends/OGL/BoundingBox.h b/Source/Core/VideoBackends/OGL/BoundingBox.h
new file mode 100644
index 0000000000..76b86d0c4c
--- /dev/null
+++ b/Source/Core/VideoBackends/OGL/BoundingBox.h
@@ -0,0 +1,20 @@
+// Copyright 2014 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#pragma once
+
+namespace OGL
+{
+
+class BoundingBox
+{
+public:
+ static void Init();
+ static void Shutdown();
+
+ static void Set(int index, int value);
+ static int Get(int index);
+};
+
+};
diff --git a/Source/Core/VideoBackends/OGL/CMakeLists.txt b/Source/Core/VideoBackends/OGL/CMakeLists.txt
index 8233677fa9..03bbdb9b9c 100644
--- a/Source/Core/VideoBackends/OGL/CMakeLists.txt
+++ b/Source/Core/VideoBackends/OGL/CMakeLists.txt
@@ -1,4 +1,5 @@
set(SRCS GLExtensions/GLExtensions.cpp
+ BoundingBox.cpp
FramebufferManager.cpp
GLUtil.cpp
main.cpp
diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp
index f672b5ca1c..b5e45a16c0 100644
--- a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp
+++ b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp
@@ -1536,6 +1536,12 @@ const GLFunc gl_function_array[] =
GLFUNC_REQUIRES(glDrawRangeElementsBaseVertex, "GL_ARB_draw_elements_base_vertex"),
GLFUNC_REQUIRES(glMultiDrawElementsBaseVertex, "GL_ARB_draw_elements_base_vertex"),
+ // EXT_draw_elements_base_vertex
+ GLFUNC_SUFFIX(glDrawElementsBaseVertex, EXT, "GL_EXT_draw_elements_base_vertex !GL_ARB_draw_elements_base_vertex"),
+ GLFUNC_SUFFIX(glDrawElementsInstancedBaseVertex, EXT, "GL_EXT_draw_elements_base_vertex VERSION_GLES3 !GL_ARB_draw_elements_base_vertex"),
+ GLFUNC_SUFFIX(glDrawRangeElementsBaseVertex, EXT, "GL_EXT_draw_elements_base_vertex VERSION_GLES3 !GL_ARB_draw_elements_base_vertex"),
+ GLFUNC_SUFFIX(glMultiDrawElementsBaseVertex, EXT, "GL_EXT_draw_elements_base_vertex GL_EXT_multi_draw_arrays !GL_ARB_draw_elements_base_vertex"),
+
// ARB_sample_shading
GLFUNC_REQUIRES(glMinSampleShadingARB, "GL_ARB_sample_shading"),
@@ -1892,17 +1898,20 @@ namespace GLExtensions
// Grab a few functions for initial checking
// We need them to grab the extension list
// Also to check if there is an error grabbing the version
- // If it fails then the user's drivers don't support GL 3.0
if (GetFuncAddress ("glGetIntegerv", (void**)&glGetIntegerv) == nullptr)
return false;
if (GetFuncAddress("glGetString", (void**)&glGetString) == nullptr)
return false;
- if (GetFuncAddress("glGetStringi", (void**)&glGetStringi) == nullptr)
- return false;
if (GetFuncAddress("glGetError", (void**)&glGetError) == nullptr)
return false;
InitVersion();
+
+ // We need to use glGetStringi to get the extension list
+ // if we are using GLES3 or a GL version greater than 2.1
+ if (_GLVersion > 210 && GetFuncAddress("glGetStringi", (void**)&glGetStringi) == nullptr)
+ return false;
+
InitExtensionList();
return InitFunctionPointers();
diff --git a/Source/Core/VideoBackends/OGL/GLInterface/EGLAndroid.cpp b/Source/Core/VideoBackends/OGL/GLInterface/EGLAndroid.cpp
index f6c567ee6c..922bf965db 100644
--- a/Source/Core/VideoBackends/OGL/GLInterface/EGLAndroid.cpp
+++ b/Source/Core/VideoBackends/OGL/GLInterface/EGLAndroid.cpp
@@ -16,8 +16,8 @@ EGLNativeWindowType cInterfaceEGLAndroid::InitializePlatform(EGLNativeWindowType
eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &format);
ANativeWindow_setBuffersGeometry(host_window, 0, 0, format);
- int none, width, height;
- Host_GetRenderWindowSize(none, none, width, height);
+ const int width = ANativeWindow_getWidth(host_window);
+ const int height = ANativeWindow_getHeight(host_window);
GLInterface->SetBackBufferDimensions(width, height);
return host_window;
diff --git a/Source/Core/VideoBackends/OGL/OGL.vcxproj b/Source/Core/VideoBackends/OGL/OGL.vcxproj
index bda0830146..1b60169220 100644
--- a/Source/Core/VideoBackends/OGL/OGL.vcxproj
+++ b/Source/Core/VideoBackends/OGL/OGL.vcxproj
@@ -35,6 +35,7 @@
+
@@ -54,6 +55,7 @@
+
@@ -111,4 +113,4 @@
-
\ No newline at end of file
+
diff --git a/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters b/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters
index 901f30f9f6..8e65e8e2f5 100644
--- a/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters
+++ b/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters
@@ -36,6 +36,9 @@
Logging
+
+ Render
+
Render
@@ -82,6 +85,9 @@
Logging
+
+ Render
+
Render
diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
index 1b0d8db5b8..f25f9c90cf 100644
--- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
+++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
@@ -485,6 +485,7 @@ void ProgramShaderCache::CreateHeader()
"%s\n" // msaa
"%s\n" // sample shading
"%s\n" // Sampler binding
+ "%s\n" // storage buffer
// Precision defines for GLSL ES
"%s\n"
@@ -516,6 +517,7 @@ void ProgramShaderCache::CreateHeader()
, (g_ogl_config.bSupportsMSAA && v < GLSL_150) ? "#extension GL_ARB_texture_multisample : enable" : ""
, (g_ogl_config.bSupportSampleShading) ? "#extension GL_ARB_sample_shading : enable" : ""
, g_ActiveConfig.backend_info.bSupportsBindingLayout ? "#define SAMPLER_BINDING(x) layout(binding = x)" : "#define SAMPLER_BINDING(x)"
+ , g_ActiveConfig.backend_info.bSupportsBBox ? "#extension GL_ARB_shader_storage_buffer_object : enable" : ""
, v>=GLSLES_300 ? "precision highp float;" : ""
, v>=GLSLES_300 ? "precision highp int;" : ""
diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp
index 2b538f063c..3d21b6891c 100644
--- a/Source/Core/VideoBackends/OGL/Render.cpp
+++ b/Source/Core/VideoBackends/OGL/Render.cpp
@@ -20,6 +20,7 @@
#include "Core/Core.h"
#include "Core/Movie.h"
+#include "VideoBackends/OGL/BoundingBox.h"
#include "VideoBackends/OGL/FramebufferManager.h"
#include "VideoBackends/OGL/GLInterfaceBase.h"
#include "VideoBackends/OGL/GLUtil.h"
@@ -465,6 +466,7 @@ Renderer::Renderer()
g_Config.backend_info.bSupportsPrimitiveRestart = !DriverDetails::HasBug(DriverDetails::BUG_PRIMITIVERESTART) &&
((GLExtensions::Version() >= 310) || GLExtensions::Supports("GL_NV_primitive_restart"));
g_Config.backend_info.bSupportsEarlyZ = GLExtensions::Supports("GL_ARB_shader_image_load_store");
+ g_Config.backend_info.bSupportsBBox = GLExtensions::Supports("GL_ARB_shader_storage_buffer_object");
// Desktop OpenGL supports the binding layout if it supports 420pack
// OpenGL ES 3.1 supports it implicitly without an extension
@@ -473,7 +475,8 @@ Renderer::Renderer()
g_ogl_config.bSupportsGLSLCache = GLExtensions::Supports("GL_ARB_get_program_binary");
g_ogl_config.bSupportsGLPinnedMemory = GLExtensions::Supports("GL_AMD_pinned_memory");
g_ogl_config.bSupportsGLSync = GLExtensions::Supports("GL_ARB_sync");
- g_ogl_config.bSupportsGLBaseVertex = GLExtensions::Supports("GL_ARB_draw_elements_base_vertex");
+ g_ogl_config.bSupportsGLBaseVertex = GLExtensions::Supports("GL_ARB_draw_elements_base_vertex") ||
+ GLExtensions::Supports("GL_EXT_draw_elements_base_vertex");
g_ogl_config.bSupportsGLBufferStorage = GLExtensions::Supports("GL_ARB_buffer_storage");
g_ogl_config.bSupportsMSAA = GLExtensions::Supports("GL_ARB_texture_multisample");
g_ogl_config.bSupportSampleShading = GLExtensions::Supports("GL_ARB_sample_shading");
@@ -1161,6 +1164,52 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
return 0;
}
+u16 Renderer::BBoxRead(int index)
+{
+ int swapped_index = index;
+ if (index >= 2)
+ swapped_index ^= 1; // swap 2 and 3 for top/bottom
+
+ // Here we get the min/max value of the truncated position of the upscaled and swapped framebuffer.
+ // So we have to correct them to the unscaled EFB sizes.
+ int value = BoundingBox::Get(swapped_index);
+
+ if (index < 2)
+ {
+ // left/right
+ value = value * EFB_WIDTH / s_target_width;
+ }
+ else
+ {
+ // up/down -- we have to swap up and down
+ value = value * EFB_HEIGHT / s_target_height;
+ value = EFB_HEIGHT - value - 1;
+ }
+ if (index & 1)
+ value++; // fix max values to describe the outer border
+
+ return value;
+}
+
+void Renderer::BBoxWrite(int index, u16 _value)
+{
+ int value = _value; // u16 isn't enough to multiply by the efb width
+ if (index & 1)
+ value--;
+ if (index < 2)
+ {
+ value = value * s_target_width / EFB_WIDTH;
+ }
+ else
+ {
+ index ^= 1; // swap 2 and 3 for top/bottom
+ value = EFB_HEIGHT - value - 1;
+ value = value * s_target_height / EFB_HEIGHT;
+ }
+
+ BoundingBox::Set(index, value);
+}
+
void Renderer::SetViewport()
{
// reversed gxsetviewport(xorig, yorig, width, height, nearz, farz)
diff --git a/Source/Core/VideoBackends/OGL/Render.h b/Source/Core/VideoBackends/OGL/Render.h
index 0c2534b18f..f35487a373 100644
--- a/Source/Core/VideoBackends/OGL/Render.h
+++ b/Source/Core/VideoBackends/OGL/Render.h
@@ -71,6 +71,9 @@ public:
u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override;
+ u16 BBoxRead(int index) override;
+ void BBoxWrite(int index, u16 value) override;
+
void ResetAPIState() override;
void RestoreAPIState() override;
diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp
index 4170480336..5f14704cae 100644
--- a/Source/Core/VideoBackends/OGL/TextureCache.cpp
+++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp
@@ -402,7 +402,7 @@ void TextureCache::DisableStage(unsigned int stage)
void TextureCache::SetStage ()
{
- // -1 is the initial value as we don't know which testure should be bound
+ // -1 is the initial value as we don't know which texture should be bound
if (s_ActiveTexture != (u32)-1)
glActiveTexture(GL_TEXTURE0 + s_ActiveTexture);
}
diff --git a/Source/Core/VideoBackends/OGL/TextureConverter.cpp b/Source/Core/VideoBackends/OGL/TextureConverter.cpp
index 79cf9122b2..0b7275eaa4 100644
--- a/Source/Core/VideoBackends/OGL/TextureConverter.cpp
+++ b/Source/Core/VideoBackends/OGL/TextureConverter.cpp
@@ -54,7 +54,7 @@ static void CreatePrograms()
{
/* TODO: Accuracy Improvements
*
- * This shader doesn't really match what the gamecube does interally in the
+ * This shader doesn't really match what the GameCube does internally in the
* copy pipeline.
* 1. It uses Opengl's built in filtering when yscaling, someone could work
* out how the copypipeline does it's filtering and implement it correctly
@@ -62,7 +62,7 @@ static void CreatePrograms()
* 2. Deflickering isn't implemented, a futher filtering over 3 lines.
* Isn't really needed on non-interlaced monitors (and would lower quality;
* But hey, accuracy!)
- * 3. Flipper's YUYV conversion implements a 3 pixel horozontal blur on the
+ * 3. Flipper's YUYV conversion implements a 3 pixel horizontal blur on the
* UV channels, centering the U channel on the Left pixel and the V channel
* on the Right pixel.
* The current implementation Centers both UV channels at the same place
@@ -101,7 +101,7 @@ static void CreatePrograms()
*
* The YVYU to RGB conversion here matches the RGB to YUYV done above, but
* if a game modifies or adds images to the XFB then it should be using the
- * same algorithm as the flipper, and could result in slight colour inaccuracies
+ * same algorithm as the flipper, and could result in slight color inaccuracies
* when run back through this shader.
*/
const char *VProgramYuyvToRgb =
@@ -253,9 +253,9 @@ static void EncodeToRamUsingShader(GLuint srcTexture,
{
// writing to a texture of a different size
// also copy more then one block line, so the different strides matters
- // copy into one pbo first, map this buffer, and then memcpy into gc memory
+ // copy into one pbo first, map this buffer, and then memcpy into GC memory
// in this way, we only have one vram->ram transfer, but maybe a bigger
- // cpu overhead because of the pbo
+ // CPU overhead because of the pbo
glBindBuffer(GL_PIXEL_PACK_BUFFER, s_PBO);
glBufferData(GL_PIXEL_PACK_BUFFER, dstSize, nullptr, GL_STREAM_READ);
glReadPixels(0, 0, (GLsizei)dstWidth, (GLsizei)dstHeight, GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
@@ -340,7 +340,7 @@ void EncodeToRamYUYV(GLuint srcTexture, const TargetRectangle& sourceRc, u8* des
glUniform4f(s_rgbToYuyvUniform_loc, static_cast(sourceRc.left), static_cast(sourceRc.top),
static_cast(sourceRc.right), static_cast(sourceRc.bottom));
- // We enable linear filtering, because the gamecube does filtering in the vertical direction when
+ // We enable linear filtering, because the GameCube does filtering in the vertical direction when
// yscale is enabled.
// Otherwise we get jaggies when a game uses yscaling (most PAL games)
EncodeToRamUsingShader(srcTexture, destAddr, dstWidth / 2, dstHeight, dstWidth*dstHeight*2, true);
diff --git a/Source/Core/VideoBackends/OGL/VertexManager.cpp b/Source/Core/VideoBackends/OGL/VertexManager.cpp
index 0fbcefa83f..e696aca536 100644
--- a/Source/Core/VideoBackends/OGL/VertexManager.cpp
+++ b/Source/Core/VideoBackends/OGL/VertexManager.cpp
@@ -63,9 +63,6 @@ void VertexManager::CreateDeviceObjects()
void VertexManager::DestroyDeviceObjects()
{
- glBindBuffer(GL_ARRAY_BUFFER, 0 );
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0 );
-
delete s_vertexBuffer;
delete s_indexBuffer;
}
diff --git a/Source/Core/VideoBackends/OGL/main.cpp b/Source/Core/VideoBackends/OGL/main.cpp
index 810509b0a9..eb01d3355a 100644
--- a/Source/Core/VideoBackends/OGL/main.cpp
+++ b/Source/Core/VideoBackends/OGL/main.cpp
@@ -48,6 +48,7 @@ Make AA apply instantly during gameplay if possible
#include "Core/Core.h"
#include "Core/Host.h"
+#include "VideoBackends/OGL/BoundingBox.h"
#include "VideoBackends/OGL/FramebufferManager.h"
#include "VideoBackends/OGL/GLInterfaceBase.h"
#include "VideoBackends/OGL/GLUtil.h"
@@ -205,6 +206,7 @@ void VideoBackend::Video_Prepare()
Renderer::Init();
VertexLoaderManager::Init();
TextureConverter::Init();
+ BoundingBox::Init();
// Notify the core that the video backend is ready
Host_Message(WM_USER_CREATE);
@@ -229,6 +231,7 @@ void VideoBackend::Video_Cleanup()
// The following calls are NOT Thread Safe
// And need to be called from the video thread
Renderer::Shutdown();
+ BoundingBox::Shutdown();
TextureConverter::Shutdown();
VertexLoaderManager::Shutdown();
delete g_sampler_cache;
diff --git a/Source/Core/VideoBackends/Software/EfbInterface.cpp b/Source/Core/VideoBackends/Software/EfbInterface.cpp
index 172dd5ae23..fad9660c14 100644
--- a/Source/Core/VideoBackends/Software/EfbInterface.cpp
+++ b/Source/Core/VideoBackends/Software/EfbInterface.cpp
@@ -540,7 +540,7 @@ namespace EfbInterface
{
// YU pixel
xfb_in_ram[x].Y = scanline[i].Y + 16;
- // we mix our color difrences in 10 bit space so it will round more accurately
+ // we mix our color differences in 10 bit space so it will round more accurately
// U[i] = 1/4 * U[i-1] + 1/2 * U[i] + 1/4 * U[i+1]
xfb_in_ram[x].UV = 128 + ((scanline[i-1].U + (scanline[i].U << 1) + scanline[i+1].U) >> 2);
@@ -553,7 +553,7 @@ namespace EfbInterface
}
}
- // Like CopyToXFB, but we copy directly into the opengl colour texture without going via GameCube main memory or doing a yuyv conversion
+ // Like CopyToXFB, but we copy directly into the opengl color texture without going via GameCube main memory or doing a yuyv conversion
void BypassXFB(u8* texture, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma)
{
if (fbWidth*fbHeight > MAX_XFB_WIDTH*MAX_XFB_HEIGHT)
diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp
index c712115282..0612a743da 100644
--- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp
+++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp
@@ -42,15 +42,15 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType)
{
m_CurrentVat = &g_main_cp_state.vtx_attr[attributeIndex];
- posScale = 1.0f / float(1 << m_CurrentVat->g0.PosFrac);
- tcScale[0] = 1.0f / float(1 << m_CurrentVat->g0.Tex0Frac);
- tcScale[1] = 1.0f / float(1 << m_CurrentVat->g1.Tex1Frac);
- tcScale[2] = 1.0f / float(1 << m_CurrentVat->g1.Tex2Frac);
- tcScale[3] = 1.0f / float(1 << m_CurrentVat->g1.Tex3Frac);
- tcScale[4] = 1.0f / float(1 << m_CurrentVat->g2.Tex4Frac);
- tcScale[5] = 1.0f / float(1 << m_CurrentVat->g2.Tex5Frac);
- tcScale[6] = 1.0f / float(1 << m_CurrentVat->g2.Tex6Frac);
- tcScale[7] = 1.0f / float(1 << m_CurrentVat->g2.Tex7Frac);
+ posScale[0] = posScale[1] = posScale[2] = posScale[3] = 1.0f / float(1 << m_CurrentVat->g0.PosFrac);
+ tcScale[0][0] = tcScale[0][1] = 1.0f / float(1 << m_CurrentVat->g0.Tex0Frac);
+ tcScale[1][0] = tcScale[1][1] = 1.0f / float(1 << m_CurrentVat->g1.Tex1Frac);
+ tcScale[2][0] = tcScale[2][1] = 1.0f / float(1 << m_CurrentVat->g1.Tex2Frac);
+ tcScale[3][0] = tcScale[3][1] = 1.0f / float(1 << m_CurrentVat->g1.Tex3Frac);
+ tcScale[4][0] = tcScale[4][1] = 1.0f / float(1 << m_CurrentVat->g2.Tex4Frac);
+ tcScale[5][0] = tcScale[5][1] = 1.0f / float(1 << m_CurrentVat->g2.Tex5Frac);
+ tcScale[6][0] = tcScale[6][1] = 1.0f / float(1 << m_CurrentVat->g2.Tex6Frac);
+ tcScale[7][0] = tcScale[7][1] = 1.0f / float(1 << m_CurrentVat->g2.Tex7Frac);
//TexMtx
const u64 tmDesc[8] = {
diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp
index 9063cece5e..8f7c06c5a8 100644
--- a/Source/Core/VideoBackends/Software/SWmain.cpp
+++ b/Source/Core/VideoBackends/Software/SWmain.cpp
@@ -33,6 +33,7 @@
#include "VideoBackends/Software/VideoBackend.h"
#include "VideoBackends/Software/XFMemLoader.h"
+#include "VideoCommon/BoundingBox.h"
#include "VideoCommon/Fifo.h"
#include "VideoCommon/OnScreenDisplay.h"
#include "VideoCommon/PixelEngine.h"
@@ -283,6 +284,11 @@ u32 VideoSoftware::Video_GetQueryResult(PerfQueryType type)
return EfbInterface::perf_values[type];
}
+u16 VideoSoftware::Video_GetBoundingBox(int index)
+{
+ return BoundingBox::coords[index];
+}
+
bool VideoSoftware::Video_Screenshot(const std::string& filename)
{
SWRenderer::SetScreenshot(filename.c_str());
diff --git a/Source/Core/VideoBackends/Software/VideoBackend.h b/Source/Core/VideoBackends/Software/VideoBackend.h
index eb4d4807c2..0edb3bd4df 100644
--- a/Source/Core/VideoBackends/Software/VideoBackend.h
+++ b/Source/Core/VideoBackends/Software/VideoBackend.h
@@ -32,6 +32,7 @@ class VideoSoftware : public VideoBackend
u32 Video_AccessEFB(EFBAccessType, u32, u32, u32) override;
u32 Video_GetQueryResult(PerfQueryType type) override;
+ u16 Video_GetBoundingBox(int index) override;
void Video_AddMessage(const std::string& msg, unsigned int milliseconds) override;
void Video_ClearMessages() override;
diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp
index 3a291c9353..1dcbbe4d9c 100644
--- a/Source/Core/VideoCommon/AVIDump.cpp
+++ b/Source/Core/VideoCommon/AVIDump.cpp
@@ -28,7 +28,7 @@
#include
#include
-#include "Core/ConfigManager.h" // for EuRGB60
+#include "Core/ConfigManager.h" // for PAL60
#include "Core/CoreTiming.h"
static HWND s_emu_wnd;
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp
index 79c24778bd..c6b57c81ca 100644
--- a/Source/Core/VideoCommon/BPStructs.cpp
+++ b/Source/Core/VideoCommon/BPStructs.cpp
@@ -380,6 +380,9 @@ static void BPWritten(const BPCmd& bp)
BoundingBox::coords[offset] = bp.newvalue & 0x3ff;
BoundingBox::coords[offset + 1] = bp.newvalue >> 10;
BoundingBox::active = true;
+
+ g_renderer->BBoxWrite(offset, bp.newvalue & 0x3ff);
+ g_renderer->BBoxWrite(offset + 1, bp.newvalue >> 10);
}
return;
case BPMEM_TEXINVALIDATE:
diff --git a/Source/Core/VideoCommon/CommandProcessor.cpp b/Source/Core/VideoCommon/CommandProcessor.cpp
index 8af2af9ccc..a47cfa18b1 100644
--- a/Source/Core/VideoCommon/CommandProcessor.cpp
+++ b/Source/Core/VideoCommon/CommandProcessor.cpp
@@ -304,6 +304,9 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
void GatherPipeBursted()
{
+ if (IsOnThread())
+ SetCPStatusFromCPU();
+
ProcessFifoEvents();
// if we aren't linked, we don't care about gather pipe data
if (!m_CPCtrlReg.GPLinkEnable)
@@ -326,11 +329,8 @@ void GatherPipeBursted()
return;
}
- if (IsOnThread())
- SetCPStatusFromCPU();
-
// update the fifo pointer
- if (fifo.CPWritePointer >= fifo.CPEnd)
+ if (fifo.CPWritePointer == fifo.CPEnd)
fifo.CPWritePointer = fifo.CPBase;
else
fifo.CPWritePointer += GATHER_PIPE_SIZE;
@@ -342,6 +342,10 @@ void GatherPipeBursted()
ProcessorInterface::Fifo_CPUEnd = fifo.CPEnd;
}
+ // If the game is running close to overflowing, make the exception checking more frequent.
+ if (fifo.bFF_HiWatermark)
+ CoreTiming::ForceExceptionCheck(0);
+
Common::AtomicAdd(fifo.CPReadWriteDistance, GATHER_PIPE_SIZE);
RunGpu();
@@ -369,6 +373,7 @@ void UpdateInterrupts(u64 userdata)
INFO_LOG(COMMANDPROCESSOR,"Interrupt cleared");
ProcessorInterface::SetInterrupt(INT_CAUSE_CP, false);
}
+ CoreTiming::ForceExceptionCheck(0);
interruptWaiting = false;
}
@@ -404,7 +409,34 @@ void SetCPStatusFromGPU()
INFO_LOG(COMMANDPROCESSOR, "Cleared breakpoint at %i", fifo.CPReadPointer);
fifo.bFF_Breakpoint = false;
}
- SetCPStatusFromCPU();
+
+ // overflow & underflow check
+ fifo.bFF_HiWatermark = (fifo.CPReadWriteDistance > fifo.CPHiWatermark);
+ fifo.bFF_LoWatermark = (fifo.CPReadWriteDistance < fifo.CPLoWatermark);
+
+ bool bpInt = fifo.bFF_Breakpoint && fifo.bFF_BPInt;
+ bool ovfInt = fifo.bFF_HiWatermark && fifo.bFF_HiWatermarkInt;
+ bool undfInt = fifo.bFF_LoWatermark && fifo.bFF_LoWatermarkInt;
+
+ bool interrupt = (bpInt || ovfInt || undfInt) && m_CPCtrlReg.GPReadEnable;
+
+ if (interrupt != interruptSet && !interruptWaiting)
+ {
+ u64 userdata = interrupt ? 1 : 0;
+ if (IsOnThread())
+ {
+ if (!interrupt || bpInt || undfInt || ovfInt)
+ {
+ // Schedule the interrupt asynchronously
+ interruptWaiting = true;
+ CommandProcessor::UpdateInterruptsFromVideoBackend(userdata);
+ }
+ }
+ else
+ {
+ CommandProcessor::UpdateInterrupts(userdata);
+ }
+ }
}
void SetCPStatusFromCPU()
@@ -421,23 +453,14 @@ void SetCPStatusFromCPU()
if (interrupt != interruptSet && !interruptWaiting)
{
- u64 userdata = interrupt?1:0;
+ u64 userdata = interrupt ? 1 : 0;
if (IsOnThread())
{
if (!interrupt || bpInt || undfInt || ovfInt)
{
- if (Core::IsGPUThread())
- {
- // Schedule the interrupt asynchronously
- interruptWaiting = true;
- CommandProcessor::UpdateInterruptsFromVideoBackend(userdata);
- }
- else
- {
- interruptSet = interrupt;
- INFO_LOG(COMMANDPROCESSOR,"Interrupt set");
- ProcessorInterface::SetInterrupt(INT_CAUSE_CP, interrupt);
- }
+ interruptSet = interrupt;
+ INFO_LOG(COMMANDPROCESSOR,"Interrupt set");
+ ProcessorInterface::SetInterrupt(INT_CAUSE_CP, interrupt);
}
}
else
@@ -451,8 +474,7 @@ void ProcessFifoAllDistance()
{
if (IsOnThread())
{
- while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable &&
- fifo.CPReadWriteDistance && !AtBreakpoint())
+ while (!interruptWaiting && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !AtBreakpoint())
Common::YieldCPU();
}
}
@@ -489,13 +511,6 @@ void SetCpStatusRegister()
void SetCpControlRegister()
{
- // If the new fifo is being attached, force an exception check
- // This fixes the hang while booting Eternal Darkness
- if (!fifo.bFF_GPReadEnable && m_CPCtrlReg.GPReadEnable && !m_CPCtrlReg.BPEnable)
- {
- CoreTiming::ForceExceptionCheck(0);
- }
-
fifo.bFF_BPInt = m_CPCtrlReg.BPInt;
fifo.bFF_BPEnable = m_CPCtrlReg.BPEnable;
fifo.bFF_HiWatermarkInt = m_CPCtrlReg.FifoOverflowIntEnable;
diff --git a/Source/Core/VideoCommon/Fifo.cpp b/Source/Core/VideoCommon/Fifo.cpp
index 6dc9732f0a..18475a737c 100644
--- a/Source/Core/VideoCommon/Fifo.cpp
+++ b/Source/Core/VideoCommon/Fifo.cpp
@@ -251,7 +251,7 @@ static void ReadDataFromFifoOnCPU(u32 readPtr)
}
}
Memory::CopyFromEmu(s_video_buffer_write_ptr, readPtr, len);
- OpcodeDecoder_Preprocess(write_ptr + len);
+ OpcodeDecoder_Preprocess(write_ptr + len, false);
// This would have to be locked if the GPU thread didn't spin.
s_video_buffer_write_ptr = write_ptr + len;
}
@@ -289,7 +289,7 @@ void RunGpuLoop()
// See comment in SyncGPU
if (write_ptr > seen_ptr)
{
- OpcodeDecoder_Run(write_ptr);
+ OpcodeDecoder_Run(write_ptr, false);
{
std::lock_guard vblk(s_video_buffer_lock);
@@ -325,7 +325,7 @@ void RunGpuLoop()
u8* write_ptr = s_video_buffer_write_ptr;
- cyclesExecuted = OpcodeDecoder_Run(write_ptr);
+ cyclesExecuted = OpcodeDecoder_Run(write_ptr, false);
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bSyncGPU && Common::AtomicLoad(CommandProcessor::VITicks) >= cyclesExecuted)
@@ -399,7 +399,7 @@ void RunGpu()
FPURoundMode::SaveSIMDState();
FPURoundMode::LoadDefaultSIMDState();
ReadDataFromFifo(fifo.CPReadPointer);
- OpcodeDecoder_Run(s_video_buffer_write_ptr);
+ OpcodeDecoder_Run(s_video_buffer_write_ptr, false);
FPURoundMode::LoadSIMDState();
}
diff --git a/Source/Core/VideoCommon/Fifo.h b/Source/Core/VideoCommon/Fifo.h
index 4418ac77af..3a441c187c 100644
--- a/Source/Core/VideoCommon/Fifo.h
+++ b/Source/Core/VideoCommon/Fifo.h
@@ -37,6 +37,7 @@ enum SyncGPUReason
SYNC_GPU_WRAPAROUND,
SYNC_GPU_EFB_POKE,
SYNC_GPU_PERFQUERY,
+ SYNC_GPU_BBOX,
SYNC_GPU_SWAP,
SYNC_GPU_AUX_SPACE,
};
diff --git a/Source/Core/VideoCommon/ImageWrite.cpp b/Source/Core/VideoCommon/ImageWrite.cpp
index 2666c62a8a..52672612c5 100644
--- a/Source/Core/VideoCommon/ImageWrite.cpp
+++ b/Source/Core/VideoCommon/ImageWrite.cpp
@@ -73,7 +73,7 @@ bool TextureToPng(u8* data, int row_stride, const std::string& filename, int wid
png_init_io(png_ptr, fp.GetHandle());
- // Write header (8 bit colour depth)
+ // Write header (8 bit color depth)
png_set_IHDR(png_ptr, info_ptr, width, height,
8, PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp
index d775cfe64c..40d2f57f20 100644
--- a/Source/Core/VideoCommon/MainBase.cpp
+++ b/Source/Core/VideoCommon/MainBase.cpp
@@ -1,6 +1,7 @@
#include "Common/Event.h"
#include "Core/ConfigManager.h"
+#include "VideoCommon/BoundingBox.h"
#include "VideoCommon/BPStructs.h"
#include "VideoCommon/CommandProcessor.h"
#include "VideoCommon/Fifo.h"
@@ -25,6 +26,11 @@ static Common::Event s_efbAccessReadyEvent;
static Common::Flag s_perfQueryRequested;
static Common::Event s_perfQueryReadyEvent;
+static Common::Flag s_BBoxRequested;
+static Common::Event s_BBoxReadyEvent;
+static int s_BBoxIndex;
+static u16 s_BBoxResult;
+
static volatile struct
{
u32 xfbAddr;
@@ -217,6 +223,39 @@ u32 VideoBackendHardware::Video_GetQueryResult(PerfQueryType type)
return g_perf_query->GetQueryResult(type);
}
+u16 VideoBackendHardware::Video_GetBoundingBox(int index)
+{
+ if (!g_ActiveConfig.backend_info.bSupportsBBox)
+ return BoundingBox::coords[index];
+
+ SyncGPU(SYNC_GPU_BBOX);
+
+ if (SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread)
+ {
+ s_BBoxReadyEvent.Reset();
+ if (s_FifoShuttingDown.IsSet())
+ return 0;
+ s_BBoxIndex = index;
+ s_BBoxRequested.Set();
+ s_BBoxReadyEvent.Wait();
+ return s_BBoxResult;
+ }
+ else
+ {
+ return g_renderer->BBoxRead(index);
+ }
+}
+
+static void VideoFifo_CheckBBoxRequest()
+{
+ if (s_BBoxRequested.IsSet())
+ {
+ s_BBoxResult = g_renderer->BBoxRead(s_BBoxIndex);
+ s_BBoxRequested.Clear();
+ s_BBoxReadyEvent.Set();
+ }
+}
+
void VideoBackendHardware::InitializeShared()
{
VideoCommon_Init();
@@ -292,6 +331,7 @@ void VideoFifo_CheckAsyncRequest()
VideoFifo_CheckSwapRequest();
VideoFifo_CheckEFBAccess();
VideoFifo_CheckPerfQueryRequest();
+ VideoFifo_CheckBBoxRequest();
}
void VideoBackendHardware::Video_GatherPipeBursted()
diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp
index 1f71bd051b..a7dd5b6a85 100644
--- a/Source/Core/VideoCommon/OpcodeDecoding.cpp
+++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp
@@ -55,7 +55,7 @@ static u32 InterpretDisplayList(u32 address, u32 size)
Statistics::SwapDL();
u8 *end = g_video_buffer_read_ptr + size;
- cycles = OpcodeDecoder_Run(end);
+ cycles = OpcodeDecoder_Run(end, true);
INCSTAT(stats.thisFrame.numDListsCalled);
// un-swap
@@ -80,7 +80,7 @@ static void InterpretDisplayListPreprocess(u32 address, u32 size)
g_video_buffer_pp_read_ptr = startAddress;
u8 *end = startAddress + size;
- OpcodeDecoder_Preprocess(end);
+ OpcodeDecoder_Preprocess(end, true);
}
g_video_buffer_pp_read_ptr = old_read_ptr;
@@ -118,15 +118,24 @@ static void UnknownOpcode(u8 cmd_byte, void *buffer, bool preprocess)
"bFF_BPEnable: %s\n"
"bFF_BPInt: %s\n"
"bFF_Breakpoint: %s\n"
+ "bFF_GPLinkEnable: %s\n"
+ "bFF_HiWatermarkInt: %s\n"
+ "bFF_LoWatermarkInt: %s\n"
,cmd_byte, fifo.CPBase, fifo.CPEnd, fifo.CPHiWatermark, fifo.CPLoWatermark, fifo.CPReadWriteDistance
- ,fifo.CPWritePointer, fifo.CPReadPointer, fifo.CPBreakpoint, fifo.bFF_GPReadEnable ? "true" : "false"
- ,fifo.bFF_BPEnable ? "true" : "false" ,fifo.bFF_BPInt ? "true" : "false"
- ,fifo.bFF_Breakpoint ? "true" : "false");
+ ,fifo.CPWritePointer, fifo.CPReadPointer, fifo.CPBreakpoint
+ ,fifo.bFF_GPReadEnable ? "true" : "false"
+ ,fifo.bFF_BPEnable ? "true" : "false"
+ ,fifo.bFF_BPInt ? "true" : "false"
+ ,fifo.bFF_Breakpoint ? "true" : "false"
+ ,fifo.bFF_GPLinkEnable ? "true" : "false"
+ ,fifo.bFF_HiWatermarkInt ? "true" : "false"
+ ,fifo.bFF_LoWatermarkInt ? "true" : "false"
+ );
}
}
template
-static u32 Decode(u8* end)
+static u32 Decode(u8* end, bool in_display_list)
{
u8 *opcodeStart = *bufp;
if (*bufp == end)
@@ -205,10 +214,19 @@ static u32 Decode(u8* end)
return 0;
u32 address = DataRead(bufp);
u32 count = DataRead(bufp);
- if (is_preprocess)
- InterpretDisplayListPreprocess(address, count);
+
+ if (in_display_list)
+ {
+ cycles = 6;
+ WARN_LOG(VIDEO,"recursive display list detected");
+ }
else
- cycles = 6 + InterpretDisplayList(address, count);
+ {
+ if (is_preprocess)
+ InterpretDisplayListPreprocess(address, count);
+ else
+ cycles = 6 + InterpretDisplayList(address, count);
+ }
}
break;
@@ -297,13 +315,13 @@ void OpcodeDecoder_Shutdown()
{
}
-u32 OpcodeDecoder_Run(u8* end)
+u32 OpcodeDecoder_Run(u8* end, bool in_display_list)
{
u32 totalCycles = 0;
while (true)
{
u8* old = g_video_buffer_read_ptr;
- u32 cycles = Decode*is_preprocess*/ false, &g_video_buffer_read_ptr>(end);
+ u32 cycles = Decode*is_preprocess*/ false, &g_video_buffer_read_ptr>(end, in_display_list);
if (cycles == 0)
{
g_video_buffer_read_ptr = old;
@@ -314,12 +332,12 @@ u32 OpcodeDecoder_Run(u8* end)
return totalCycles;
}
-void OpcodeDecoder_Preprocess(u8 *end)
+void OpcodeDecoder_Preprocess(u8 *end, bool in_display_list)
{
while (true)
{
u8* old = g_video_buffer_pp_read_ptr;
- u32 cycles = Decode*is_preprocess*/ true, &g_video_buffer_pp_read_ptr>(end);
+ u32 cycles = Decode*is_preprocess*/ true, &g_video_buffer_pp_read_ptr>(end, in_display_list);
if (cycles == 0)
{
g_video_buffer_pp_read_ptr = old;
diff --git a/Source/Core/VideoCommon/OpcodeDecoding.h b/Source/Core/VideoCommon/OpcodeDecoding.h
index c454590f24..a217da556e 100644
--- a/Source/Core/VideoCommon/OpcodeDecoding.h
+++ b/Source/Core/VideoCommon/OpcodeDecoding.h
@@ -40,5 +40,5 @@ extern bool g_bRecordFifoData;
void OpcodeDecoder_Init();
void OpcodeDecoder_Shutdown();
-u32 OpcodeDecoder_Run(u8* end);
-void OpcodeDecoder_Preprocess(u8* write_ptr);
+u32 OpcodeDecoder_Run(u8* end, bool in_display_list);
+void OpcodeDecoder_Preprocess(u8* end, bool in_display_list);
diff --git a/Source/Core/VideoCommon/PixelEngine.cpp b/Source/Core/VideoCommon/PixelEngine.cpp
index 7fd8e12a39..f6bc26186a 100644
--- a/Source/Core/VideoCommon/PixelEngine.cpp
+++ b/Source/Core/VideoCommon/PixelEngine.cpp
@@ -233,7 +233,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
mmio->Register(base | (PE_BBOX_LEFT + 2 * i),
MMIO::ComplexRead([i](u32) {
BoundingBox::active = false;
- return BoundingBox::coords[i];
+ return g_video_backend->Video_GetBoundingBox(i);
}),
MMIO::InvalidWrite()
);
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 0f03fc013b..c0b45fdfda 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -10,6 +10,7 @@
#include
#endif
+#include "VideoCommon/BoundingBox.h"
#include "VideoCommon/BPMemory.h"
#include "VideoCommon/ConstantManager.h"
#include "VideoCommon/LightingShaderGen.h"
@@ -264,6 +265,16 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
"\tfloat4 " I_DEPTHPARAMS";\n"
"};\n");
}
+
+ if (g_ActiveConfig.backend_info.bSupportsBBox)
+ {
+ out.Write(
+ "layout(std140, binding = 3) buffer BBox {\n"
+ "\tint4 bbox_data;\n"
+ "};\n"
+ );
+ }
+
const bool forced_early_z = g_ActiveConfig.backend_info.bSupportsEarlyZ && bpmem.UseEarlyDepthTest() && (g_ActiveConfig.bFastDepthCalc || bpmem.alpha_test.TestResult() == AlphaTest::UNDETERMINED);
const bool per_pixel_depth = (bpmem.ztex2.op != ZTEXTURE_DISABLE && bpmem.UseLateDepthTest()) || (!g_ActiveConfig.bFastDepthCalc && bpmem.zmode.testenable && !forced_early_z);
@@ -551,6 +562,17 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
out.Write("\tocol0.a = float(" I_ALPHA".a) / 255.0;\n");
}
+ if (g_ActiveConfig.backend_info.bSupportsBBox && BoundingBox::active)
+ {
+ uid_data->bounding_box = true;
+ out.Write(
+ "\tif(bbox_data.x > int(gl_FragCoord.x)) atomicMin(bbox_data.x, int(gl_FragCoord.x));\n"
+ "\tif(bbox_data.y < int(gl_FragCoord.x)) atomicMax(bbox_data.y, int(gl_FragCoord.x));\n"
+ "\tif(bbox_data.z > int(gl_FragCoord.y)) atomicMin(bbox_data.z, int(gl_FragCoord.y));\n"
+ "\tif(bbox_data.w < int(gl_FragCoord.y)) atomicMax(bbox_data.w, int(gl_FragCoord.y));\n"
+ );
+ }
+
out.Write("}\n");
if (is_writing_shadercode)
diff --git a/Source/Core/VideoCommon/PixelShaderGen.h b/Source/Core/VideoCommon/PixelShaderGen.h
index 2be3f59ba3..369f940619 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.h
+++ b/Source/Core/VideoCommon/PixelShaderGen.h
@@ -61,7 +61,7 @@ struct pixel_shader_uid_data
u32 per_pixel_depth : 1;
u32 forced_early_z : 1;
u32 early_ztest : 1;
- u32 pad1 : 1;
+ u32 bounding_box : 1;
u32 texMtxInfo_n_projection : 8; // 8x1 bit
u32 tevindref_bi0 : 3;
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 18b622b513..d93d43f490 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -132,7 +132,7 @@ int Renderer::EFBToScaledX(int x)
{
switch (g_ActiveConfig.iEFBScale)
{
- case SCALE_AUTO: // fractional
+ case SCALE_AUTO: // fractional
return FramebufferManagerBase::ScaleToVirtualXfbWidth(x, s_backbuffer_width);
default:
diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h
index 2350117369..746f75366c 100644
--- a/Source/Core/VideoCommon/RenderBase.h
+++ b/Source/Core/VideoCommon/RenderBase.h
@@ -104,6 +104,9 @@ public:
virtual u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) = 0;
+ virtual u16 BBoxRead(int index) = 0;
+ virtual void BBoxWrite(int index, u16 value) = 0;
+
// What's the real difference between these? Too similar names.
virtual void ResetAPIState() = 0;
virtual void RestoreAPIState() = 0;
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index df28184615..0618b3f1b9 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -410,7 +410,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
// D3D doesn't like when the specified mipmap count would require more than one 1x1-sized LOD in the mipmap chain
// e.g. 64x64 with 7 LODs would have the mipmap chain 64x64,32x32,16x16,8x8,4x4,2x2,1x1,1x1, so we limit the mipmap count to 6 there
- while (g_ActiveConfig.backend_info.bUseMinimalMipCount && std::max(expandedWidth, expandedHeight) >> maxlevel == 0)
+ while (g_ActiveConfig.backend_info.bUseMinimalMipCount && std::max(width, height) >> maxlevel == 0)
--maxlevel;
TCacheEntryBase *entry = textures[texID];
diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp
index 4e6963124e..80a891ff26 100644
--- a/Source/Core/VideoCommon/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/VertexLoader.cpp
@@ -41,8 +41,9 @@ static int s_texmtxread = 0;
int tcIndex;
int colIndex;
int colElements[2];
-float posScale;
-float tcScale[8];
+// Duplicated (4x and 2x respectively) and used in SSE code in the vertex loader JIT
+GC_ALIGNED128(float posScale[4]);
+GC_ALIGNED64(float tcScale[8][2]);
static const float fractionTable[32] = {
1.0f / (1U << 0), 1.0f / (1U << 1), 1.0f / (1U << 2), 1.0f / (1U << 3),
@@ -65,10 +66,8 @@ static void LOADERDECL PosMtx_ReadDirect_UByte()
static void LOADERDECL PosMtx_Write()
{
- DataWrite(s_curposmtx);
- DataWrite(0);
- DataWrite(0);
- DataWrite(0);
+ // u8, 0, 0, 0
+ DataWrite(s_curposmtx);
}
static void LOADERDECL TexMtx_ReadDirect_UByte()
@@ -171,7 +170,8 @@ void VertexLoader::CompileVertexTranslator()
#endif
// Get the pointer to this vertex's buffer data for the bounding box
- WriteCall(BoundingBox::SetVertexBufferPosition);
+ if (!g_ActiveConfig.backend_info.bSupportsBBox)
+ WriteCall(BoundingBox::SetVertexBufferPosition);
// Colors
const u64 col[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
@@ -380,7 +380,8 @@ void VertexLoader::CompileVertexTranslator()
}
// Update the bounding box
- WriteCall(BoundingBox::Update);
+ if (!g_ActiveConfig.backend_info.bSupportsBBox)
+ WriteCall(BoundingBox::Update);
if (m_VtxDesc.PosMatIdx)
{
@@ -449,15 +450,16 @@ void VertexLoader::SetupRunVertices(const VAT& vat, int primitive, int const cou
m_VtxAttr.texCoord[6].Frac = vat.g2.Tex6Frac;
m_VtxAttr.texCoord[7].Frac = vat.g2.Tex7Frac;
- posScale = fractionTable[m_VtxAttr.PosFrac];
+ posScale[0] = posScale[1] = posScale[2] = posScale[3] = fractionTable[m_VtxAttr.PosFrac];
if (m_native_components & VB_HAS_UVALL)
for (int i = 0; i < 8; i++)
- tcScale[i] = fractionTable[m_VtxAttr.texCoord[i].Frac];
+ tcScale[i][0] = tcScale[i][1] = fractionTable[m_VtxAttr.texCoord[i].Frac];
for (int i = 0; i < 2; i++)
colElements[i] = m_VtxAttr.color[i].Elements;
// Prepare bounding box
- BoundingBox::Prepare(vat, primitive, m_VtxDesc, m_native_vtx_decl);
+ if (!g_ActiveConfig.backend_info.bSupportsBBox)
+ BoundingBox::Prepare(vat, primitive, m_VtxDesc, m_native_vtx_decl);
}
void VertexLoader::ConvertVertices ( int count )
diff --git a/Source/Core/VideoCommon/VertexLoader.h b/Source/Core/VideoCommon/VertexLoader.h
index c81be52556..71159b60d7 100644
--- a/Source/Core/VideoCommon/VertexLoader.h
+++ b/Source/Core/VideoCommon/VertexLoader.h
@@ -19,6 +19,13 @@
#include "VideoCommon/DataReader.h"
#include "VideoCommon/NativeVertexFormat.h"
+#if _M_SSE >= 0x401
+#include
+#include
+#elif _M_SSE >= 0x301 && !(defined __GNUC__ && !defined __SSSE3__)
+#include
+#endif
+
#ifdef _M_X86
#define USE_VERTEX_LOADER_JIT
#endif
@@ -27,8 +34,8 @@
extern int tcIndex;
extern int colIndex;
extern int colElements[2];
-extern float posScale;
-extern float tcScale[8];
+GC_ALIGNED128(extern float posScale[4]);
+GC_ALIGNED64(extern float tcScale[8][2]);
class VertexLoaderUID
{
@@ -155,3 +162,61 @@ private:
void WriteSetVariable(int bits, void *address, Gen::OpArg dest);
#endif
};
+
+#if _M_SSE >= 0x301
+static const __m128i kMaskSwap32_3 = _mm_set_epi32(0xFFFFFFFFL, 0x08090A0BL, 0x04050607L, 0x00010203L);
+static const __m128i kMaskSwap32_2 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0x04050607L, 0x00010203L);
+static const __m128i kMaskSwap16to32l_3 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFF0405L, 0xFFFF0203L, 0xFFFF0001L);
+static const __m128i kMaskSwap16to32l_2 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0xFFFF0203L, 0xFFFF0001L);
+static const __m128i kMaskSwap16to32h_3 = _mm_set_epi32(0xFFFFFFFFL, 0x0405FFFFL, 0x0203FFFFL, 0x0001FFFFL);
+static const __m128i kMaskSwap16to32h_2 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0x0203FFFFL, 0x0001FFFFL);
+static const __m128i kMask8to32l_3 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFF02L, 0xFFFFFF01L, 0xFFFFFF00L);
+static const __m128i kMask8to32l_2 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0xFFFFFF01L, 0xFFFFFF00L);
+static const __m128i kMask8to32h_3 = _mm_set_epi32(0xFFFFFFFFL, 0x02FFFFFFL, 0x01FFFFFFL, 0x00FFFFFFL);
+static const __m128i kMask8to32h_2 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0x01FFFFFFL, 0x00FFFFFFL);
+
+template
+__forceinline void Vertex_Read_SSSE3(const T* pData, __m128 scale)
+{
+ __m128i coords, mask;
+
+ int loadBytes = sizeof(T) * (2 + threeIn);
+ if (loadBytes > 8)
+ coords = _mm_loadu_si128((__m128i*)pData);
+ else if (loadBytes > 4)
+ coords = _mm_loadl_epi64((__m128i*)pData);
+ else
+ coords = _mm_cvtsi32_si128(*(u32*)pData);
+
+ // Float case (no scaling)
+ if (sizeof(T) == 4)
+ {
+ coords = _mm_shuffle_epi8(coords, threeIn ? kMaskSwap32_3 : kMaskSwap32_2);
+ if (threeOut)
+ _mm_storeu_si128((__m128i*)VertexManager::s_pCurBufferPointer, coords);
+ else
+ _mm_storel_epi64((__m128i*)VertexManager::s_pCurBufferPointer, coords);
+ }
+ else
+ {
+ // Byte swap, unpack, and move to high bytes for sign extend.
+ if (std::is_unsigned::value)
+ mask = sizeof(T) == 2 ? (threeIn ? kMaskSwap16to32l_3 : kMaskSwap16to32l_2) : (threeIn ? kMask8to32l_3 : kMask8to32l_2);
+ else
+ mask = sizeof(T) == 2 ? (threeIn ? kMaskSwap16to32h_3 : kMaskSwap16to32h_2) : (threeIn ? kMask8to32h_3 : kMask8to32h_2);
+ coords = _mm_shuffle_epi8(coords, mask);
+
+ // Sign extend
+ if (std::is_signed::value)
+ coords = _mm_srai_epi32(coords, 32 - sizeof(T) * 8);
+
+ __m128 out = _mm_mul_ps(_mm_cvtepi32_ps(coords), scale);
+ if (threeOut)
+ _mm_storeu_ps((float*)VertexManager::s_pCurBufferPointer, out);
+ else
+ _mm_storel_pi((__m64*)VertexManager::s_pCurBufferPointer, out);
+ }
+
+ VertexManager::s_pCurBufferPointer += sizeof(float) * (2 + threeOut);
+}
+#endif
\ No newline at end of file
diff --git a/Source/Core/VideoCommon/VertexLoader_Normal.cpp b/Source/Core/VideoCommon/VertexLoader_Normal.cpp
index 3d58592d70..8ff5a767e7 100644
--- a/Source/Core/VideoCommon/VertexLoader_Normal.cpp
+++ b/Source/Core/VideoCommon/VertexLoader_Normal.cpp
@@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#include
-#include
+#include
#include "Common/CommonTypes.h"
#include "Common/CPUDetect.h"
@@ -13,13 +13,6 @@
#include "VideoCommon/VertexManagerBase.h"
#include "VideoCommon/VideoCommon.h"
-#if _M_SSE >= 0x401
-#include
-#include
-#elif _M_SSE >= 0x301 && !(defined __GNUC__ && !defined __SSSE3__)
-#include
-#endif
-
// warning: mapping buffer should be disabled to use this
#define LOG_NORM() // PRIM_LOG("norm: %f %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[-3], ((float*)VertexManager::s_pCurBufferPointer)[-2], ((float*)VertexManager::s_pCurBufferPointer)[-1]);
@@ -37,7 +30,7 @@ __forceinline float FracAdjust(T val)
//auto const U16FRAC = 1.f / (1u << 15);
// TODO: is this right?
- return val / float(1u << (sizeof(T) * 8 - std::numeric_limits::is_signed - 1));
+ return val / float(1u << (sizeof(T) * 8 - std::is_signed::value - 1));
}
template <>
@@ -76,11 +69,11 @@ struct Normal_Direct
template
__forceinline void Normal_Index_Offset()
{
- static_assert(!std::numeric_limits::is_signed, "Only unsigned I is sane!");
+ static_assert(std::is_unsigned::value, "Only unsigned I is sane!");
auto const index = DataRead();
auto const data = reinterpret_cast(cached_arraybases[ARRAY_NORMAL]
- + (index * g_main_cp_state.array_strides[ARRAY_NORMAL]) + sizeof(T) * 3 * Offset);
+ + (index * g_main_cp_state.array_strides[ARRAY_NORMAL]) + sizeof(T) * 3 * Offset);
ReadIndirect(data);
}
@@ -108,6 +101,63 @@ struct Normal_Index_Indices3
static const int size = sizeof(I) * 3;
};
+#if _M_SSE >= 0x301
+template
+struct Normal_Direct_SSSE3
+{
+ static void LOADERDECL function()
+ {
+ const T* pData = reinterpret_cast(DataGetPosition());
+ const float frac = 1. / float(1u << (sizeof(T) * 8 - std::is_signed::value - 1));
+ const __m128 scale = _mm_set_ps(frac, frac, frac, frac);
+ for (int i = 0; i < N; i++, pData += 3)
+ Vertex_Read_SSSE3(pData, scale);
+ DataSkip();
+ }
+
+ static const int size = sizeof(T) * N * 3;
+};
+
+template
+__forceinline void Normal_Index_Offset_SSSE3()
+{
+ static_assert(std::is_unsigned::value, "Only unsigned I is sane!");
+
+ auto const index = DataRead();
+ const T* pData = (const T*)(cached_arraybases[ARRAY_NORMAL]
+ + (index * g_main_cp_state.array_strides[ARRAY_NORMAL]) + sizeof(T) * 3 * Offset);
+ const float frac = 1. / float(1u << (sizeof(T) * 8 - std::is_signed::value - 1));
+ const __m128 scale = _mm_set_ps(frac, frac, frac, frac);
+ for (int i = 0; i < N; i++, pData += 3)
+ Vertex_Read_SSSE3(pData, scale);
+}
+
+template
+struct Normal_Index_SSSE3
+{
+ static void LOADERDECL function()
+ {
+ Normal_Index_Offset_SSSE3();
+ }
+
+ static const int size = sizeof(I);
+};
+
+template
+struct Normal_Index_Indices3_SSSE3
+{
+ static void LOADERDECL function()
+ {
+ Normal_Index_Offset_SSSE3();
+ Normal_Index_Offset_SSSE3();
+ Normal_Index_Offset_SSSE3();
+ }
+
+ static const int size = sizeof(I) * 3;
+};
+
+#endif
+
}
void VertexLoader_Normal::Init()
@@ -180,6 +230,77 @@ void VertexLoader_Normal::Init()
m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT3][FORMAT_USHORT] = Normal_Index_Indices3();
m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT3][FORMAT_SHORT] = Normal_Index_Indices3();
m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT3][FORMAT_FLOAT] = Normal_Index_Indices3();
+
+#if _M_SSE >= 0x301
+ if (cpu_info.bSSSE3)
+ {
+ m_Table[NRM_DIRECT][NRM_INDICES1][NRM_NBT][FORMAT_UBYTE] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES1][NRM_NBT][FORMAT_BYTE] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES1][NRM_NBT][FORMAT_USHORT] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES1][NRM_NBT][FORMAT_SHORT] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES1][NRM_NBT][FORMAT_FLOAT] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES1][NRM_NBT3][FORMAT_UBYTE] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES1][NRM_NBT3][FORMAT_BYTE] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES1][NRM_NBT3][FORMAT_USHORT] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES1][NRM_NBT3][FORMAT_SHORT] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES1][NRM_NBT3][FORMAT_FLOAT] = Normal_Direct_SSSE3();
+
+ m_Table[NRM_DIRECT][NRM_INDICES3][NRM_NBT][FORMAT_UBYTE] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES3][NRM_NBT][FORMAT_BYTE] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES3][NRM_NBT][FORMAT_USHORT] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES3][NRM_NBT][FORMAT_SHORT] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES3][NRM_NBT][FORMAT_FLOAT] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES3][NRM_NBT3][FORMAT_UBYTE] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES3][NRM_NBT3][FORMAT_BYTE] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES3][NRM_NBT3][FORMAT_USHORT] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES3][NRM_NBT3][FORMAT_SHORT] = Normal_Direct_SSSE3();
+ m_Table[NRM_DIRECT][NRM_INDICES3][NRM_NBT3][FORMAT_FLOAT] = Normal_Direct_SSSE3();
+
+ m_Table[NRM_INDEX8][NRM_INDICES1][NRM_NBT][FORMAT_UBYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES1][NRM_NBT][FORMAT_BYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES1][NRM_NBT][FORMAT_USHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES1][NRM_NBT][FORMAT_SHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES1][NRM_NBT][FORMAT_FLOAT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES1][NRM_NBT3][FORMAT_UBYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES1][NRM_NBT3][FORMAT_BYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES1][NRM_NBT3][FORMAT_USHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES1][NRM_NBT3][FORMAT_SHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES1][NRM_NBT3][FORMAT_FLOAT] = Normal_Index_SSSE3();
+
+ m_Table[NRM_INDEX8][NRM_INDICES3][NRM_NBT][FORMAT_UBYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES3][NRM_NBT][FORMAT_BYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES3][NRM_NBT][FORMAT_USHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES3][NRM_NBT][FORMAT_SHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES3][NRM_NBT][FORMAT_FLOAT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES3][NRM_NBT3][FORMAT_UBYTE] = Normal_Index_Indices3_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES3][NRM_NBT3][FORMAT_BYTE] = Normal_Index_Indices3_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES3][NRM_NBT3][FORMAT_USHORT] = Normal_Index_Indices3_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES3][NRM_NBT3][FORMAT_SHORT] = Normal_Index_Indices3_SSSE3();
+ m_Table[NRM_INDEX8][NRM_INDICES3][NRM_NBT3][FORMAT_FLOAT] = Normal_Index_Indices3_SSSE3();
+
+ m_Table[NRM_INDEX16][NRM_INDICES1][NRM_NBT][FORMAT_UBYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES1][NRM_NBT][FORMAT_BYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES1][NRM_NBT][FORMAT_USHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES1][NRM_NBT][FORMAT_SHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES1][NRM_NBT][FORMAT_FLOAT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES1][NRM_NBT3][FORMAT_UBYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES1][NRM_NBT3][FORMAT_BYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES1][NRM_NBT3][FORMAT_USHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES1][NRM_NBT3][FORMAT_SHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES1][NRM_NBT3][FORMAT_FLOAT] = Normal_Index_SSSE3();
+
+ m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT][FORMAT_UBYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT][FORMAT_BYTE] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT][FORMAT_USHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT][FORMAT_SHORT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT][FORMAT_FLOAT] = Normal_Index_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT3][FORMAT_UBYTE] = Normal_Index_Indices3_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT3][FORMAT_BYTE] = Normal_Index_Indices3_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT3][FORMAT_USHORT] = Normal_Index_Indices3_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT3][FORMAT_SHORT] = Normal_Index_Indices3_SSSE3();
+ m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT3][FORMAT_FLOAT] = Normal_Index_Indices3_SSSE3();
+ }
+#endif
}
unsigned int VertexLoader_Normal::GetSize(u64 _type,
diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp
index a38d429d58..6c50dd1560 100644
--- a/Source/Core/VideoCommon/VertexLoader_Position.cpp
+++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp
@@ -2,7 +2,7 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
-#include
+#include
#include "Common/CommonTypes.h"
#include "Common/CPUDetect.h"
@@ -74,7 +74,7 @@ template
void LOADERDECL Pos_ReadDirect()
{
static_assert(N <= 3, "N > 3 is not sane!");
- auto const scale = posScale;
+ auto const scale = posScale[0];
DataWriter dst;
DataReader src;
@@ -87,12 +87,12 @@ void LOADERDECL Pos_ReadDirect()
template
void LOADERDECL Pos_ReadIndex()
{
- static_assert(!std::numeric_limits::is_signed, "Only unsigned I is sane!");
+ static_assert(std::is_unsigned::value, "Only unsigned I is sane!");
static_assert(N <= 3, "N > 3 is not sane!");
auto const index = DataRead();
auto const data = reinterpret_cast(cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION]));
- auto const scale = posScale;
+ auto const scale = posScale[0];
DataWriter dst;
for (int i = 0; i < 3; ++i)
@@ -102,18 +102,22 @@ void LOADERDECL Pos_ReadIndex()
}
#if _M_SSE >= 0x301
-static const __m128i kMaskSwap32_3 = _mm_set_epi32(0xFFFFFFFFL, 0x08090A0BL, 0x04050607L, 0x00010203L);
-static const __m128i kMaskSwap32_2 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0x04050607L, 0x00010203L);
-
-template
-void LOADERDECL Pos_ReadIndex_Float_SSSE3()
+template
+void LOADERDECL Pos_ReadDirect_SSSE3()
{
+ const T* pData = reinterpret_cast(DataGetPosition());
+ Vertex_Read_SSSE3(pData, *(__m128*)posScale);
+ DataSkip<(2 + three) * sizeof(T)>();
+ LOG_VTX();
+}
+
+template
+void LOADERDECL Pos_ReadIndex_SSSE3()
+{
+ static_assert(std::is_unsigned::value, "Only unsigned I is sane!");
auto const index = DataRead();
- const u32* pData = (const u32 *)(cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION]));
- GC_ALIGNED128(const __m128i a = _mm_loadu_si128((__m128i*)pData));
- GC_ALIGNED128(__m128i b = _mm_shuffle_epi8(a, three ? kMaskSwap32_3 : kMaskSwap32_2));
- _mm_storeu_si128((__m128i*)VertexManager::s_pCurBufferPointer, b);
- VertexManager::s_pCurBufferPointer += sizeof(float) * 3;
+ const T* pData = (const T*)(cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION]));
+ Vertex_Read_SSSE3(pData, *(__m128*)posScale);
LOG_VTX();
}
#endif
@@ -169,15 +173,39 @@ void VertexLoader_Position::Init()
{
#if _M_SSE >= 0x301
-
if (cpu_info.bSSSE3)
{
- tableReadPosition[2][4][0] = Pos_ReadIndex_Float_SSSE3;
- tableReadPosition[2][4][1] = Pos_ReadIndex_Float_SSSE3;
- tableReadPosition[3][4][0] = Pos_ReadIndex_Float_SSSE3;
- tableReadPosition[3][4][1] = Pos_ReadIndex_Float_SSSE3;
+ tableReadPosition[1][0][0] = Pos_ReadDirect_SSSE3;
+ tableReadPosition[1][0][1] = Pos_ReadDirect_SSSE3;
+ tableReadPosition[1][1][0] = Pos_ReadDirect_SSSE3;
+ tableReadPosition[1][1][1] = Pos_ReadDirect_SSSE3;
+ tableReadPosition[1][2][0] = Pos_ReadDirect_SSSE3;
+ tableReadPosition[1][2][1] = Pos_ReadDirect_SSSE3;
+ tableReadPosition[1][3][0] = Pos_ReadDirect_SSSE3;
+ tableReadPosition[1][3][1] = Pos_ReadDirect_SSSE3;
+ tableReadPosition[1][4][0] = Pos_ReadDirect_SSSE3;
+ tableReadPosition[1][4][1] = Pos_ReadDirect_SSSE3;
+ tableReadPosition[2][0][0] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[2][0][1] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[3][0][0] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[3][0][1] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[2][1][0] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[2][1][1] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[3][1][0] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[3][1][1] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[2][2][0] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[2][2][1] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[3][2][0] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[3][2][1] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[2][3][0] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[2][3][1] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[3][3][0] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[3][3][1] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[2][4][0] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[2][4][1] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[3][4][0] = Pos_ReadIndex_SSSE3;
+ tableReadPosition[3][4][1] = Pos_ReadIndex_SSSE3;
}
-
#endif
}
diff --git a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp
index 25114ac82d..8acebd9213 100644
--- a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp
+++ b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
+#include
+
#include "Common/CommonTypes.h"
#include "Common/CPUDetect.h"
@@ -10,13 +12,6 @@
#include "VideoCommon/VertexManagerBase.h"
#include "VideoCommon/VideoCommon.h"
-
-#if _M_SSE >= 0x401
-#include
-#elif _M_SSE >= 0x301 && !(defined __GNUC__ && !defined __SSSE3__)
-#include
-#endif
-
template
void LOG_TEX();
@@ -54,7 +49,7 @@ float TCScale(float val, float scale)
template
void LOADERDECL TexCoord_ReadDirect()
{
- auto const scale = tcScale[tcIndex];
+ auto const scale = tcScale[tcIndex][0];
DataWriter dst;
DataReader src;
@@ -69,12 +64,12 @@ void LOADERDECL TexCoord_ReadDirect()
template
void LOADERDECL TexCoord_ReadIndex()
{
- static_assert(!std::numeric_limits::is_signed, "Only unsigned I is sane!");
+ static_assert(std::is_unsigned::value, "Only unsigned I is sane!");
auto const index = DataRead();
auto const data = reinterpret_cast(cached_arraybases[ARRAY_TEXCOORD0 + tcIndex]
- + (index * g_main_cp_state.array_strides[ARRAY_TEXCOORD0 + tcIndex]));
- auto const scale = tcScale[tcIndex];
+ + (index * g_main_cp_state.array_strides[ARRAY_TEXCOORD0 + tcIndex]));
+ auto const scale = tcScale[tcIndex][0];
DataWriter dst;
for (int i = 0; i != N; ++i)
@@ -84,44 +79,27 @@ void LOADERDECL TexCoord_ReadIndex()
++tcIndex;
}
-#if _M_SSE >= 0x401
-static const __m128i kMaskSwap16_2 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0xFFFFFFFFL, 0x02030001L);
-
-template
-void LOADERDECL TexCoord_ReadIndex_Short2_SSE4()
+#if _M_SSE >= 0x301
+template
+void LOADERDECL TexCoord_ReadDirect2_SSSE3()
{
- static_assert(!std::numeric_limits::is_signed, "Only unsigned I is sane!");
-
- // Heavy in ZWW
- auto const index = DataRead();
- const s32 *pData = (const s32*)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (index * g_main_cp_state.array_strides[ARRAY_TEXCOORD0+tcIndex]));
- const __m128i a = _mm_cvtsi32_si128(*pData);
- const __m128i b = _mm_shuffle_epi8(a, kMaskSwap16_2);
- const __m128i c = _mm_cvtepi16_epi32(b);
- const __m128 d = _mm_cvtepi32_ps(c);
- const __m128 e = _mm_load1_ps(&tcScale[tcIndex]);
- const __m128 f = _mm_mul_ps(d, e);
- _mm_storeu_ps((float*)VertexManager::s_pCurBufferPointer, f);
- VertexManager::s_pCurBufferPointer += sizeof(float) * 2;
+ const T* pData = reinterpret_cast(DataGetPosition());
+ __m128 scale = _mm_castsi128_ps(_mm_loadl_epi64((__m128i*)tcScale[tcIndex]));
+ Vertex_Read_SSSE3(pData, scale);
+ DataSkip<2 * sizeof(T)>();
LOG_TEX<2>();
tcIndex++;
}
-#endif
-#if _M_SSE >= 0x301
-static const __m128i kMaskSwap32 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0x04050607L, 0x00010203L);
-
-template
-void LOADERDECL TexCoord_ReadIndex_Float2_SSSE3()
+template
+void LOADERDECL TexCoord_ReadIndex2_SSSE3()
{
- static_assert(!std::numeric_limits::is_signed, "Only unsigned I is sane!");
+ static_assert(std::is_unsigned::value, "Only unsigned I is sane!");
auto const index = DataRead();
- const u32 *pData = (const u32 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (index * g_main_cp_state.array_strides[ARRAY_TEXCOORD0+tcIndex]));
- GC_ALIGNED128(const __m128i a = _mm_loadl_epi64((__m128i*)pData));
- GC_ALIGNED128(const __m128i b = _mm_shuffle_epi8(a, kMaskSwap32));
- _mm_storel_epi64((__m128i*)VertexManager::s_pCurBufferPointer, b);
- VertexManager::s_pCurBufferPointer += sizeof(float) * 2;
+ const T* pData = (const T*)(cached_arraybases[ARRAY_TEXCOORD0 + tcIndex] + (index * g_main_cp_state.array_strides[ARRAY_TEXCOORD0 + tcIndex]));
+ __m128 scale = _mm_castsi128_ps(_mm_loadl_epi64((__m128i*)tcScale[tcIndex]));
+ Vertex_Read_SSSE3(pData, scale);
LOG_TEX<2>();
tcIndex++;
}
@@ -177,23 +155,24 @@ void VertexLoader_TextCoord::Init()
{
#if _M_SSE >= 0x301
-
if (cpu_info.bSSSE3)
{
- tableReadTexCoord[2][4][1] = TexCoord_ReadIndex_Float2_SSSE3;
- tableReadTexCoord[3][4][1] = TexCoord_ReadIndex_Float2_SSSE3;
+ tableReadTexCoord[1][0][1] = TexCoord_ReadDirect2_SSSE3;
+ tableReadTexCoord[1][1][1] = TexCoord_ReadDirect2_SSSE3;
+ tableReadTexCoord[1][2][1] = TexCoord_ReadDirect2_SSSE3;
+ tableReadTexCoord[1][3][1] = TexCoord_ReadDirect2_SSSE3;
+ tableReadTexCoord[1][4][1] = TexCoord_ReadDirect2_SSSE3;
+ tableReadTexCoord[2][0][1] = TexCoord_ReadIndex2_SSSE3;
+ tableReadTexCoord[3][0][1] = TexCoord_ReadIndex2_SSSE3;
+ tableReadTexCoord[2][1][1] = TexCoord_ReadIndex2_SSSE3;
+ tableReadTexCoord[3][1][1] = TexCoord_ReadIndex2_SSSE3;
+ tableReadTexCoord[2][2][1] = TexCoord_ReadIndex2_SSSE3;
+ tableReadTexCoord[3][2][1] = TexCoord_ReadIndex2_SSSE3;
+ tableReadTexCoord[2][3][1] = TexCoord_ReadIndex2_SSSE3;
+ tableReadTexCoord[3][3][1] = TexCoord_ReadIndex2_SSSE3;
+ tableReadTexCoord[2][4][1] = TexCoord_ReadIndex2_SSSE3;
+ tableReadTexCoord[3][4][1] = TexCoord_ReadIndex2_SSSE3;
}
-
-#endif
-
-#if _M_SSE >= 0x401
-
- if (cpu_info.bSSE4_1)
- {
- tableReadTexCoord[2][3][1] = TexCoord_ReadIndex_Short2_SSE4;
- tableReadTexCoord[3][3][1] = TexCoord_ReadIndex_Short2_SSE4;
- }
-
#endif
}
diff --git a/Source/Core/VideoCommon/VertexManagerBase.cpp b/Source/Core/VideoCommon/VertexManagerBase.cpp
index 7a18ba435b..dcd8780ede 100644
--- a/Source/Core/VideoCommon/VertexManagerBase.cpp
+++ b/Source/Core/VideoCommon/VertexManagerBase.cpp
@@ -53,7 +53,8 @@ u32 VertexManager::GetRemainingSize()
void VertexManager::PrepareForAdditionalData(int primitive, u32 count, u32 stride)
{
- u32 const needed_vertex_bytes = count * stride;
+ // The SSE vertex loader can write up to 4 bytes past the end
+ u32 const needed_vertex_bytes = count * stride + 4;
// We can't merge different kinds of primitives, so we have to flush here
if (current_primitive_type != primitive_from_gx[primitive])
diff --git a/Source/Core/VideoCommon/VideoBackendBase.h b/Source/Core/VideoCommon/VideoBackendBase.h
index 7d62dda37b..7260fe6098 100644
--- a/Source/Core/VideoCommon/VideoBackendBase.h
+++ b/Source/Core/VideoCommon/VideoBackendBase.h
@@ -89,6 +89,7 @@ public:
virtual u32 Video_AccessEFB(EFBAccessType, u32, u32, u32) = 0;
virtual u32 Video_GetQueryResult(PerfQueryType type) = 0;
+ virtual u16 Video_GetBoundingBox(int index) = 0;
virtual void Video_AddMessage(const std::string& msg, unsigned int milliseconds) = 0;
virtual void Video_ClearMessages() = 0;
@@ -137,6 +138,7 @@ class VideoBackendHardware : public VideoBackend
u32 Video_AccessEFB(EFBAccessType, u32, u32, u32) override;
u32 Video_GetQueryResult(PerfQueryType type) override;
+ u16 Video_GetBoundingBox(int index) override;
void Video_AddMessage(const std::string& pstr, unsigned int milliseconds) override;
void Video_ClearMessages() override;
diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h
index 9f2a8e81eb..44b0740728 100644
--- a/Source/Core/VideoCommon/VideoConfig.h
+++ b/Source/Core/VideoCommon/VideoConfig.h
@@ -138,6 +138,7 @@ struct VideoConfig final
bool bSupportsOversizedViewports;
bool bSupportsEarlyZ; // needed by PixelShaderGen, so must stay in VideoCommon
bool bSupportsBindingLayout; // Needed by ShaderGen, so must stay in VideoCommon
+ bool bSupportsBBox;
} backend_info;
// Utility
diff --git a/Source/UnitTests/CMakeLists.txt b/Source/UnitTests/CMakeLists.txt
index e625f5ffe9..bfe197fcfb 100644
--- a/Source/UnitTests/CMakeLists.txt
+++ b/Source/UnitTests/CMakeLists.txt
@@ -1,3 +1,7 @@
+set(LIBS core gtest)
+if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ list(APPEND LIBS ${FOUNDATION_LIBRARY} ${CORESERV_LIBRARY})
+endif()
macro(add_dolphin_test target srcs)
# Since this is a Core dependency, it can't be linked as a library and has
# to be linked as an object file. Otherwise CMake inserts the library after
@@ -9,7 +13,7 @@ macro(add_dolphin_test target srcs)
add_custom_command(TARGET Test_${target}
PRE_LINK
COMMAND mkdir -p ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Tests)
- target_link_libraries(Test_${target} core gtest)
+ target_link_libraries(Test_${target} ${LIBS})
add_dependencies(unittests Test_${target})
add_test(NAME ${target} COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Tests/${target})
endmacro(add_dolphin_test)
diff --git a/Source/UnitTests/TestUtils/StubHost.cpp b/Source/UnitTests/TestUtils/StubHost.cpp
index a8f6f1cf2f..2e8839ea67 100644
--- a/Source/UnitTests/TestUtils/StubHost.cpp
+++ b/Source/UnitTests/TestUtils/StubHost.cpp
@@ -17,7 +17,6 @@ void* Host_GetRenderHandle() { return nullptr; }
void Host_UpdateTitle(const std::string&) {}
void Host_UpdateDisasmDialog() {}
void Host_UpdateMainFrame() {}
-void Host_GetRenderWindowSize(int&, int&, int&, int&) {}
void Host_RequestRenderWindowSize(int, int) {}
void Host_RequestFullscreen(bool) {}
void Host_SetStartupDebuggingParameters() {}
diff --git a/Tools/check-includes.py b/Tools/check-includes.py
index d8d1c33c0d..0c2aee3832 100755
--- a/Tools/check-includes.py
+++ b/Tools/check-includes.py
@@ -76,7 +76,16 @@ def show_differences(bad, good):
def check_file(path):
print('Checking %s' % path)
- lines = (l.strip() for l in open(path).read().split('\n'))
+ try:
+ try:
+ data = open(path, encoding='utf-8').read()
+ except TypeError: # py2
+ data = open(path).read().decode('utf-8')
+ except UnicodeDecodeError:
+ sys.stderr.write('%s: bad UTF-8 data\n' % path)
+ return
+
+ lines = (l.strip() for l in data.split('\n'))
lines = exclude_if_blocks(lines)
includes = list(filter_includes(lines))
sorted_includes = sort_includes(includes)