summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-07-16 20:50:16 +0000
committerhrydgard <hrydgard@gmail.com>2008-07-16 20:50:16 +0000
commitea934759e15c94ad2fa67e76e11f5d469ebfccf4 (patch)
tree43dd6f2fa6a3e747e0d81c602d5490d02b10b087 /Source
parentcb5072c3e4cf66d33d30697984a9179534334b38 (diff)
Mostly cleanup and some better crash messages. Also enabled partial block linking (see JitCache.cpp), should give a small speedup but may cause problems, please report!
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@12 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Common/Common.vcproj10
-rw-r--r--Source/Core/Common/Src/Common.h2
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp11
-rw-r--r--Source/Core/Common/Src/FileUtil.h12
-rw-r--r--Source/Core/Common/Src/MemArena.cpp12
-rw-r--r--Source/Core/Core/Core.vcproj10
-rw-r--r--Source/Core/Core/Src/CoreTiming.cpp1
-rw-r--r--Source/Core/Core/Src/MemTools.cpp25
-rw-r--r--Source/Core/Core/Src/PowerPC/Jit64/Jit.h6
-rw-r--r--Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp126
-rw-r--r--Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.h10
-rw-r--r--Source/Core/Core/Src/PowerPC/Jit64/JitCache.cpp250
-rw-r--r--Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp20
-rw-r--r--Source/Core/Core/Src/PowerPC/Jit64/Jit_Paired.cpp5
-rw-r--r--Source/Core/Core/Src/PowerPC/PowerPC.cpp3
-rw-r--r--Source/Core/Core/Src/PowerPC/PowerPC.h2
-rw-r--r--Source/Core/DebuggerWX/DebuggerWX.vcproj3
-rw-r--r--Source/Core/DiscIO/DiscIO.vcproj12
-rw-r--r--Source/Core/DolphinWX/DolphinWX.vcproj6
-rw-r--r--Source/Core/DolphinWX/src/Main.cpp1
-rw-r--r--Source/Core/DolphinWX/src/PluginManager.cpp17
-rw-r--r--Source/Dolphin.sln41
-rw-r--r--Source/Plugins/Plugin_DSP_NULL/Src/resource.h4
-rw-r--r--Source/Plugins/Plugin_DSP_NULL/Src/resource.rc52
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj10
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Plugin_VideoOGL.vcproj8
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.rc22
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/main.cpp6
28 files changed, 381 insertions, 306 deletions
diff --git a/Source/Core/Common/Common.vcproj b/Source/Core/Common/Common.vcproj
index 02688ff4fe..7344e39587 100644
--- a/Source/Core/Common/Common.vcproj
+++ b/Source/Core/Common/Common.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8,00"
+ Version="8.00"
Name="Common"
ProjectGUID="{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}"
RootNamespace="Common"
@@ -472,6 +472,14 @@
>
</File>
<File
+ RelativePath=".\Src\FileUtil.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Src\FileUtil.h"
+ >
+ </File>
+ <File
RelativePath=".\Src\Hash.cpp"
>
</File>
diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h
index d3f0fa481f..8281703c10 100644
--- a/Source/Core/Common/Src/Common.h
+++ b/Source/Core/Common/Src/Common.h
@@ -69,7 +69,9 @@ typedef signed __int16 s16;
typedef signed __int8 s8;
#define GC_ALIGNED16(x) __declspec(align(16)) x
+#define GC_ALIGNED64(x) __declspec(align(64)) x
#define GC_ALIGNED16_DECL(x) __declspec(align(16)) x
+#define GC_ALIGNED64_DECL(x) __declspec(align(64)) x
#else
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp
new file mode 100644
index 0000000000..1eb5540486
--- /dev/null
+++ b/Source/Core/Common/Src/FileUtil.cpp
@@ -0,0 +1,11 @@
+#include "Common.h"
+#include "FileUtil.h"
+
+bool File::Exists(const std::string &filename)
+{
+#ifdef _WIN32
+ return GetFileAttributes(filename.c_str()) != INVALID_FILE_ATTRIBUTES;
+#else
+ return true; //TODO
+#endif
+} \ No newline at end of file
diff --git a/Source/Core/Common/Src/FileUtil.h b/Source/Core/Common/Src/FileUtil.h
new file mode 100644
index 0000000000..b170d45ba7
--- /dev/null
+++ b/Source/Core/Common/Src/FileUtil.h
@@ -0,0 +1,12 @@
+#ifndef _FILEUTIL_H
+#define _FILEUTIL_H
+
+#include <string>
+
+class File
+{
+public:
+ static bool Exists(const std::string &filename);
+};
+
+#endif
diff --git a/Source/Core/Common/Src/MemArena.cpp b/Source/Core/Common/Src/MemArena.cpp
index f577373fdd..4455f99004 100644
--- a/Source/Core/Common/Src/MemArena.cpp
+++ b/Source/Core/Common/Src/MemArena.cpp
@@ -104,11 +104,10 @@ u64 MemArena::Find4GBBase()
{
#ifdef _M_X64
#ifdef _WIN32
- // The highest thing in any 1GB section of memory space is the locked cache. We only need to fit it.
+ // 64 bit
u8* base = (u8*)VirtualAlloc(0, 0xE1000000, MEM_RESERVE, PAGE_READWRITE);
VirtualFree(base, 0, MEM_RELEASE);
return((u64)base);
-
#else
// Very precarious - mmap cannot return an error when trying to map already used pages.
// This makes the Windows approach above unusable on Linux, so we will simply pray...
@@ -116,12 +115,13 @@ u64 MemArena::Find4GBBase()
#endif
#else
- // Only grab a bit less than 1GB
+ // 32 bit
+ // The highest thing in any 1GB section of memory space is the locked cache. We only need to fit it.
u8* base = (u8*)VirtualAlloc(0, 0x31000000, MEM_RESERVE, PAGE_READWRITE);
- VirtualFree(base, 0, MEM_RELEASE);
+ if (base) {
+ VirtualFree(base, 0, MEM_RELEASE);
+ }
return((u64)base);
#endif
}
-
-
diff --git a/Source/Core/Core/Core.vcproj b/Source/Core/Core/Core.vcproj
index 1779e0bfd7..cc8922d284 100644
--- a/Source/Core/Core/Core.vcproj
+++ b/Source/Core/Core/Core.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8,00"
+ Version="8.00"
Name="Core"
ProjectGUID="{F0B874CB-4476-4199-9315-8343D05AE684}"
RootNamespace="Core"
@@ -902,6 +902,14 @@
>
</File>
<File
+ RelativePath=".\Src\PowerPC\Jit64\JitBackpatch.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Src\PowerPC\Jit64\JitBackpatch.h"
+ >
+ </File>
+ <File
RelativePath=".\Src\PowerPC\Jit64\JitCache.cpp"
>
</File>
diff --git a/Source/Core/Core/Src/CoreTiming.cpp b/Source/Core/Core/Src/CoreTiming.cpp
index eb31d9d46a..3799db6501 100644
--- a/Source/Core/Core/Src/CoreTiming.cpp
+++ b/Source/Core/Core/Src/CoreTiming.cpp
@@ -233,6 +233,7 @@ void Advance()
if (!first)
{
LOG(GEKKO, "WARNING - no events in queue. Setting downcount to 10000");
+ // PanicAlert?
downcount += 10000;
}
else
diff --git a/Source/Core/Core/Src/MemTools.cpp b/Source/Core/Core/Src/MemTools.cpp
index e9e091a14e..3bcad01b7b 100644
--- a/Source/Core/Core/Src/MemTools.cpp
+++ b/Source/Core/Core/Src/MemTools.cpp
@@ -24,12 +24,12 @@
#include <vector>
#include "Common.h"
-#include "x64Analyzer.h"
-#include "PowerPC/Jit64/Jit.h"
-
#include "MemTools.h"
+#include "HW/Memmap.h"
+#include "PowerPC/Jit64/Jit.h"
+#include "PowerPC/Jit64/JitBackpatch.h"
+#include "x64Analyzer.h"
-//#ifdef ASDFKJLASJDF
namespace EMM
{
/* DESIGN
@@ -98,14 +98,11 @@ struct Watch
std::vector<Watch> watches;
-
-
void UpdateProtection(EAddr startAddr, EAddr endAddr)
{
}
-
int AddWatchRegion(EAddr startAddr, EAddr endAddr, WR watchFor, WatchType type, WatchCallback callback, u64 userData)
{
static int watchIDGen = 0;
@@ -124,8 +121,6 @@ int AddWatchRegion(EAddr startAddr, EAddr endAddr, WR watchFor, WatchType type,
return watch.ID;
}
-
-
void Notify(EAddr address, WR action)
{
for (std::vector<Watch>::iterator iter = watches.begin(); iter != watches.end(); ++iter)
@@ -208,6 +203,9 @@ public:
}
};
+// ======
+// From here on is the code in this file that actually works and is active.
+
LONG NTAPI Handler(PEXCEPTION_POINTERS pPtrs)
{
switch (pPtrs->ExceptionRecord->ExceptionCode)
@@ -233,6 +231,7 @@ LONG NTAPI Handler(PEXCEPTION_POINTERS pPtrs)
//Figure out what address was hit
DWORD_PTR badAddress = (DWORD_PTR)pPtrs->ExceptionRecord->ExceptionInformation[1];
//TODO: First examine the address, make sure it's within the emulated memory space
+ u64 memspaceBottom = (u64)Memory::base;
if (badAddress < memspaceBottom) {
PanicAlert("Exception handler - access below memory space. %08x%08x",
badAddress >> 32, badAddress);
@@ -240,17 +239,15 @@ LONG NTAPI Handler(PEXCEPTION_POINTERS pPtrs)
u32 emAddress = (u32)(badAddress - memspaceBottom);
//Now we have the emulated address.
- //_assert_msg_(DYNA_REC,0,"MT : %08x",emAddress);
-
//Let's notify everyone who wants to be notified
//Notify(emAddress, accessType == 0 ? Read : Write);
CONTEXT *ctx = pPtrs->ContextRecord;
- //opportunity to change the debug regs!
+ //opportunity to play with the context - we can change the debug regs!
//We could emulate the memory accesses here, but then they would still be around to take up
- //execution resources. Instead, we backpatch and retry.
- Jit64::BackPatch(codePtr, accessType);
+ //execution resources. Instead, we backpatch into a generic memory call and retry.
+ Jit64::BackPatch(codePtr, accessType, emAddress);
// We no longer touch Rip, since we return back to the instruction, after overwriting it with a
// trampoline jump and some nops
diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.h b/Source/Core/Core/Src/PowerPC/Jit64/Jit.h
index ce258ffb7b..729fb5a033 100644
--- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.h
+++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.h
@@ -14,6 +14,11 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
+
+// Low hanging fruit:
+// all used in zelda
+// negx
+
#ifndef _JIT_H
#define _JIT_H
@@ -74,7 +79,6 @@ namespace Jit64
void WriteExitDestInEAX(int exit_num);
void WriteExceptionExit(u32 exception);
void WriteRfiExitDestInEAX();
- void BackPatch(u8 *codePtr, int accessType);
void HLEFunction(UGeckoInstruction _inst);
diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp b/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp
new file mode 100644
index 0000000000..b16d333b31
--- /dev/null
+++ b/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp
@@ -0,0 +1,126 @@
+#include <string>
+
+#include "Common.h"
+#include "disasm.h"
+#include "JitBackpatch.h"
+#include "../../HW/Memmap.h"
+
+#include "x64Emitter.h"
+#include "x64Analyzer.h"
+
+#include "StringUtil.h"
+#include "Jit.h"
+
+using namespace Gen;
+
+namespace Jit64 {
+
+extern u8 *trampolineCodePtr;
+
+void BackPatchError(const std::string &text, u8 *codePtr, u32 emAddress) {
+ u64 code_addr = (u64)codePtr;
+ disassembler disasm;
+ char disbuf[256];
+ memset(disbuf, 0, 256);
+#ifdef _M_IX86
+ disasm.disasm32(
+#else
+ disasm.disasm64(
+#endif
+ 0, code_addr, codePtr, disbuf);
+ PanicAlert("%s\n\n"
+ "Error encountered accessing emulated address %08x.\n"
+ "Culprit instruction: \n%s\nat %08x%08x",
+ text.c_str(), emAddress, disbuf, code_addr>>32, code_addr);
+ return;
+}
+
+void BackPatch(u8 *codePtr, int accessType, u32 emAddress)
+{
+ if (!IsInJitCode(codePtr))
+ return; // this will become a regular crash real soon after this
+
+ // TODO: also mark and remember the instruction address as known HW memory access, for use in later compiles.
+ // But to do that we need to be able to reconstruct what instruction wrote this code, and we can't do that yet.
+ u8 *oldCodePtr = GetWritableCodePtr();
+ InstructionInfo info;
+ if (!DisassembleMov(codePtr, info, accessType)) {
+ BackPatchError("BackPatch - failed to disassemble MOV instruction", codePtr, emAddress);
+ }
+ if (info.operandSize != 4) {
+ BackPatchError(StringFromFormat("BackPatch - no support for operand size %i", info.operandSize), codePtr, emAddress);
+ }
+ u64 code_addr = (u64)codePtr;
+ X64Reg addrReg = (X64Reg)info.scaledReg;
+ X64Reg dataReg = (X64Reg)info.regOperandReg;
+ if (info.otherReg != RBX)
+ PanicAlert("BackPatch : Base reg not RBX."
+ "\n\nAttempted to access %08x.", emAddress);
+ if (accessType == OP_ACCESS_WRITE)
+ PanicAlert("BackPatch : Currently only supporting reads."
+ "\n\nAttempted to write to %08x.", emAddress);
+ //if (info.instructionSize < 5)
+ // PanicAlert("Instruction at %08x Too Small : %i", (u32)codePtr, info.instructionSize);
+ // OK, let's write a trampoline, and a jump to it.
+ // Later, let's share trampolines.
+
+ // In the first iteration, we assume that all accesses are 32-bit. We also only deal with reads.
+ // Next step - support writes, special case FIFO writes. Also, support 32-bit mode.
+ u8 *trampoline = trampolineCodePtr;
+ SetCodePtr(trampolineCodePtr);
+ // * Save all volatile regs
+ PUSH(RCX);
+ PUSH(RDX);
+ PUSH(RSI);
+ PUSH(RDI);
+ PUSH(R8);
+ PUSH(R9);
+ PUSH(R10);
+ PUSH(R11);
+ //TODO: Also preserve XMM0-3?
+ SUB(64, R(RSP), Imm8(0x20));
+ // * Set up stack frame.
+ // * Call ReadMemory32
+ //LEA(32, ECX, MDisp((X64Reg)addrReg, info.displacement));
+ MOV(32, R(ECX), R((X64Reg)addrReg));
+ if (info.displacement) {
+ ADD(32, R(ECX), Imm32(info.displacement));
+ }
+ switch (info.operandSize) {
+ //case 1:
+ // CALL((void *)&Memory::Read_U8);
+ // break;
+ case 4:
+ CALL((void *)&Memory::Read_U32);
+ break;
+ default:
+ BackPatchError(StringFromFormat("We don't handle the size %i yet in backpatch", info.operandSize), codePtr, emAddress);
+ break;
+ }
+ // * Tear down stack frame.
+ ADD(64, R(RSP), Imm8(0x20));
+ POP(R11);
+ POP(R10);
+ POP(R9);
+ POP(R8);
+ POP(RDI);
+ POP(RSI);
+ POP(RDX);
+ POP(RCX);
+ MOV(32, R(dataReg), R(EAX));
+ RET();
+ trampolineCodePtr = GetWritableCodePtr();
+
+ SetCodePtr(codePtr);
+ int bswapNopCount;
+ // Check the following BSWAP for REX byte
+ if ((GetCodePtr()[info.instructionSize] & 0xF0) == 0x40)
+ bswapNopCount = 3;
+ else
+ bswapNopCount = 2;
+ CALL(trampoline);
+ NOP((int)info.instructionSize + bswapNopCount - 5);
+ SetCodePtr(oldCodePtr);
+}
+
+} // namespace
diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.h b/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.h
new file mode 100644
index 0000000000..1cf07196ab
--- /dev/null
+++ b/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.h
@@ -0,0 +1,10 @@
+#ifndef _JITBACKPATCH_H
+#define _JITBACKPATCH_H
+
+#include "Common.h"
+
+namespace Jit64 {
+void BackPatch(u8 *codePtr, int accessType, u32 emAddress);
+}
+
+#endif
diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitCache.cpp b/Source/Core/Core/Src/PowerPC/Jit64/JitCache.cpp
index c17e526afc..52040c5da0 100644
--- a/Source/Core/Core/Src/PowerPC/Jit64/JitCache.cpp
+++ b/Source/Core/Core/Src/PowerPC/Jit64/JitCache.cpp
@@ -26,7 +26,6 @@
#include "../PPCTables.h"
#include "../PPCAnalyst.h"
-
#include "x64Emitter.h"
#include "x64Analyzer.h"
@@ -34,6 +33,8 @@
#include "JitCache.h"
#include "JitAsm.h"
+#include "disasm.h"
+
using namespace Gen;
namespace Jit64
@@ -43,6 +44,8 @@ namespace Jit64
u8 *trampolineCache;
u8 *trampolineCodePtr;
#define INVALID_EXIT 0xFFFFFFFF
+ void LinkBlockExits(int i);
+ void LinkBlock(int i);
enum
{
@@ -54,8 +57,7 @@ namespace Jit64
u8 **blockCodePointers; // cut these in half and force below 2GB?
- // todo - replace with something faster
- std::map<u32, int> unlinked;
+ std::multimap<u32, int> links_to;
JitBlock *blocks;
int numBlocks;
@@ -72,20 +74,49 @@ namespace Jit64
LOG(DYNA_REC, "======================================");
}
+ void InitCache()
+ {
+ jo.optimizeStack = true;
+ jo.enableBlocklink = true; // Speed boost, but not 100% safe
+#ifdef _M_X64
+ jo.enableFastMem = true;
+#else
+ jo.enableFastMem = false;
+#endif
+ jo.noAssumeFPLoadFromMem = false;
+ jo.fpAccurateFlags = true;
+
+ codeCache = (u8*)AllocateExecutableMemory(CODE_SIZE);
+ genFunctions = (u8*)AllocateExecutableMemory(GEN_SIZE);
+ trampolineCache = (u8*)AllocateExecutableMemory(TRAMPOLINE_SIZE);
+ trampolineCodePtr = trampolineCache;
+ numFlushes = 0;
+
+ blocks = new JitBlock[MAX_NUM_BLOCKS];
+ blockCodePointers = new u8*[MAX_NUM_BLOCKS];
+ ClearCache();
+ SetCodePtr(genFunctions);
+ Asm::Generate();
+ // Protect the generated functions
+ WriteProtectMemory(genFunctions, 4096, true);
+ SetCodePtr(codeCache);
+ }
+
JitBlock *CurBlock()
{
return &blocks[numBlocks];
}
+
JitBlock *GetBlock(int no)
{
return &blocks[no];
}
+
int GetNumBlocks()
{
return numBlocks;
}
-
bool RangeIntersect(int s1, int e1, int s2, int e2)
{
// check if any endpoint is inside the other range
@@ -98,50 +129,39 @@ namespace Jit64
return false;
}
- void LinkBlocksCallback(u64 userdata, int cyclesLate)
+ u8 *Jit(u32 emAddress)
{
- LinkBlocks();
- }
-
- u8 *Jit(u32 emaddress)
- {
- if (GetCodePtr() >= codeCache + CODE_SIZE - 0x10000 || numBlocks>=MAX_NUM_BLOCKS-1)
+ if (GetCodePtr() >= codeCache + CODE_SIZE - 0x10000 || numBlocks >= MAX_NUM_BLOCKS - 1)
{
- //PanicAlert("Cleared cache");
+ // PanicAlert("Cleared cache");
LOG(DYNA_REC, "JIT code cache full - clearing cache and restoring memory")
ClearCache();
}
JitBlock &b = blocks[numBlocks];
- b.originalAddress = emaddress;
+ b.invalid = false;
+ b.originalAddress = emAddress;
+ b.originalFirstOpcode = Memory::ReadFast32(emAddress);
b.exitAddress[0] = INVALID_EXIT;
b.exitAddress[1] = INVALID_EXIT;
b.exitPtrs[0] = 0;
b.exitPtrs[1] = 0;
b.linkStatus[0] = false;
b.linkStatus[1] = false;
- b.originalFirstOpcode = Memory::ReadFast32(emaddress);
- blockCodePointers[numBlocks] = (u8*)DoJit(emaddress, b); //cast away const, evil
- Memory::WriteUnchecked_U32((JIT_OPCODE << 26) | numBlocks, emaddress);
-
- //Flatten should also compute exits
- //Success!
+ blockCodePointers[numBlocks] = (u8*)DoJit(emAddress, b); //cast away const
+ Memory::WriteUnchecked_U32((JIT_OPCODE << 26) | numBlocks, emAddress);
if (jo.enableBlocklink) {
for (int i = 0; i < 2; i++) {
- if (b.exitAddress[0] != INVALID_EXIT)
- {
- unlinked[b.exitAddress[0]] = numBlocks;
+ if (b.exitAddress[i] != INVALID_EXIT) {
+ links_to.insert(std::pair<u32, int>(b.exitAddress[i], numBlocks));
}
}
- // Link max once per half billion cycles
- //LinkBlocks();
- /*if (!CoreTiming::IsScheduled(&LinkBlocksCallback))
- {
- CoreTiming::ScheduleEvent(50000000, &LinkBlocksCallback, "Link JIT blocks", 0);
- }*/
- //if ((numBlocks & 1) == 0)
- LinkBlocks();
+
+ u8 *oldCodePtr = GetWritableCodePtr();
+ LinkBlock(numBlocks);
+ LinkBlockExits(numBlocks);
+ SetCodePtr(oldCodePtr);
}
numBlocks++; //commit the current block
return 0;
@@ -159,29 +179,6 @@ namespace Jit64
return blockCodePointers;
}
- void InitCache()
- {
- jo.optimizeStack = true;
- jo.enableBlocklink = false; // Large speed boost but currently causes slowdowns too, due to stupid O(n^2) algo :P
- jo.enableFastMem = true;
- jo.noAssumeFPLoadFromMem = false;
- jo.fpAccurateFlags = true;
-
- codeCache = (u8*)AllocateExecutableMemory(CODE_SIZE);
- genFunctions = (u8*)AllocateExecutableMemory(GEN_SIZE);
- trampolineCache = (u8*)AllocateExecutableMemory(TRAMPOLINE_SIZE);
- trampolineCodePtr = trampolineCache;
- numFlushes = 0;
-
- blocks = new JitBlock[MAX_NUM_BLOCKS];
- blockCodePointers = new u8*[MAX_NUM_BLOCKS];
- ClearCache();
- SetCodePtr(genFunctions);
- Asm::Generate();
- // Protect the generated functions
- WriteProtectMemory(genFunctions, 4096, true);
- SetCodePtr(codeCache);
- }
bool IsInJitCode(u8 *codePtr) {
return codePtr >= codeCache && codePtr <= GetCodePtr();
@@ -271,6 +268,11 @@ namespace Jit64
void LinkBlockExits(int i)
{
JitBlock &b = blocks[i];
+ if (b.invalid)
+ {
+ // This block is dead. Don't relink it.
+ return;
+ }
for (int e = 0; e < 2; e++)
{
if (b.exitAddress[e] != INVALID_EXIT && !b.linkStatus[e])
@@ -286,37 +288,31 @@ namespace Jit64
}
}
+ /*
+ if ((b.exitAddress[0] == INVALID_EXIT || b.linkStatus[0]) &&
+ (b.exitAddress[1] == INVALID_EXIT || b.linkStatus[1])) {
+ unlinked.erase(iter);
+ if (unlinked.size() > 4000) PanicAlert("Removed from unlinked. Size = %i", unlinked.size());
+ }
+*/
+ using namespace std;
void LinkBlock(int i)
{
LinkBlockExits(i);
JitBlock &b = blocks[i];
std::map<u32, int>::iterator iter;
- iter = unlinked.find(b.originalAddress);
- if (iter != unlinked.end())
- {
- LinkBlockExits(iter->second);
- // todo - remove stuff from unlinked
- }
- }
-
- void LinkBlocks()
- {
- u8 *oldCodePtr = GetWritableCodePtr();
- //for (int i = 0; i < numBlocks; i++)
- // LinkBlockExits(i);
-
- for (std::map<u32, int>::iterator iter = unlinked.begin();
- iter != unlinked.end(); iter++)
- {
- LinkBlockExits(iter->second);
+ pair<multimap<u32, int>::iterator, multimap<u32, int>::iterator> ppp;
+ // equal_range(b) returns pair<iterator,iterator> representing the range
+ // of element with key b
+ ppp = links_to.equal_range(b.originalAddress);
+ if (ppp.first == ppp.second)
+ return;
+ for (multimap<u32, int>::iterator iter2 = ppp.first; iter2 != ppp.second; ++iter2) {
+ // PanicAlert("Linking block %i to block %i", iter2->second, i);
+ LinkBlockExits(iter2->second);
}
- // for (int i = 0; i < 2000; i++)
- LinkBlock(numBlocks);
- SetCodePtr(oldCodePtr);
}
-
-
void DestroyBlock(int blocknum, bool invalidate)
{
u32 codebytes = (JIT_OPCODE << 26) | blocknum; //generate from i
@@ -336,6 +332,8 @@ namespace Jit64
//for something else, then it's fine.
LOG(MASTER_LOG, "WARNING - ClearCache detected code overwrite @ %08x", blocks[blocknum].originalAddress);
}
+ // TODO: Unlink block.
+
u8 *prev_code = GetWritableCodePtr();
// Spurious entrances from previously linked blocks can only come through checkedEntry
SetCodePtr((u8*)b.checkedEntry);
@@ -344,7 +342,7 @@ namespace Jit64
SetCodePtr(blockCodePointers[blocknum]);
MOV(32, M(&PC), Imm32(b.originalAddress));
JMP(Asm::dispatcher, true);
- SetCodePtr(prev_code);
+ SetCodePtr(prev_code); // reset code pointer
}
#define BLR_OP 0x4e800020
@@ -358,7 +356,7 @@ namespace Jit64
for (int i = 0; i < numBlocks; i++)
{
if (RangeIntersect(blocks[i].originalAddress, blocks[i].originalAddress+blocks[i].originalSize,
- address, address+length))
+ address, address + length))
{
DestroyBlock(i, true);
}
@@ -368,11 +366,10 @@ namespace Jit64
void ClearCache()
{
// Is destroying the blocks really necessary?
- for (int i = 0; i < numBlocks; i++)
- {
+ for (int i = 0; i < numBlocks; i++) {
DestroyBlock(i, false);
}
- unlinked.clear();
+ links_to.clear();
trampolineCodePtr = trampolineCache;
numBlocks = 0;
numFlushes++;
@@ -381,96 +378,5 @@ namespace Jit64
SetCodePtr(codeCache);
}
- extern u8 *trampolineCodePtr;
- void BackPatch(u8 *codePtr, int accessType)
- {
- if (codePtr < codeCache || codePtr > codeCache + CODE_SIZE)
- return; // this will become a regular crash real soon after this
-
- static int counter = 0;
- ++counter;
- if (counter == 30)
- {
- counter++;
- counter--;
- }
-
- // TODO: also mark and remember the instruction address as known HW memory access, for use in later compiles.
- // But to do that we need to be able to reconstruct what instruction wrote this code, and we can't do that yet.
- u8 *oldCodePtr = GetWritableCodePtr();
- InstructionInfo info;
- if (!DisassembleMov(codePtr, info, accessType))
- PanicAlert("BackPatch - failed to disassemble MOV instruction");
-
- X64Reg addrReg = (X64Reg)info.scaledReg;
- X64Reg dataReg = (X64Reg)info.regOperandReg;
- if (info.otherReg != RBX)
- PanicAlert("BackPatch : Base reg not RBX.");
- if (accessType == OP_ACCESS_WRITE)
- PanicAlert("BackPatch : Currently only supporting reads.");
- //if (info.instructionSize < 5)
- // PanicAlert("Instruction at %08x Too Small : %i", (u32)codePtr, info.instructionSize);
- // OK, let's write a trampoline, and a jump to it.
- // Later, let's share trampolines.
-
- // In the first iteration, we assume that all accesses are 32-bit. We also only deal with reads.
- u8 *trampoline = trampolineCodePtr;
- SetCodePtr(trampolineCodePtr);
- // * Save all volatile regs
- PUSH(RCX);
- PUSH(RDX);
- PUSH(RSI);
- PUSH(RDI);
- PUSH(R8);
- PUSH(R9);
- PUSH(R10);
- PUSH(R11);
- //TODO: Also preserve XMM0-3?
- SUB(64, R(RSP), Imm8(0x20));
- // * Set up stack frame.
- // * Call ReadMemory32
- //LEA(32, ECX, MDisp((X64Reg)addrReg, info.displacement));
- MOV(32, R(ECX), R((X64Reg)addrReg));
- if (info.displacement) {
- ADD(32, R(ECX), Imm32(info.displacement));
- }
- switch (info.operandSize) {
- //case 1:
- // CALL((void *)&Memory::Read_U8);
- // break;
- case 4:
- CALL((void *)&Memory::Read_U32);
- break;
- default:
- PanicAlert("We don't handle this size %i yet in backpatch", info.operandSize);
- break;
- }
- // * Tear down stack frame.
- ADD(64, R(RSP), Imm8(0x20));
- POP(R11);
- POP(R10);
- POP(R9);
- POP(R8);
- POP(RDI);
- POP(RSI);
- POP(RDX);
- POP(RCX);
- MOV(32, R(dataReg), R(EAX));
- RET();
- trampolineCodePtr = GetWritableCodePtr();
-
- SetCodePtr(codePtr);
- int bswapNopCount;
- // Check the following BSWAP for REX byte
- if ((GetCodePtr()[info.instructionSize] & 0xF0) == 0x40)
- bswapNopCount = 3;
- else
- bswapNopCount = 2;
- CALL(trampoline);
- NOP((int)info.instructionSize + bswapNopCount - 5);
- // There is also a BSWAP to kill.
- SetCodePtr(oldCodePtr);
- }
-
}
diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp
index b623e8aa01..8851c3d8eb 100644
--- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp
+++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp
@@ -44,21 +44,21 @@
namespace Jit64
{
#ifdef _M_X64
- void SafeLoadECXtoEAX(int accessSize, int offset)
+ void SafeLoadECXtoEAX(int accessSize, s32 offset)
{
if (offset)
- ADD(32,R(ECX),Imm32((u32)offset));
- TEST(32,R(ECX),Imm32(0x0C000000));
+ ADD(32, R(ECX), Imm32((u32)offset));
+ TEST(32, R(ECX), Imm32(0x0C000000));
FixupBranch argh = J_CC(CC_NZ);
if (accessSize != 32)
XOR(32, R(EAX), R(EAX));
MOV(accessSize, R(EAX), MComplex(RBX, ECX, SCALE_1, 0));
if (accessSize == 32)
- BSWAP(32,EAX);
+ BSWAP(32, EAX);
else if (accessSize == 16)
{
- BSWAP(32,EAX);
- SHR(32,R(EAX),Imm8(16));
+ BSWAP(32, EAX);
+ SHR(32, R(EAX), Imm8(16));
}
FixupBranch arg2 = J();
SetJumpTarget(argh);
@@ -71,7 +71,7 @@ namespace Jit64
SetJumpTarget(arg2);
}
#elif _M_IX86
- void SafeLoadECXtoEAX(int accessSize, int offset)
+ void SafeLoadECXtoEAX(int accessSize, s32 offset)
{
if (offset)
ADD(32, R(ECX), Imm32((u32)offset));
@@ -86,7 +86,7 @@ namespace Jit64
BSWAP(32,EAX);
else if (accessSize == 16)
{
- BSWAP(32,EAX);
+ BSWAP(32, EAX);
SHR(32, R(EAX), Imm8(16));
}
FixupBranch arg2 = J();
@@ -183,10 +183,10 @@ namespace Jit64
// Safe and boring
gpr.Flush(FLUSH_VOLATILE);
gpr.Lock(d, a);
- MOV(32,R(ECX), gpr.R(a));
+ MOV(32, R(ECX), gpr.R(a));
SafeLoadECXtoEAX(accessSize, offset);
gpr.LoadToX64(d, false, true);
- MOV(32,gpr.R(d), R(EAX));
+ MOV(32, gpr.R(d), R(EAX));
gpr.UnlockAll();
return;
}
diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Paired.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Paired.cpp
index aada348f42..52ef314a45 100644
--- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Paired.cpp
+++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Paired.cpp
@@ -23,6 +23,11 @@
#include "JitCache.h"
#include "JitRegCache.h"
+// TODO
+// ps_madds0
+// ps_muls0
+// ps_madds1
+
//#define OLD Default(inst); return;
#define OLD
diff --git a/Source/Core/Core/Src/PowerPC/PowerPC.cpp b/Source/Core/Core/Src/PowerPC/PowerPC.cpp
index a8ed96b2c0..74611d6791 100644
--- a/Source/Core/Core/Src/PowerPC/PowerPC.cpp
+++ b/Source/Core/Core/Src/PowerPC/PowerPC.cpp
@@ -29,7 +29,8 @@
namespace PowerPC
{
- GC_ALIGNED16_DECL(PowerPCState ppcState);
+ // align to cache line
+ GC_ALIGNED64_DECL(PowerPCState ppcState);
ICPUCore* m_pCore = NULL;
volatile CPUState state = CPU_STEPPING;
diff --git a/Source/Core/Core/Src/PowerPC/PowerPC.h b/Source/Core/Core/Src/PowerPC/PowerPC.h
index 38dda982fb..077b0b0e0d 100644
--- a/Source/Core/Core/Src/PowerPC/PowerPC.h
+++ b/Source/Core/Core/Src/PowerPC/PowerPC.h
@@ -36,7 +36,7 @@ namespace PowerPC
CORE_INTERPRETER,
CORE_DYNAREC,
};
- struct GC_ALIGNED16(PowerPCState)
+ struct GC_ALIGNED64(PowerPCState)
{
u32 mojs[128];
// sets of registers
diff --git a/Source/Core/DebuggerWX/DebuggerWX.vcproj b/Source/Core/DebuggerWX/DebuggerWX.vcproj
index 4bf1ba00b5..4502ea779a 100644
--- a/Source/Core/DebuggerWX/DebuggerWX.vcproj
+++ b/Source/Core/DebuggerWX/DebuggerWX.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8,00"
+ Version="8.00"
Name="DebuggerWX"
ProjectGUID="{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}"
RootNamespace="DebuggerWX"
@@ -238,6 +238,7 @@
AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__"
RuntimeLibrary="0"
+ BufferSecurityCheck="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
diff --git a/Source/Core/DiscIO/DiscIO.vcproj b/Source/Core/DiscIO/DiscIO.vcproj
index 345b8243ba..b5180b7ae2 100644
--- a/Source/Core/DiscIO/DiscIO.vcproj
+++ b/Source/Core/DiscIO/DiscIO.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8,00"
+ Version="8.00"
Name="DiscIO"
ProjectGUID="{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}"
RootNamespace="DiscIO"
@@ -24,6 +24,7 @@
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
+ WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
@@ -88,6 +89,7 @@
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
+ WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
@@ -153,7 +155,7 @@
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
- WholeProgramOptimization="1"
+ WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
@@ -215,7 +217,7 @@
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
- WholeProgramOptimization="1"
+ WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
@@ -279,7 +281,7 @@
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
- WholeProgramOptimization="1"
+ WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
@@ -341,7 +343,7 @@
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
- WholeProgramOptimization="1"
+ WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
diff --git a/Source/Core/DolphinWX/DolphinWX.vcproj b/Source/Core/DolphinWX/DolphinWX.vcproj
index fb622f0d42..1ab5715ba0 100644
--- a/Source/Core/DolphinWX/DolphinWX.vcproj
+++ b/Source/Core/DolphinWX/DolphinWX.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8,00"
+ Version="8.00"
Name="DolphinWX"
ProjectGUID="{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
RootNamespace="DolphinWX"
@@ -157,9 +157,11 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/EHsc "
- Optimization="2"
+ Optimization="3"
InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
+ OmitFramePointers="false"
AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DiscIO\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\DebuggerWX\src"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
StringPooling="true"
diff --git a/Source/Core/DolphinWX/src/Main.cpp b/Source/Core/DolphinWX/src/Main.cpp
index a278f8f8f9..4d9c18cdbe 100644
--- a/Source/Core/DolphinWX/src/Main.cpp
+++ b/Source/Core/DolphinWX/src/Main.cpp
@@ -170,7 +170,6 @@ void Host_UpdateDisasmDialog()
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEDISASMDIALOG);
wxPostEvent(main_frame, event);
-
if (code_frame)
{
wxPostEvent(code_frame, event);
diff --git a/Source/Core/DolphinWX/src/PluginManager.cpp b/Source/Core/DolphinWX/src/PluginManager.cpp
index 63bcb4ab24..07f7594bd7 100644
--- a/Source/Core/DolphinWX/src/PluginManager.cpp
+++ b/Source/Core/DolphinWX/src/PluginManager.cpp
@@ -18,10 +18,11 @@
#include <string>
#include <vector>
-#include "Globals.h"
#include "Common.h"
-#include "PluginManager.h"
+#include "Globals.h"
#include "FileSearch.h"
+#include "FileUtil.h"
+#include "PluginManager.h"
#include "StringUtil.h"
CPluginManager CPluginManager::m_Instance;
@@ -57,7 +58,7 @@ CPluginManager::ScanForPlugins(wxWindow* _wxWindow)
{
wxProgressDialog dialog(_T("Scanning for Plugins"),
_T("Scanning..."),
- rFilenames.size(), // range
+ (int)rFilenames.size(), // range
_wxWindow, // parent
wxPD_CAN_ABORT |
wxPD_APP_MODAL |
@@ -67,8 +68,6 @@ CPluginManager::ScanForPlugins(wxWindow* _wxWindow)
wxPD_REMAINING_TIME |
wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small
);
-
-
dialog.CenterOnParent();
for (size_t i = 0; i < rFilenames.size(); i++)
@@ -85,7 +84,7 @@ CPluginManager::ScanForPlugins(wxWindow* _wxWindow)
wxString msg;
msg.Printf("Scanning %s", FileName.c_str());
- bool Cont = dialog.Update(i, msg);
+ bool Cont = dialog.Update((int)i, msg);
if (!Cont)
{
@@ -154,7 +153,11 @@ CPluginInfo::CPluginInfo(const std::string& _rFileName)
}
else
{
- PanicAlert("Failed to load plugin %s\nhello world", _rFileName.c_str());
+ if (!File::Exists(_rFileName)) {
+ PanicAlert("Could not load plugin %s - file does not exist", _rFileName.c_str());
+ } else {
+ PanicAlert("Failed to load plugin %s - unknown error.\n", _rFileName.c_str());
+ }
}
}
diff --git a/Source/Dolphin.sln b/Source/Dolphin.sln
index f26c19bddb..645079ad29 100644
--- a/Source/Dolphin.sln
+++ b/Source/Dolphin.sln
@@ -2,18 +2,15 @@ Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "Core\Core\Core.vcproj", "{F0B874CB-4476-4199-9315-8343D05AE684}"
ProjectSection(ProjectDependencies) = postProject
- {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
- {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
+ {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
+ {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoDX9", "Plugins\Plugin_VideoDX9\Plugin_VideoDX9.vcproj", "{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}"
ProjectSection(ProjectDependencies) = postProject
- {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
- {F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
- {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
- {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8} = {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}
{3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
+ {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_PadSimple", "Plugins\Plugin_PadSimple\Plugin_PadSimple.vcproj", "{9A183B48-ECC2-4121-876A-9B3793686073}"
@@ -41,19 +38,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "Core\Common\Commo
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DolphinWX", "Core\DolphinWX\DolphinWX.vcproj", "{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
ProjectSection(ProjectDependencies) = postProject
- {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
- {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
- {F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
- {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77} = {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}
- {0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
- {3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
- {9A183B48-ECC2-4121-876A-9B3793686073} = {9A183B48-ECC2-4121-876A-9B3793686073}
- {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} = {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}
- {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
- {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
- {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8} = {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}
- {636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18} = {636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}
{9AC65CBE-7854-4A86-AA10-D73FF9E5D61F} = {9AC65CBE-7854-4A86-AA10-D73FF9E5D61F}
+ {636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18} = {636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}
+ {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8} = {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}
+ {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
+ {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
+ {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} = {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}
+ {9A183B48-ECC2-4121-876A-9B3793686073} = {9A183B48-ECC2-4121-876A-9B3793686073}
+ {3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
+ {0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
+ {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77} = {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}
+ {F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
+ {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
+ {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxBase28", "..\Externals\wxWidgets\build\msw\wx_base.vcproj", "{48AD7E0A-25B1-4974-A1E3-03F8C438D34F}"
@@ -62,11 +59,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxCore28", "..\Externals\wx
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DebuggerWX", "Core\DebuggerWX\DebuggerWX.vcproj", "{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}"
ProjectSection(ProjectDependencies) = postProject
- {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
- {F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
- {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
- {0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
+ {0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
+ {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
+ {F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
+ {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_DSP_NULL", "Plugins\Plugin_DSP_NULL\Plugin_DSP_NULL.vcproj", "{9AC65CBE-7854-4A86-AA10-D73FF9E5D61F}"
diff --git a/Source/Plugins/Plugin_DSP_NULL/Src/resource.h b/Source/Plugins/Plugin_DSP_NULL/Src/resource.h
index 3c0568c848..9188e4df98 100644
--- a/Source/Plugins/Plugin_DSP_NULL/Src/resource.h
+++ b/Source/Plugins/Plugin_DSP_NULL/Src/resource.h
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
-// Used by Plugin_DSP.rc
+// Used by resource.rc
//
#define IDD_SETTINGS 101
#define IDD_DIALOG2 102
@@ -21,7 +21,7 @@
#define IDC_CHECK3 1010
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
diff --git a/Source/Plugins/Plugin_DSP_NULL/Src/resource.rc b/Source/Plugins/Plugin_DSP_NULL/Src/resource.rc
index 5fabd32788..95c7440eaf 100644
--- a/Source/Plugins/Plugin_DSP_NULL/Src/resource.rc
+++ b/Source/Plugins/Plugin_DSP_NULL/Src/resource.rc
@@ -52,49 +52,29 @@ END
// Dialog
//
-IDD_SETTINGS DIALOGEX 0, 0, 241, 206
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
- WS_SYSMENU
-CAPTION "Dolphin DSP-HLE Plugin 0.1 Settings"
+IDD_SETTINGS DIALOGEX 0, 0, 241, 135
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Dolphin DSP-NULL settings"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- DEFPUSHBUTTON "OK",IDOK,129,185,50,14
- PUSHBUTTON "Cancel",IDCANCEL,184,185,50,14
- GROUPBOX "&Sound settings",IDC_STATIC,7,7,227,45
- EDITTEXT IDC_SAMPLEDUMPPATH,13,158,155,13,ES_AUTOHSCROLL |
- WS_DISABLED
- CONTROL "&Enable HLE Audio",IDC_ENABLE_HLE_AUDIO,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,13,22,84,8
- GROUPBOX "Sample d&umping",IDC_STATIC,7,128,227,51
- CONTROL "Enab&le DTK Music",IDC_ENABLE_DTK_MUSIC,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,13,36,102,8
- CONTROL "&Dump all samples longer than",IDC_DUMPSAMPLES,"Button",
- BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,13,142,105,9
- EDITTEXT IDC_SAMPLEMINLENGTH,122,140,47,12,ES_AUTOHSCROLL |
- WS_DISABLED
- LTEXT "seconds to:",IDC_STATIC,173,142,40,10
- PUSHBUTTON "&Browse...",IDC_BROWSE,173,158,54,14
- GROUPBOX "&Audio quality",IDC_STATIC,7,55,227,70
- LTEXT "Sample &rate:",IDC_STATIC,13,71,67,9
- COMBOBOX IDC_SAMPLERATE,81,69,65,13,CBS_DROPDOWNLIST | CBS_SORT |
- WS_VSCROLL | WS_TABSTOP
- LTEXT "48000hz recommended, if it doesn't work use 44100, it will slow down some music. Changing this during a game will have no effect.",
- IDC_STATIC,81,84,146,32
- CONTROL "&Anti-gap (dangerous!)",IDC_ANTIGAP,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,122,22,96,9
- CONTROL "&Reverb",IDC_CHECK3,"Button",BS_AUTOCHECKBOX |
- WS_DISABLED | WS_TABSTOP,122,36,89,10
+ DEFPUSHBUTTON "OK",IDOK,129,114,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,184,114,50,14
+ GROUPBOX "&Sound settings",IDC_STATIC,7,7,227,26
+ CONTROL "Enab&le DTK Music",IDC_ENABLE_DTK_MUSIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,19,102,8
+ GROUPBOX "&Audio quality",IDC_STATIC,7,36,227,70
+ LTEXT "Sample &rate:",IDC_STATIC,13,52,67,9
+ COMBOBOX IDC_SAMPLERATE,81,50,65,13,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "48000hz recommended, if it doesn't work use 44100, it will slow down some music. Changing this during a game will have no effect.",IDC_STATIC,81,65,146,32
END
IDD_ABOUT DIALOGEX 0, 0, 184, 65
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
- WS_SYSMENU
-CAPTION "About Dolphin DSP-HLE Plugin 0.1"
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About Dolphin DSP-NULL plugin"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,127,44,50,14
- LTEXT "Coded by ector and F|RES",IDC_STATIC,51,25,104,14
- LTEXT "Dolphin DSP-HLE plugin",IDC_STATIC,51,7,104,14
+ LTEXT "Coded by ector and F|RES",IDC_STATIC,51,21,104,14
+ LTEXT "Dolphin DSP-NULL plugin",IDC_STATIC,51,7,104,14
END
@@ -114,7 +94,7 @@ BEGIN
VERTGUIDE, 122
VERTGUIDE, 168
TOPMARGIN, 7
- BOTTOMMARGIN, 199
+ BOTTOMMARGIN, 128
HORZGUIDE, 31
END
diff --git a/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj b/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj
index 307f5f18a7..3d9f033dbe 100644
--- a/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj
+++ b/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8,00"
+ Version="8.00"
Name="Plugin_VideoDX9"
ProjectGUID="{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}"
RootNamespace="Plugin_VideoDX9"
@@ -133,7 +133,7 @@
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
- WholeProgramOptimization="0"
+ WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
@@ -170,7 +170,7 @@
ExceptionHandling="1"
RuntimeLibrary="0"
BufferSecurityCheck="false"
- EnableFunctionLevelLinking="true"
+ EnableFunctionLevelLinking="false"
EnableEnhancedInstructionSet="0"
FloatingPointModel="2"
UsePrecompiledHeader="2"
@@ -178,7 +178,7 @@
PrecompiledHeaderFile="$(IntDir)/Video_DirectX9.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="..\..\..\Binary\x64\Plugins\"
+ ProgramDataBaseFileName="$(IntDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
@@ -589,7 +589,7 @@
PrecompiledHeaderFile="$(IntDir)/Video_DirectX9.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="..\..\..\Binary\x64\Plugins\"
+ ProgramDataBaseFileName="$(IntDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
diff --git a/Source/Plugins/Plugin_VideoOGL/Plugin_VideoOGL.vcproj b/Source/Plugins/Plugin_VideoOGL/Plugin_VideoOGL.vcproj
index 17b996adb2..06d40f998f 100644
--- a/Source/Plugins/Plugin_VideoOGL/Plugin_VideoOGL.vcproj
+++ b/Source/Plugins/Plugin_VideoOGL/Plugin_VideoOGL.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8,00"
+ Version="8.00"
Name="Plugin_VideoOGL"
ProjectGUID="{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}"
RootNamespace="Plugin_VideoOGL"
@@ -177,7 +177,7 @@
PrecompiledHeaderFile="$(IntDir)/VideoOGL.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="..\..\..\Binary\x64\Plugins\"
+ ProgramDataBaseFileName="$(IntDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
@@ -203,7 +203,7 @@
SuppressStartupBanner="true"
AdditionalLibraryDirectories="Src\Windows\GL;Src\Windows\libjpeg;..\..\..\Externals\Cg64"
GenerateManifest="false"
- GenerateDebugInformation="true"
+ GenerateDebugInformation="false"
ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
ImportLibrary="$(TargetDir)$(TargetName).lib"
TargetMachine="17"
@@ -594,7 +594,7 @@
PrecompiledHeaderFile="$(IntDir)/VideoOGL.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="..\..\..\Binary\x64\Plugins\"
+ ProgramDataBaseFileName="$(IntDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.rc b/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.rc
index 58982abe74..1304388e9a 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.rc
+++ b/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.rc
@@ -80,11 +80,11 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "&Fullscreen video mode:",IDC_STATIC,7,22,74,8
LTEXT "&Antialias mode:",IDC_STATIC,7,60,61,8
- COMBOBOX IDC_ANTIALIASMODE,68,57,156,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_ANTIALIASMODE,68,57,156,73,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
LTEXT "&Windowed resolution:",IDC_STATIC,7,41,74,8
- COMBOBOX IDC_RESOLUTIONWINDOWED,87,39,137,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "&Fullscreen",IDC_FULLSCREENENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,87,7,84,8
- COMBOBOX IDC_RESOLUTION,87,20,137,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_RESOLUTIONWINDOWED,87,39,137,73,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
+ CONTROL "&Fullscreen",IDC_FULLSCREENENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,87,7,84,8
+ COMBOBOX IDC_RESOLUTION,87,20,137,73,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
END
IDD_DEBUGGER DIALOGEX 0, 0, 234, 254
@@ -105,14 +105,14 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
GROUPBOX "&Settings",IDC_STATIC,7,7,192,81
- CONTROL "&Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,19,79,9
+ CONTROL "&Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,14,19,79,9
CONTROL "&Overlay some statistics",IDC_OVERLAYSTATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,31,88,9
LTEXT "&Default display list optimization level:",IDC_STATIC,14,57,137,9,WS_DISABLED
COMBOBOX IDC_DLOPTLEVEL,14,67,178,63,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
- CONTROL "&Dump textures to:",IDC_TEXDUMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,104,70,9
- EDITTEXT IDC_TEXDUMPPATH,25,116,148,12,ES_AUTOHSCROLL
- GROUPBOX "&Data dumping",IDC_STATIC,7,91,192,44
- PUSHBUTTON "...",IDC_BROWSETEXDUMPPATH,176,116,14,13
+ CONTROL "&Dump textures to:",IDC_TEXDUMP,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,14,104,70,9
+ EDITTEXT IDC_TEXDUMPPATH,25,116,148,12,ES_AUTOHSCROLL | WS_DISABLED
+ GROUPBOX "&Data dumping",IDC_STATIC,7,91,192,44,WS_DISABLED
+ PUSHBUTTON "...",IDC_BROWSETEXDUMPPATH,176,116,14,13,WS_DISABLED
CONTROL "Show s&hader compilation errors",IDC_SHOWSHADERERRORS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,43,127,9
END
@@ -126,9 +126,9 @@ BEGIN
COMBOBOX IDC_PREUPSCALETYPE,74,74,117,49,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Texture &filtering",IDC_STATIC,7,7,193,50
CONTROL "&Force bi/trilinear (may cause very small glitches)",IDC_FORCEFILTERING,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,20,170,9
+ "Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,16,20,170,9
CONTROL "&Force maximum anisotropy filtering",IDC_FORCEANISOTROPY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,35,127,10
+ "Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,16,35,127,10
END
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp
index 1baac68e31..7a53dd2c92 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp
@@ -39,9 +39,9 @@ SVideoInitialize g_VideoInitialize;
#define VERSION_STRING "0.1"
#ifdef _WIN32
-BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle
- DWORD dwReason, // reason called
- LPVOID lpvReserved) // reserved
+BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
+ DWORD dwReason, // reason called
+ LPVOID lpvReserved) // reserved
{
switch (dwReason)
{