diff --git a/.gitignore b/.gitignore
index cbbe22f3ec..ce94486f63 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,7 +18,6 @@
*.aps
*.exp
Debug
-DebugFast
Release
Windows/x64
Windows/ipch
@@ -35,6 +34,8 @@ PPSSPPControls.dat
Logs
Memstick
+memstick
+Cheats
bin
gen
@@ -55,3 +56,7 @@ android/assets/lang
android/assets/flash0
ppge_atlas.zim.png
local.properties
+
+# For vim
+*.swp
+tags
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2a0070625..4c2800ec37 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,9 +129,15 @@ if(NOT MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
add_definitions(-Wno-multichar)
add_definitions(-fno-strict-aliasing)
- add_definitions(-ffast-math)
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -parallel -fopenmp")
+ else()
+ add_definitions(-ffast-math)
+ endif()
if(NOT APPLE)
- add_definitions(-Wno-psabi)
+ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ add_definitions(-Wno-psabi)
+ endif()
add_definitions(-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D__BSD_VISIBLE=1)
add_definitions(-D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64)
endif()
@@ -140,7 +146,7 @@ if(NOT MSVC)
endif()
if(BLACKBERRY)
- add_definitions(-D_QNX_SOURCE=1 -D_C99=1 -O2 -mfpu=neon -mtune=cortex-a9)
+ add_definitions(-D_QNX_SOURCE=1 -D_C99=1 -O3 -mfpu=neon -mtune=cortex-a9)
endif()
if(X86 AND NOT MIPS)
@@ -437,8 +443,16 @@ elseif(IOS)
ios/ViewController.mm
ios/ViewController.h
ios/AudioEngine.mm
- ios/AudioEngine.h)
+ ios/AudioEngine.h
+ ios/iCade/iCadeReaderView.h
+ ios/iCade/iCadeReaderView.m
+ ios/iCade/iCadeState.h)
set(nativeExtraLibs ${nativeExtraLibs} "-framework Foundation -framework AudioToolbox -framework CoreGraphics -framework QuartzCore -framework OpenGLES -framework UIKit -framework GLKit -framework OpenAL")
+ # FFMPEG
+ add_definitions(-DUSE_FFMPEG)
+ include_directories(ffmpeg/ios/universal/include)
+ link_directories(ffmpeg/ios/universal/lib)
+ set(nativeExtraLibs ${nativeExtraLibs} iconv bz2 libavformat.a libavcodec.a libswresample.a libavutil.a libswscale.a)
set(TargetBin PPSSPP)
elseif(USING_QT_UI)
# Currently unused
@@ -449,13 +463,13 @@ elseif(USING_QT_UI)
set(nativeExtraLibs ${nativeExtraLibs} ${QT_LIBRARIES})
set(TargetBin PPSSPPQt)
elseif(BLACKBERRY)
- set(nativeExtra ${nativeExtra} native/base/BlackberryMain.cpp)
+ set(nativeExtra ${nativeExtra} native/base/BlackberryMain.cpp native/base/BlackberryDisplay.cpp)
set(nativeExtraLibs ${nativeExtraLibs} OpenAL bps screen socket EGL)
# FFMPEG
add_definitions(-DUSE_FFMPEG)
include_directories(ffmpeg/blackberry/armv7/include)
link_directories(ffmpeg/blackberry/armv7/lib)
- set(nativeExtraLibs ${nativeExtraLibs} iconv libavformat.a libavcodec.a libswresample.a libavutil.a)
+ set(nativeExtraLibs ${nativeExtraLibs} iconv libavformat.a libavcodec.a libswresample.a libavutil.a libswscale.a)
set(TargetBin PPSSPPBlackberry)
elseif(SDL_FOUND)
# Require SDL
@@ -468,6 +482,9 @@ elseif(SDL_FOUND)
elseif(PANDORA OR MAEMO)
set(nativeExtraLibs ${nativeExtraLibs} pthread EGL X11)
endif()
+ # FFMPEG
+ add_definitions(-DUSE_FFMPEG)
+ set(nativeExtraLibs ${nativeExtraLibs} avformat avcodec swresample swscale)
set(TargetBin PPSSPPSDL)
else()
message(FATAL_ERROR "Could not find SDL. Failing.")
@@ -497,6 +514,7 @@ add_library(native STATIC
native/base/error_context.h
native/base/fastlist.h
native/base/fastlist_test.cpp
+ native/base/functional.h
native/base/linked_ptr.h
native/base/logging.h
native/base/mutex.h
@@ -506,6 +524,8 @@ add_library(native STATIC
native/base/stringutil.h
native/base/timeutil.cpp
native/base/timeutil.h
+ native/data/compression.cpp
+ native/data/compression.h
native/file/chunk_file.cpp
native/file/chunk_file.h
native/file/dialog.cpp
@@ -555,7 +575,6 @@ add_library(native STATIC
native/input/input_state.h
native/json/json_writer.cpp
native/json/json_writer.h
- native/math/compression.h
native/math/curves.cpp
native/math/curves.h
native/math/lin/aabb.cpp
@@ -577,6 +596,8 @@ add_library(native STATIC
native/net/http_client.h
native/net/resolve.cpp
native/net/resolve.h
+ native/net/url.cpp
+ native/net/url.h
native/profiler/profiler.cpp
native/profiler/profiler.h
native/thread/prioritizedworkqueue.cpp
@@ -591,6 +612,12 @@ add_library(native STATIC
native/ui/ui.h
native/ui/ui_context.cpp
native/ui/ui_context.h
+ native/ui/ui_screen.cpp
+ native/ui/ui_screen.h
+ native/ui/view.cpp
+ native/ui/view.h
+ native/ui/viewgroup.cpp
+ native/ui/viewgroup.h
native/ui/virtual_input.cpp
native/ui/virtual_input.h
native/util/bits/bits.cpp
@@ -608,7 +635,11 @@ add_library(native STATIC
native/ext/rapidxml/rapidxml.hpp
native/ext/rapidxml/rapidxml_iterators.hpp
native/ext/rapidxml/rapidxml_print.hpp
- native/ext/rapidxml/rapidxml_utils.hpp)
+ native/ext/rapidxml/rapidxml_utils.hpp
+ native/ext/vjson/json.cpp
+ native/ext/vjson/json.h
+ native/ext/vjson/block_allocator.cpp
+ native/ext/vjson/block_allocator.h)
include_directories(native)
# rapidxml is headers only so we can't make a lib specific for it
include_directories(native/ext/rapidxml)
@@ -643,6 +674,7 @@ add_library(xbrz STATIC
include_directories(ext/xbrz)
set(CoreExtra)
+set(CoreExtraLibs)
if(ARM)
set(CoreExtra ${CoreExtra}
Core/MIPS/ARM/ArmAsm.cpp
@@ -676,6 +708,12 @@ elseif(X86)
Core/MIPS/x86/RegCacheFPU.h)
endif()
+# atrac3plus.cpp used dl* functions on non-win32 platforms
+# Core needs to be linked with dl on these platforms
+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(CoreExtraLibs ${CoreExtraLibs} ${CMAKE_DL_LIBS})
+endif()
+
# 'ppsspp_jni' on ANDROID, 'Core' everywhere else
# SHARED on ANDROID, STATIC everywhere else
add_library(${CoreLibName} ${CoreLinkType}
@@ -689,6 +727,8 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/CoreParameter.h
Core/CoreTiming.cpp
Core/CoreTiming.h
+ Core/CwCheat.cpp
+ Core/CwCheat.h
Core/Debugger/Breakpoints.cpp
Core/Debugger/Breakpoints.h
Core/Debugger/DebugInterface.h
@@ -737,6 +777,8 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/HLE/sceAtrac.cpp
Core/HLE/sceAtrac.h
Core/HLE/sceAudio.cpp
+ Core/HLE/sceAudiocodec.cpp
+ Core/HLE/sceAudiocodec.h
Core/HLE/sceAudio.h
Core/HLE/sceChnnlsv.cpp
Core/HLE/sceChnnlsv.h
@@ -832,10 +874,16 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/HLE/sceNp.h
Core/HLE/scePauth.cpp
Core/HLE/scePauth.h
+ Core/HW/atrac3plus.cpp
+ Core/HW/atrac3plus.h
Core/HW/MediaEngine.cpp
Core/HW/MediaEngine.h
+ Core/HW/MpegDemux.cpp
+ Core/HW/MpegDemux.h
Core/HW/MemoryStick.cpp
Core/HW/MemoryStick.h
+ Core/HW/OMAConvert.cpp
+ Core/HW/OMAConvert.h
Core/HW/SasAudio.cpp
Core/HW/SasAudio.h
Core/Host.cpp
@@ -889,7 +937,7 @@ add_library(${CoreLibName} ${CoreLinkType}
Globals.h
git-version.cpp)
target_link_libraries(${CoreLibName} Common native kirk cityhash xbrz
- ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES})
+ ${CoreExtraLibs} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES})
setup_target_project(${CoreLibName} Core)
# Generate git-version.cpp at build time.
@@ -1026,9 +1074,12 @@ set(NativeAppSource
android/jni/TestRunner.cpp
UI/GameInfoCache.cpp
UI/MenuScreens.cpp
+ UI/GameScreen.cpp
+ UI/GameSettingsScreen.cpp
UI/GamepadEmu.cpp
UI/UIShader.cpp
UI/OnScreenDisplay.cpp
+ UI/PluginScreen.cpp
UI/ui_atlas.cpp)
if(ANDROID)
set(NativeAppSource ${NativeAppSource} android/jni/ArmEmitterTest.cpp)
diff --git a/Common/ArmEmitter.cpp b/Common/ArmEmitter.cpp
index 5bcfd618d7..c66c1b3a88 100644
--- a/Common/ArmEmitter.cpp
+++ b/Common/ArmEmitter.cpp
@@ -117,14 +117,33 @@ bool ARMXEmitter::TrySetValue_TwoOp(ARMReg reg, u32 val)
return true;
}
-void ARMXEmitter::MOVI2F(ARMReg dest, float val, ARMReg tempReg)
+void ARMXEmitter::MOVI2F(ARMReg dest, float val, ARMReg tempReg, bool negate)
{
union {float f; u32 u;} conv;
- conv.f = val;
+ conv.f = negate ? -val : val;
+ // Try moving directly first if mantisse is empty
+ if (cpu_info.bVFPv3 && ((conv.u & 0x7FFFF) == 0))
+ {
+ // VFP Encoding for Imms: <7> Not(<6>) Repeat(<6>,5) <5:0> Zeros(19)
+ bool bit6 = (conv.u & 0x40000000) == 0x40000000;
+ bool canEncode = true;
+ for (u32 mask = 0x20000000; mask >= 0x2000000; mask >>= 1)
+ {
+ if (((conv.u & mask) == mask) == bit6)
+ canEncode = false;
+ }
+ if (canEncode)
+ {
+ u32 imm8 = (conv.u & 0x80000000) >> 24; // sign bit
+ imm8 |= (!bit6 << 6);
+ imm8 |= (conv.u & 0x1F80000) >> 19;
+ VMOV(dest, IMM(imm8));
+ return;
+ }
+ }
MOVI2R(tempReg, conv.u);
VMOV(dest, tempReg);
- // TODO: VMOV an IMM directly if possible
- // Otherwise, use a literal pool and VLDR directly (+- 1020)
+ // Otherwise, possible to use a literal pool and VLDR directly (+- 1020)
}
void ARMXEmitter::ADDI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch)
@@ -648,11 +667,11 @@ void ARMXEmitter::RBIT(ARMReg dest, ARMReg src)
}
void ARMXEmitter::REV (ARMReg dest, ARMReg src)
{
- Write32(condition | (0x6B << 20) | (0xF << 16) | (dest << 12) | (0xF3 << 4) | src);
+ Write32(condition | (0x6BF << 16) | (dest << 12) | (0xF3 << 4) | src);
}
void ARMXEmitter::REV16(ARMReg dest, ARMReg src)
{
- Write32(condition | (0x3DF << 16) | (dest << 12) | (0xFD << 4) | src);
+ Write32(condition | (0x6BF << 16) | (dest << 12) | (0xFB << 4) | src);
}
void ARMXEmitter::_MSR (bool write_nzcvq, bool write_g, Operand2 op2)
@@ -850,6 +869,21 @@ ARMReg ARMXEmitter::SubBase(ARMReg Reg)
}
// NEON Specific
+void ARMXEmitter::VABD(IntegerSize Size, ARMReg Vd, ARMReg Vn, ARMReg Vm)
+{
+ _assert_msg_(DYNA_REC, Vd >= D0, "Pass invalid register to VABD(float)");
+ _assert_msg_(DYNA_REC, cpu_info.bNEON, "Can't use VABD(float) when CPU doesn't support it");
+ bool register_quad = Vd >= Q0;
+
+ // Gets encoded as a double register
+ Vd = SubBase(Vd);
+ Vn = SubBase(Vn);
+ Vm = SubBase(Vm);
+
+ Write32((0xF3 << 24) | ((Vd & 0x10) << 18) | (Size << 20) | ((Vn & 0xF) << 16) \
+ | ((Vd & 0xF) << 12) | (0xD << 8) | ((Vn & 0x10) << 3) | (register_quad << 6) \
+ | ((Vm & 0x10) << 2) | (Vm & 0xF));
+}
void ARMXEmitter::VADD(IntegerSize Size, ARMReg Vd, ARMReg Vn, ARMReg Vm)
{
_assert_msg_(DYNA_REC, Vd >= D0, "Pass invalid register to VADD(integer)");
@@ -864,7 +898,7 @@ void ARMXEmitter::VADD(IntegerSize Size, ARMReg Vd, ARMReg Vn, ARMReg Vm)
Write32((0xF2 << 24) | ((Vd & 0x10) << 18) | (Size << 20) | ((Vn & 0xF) << 16) \
| ((Vd & 0xF) << 12) | (0x8 << 8) | ((Vn & 0x10) << 3) | (register_quad << 6) \
- | ((Vm & 0x10) << 2) | (Vm & 0xF));
+ | ((Vm & 0x10) << 2) | (Vm & 0xF));
}
void ARMXEmitter::VSUB(IntegerSize Size, ARMReg Vd, ARMReg Vn, ARMReg Vm)
@@ -879,7 +913,7 @@ void ARMXEmitter::VSUB(IntegerSize Size, ARMReg Vd, ARMReg Vn, ARMReg Vm)
Write32((0xF3 << 24) | ((Vd & 0x10) << 18) | (Size << 20) | ((Vn & 0xF) << 16) \
| ((Vd & 0xF) << 12) | (0x8 << 8) | ((Vn & 0x10) << 3) | (1 << 6) \
- | ((Vm & 0x10) << 2) | (Vm & 0xF));
+ | ((Vm & 0x10) << 2) | (Vm & 0xF));
}
// VFP Specific
@@ -891,24 +925,30 @@ struct VFPEnc
// Double/single, Neon
const VFPEnc VFPOps[][2] = {
{{0xE0, 0xA0}, {0x20, 0xD1}}, // 0: VMLA
- {{0xE0, 0xA4}, {0x22, 0xD1}}, // 1: VMLS
- {{0xE3, 0xA0}, {0x20, 0xD0}}, // 2: VADD
- {{0xE3, 0xA4}, {0x22, 0xD0}}, // 3: VSUB
- {{0xE2, 0xA0}, {0x30, 0xD1}}, // 4: VMUL
- {{0xEB, 0xAC}, { -1 /* 0x3B */, -1 /* 0x70 */}}, // 5: VABS(Vn(0x0) used for encoding)
- {{0xE8, 0xA0}, { -1, -1}}, // 6: VDIV
- {{0xEB, 0xA4}, { -1 /* 0x3B */, -1 /* 0x78 */}}, // 7: VNEG(Vn(0x1) used for encoding)
- {{0xEB, 0xAC}, { -1, -1}}, // 8: VSQRT (Vn(0x1) used for encoding)
- {{0xEB, 0xA4}, { -1, -1}}, // 9: VCMP (Vn(0x4 | #0 ? 1 : 0) used for encoding)
- {{0xEB, 0xAC}, { -1, -1}}, // 10: VCMPE (Vn(0x4 | #0 ? 1 : 0) used for encoding)
- {{ -1, -1}, {0x3B, 0x30}}, // 11: VABSi
+ {{0xE1, 0xA4}, { -1, -1}}, // 1: VNMLA
+ {{0xE0, 0xA4}, {0x22, 0xD1}}, // 2: VMLS
+ {{0xE1, 0xA0}, { -1, -1}}, // 3: VNMLS
+ {{0xE3, 0xA0}, {0x20, 0xD0}}, // 4: VADD
+ {{0xE3, 0xA4}, {0x22, 0xD0}}, // 5: VSUB
+ {{0xE2, 0xA0}, {0x30, 0xD1}}, // 6: VMUL
+ {{0xE2, 0xA4}, { -1, -1}}, // 7: VNMUL
+ {{0xEB, 0xAC}, { -1 /* 0x3B */, -1 /* 0x70 */}}, // 8: VABS(Vn(0x0) used for encoding)
+ {{0xE8, 0xA0}, { -1, -1}}, // 9: VDIV
+ {{0xEB, 0xA4}, { -1 /* 0x3B */, -1 /* 0x78 */}}, // 10: VNEG(Vn(0x1) used for encoding)
+ {{0xEB, 0xAC}, { -1, -1}}, // 11: VSQRT (Vn(0x1) used for encoding)
+ {{0xEB, 0xA4}, { -1, -1}}, // 12: VCMP (Vn(0x4 | #0 ? 1 : 0) used for encoding)
+ {{0xEB, 0xAC}, { -1, -1}}, // 13: VCMPE (Vn(0x4 | #0 ? 1 : 0) used for encoding)
+ {{ -1, -1}, {0x3B, 0x30}}, // 14: VABSi
};
const char *VFPOpNames[] = {
"VMLA",
+ "VNMLA",
"VMLS",
+ "VNMLS",
"VADD",
"VSUB",
"VMUL",
+ "VNMUL",
"VABS",
"VDIV",
"VNEG",
@@ -962,6 +1002,7 @@ u32 ARMXEmitter::EncodeVm(ARMReg Vm)
else
return ((Reg & 0x1) << 5) | (Reg >> 1);
}
+
void ARMXEmitter::WriteVFPDataOp(u32 Op, ARMReg Vd, ARMReg Vn, ARMReg Vm)
{
bool quad_reg = Vd >= Q0;
@@ -978,18 +1019,21 @@ void ARMXEmitter::WriteVFPDataOp(u32 Op, ARMReg Vd, ARMReg Vn, ARMReg Vm)
Write32(cond | (enc.opc1 << 20) | VnEnc | VdEnc | (enc.opc2 << 4) | (quad_reg << 6) | (double_reg << 8) | VmEnc);
}
void ARMXEmitter::VMLA(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(0, Vd, Vn, Vm); }
-void ARMXEmitter::VMLS(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(1, Vd, Vn, Vm); }
-void ARMXEmitter::VADD(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(2, Vd, Vn, Vm); }
-void ARMXEmitter::VSUB(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(3, Vd, Vn, Vm); }
-void ARMXEmitter::VMUL(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(4, Vd, Vn, Vm); }
-void ARMXEmitter::VABS(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(5, Vd, D0, Vm); }
-void ARMXEmitter::VDIV(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(6, Vd, Vn, Vm); }
-void ARMXEmitter::VNEG(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(7, Vd, D1, Vm); }
-void ARMXEmitter::VSQRT(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(8, Vd, D1, Vm); }
-void ARMXEmitter::VCMP(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(9, Vd, D4, Vm); }
-void ARMXEmitter::VCMPE(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(10, Vd, D4, Vm); }
-void ARMXEmitter::VCMP(ARMReg Vd){ WriteVFPDataOp(9, Vd, D5, D0); }
-void ARMXEmitter::VCMPE(ARMReg Vd){ WriteVFPDataOp(10, Vd, D5, D0); }
+void ARMXEmitter::VNMLA(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(1, Vd, Vn, Vm); }
+void ARMXEmitter::VMLS(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(2, Vd, Vn, Vm); }
+void ARMXEmitter::VNMLS(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(3, Vd, Vn, Vm); }
+void ARMXEmitter::VADD(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(4, Vd, Vn, Vm); }
+void ARMXEmitter::VSUB(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(5, Vd, Vn, Vm); }
+void ARMXEmitter::VMUL(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(6, Vd, Vn, Vm); }
+void ARMXEmitter::VNMUL(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(7, Vd, Vn, Vm); }
+void ARMXEmitter::VABS(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(8, Vd, D0, Vm); }
+void ARMXEmitter::VDIV(ARMReg Vd, ARMReg Vn, ARMReg Vm){ WriteVFPDataOp(9, Vd, Vn, Vm); }
+void ARMXEmitter::VNEG(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(10, Vd, D1, Vm); }
+void ARMXEmitter::VSQRT(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(11, Vd, D1, Vm); }
+void ARMXEmitter::VCMP(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(12, Vd, D4, Vm); }
+void ARMXEmitter::VCMPE(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(13, Vd, D4, Vm); }
+void ARMXEmitter::VCMP(ARMReg Vd){ WriteVFPDataOp(12, Vd, D5, D0); }
+void ARMXEmitter::VCMPE(ARMReg Vd){ WriteVFPDataOp(13, Vd, D5, D0); }
void ARMXEmitter::VLDR(ARMReg Dest, ARMReg Base, s16 offset)
{
@@ -1059,6 +1103,11 @@ void ARMXEmitter::VMSR(ARMReg Rt) {
}
// VFP and ASIMD
+void ARMXEmitter::VMOV(ARMReg Dest, Operand2 op2)
+{
+ _assert_msg_(DYNA_REC, cpu_info.bVFPv3, "VMOV #imm requires VFPv3");
+ Write32(condition | (0xEB << 20) | EncodeVd(Dest) | (0xA << 8) | op2.Imm8VFP());
+}
void ARMXEmitter::VMOV(ARMReg Dest, ARMReg Src, bool high)
{
_assert_msg_(DYNA_REC, Src < S0, "This VMOV doesn't support SRC other than ARM Reg");
@@ -1067,7 +1116,7 @@ void ARMXEmitter::VMOV(ARMReg Dest, ARMReg Src, bool high)
Dest = SubBase(Dest);
Write32(condition | (0xE << 24) | (high << 21) | ((Dest & 0xF) << 16) | (Src << 12) \
- | (11 << 8) | ((Dest & 0x10) << 3) | (1 << 4));
+ | (0xB << 8) | ((Dest & 0x10) << 3) | (1 << 4));
}
void ARMXEmitter::VMOV(ARMReg Dest, ARMReg Src)
diff --git a/Common/ArmEmitter.h b/Common/ArmEmitter.h
index 8ef109d8ff..208d5794ac 100644
--- a/Common/ArmEmitter.h
+++ b/Common/ArmEmitter.h
@@ -530,6 +530,7 @@ public:
// Subtracts the base from the register to give us the real one
ARMReg SubBase(ARMReg Reg);
// NEON Only
+ void VABD(IntegerSize Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VADD(IntegerSize Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VSUB(IntegerSize Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
@@ -541,6 +542,10 @@ public:
// Compares against zero
void VCMP(ARMReg Vd);
void VCMPE(ARMReg Vd);
+
+ void VNMLA(ARMReg Vd, ARMReg Vn, ARMReg Vm);
+ void VNMLS(ARMReg Vd, ARMReg Vn, ARMReg Vm);
+ void VNMUL(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VDIV(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VSQRT(ARMReg Vd, ARMReg Vm);
@@ -552,6 +557,7 @@ public:
void VMUL(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VMLA(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VMLS(ARMReg Vd, ARMReg Vn, ARMReg Vm);
+ void VMOV(ARMReg Dest, Operand2 op2);
void VMOV(ARMReg Dest, ARMReg Src, bool high);
void VMOV(ARMReg Dest, ARMReg Src);
void VCVT(ARMReg Dest, ARMReg Src, int flags);
@@ -564,7 +570,7 @@ public:
// Wrapper around MOVT/MOVW with fallbacks.
void MOVI2R(ARMReg reg, u32 val, bool optimize = true);
- void MOVI2F(ARMReg dest, float val, ARMReg tempReg);
+ void MOVI2F(ARMReg dest, float val, ARMReg tempReg, bool negate = false);
void ADDI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch);
void ANDI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch);
diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj
index 318e0dcce3..0095221811 100644
--- a/Common/Common.vcxproj
+++ b/Common/Common.vcxproj
@@ -72,6 +72,9 @@
../native
StreamingSIMDExtensions2
Fast
+ true
+ false
+ false
Windows
@@ -93,6 +96,9 @@
StreamingSIMDExtensions2
Fast
false
+ true
+ false
+ false
Windows
@@ -116,6 +122,8 @@
Fast
../native
Speed
+ true
+ false
Windows
@@ -142,6 +150,8 @@
Fast
Speed
false
+ true
+ false
Windows
diff --git a/Common/ConsoleListener.cpp b/Common/ConsoleListener.cpp
index b7a69208d5..0dfcf3914f 100644
--- a/Common/ConsoleListener.cpp
+++ b/Common/ConsoleListener.cpp
@@ -37,6 +37,15 @@ const int LOG_PENDING_MAX = 120 * 10000;
const int LOG_LATENCY_DELAY_MS = 20;
const int LOG_SHUTDOWN_DELAY_MS = 250;
const int LOG_MAX_DISPLAY_LINES = 4000;
+
+int ConsoleListener::refCount = 0;
+HANDLE ConsoleListener::hThread = NULL;
+HANDLE ConsoleListener::hTriggerEvent = NULL;
+CRITICAL_SECTION ConsoleListener::criticalSection;
+
+char *ConsoleListener::logPending = NULL;
+volatile u32 ConsoleListener::logPendingReadPos = 0;
+volatile u32 ConsoleListener::logPendingWritePos = 0;
#endif
ConsoleListener::ConsoleListener()
@@ -45,12 +54,12 @@ ConsoleListener::ConsoleListener()
hConsole = NULL;
bUseColor = true;
- hThread = NULL;
- hTriggerEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- InitializeCriticalSection(&criticalSection);
- logPending = NULL;
- logPendingReadPos = 0;
- logPendingWritePos = 0;
+ if (hTriggerEvent == NULL)
+ {
+ hTriggerEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ InitializeCriticalSection(&criticalSection);
+ }
+ ++refCount;
#else
bUseColor = isatty(fileno(stdout));
#endif
@@ -59,13 +68,6 @@ ConsoleListener::ConsoleListener()
ConsoleListener::~ConsoleListener()
{
Close();
-
-#ifdef _WIN32
- DeleteCriticalSection(&criticalSection);
-
- if (logPending != NULL)
- delete [] logPending;
-#endif
}
// 100, 100, "Dolphin Log Console"
@@ -96,7 +98,7 @@ void ConsoleListener::Open(bool Hidden, int Width, int Height, const char *Title
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
}
- if (hTriggerEvent != NULL)
+ if (hTriggerEvent != NULL && hThread == NULL)
{
logPending = new char[LOG_PENDING_MAX];
hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) &ConsoleListener::RunThread, this, 0, NULL);
@@ -135,17 +137,30 @@ void ConsoleListener::Close()
if (hConsole == NULL)
return;
- if (hThread != NULL)
+ if (--refCount <= 0)
{
- Common::AtomicStoreRelease(logPendingWritePos, (u32) -1);
+ if (hThread != NULL)
+ {
+ Common::AtomicStoreRelease(logPendingWritePos, (u32) -1);
- SetEvent(hTriggerEvent);
- WaitForSingleObject(hThread, LOG_SHUTDOWN_DELAY_MS);
- CloseHandle(hThread);
- hThread = NULL;
+ SetEvent(hTriggerEvent);
+ WaitForSingleObject(hThread, LOG_SHUTDOWN_DELAY_MS);
+ CloseHandle(hThread);
+ hThread = NULL;
+ }
+ if (hTriggerEvent != NULL)
+ {
+ DeleteCriticalSection(&criticalSection);
+ CloseHandle(hTriggerEvent);
+ hTriggerEvent = NULL;
+ }
+ if (logPending != NULL)
+ {
+ delete [] logPending;
+ logPending = NULL;
+ }
+ refCount = 0;
}
- if (hTriggerEvent != NULL)
- CloseHandle(hTriggerEvent);
FreeConsole();
hConsole = NULL;
diff --git a/Common/ConsoleListener.h b/Common/ConsoleListener.h
index b98cf444cd..42547c0a00 100644
--- a/Common/ConsoleListener.h
+++ b/Common/ConsoleListener.h
@@ -55,13 +55,14 @@ private:
void SendToThread(LogTypes::LOG_LEVELS Level, const char *Text);
void WriteToConsole(LogTypes::LOG_LEVELS Level, const char *Text, size_t Len);
- HANDLE hThread;
- HANDLE hTriggerEvent;
- CRITICAL_SECTION criticalSection;
+ static int refCount;
+ static HANDLE hThread;
+ static HANDLE hTriggerEvent;
+ static CRITICAL_SECTION criticalSection;
- char *logPending;
- volatile u32 logPendingReadPos;
- volatile u32 logPendingWritePos;
+ static char *logPending;
+ static volatile u32 logPendingReadPos;
+ static volatile u32 logPendingWritePos;
#endif
bool bHidden;
bool bUseColor;
diff --git a/Common/FileSearch.cpp b/Common/FileSearch.cpp
index aa836a166f..3d8e07d852 100644
--- a/Common/FileSearch.cpp
+++ b/Common/FileSearch.cpp
@@ -28,7 +28,6 @@
#ifdef __APPLE__
#include
#endif
-#include
#include "FileSearch.h"
diff --git a/Common/KeyMap.cpp b/Common/KeyMap.cpp
index 77badcf5e3..4a1c74335a 100644
--- a/Common/KeyMap.cpp
+++ b/Common/KeyMap.cpp
@@ -15,9 +15,6 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
-#include