mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
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:
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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
Source/Core/Common/Src/ConsoleListener.h
Normal file
55
Source/Core/Common/Src/ConsoleListener.h
Normal 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
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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_
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user