JitIL is no longer a separate .exe/binary - it's now a simple option, Dolphin.exe now contains both cores.

Advantages:
* Less confusion for users
* No need to build twice to make sure you didn't break something
* Easier to switch between the cores for testing

Disadvantages:
* None, as far as I can tell :) Maybe some extra code complexity, but not much.

Also break some include chains that caused <windows.h> to get included into everything, slowing down the build on Windows. There's more to do here though, there's still a lot of files that get it included that don't need it at all.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4891 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2010-01-19 19:28:27 +00:00
parent 657ba22f54
commit 576990c5a3
82 changed files with 1365 additions and 1953 deletions
+4
View File
@@ -535,6 +535,10 @@
RelativePath=".\Src\ConsoleListener.cpp"
>
</File>
<File
RelativePath=".\Src\ConsoleListener.h"
>
</File>
<File
RelativePath=".\Src\Log.h"
>
+24
View File
@@ -3,6 +3,30 @@
#include "CDUtils.h"
#include "Common.h"
#ifdef _WIN32
#include <windows.h>
#define PATH_MAX MAX_PATH
#elif __APPLE__
#include <paths.h>
#include <Carbon/Carbon.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/storage/IOCDMedia.h>
#include <IOKit/storage/IOMedia.h>
#include <IOKit/IOBSD.h>
#elif __linux__
#include <mntent.h>
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <linux/cdrom.h>
#endif // WIN32
// Follow symlinks until we have the real device file (idea taken from libunieject).
void cdio_follow_symlink(const char * src, char * dst) {
#ifndef _WIN32
-24
View File
@@ -5,30 +5,6 @@
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#define PATH_MAX MAX_PATH
#elif __APPLE__
#include <paths.h>
#include <Carbon/Carbon.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/storage/IOCDMedia.h>
#include <IOKit/storage/IOMedia.h>
#include <IOKit/IOBSD.h>
#elif __linux__
#include <mntent.h>
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <linux/cdrom.h>
#endif // WIN32
// Returns a pointer to an array of strings with the device names
char **cdio_get_devices();
+3
View File
@@ -18,6 +18,9 @@
#ifndef _COMMON_H_
#define _COMMON_H_
// DO NOT EVER INCLUDE <windows.h> directly _or indirectly_ from this file
// since it slows down the build a lot.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -28,6 +28,7 @@
#include "Common.h"
#include "LogManager.h" // Common
#include "ConsoleListener.h" // Common
ConsoleListener::ConsoleListener()
{
+55
View File
@@ -0,0 +1,55 @@
// Copyright (C) 2003 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _CONSOLELISTENER_H
#define _CONSOLELISTENER_H
#include "LogManager.h"
#ifdef _WIN32
#include <windows.h>
#endif
class ConsoleListener : public LogListener
{
public:
ConsoleListener();
~ConsoleListener();
void Open(bool Hidden = false, int Width = 100, int Height = 100, const char * Name = "Console");
void UpdateHandle();
void Close();
bool IsOpen();
void LetterSpace(int Width, int Height);
void BufferWidthHeight(int BufferWidth, int BufferHeight, int ScreenWidth, int ScreenHeight, bool BufferFirst);
void PixelSpace(int Left, int Top, int Width, int Height, bool);
#ifdef _WIN32
COORD GetCoordinates(int BytesRead, int BufferWidth);
#endif
void Log(LogTypes::LOG_LEVELS, const char *Text);
void ClearScreen(bool Cursor = true);
const char *getName() const { return "Console"; }
private:
#ifdef _WIN32
HWND GetHwnd(void);
HANDLE hConsole;
#endif
};
#endif // _CONSOLELISTENER_H
+5 -5
View File
@@ -69,7 +69,7 @@ int LinearDiskCache::OpenAndRead(const char *filename, LinearDiskCacheReader *re
fclose(file_);
unlink(filename);
PanicAlert("LinearDiskCache file header broken.");
// PanicAlert("LinearDiskCache file header broken.");
file_ = fopen(filename, "wb");
WriteHeader();
@@ -86,8 +86,8 @@ int LinearDiskCache::OpenAndRead(const char *filename, LinearDiskCacheReader *re
break;
}
if (key_size <= 0 || value_size < 0 || key_size_size != 4 || value_size_size != 4) {
PanicAlert("Disk cache file %s corrupted/truncated! ks: %i vs %i kss %i vss %i", filename,
key_size, value_size, key_size_size, value_size_size);
// PanicAlert("Disk cache file %s corrupted/truncated! ks: %i vs %i kss %i vss %i", filename,
// key_size, value_size, key_size_size, value_size_size);
file_corrupt = true;
break;
}
@@ -96,8 +96,8 @@ int LinearDiskCache::OpenAndRead(const char *filename, LinearDiskCacheReader *re
int actual_key_size = (int)fread(key, 1, key_size, file_);
int actual_value_size = (int)fread(value, 1, value_size, file_);
if (actual_key_size != key_size || actual_value_size != value_size) {
PanicAlert("Disk cache file %s corrupted/truncated! ks: %i actual ks: %i vs: %i actual vs: %i", filename,
key_size, actual_key_size, value_size, actual_value_size);
// PanicAlert("Disk cache file %s corrupted/truncated! ks: %i actual ks: %i vs: %i actual vs: %i", filename,
// key_size, actual_key_size, value_size, actual_value_size);
file_corrupt = true;
} else {
reader->Read(key, key_size, value, value_size);
+11 -5
View File
@@ -16,7 +16,10 @@
// http://code.google.com/p/dolphin-emu/
#include "LogManager.h"
#include "ConsoleListener.h"
#include "Timer.h"
#include "Thread.h"
void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
const char *file, int line, const char* fmt, ...)
{
@@ -28,7 +31,9 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
LogManager *LogManager::m_logManager = NULL;
LogManager::LogManager() : logMutex(1) {
LogManager::LogManager() {
logMutex = new Common::CriticalSection(1);
// create log files
m_Log[LogTypes::MASTER_LOG] = new LogContainer("*", "Master Log");
m_Log[LogTypes::BOOT] = new LogContainer("BOOT", "Boot");
@@ -92,6 +97,7 @@ LogManager::~LogManager() {
}
delete m_fileLog;
delete m_consoleLog;
delete logMutex;
}
void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
@@ -113,15 +119,15 @@ void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
file, line, level_to_char[(int)level],
log->getShortName(), temp);
logMutex.Enter();
logMutex->Enter();
log->trigger(level, msg);
logMutex.Leave();
logMutex->Leave();
}
void LogManager::removeListener(LogTypes::LOG_TYPE type, LogListener *listener) {
logMutex.Enter();
logMutex->Enter();
m_Log[type]->removeListener(listener);
logMutex.Leave();
logMutex->Leave();
}
LogContainer::LogContainer(const char* shortName, const char* fullName, bool enable)
+12 -36
View File
@@ -19,11 +19,8 @@
#define _LOGMANAGER_H_
#include "Log.h"
#include "Thread.h"
#include "StringUtil.h"
#ifdef _WIN32
#include <windows.h>
#endif
#include <vector>
#include <string.h>
#include <stdio.h>
@@ -67,34 +64,6 @@ private:
bool m_enable;
};
class ConsoleListener : public LogListener
{
public:
ConsoleListener();
~ConsoleListener();
void Open(bool Hidden = false, int Width = 100, int Height = 100, const char * Name = "Console");
void UpdateHandle();
void Close();
bool IsOpen();
void LetterSpace(int Width, int Height);
void BufferWidthHeight(int BufferWidth, int BufferHeight, int ScreenWidth, int ScreenHeight, bool BufferFirst);
void PixelSpace(int Left, int Top, int Width, int Height, bool);
#ifdef _WIN32
COORD GetCoordinates(int BytesRead, int BufferWidth);
#endif
void Log(LogTypes::LOG_LEVELS, const char *Text);
void ClearScreen(bool Cursor = true);
const char *getName() const { return "Console"; }
private:
#ifdef _WIN32
HWND GetHwnd(void);
HANDLE hConsole;
#endif
};
class LogContainer {
public:
LogContainer(const char* shortName, const char* fullName, bool enable = false);
@@ -130,16 +99,26 @@ private:
std::vector<LogListener *> listeners;
};
class ConsoleListener;
// Avoid <windows.h> include through Thread.h
namespace Common {
class CriticalSection;
}
class LogManager
{
private:
LogContainer* m_Log[LogTypes::NUMBER_OF_LOGS];
Common::CriticalSection logMutex;
Common::CriticalSection *logMutex;
FileLogListener *m_fileLog;
ConsoleListener *m_consoleLog;
static LogManager *m_logManager; // Singleton. Ugh.
public:
LogManager();
~LogManager();
static u32 GetMaxLevel() { return MAX_LOGLEVEL; }
void Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
@@ -192,9 +171,6 @@ public:
static void SetInstance(LogManager *logManager) {
m_logManager = logManager;
}
LogManager();
~LogManager();
};
#endif // _LOGMANAGER_H_
+1 -1
View File
@@ -18,7 +18,7 @@
#ifndef _MEMORYUTIL_H
#define _MEMORYUTIL_H
#include <iostream>
#include <string>
void* AllocateExecutableMemory(size_t size, bool low = true);
void* AllocateMemoryPages(size_t size);
+3
View File
@@ -18,6 +18,9 @@
#ifndef __SYSCONF_MANAGER_h__
#define __SYSCONF_MANAGER_h__
#include <string>
#include <vector>
// This class is meant to edit the values in a given Wii SYSCONF file
// It currently does not add/remove/rearrange sections,
// instead only modifies exiting sections' data
File diff suppressed because it is too large Load Diff
+4
View File
@@ -22,6 +22,10 @@
#include "ARDecrypt.h"
#include <algorithm>
#ifdef _WIN32
#include <windows.h>
#endif
namespace ActionReplay
{
-4
View File
@@ -17,10 +17,6 @@
#ifndef _ARDECRYPT_H_
#define _ARDECRYPT_H_
#ifdef _WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+2 -2
View File
@@ -104,7 +104,7 @@ void SConfig::SaveSettings()
// Core
ini.Set("Core", "HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2);
ini.Set("Core", "UseDynarec", m_LocalCoreStartupParameter.bUseJIT);
ini.Set("Core", "CPUCore", m_LocalCoreStartupParameter.iCPUCore);
ini.Set("Core", "CPUThread", m_LocalCoreStartupParameter.bCPUThread);
ini.Set("Core", "DSPThread", m_LocalCoreStartupParameter.bDSPThread);
ini.Set("Core", "SkipIdle", m_LocalCoreStartupParameter.bSkipIdle);
@@ -224,7 +224,7 @@ void SConfig::LoadSettings()
// Core
ini.Get("Core", "HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, true);
ini.Get("Core", "UseDynarec", &m_LocalCoreStartupParameter.bUseJIT, true);
ini.Get("Core", "CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 1);
ini.Get("Core", "DSPThread", &m_LocalCoreStartupParameter.bDSPThread, true);
ini.Get("Core", "CPUThread", &m_LocalCoreStartupParameter.bCPUThread, true);
ini.Get("Core", "SkipIdle", &m_LocalCoreStartupParameter.bSkipIdle, true);
+1 -1
View File
@@ -25,7 +25,7 @@
#include "PowerPC/PPCTables.h"
#include "CoreTiming.h"
#include "Core.h"
#include "PowerPC/Jit64/Jit.h"
#include "PowerPC/JitCommon/JitBase.h"
#include "PowerPC/PPCSymbolDB.h"
#include "PowerPCDisasm.h"
#include "Console.h"
+5 -12
View File
@@ -47,6 +47,7 @@
#include "HW/SystemTimers.h"
#include "PowerPC/PowerPC.h"
#include "PowerPC/JitCommon/JitBase.h"
#include "PluginManager.h"
#include "ConfigManager.h"
@@ -387,7 +388,7 @@ THREAD_RETURN EmuThread(void *pArg)
g_pUpdateFPSDisplay(("Loading " + _CoreParameter.m_strFilename).c_str());
// Setup our core, but can't use dynarec if we are compare server
if (_CoreParameter.bUseJIT && (!_CoreParameter.bRunCompareServer || _CoreParameter.bRunCompareClient))
if (_CoreParameter.iCPUCore && (!_CoreParameter.bRunCompareServer || _CoreParameter.bRunCompareClient))
PowerPC::SetMode(PowerPC::MODE_JIT);
else
PowerPC::SetMode(PowerPC::MODE_INTERPRETER);
@@ -592,18 +593,10 @@ void VideoThrottle()
// Settings are shown the same for both extended and summary info
std::string SSettings = StringFromFormat("%s %s",
#if defined(JITTEST) && JITTEST
#ifdef _M_IX86
_CoreParameter.bUseJIT ? "JIT32IL" : "Int32",
#else
_CoreParameter.bUseJIT ? "JIT64IL" : "Int64",
#endif
#ifdef _M_IX86
_CoreParameter.iCPUCore ? jit->GetName() : "Int32",
#else
#ifdef _M_IX86
_CoreParameter.bUseJIT ? "JIT32" : "Int32",
#else
_CoreParameter.bUseJIT ? "JIT64" : "Int64",
#endif
_CoreParameter.iCPUCore ? jit->GetName() : "Int64",
#endif
_CoreParameter.bCPUThread ? "DC" : "SC");
+1 -1
View File
@@ -37,7 +37,7 @@ SCoreStartupParameter::SCoreStartupParameter()
void SCoreStartupParameter::LoadDefaults()
{
bEnableDebugging = false;
bUseJIT = false;
iCPUCore = 1;
bCPUThread = false;
bSkipIdle = false;
bRunCompareServer = false;
+10 -10
View File
@@ -18,10 +18,6 @@
#ifndef _COREPARAMETER_H
#define _COREPARAMETER_H
#ifdef _WIN32
#include <windows.h>
#endif
#include "IniFile.h"
#include <string>
@@ -30,18 +26,22 @@
struct SCoreStartupParameter
{
#ifdef _WIN32
HINSTANCE hInstance;
#endif
void * hInstance; // HINSTANCE but we don't want to include <windows.h>
// Windows/GUI related
void* hMainWindow;
// Settings
bool bEnableDebugging; bool bAutomaticStart; bool bBootToPause;
bool bUseJIT;
bool bEnableDebugging;
bool bAutomaticStart;
bool bBootToPause;
// JIT
// 0 = Interpreter
// 1 = Jit
// 2 = JitIL
int iCPUCore;
// JIT (shared between JIT and JITIL)
bool bJITUnlimitedCache, bJITBlockLinking;
bool bJITOff;
bool bJITLoadStoreOff, bJITLoadStorelXzOff, bJITLoadStorelwzOff, bJITLoadStorelbzxOff;
@@ -25,7 +25,7 @@
#include "../HW/DSP.h"
#include "../HW/Memmap.h"
#include "../PowerPC/PowerPC.h"
#include "../PowerPC/Jit64/Jit.h"
#include "../PowerPC/JitCommon/JitBase.h"
#include "../PowerPC/PPCSymbolDB.h"
void PPCDebugInterface::disasm(unsigned int address, char *dest, int max_size)
@@ -114,13 +114,13 @@ bool PPCDebugInterface::isBreakpoint(unsigned int address)
void PPCDebugInterface::setBreakpoint(unsigned int address)
{
if (PowerPC::breakpoints.Add(address))
jit.NotifyBreakpoint(address, true);
jit->NotifyBreakpoint(address, true);
}
void PPCDebugInterface::clearBreakpoint(unsigned int address)
{
if (PowerPC::breakpoints.Remove(address))
jit.NotifyBreakpoint(address, false);
jit->NotifyBreakpoint(address, false);
}
void PPCDebugInterface::clearAllBreakpoints() {}

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