mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-30 04:21:16 +00:00
Some code cleanup
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2768 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
bdabcd4bf5
commit
eb0cab140f
90
Externals/Bochs_disasm/Bochs_disasm.vcproj
vendored
90
Externals/Bochs_disasm/Bochs_disasm.vcproj
vendored
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9,00"
|
Version="9.00"
|
||||||
Name="Bochs_disasm"
|
Name="Bochs_disasm"
|
||||||
ProjectGUID="{29C2ABC1-ADA5-42CD-A5FC-96022D52A510}"
|
ProjectGUID="{29C2ABC1-ADA5-42CD-A5FC-96022D52A510}"
|
||||||
RootNamespace="Bochs_disasm"
|
RootNamespace="Bochs_disasm"
|
||||||
@ -44,15 +44,16 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
WarnAsError="false"
|
WarnAsError="false"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles="stdafx.h"
|
||||||
|
ForcedUsingFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -108,15 +109,16 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
WarnAsError="false"
|
WarnAsError="false"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles="stdafx.h"
|
||||||
|
ForcedUsingFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -172,13 +174,14 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
WarnAsError="false"
|
WarnAsError="false"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles="stdafx.h"
|
||||||
|
ForcedUsingFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -237,13 +240,14 @@
|
|||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
FavorSizeOrSpeed="2"
|
FavorSizeOrSpeed="2"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
WarnAsError="false"
|
WarnAsError="false"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
|
ForcedUsingFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -299,13 +303,14 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
WarnAsError="false"
|
WarnAsError="false"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles="stdafx.h"
|
||||||
|
ForcedUsingFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -364,13 +369,14 @@
|
|||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
FavorSizeOrSpeed="2"
|
FavorSizeOrSpeed="2"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
WarnAsError="false"
|
WarnAsError="false"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles="stdafx.h"
|
||||||
|
ForcedUsingFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -444,62 +450,6 @@
|
|||||||
RelativePath=".\resolve.cpp"
|
RelativePath=".\resolve.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\stdafx.cpp"
|
|
||||||
>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="DebugFast|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="DebugFast|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\stdafx.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\syntax.cpp"
|
RelativePath=".\syntax.cpp"
|
||||||
>
|
>
|
||||||
|
8
Externals/Bochs_disasm/stdafx.cpp
vendored
8
Externals/Bochs_disasm/stdafx.cpp
vendored
@ -1,8 +0,0 @@
|
|||||||
// stdafx.cpp : source file that includes just the standard includes
|
|
||||||
// Bochs_disasm.pch will be the pre-compiled header
|
|
||||||
// stdafx.obj will contain the pre-compiled type information
|
|
||||||
|
|
||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
// TODO: reference any additional headers you need in STDAFX.H
|
|
||||||
// and not in this file
|
|
18
Externals/Bochs_disasm/stdafx.h
vendored
18
Externals/Bochs_disasm/stdafx.h
vendored
@ -1,18 +0,0 @@
|
|||||||
// stdafx.h : include file for standard system include files,
|
|
||||||
// or project specific include files that are used frequently, but
|
|
||||||
// are changed infrequently
|
|
||||||
//
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
|
||||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: reference additional headers your program requires here
|
|
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef __AOSOUNDSTREAM_H__
|
#ifndef _AOSOUNDSTREAM_H_
|
||||||
#define __AOSOUNDSTREAM_H__
|
#define _AOSOUNDSTREAM_H_
|
||||||
|
|
||||||
#include "SoundStream.h"
|
#include "SoundStream.h"
|
||||||
|
|
||||||
@ -69,4 +69,4 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__AOSOUNDSTREAM_H__
|
#endif //_AOSOUNDSTREAM_H_
|
||||||
|
@ -1,87 +1,104 @@
|
|||||||
#include "AudioCommon.h"
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
#include "Mixer.h"
|
|
||||||
#include "AOSoundStream.h"
|
// This program is free software: you can redistribute it and/or modify
|
||||||
#include "DSoundStream.h"
|
// it under the terms of the GNU General Public License as published by
|
||||||
#include "NullSoundStream.h"
|
// the Free Software Foundation, version 2.0.
|
||||||
#include "OpenALStream.h"
|
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
namespace AudioCommon {
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
SoundStream *InitSoundStream(std::string backend, CMixer *mixer) {
|
// GNU General Public License 2.0 for more details.
|
||||||
|
|
||||||
if (!mixer) {
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
mixer = new CMixer();
|
// If not, see http://www.gnu.org/licenses/
|
||||||
}
|
|
||||||
|
// Official SVN repository and contact information can be found at
|
||||||
if (backend == "DSound") {
|
// http://code.google.com/p/dolphin-emu/
|
||||||
if (DSound::isValid())
|
|
||||||
soundStream = new DSound(mixer, g_dspInitialize.hWnd);
|
#include "AudioCommon.h"
|
||||||
}
|
#include "Mixer.h"
|
||||||
else if (backend == "AOSound") {
|
#include "AOSoundStream.h"
|
||||||
if (AOSound::isValid())
|
#include "DSoundStream.h"
|
||||||
soundStream = new AOSound(mixer);
|
#include "NullSoundStream.h"
|
||||||
}
|
#include "OpenALStream.h"
|
||||||
else if (backend == "OpenAL") {
|
|
||||||
if (OpenALStream::isValid())
|
namespace AudioCommon
|
||||||
soundStream = new OpenALStream(mixer);
|
{
|
||||||
}
|
SoundStream *InitSoundStream(std::string backend, CMixer *mixer) {
|
||||||
else if (backend == "NullSound") {
|
|
||||||
soundStream = new NullSound(mixer);
|
if (!mixer) {
|
||||||
}
|
mixer = new CMixer();
|
||||||
else {
|
}
|
||||||
PanicAlert("Cannot recognize backend %s", backend.c_str());
|
|
||||||
return NULL;
|
if (backend == "DSound") {
|
||||||
}
|
if (DSound::isValid())
|
||||||
|
soundStream = new DSound(mixer, g_dspInitialize.hWnd);
|
||||||
if (soundStream) {
|
}
|
||||||
if (!soundStream->Start()) {
|
else if (backend == "AOSound") {
|
||||||
PanicAlert("Could not initialize backend %s, falling back to NULL",
|
if (AOSound::isValid())
|
||||||
backend.c_str());
|
soundStream = new AOSound(mixer);
|
||||||
delete soundStream;
|
}
|
||||||
soundStream = new NullSound(mixer);
|
else if (backend == "OpenAL") {
|
||||||
soundStream->Start();
|
if (OpenALStream::isValid())
|
||||||
}
|
soundStream = new OpenALStream(mixer);
|
||||||
}
|
}
|
||||||
else {
|
else if (backend == "NullSound") {
|
||||||
PanicAlert("Sound backend %s is not valid, falling back to NULL",
|
soundStream = new NullSound(mixer);
|
||||||
backend.c_str());
|
}
|
||||||
delete soundStream;
|
else {
|
||||||
soundStream = new NullSound(mixer);
|
PanicAlert("Cannot recognize backend %s", backend.c_str());
|
||||||
soundStream->Start();
|
return NULL;
|
||||||
}
|
}
|
||||||
return soundStream;
|
|
||||||
}
|
if (soundStream) {
|
||||||
|
if (!soundStream->Start()) {
|
||||||
void ShutdownSoundStream() {
|
PanicAlert("Could not initialize backend %s, falling back to NULL",
|
||||||
NOTICE_LOG(DSPHLE, "Shutting down sound stream");
|
backend.c_str());
|
||||||
|
delete soundStream;
|
||||||
if (soundStream) {
|
soundStream = new NullSound(mixer);
|
||||||
soundStream->Stop();
|
soundStream->Start();
|
||||||
soundStream->StopLogAudio();
|
}
|
||||||
delete soundStream;
|
}
|
||||||
soundStream = NULL;
|
else {
|
||||||
}
|
PanicAlert("Sound backend %s is not valid, falling back to NULL",
|
||||||
|
backend.c_str());
|
||||||
// Check that soundstream already is stopped.
|
delete soundStream;
|
||||||
while (soundStream) {
|
soundStream = new NullSound(mixer);
|
||||||
ERROR_LOG(DSPHLE, "Waiting for sound stream");
|
soundStream->Start();
|
||||||
Common::SleepCurrentThread(2000);
|
}
|
||||||
}
|
return soundStream;
|
||||||
INFO_LOG(DSPHLE, "Done shutting down sound stream");
|
}
|
||||||
}
|
|
||||||
|
void ShutdownSoundStream() {
|
||||||
std::vector<std::string> GetSoundBackends() {
|
NOTICE_LOG(DSPHLE, "Shutting down sound stream");
|
||||||
std::vector<std::string> backends;
|
|
||||||
// Add avaliable output options
|
if (soundStream) {
|
||||||
if (DSound::isValid())
|
soundStream->Stop();
|
||||||
backends.push_back("DSound");
|
soundStream->StopLogAudio();
|
||||||
if (AOSound::isValid())
|
delete soundStream;
|
||||||
backends.push_back("AOSound");
|
soundStream = NULL;
|
||||||
if (OpenALStream::isValid())
|
}
|
||||||
backends.push_back("OpenAL");
|
|
||||||
backends.push_back("NullSound");
|
// Check that soundstream already is stopped.
|
||||||
|
while (soundStream) {
|
||||||
return backends;
|
ERROR_LOG(DSPHLE, "Waiting for sound stream");
|
||||||
}
|
Common::SleepCurrentThread(2000);
|
||||||
|
}
|
||||||
} // Namespace
|
INFO_LOG(DSPHLE, "Done shutting down sound stream");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> GetSoundBackends() {
|
||||||
|
std::vector<std::string> backends;
|
||||||
|
// Add avaliable output options
|
||||||
|
if (DSound::isValid())
|
||||||
|
backends.push_back("DSound");
|
||||||
|
if (AOSound::isValid())
|
||||||
|
backends.push_back("AOSound");
|
||||||
|
if (OpenALStream::isValid())
|
||||||
|
backends.push_back("OpenAL");
|
||||||
|
backends.push_back("NullSound");
|
||||||
|
|
||||||
|
return backends;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // Namespace
|
||||||
|
@ -1,5 +1,22 @@
|
|||||||
#ifndef _AUDIO_COMMON_H
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
#define _AUDIO_COMMON_H
|
|
||||||
|
// 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 _AUDIO_COMMON_H_
|
||||||
|
#define _AUDIO_COMMON_H_
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "../../../PluginSpecs/pluginspecs_dsp.h"
|
#include "../../../PluginSpecs/pluginspecs_dsp.h"
|
||||||
@ -17,4 +34,4 @@ namespace AudioCommon {
|
|||||||
std::vector<std::string> GetSoundBackends();
|
std::vector<std::string> GetSoundBackends();
|
||||||
} // Namespace
|
} // Namespace
|
||||||
|
|
||||||
#endif // AUDIO_COMMON
|
#endif // _AUDIO_COMMON_H_
|
||||||
|
@ -15,26 +15,22 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef __DSOUNDSTREAM_H__
|
#ifndef _DSOUNDSTREAM_H_
|
||||||
#define __DSOUNDSTREAM_H__
|
#define _DSOUNDSTREAM_H_
|
||||||
#include "SoundStream.h"
|
|
||||||
|
|
||||||
|
#include "SoundStream.h"
|
||||||
#include "Thread.h"
|
#include "Thread.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
#include <dsound.h>
|
#include <dsound.h>
|
||||||
|
|
||||||
#define BUFSIZE 32768
|
#define BUFSIZE 32768
|
||||||
#define MAXWAIT 70 //ms
|
#define MAXWAIT 70 // miliseconds
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class DSound : public SoundStream
|
class DSound : public SoundStream
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
Common::Thread *thread;
|
Common::Thread *thread;
|
||||||
Common::CriticalSection soundCriticalSection;
|
Common::CriticalSection soundCriticalSection;
|
||||||
Common::Event soundSyncEvent;
|
Common::Event soundSyncEvent;
|
||||||
@ -77,12 +73,6 @@ public:
|
|||||||
static bool isValid() { return true; }
|
static bool isValid() { return true; }
|
||||||
virtual bool usesMixer() const { return true; }
|
virtual bool usesMixer() const { return true; }
|
||||||
virtual void Update();
|
virtual void Update();
|
||||||
|
|
||||||
#else
|
|
||||||
public:
|
|
||||||
DSound(CMixer *mixer, void *hWnd = NULL) :
|
|
||||||
SoundStream(mixer) {}
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__DSOUNDSTREAM_H__
|
#endif //_DSOUNDSTREAM_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -162,4 +162,3 @@ void CMixer::PushSamples(short *samples, int num_stereo_samples)
|
|||||||
}
|
}
|
||||||
push_sync.Leave();
|
push_sync.Leave();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _MIXER_H
|
#ifndef _MIXER_H_
|
||||||
#define _MIXER_H
|
#define _MIXER_H_
|
||||||
|
|
||||||
#include "FixedSizeQueue.h"
|
#include "FixedSizeQueue.h"
|
||||||
|
|
||||||
@ -42,10 +42,10 @@ public:
|
|||||||
|
|
||||||
void SetThrottle(bool use) { m_throttle = use;}
|
void SetThrottle(bool use) { m_throttle = use;}
|
||||||
|
|
||||||
// FIXME do we need this
|
// TODO: do we need this
|
||||||
bool IsHLEReady() { return m_HLEready;}
|
bool IsHLEReady() { return m_HLEready;}
|
||||||
void SetHLEReady(bool ready) { m_HLEready = ready;}
|
void SetHLEReady(bool ready) { m_HLEready = ready;}
|
||||||
//////
|
// ---------------------
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_sampleRate;
|
int m_sampleRate;
|
||||||
@ -63,5 +63,4 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _MIXER_H_
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef __NULLSOUNDSTREAM_H__
|
#ifndef _NULLSOUNDSTREAM_H_
|
||||||
#define __NULLSOUNDSTREAM_H__
|
#define _NULLSOUNDSTREAM_H_
|
||||||
|
|
||||||
#include "SoundStream.h"
|
#include "SoundStream.h"
|
||||||
|
|
||||||
@ -39,4 +39,4 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__NULLSOUNDSTREAM_H__
|
#endif //_NULLSOUNDSTREAM_H_
|
||||||
|
@ -44,4 +44,4 @@ void OpenALStream::Update()
|
|||||||
void OpenALStream::SoundThread()
|
void OpenALStream::SoundThread()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef __OPENALSTREAM_H__
|
#ifndef _OPENALSTREAM_H_
|
||||||
#define __OPENALSTREAM_H__
|
#define _OPENALSTREAM_H_
|
||||||
|
|
||||||
#include "SoundStream.h"
|
#include "SoundStream.h"
|
||||||
#include "Thread.h"
|
#include "Thread.h"
|
||||||
|
|
||||||
@ -49,4 +50,4 @@ private:
|
|||||||
Common::Event soundSyncEvent;
|
Common::Event soundSyncEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef __SOUNDSTREAM_H__
|
#ifndef _SOUNDSTREAM_H_
|
||||||
#define __SOUNDSTREAM_H__
|
#define _SOUNDSTREAM_H_
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "Mixer.h"
|
#include "Mixer.h"
|
||||||
@ -65,4 +65,4 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _SOUNDSTREAM_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -51,26 +51,29 @@ bool WaveFileWriter::Start(const char *filename)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// -----------------
|
||||||
// Write file header
|
// Write file header
|
||||||
// ---------------
|
// -----------------
|
||||||
Write4("RIFF");
|
Write4("RIFF");
|
||||||
Write(100 * 1000 * 1000); // write big value in case the file gets truncated
|
Write(100 * 1000 * 1000); // write big value in case the file gets truncated
|
||||||
Write4("WAVE");
|
Write4("WAVE");
|
||||||
Write4("fmt ");
|
Write4("fmt ");
|
||||||
|
|
||||||
Write(16); // size of fmt block
|
Write(16); // size of fmt block
|
||||||
Write(0x00020001); //two channels, uncompressed
|
Write(0x00020001); //two channels, uncompressed
|
||||||
|
|
||||||
//const u32 sample_rate = 32000;
|
//const u32 sample_rate = 32000;
|
||||||
const u32 sample_rate = 48000;
|
const u32 sample_rate = 48000;
|
||||||
Write(sample_rate);
|
Write(sample_rate);
|
||||||
Write(sample_rate * 2 * 2); //two channels, 16bit
|
Write(sample_rate * 2 * 2); //two channels, 16bit
|
||||||
|
|
||||||
Write(0x00100004);
|
Write(0x00100004);
|
||||||
Write4("data");
|
Write4("data");
|
||||||
Write(100 * 1000 * 1000 - 32);
|
Write(100 * 1000 * 1000 - 32);
|
||||||
|
|
||||||
// We are now at offset 44
|
// We are now at offset 44
|
||||||
if (ftell(file) != 44)
|
if (ftell(file) != 44)
|
||||||
PanicAlert("wrong offset: %i", ftell(file));
|
PanicAlert("wrong offset: %i", ftell(file));
|
||||||
// ---------------------------
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -79,11 +82,14 @@ void WaveFileWriter::Stop()
|
|||||||
{
|
{
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
// u32 file_size = (u32)ftell(file);
|
|
||||||
|
// u32 file_size = (u32)ftell(file);
|
||||||
fseek(file, 4, SEEK_SET);
|
fseek(file, 4, SEEK_SET);
|
||||||
Write(audio_size + 36);
|
Write(audio_size + 36);
|
||||||
|
|
||||||
fseek(file, 40, SEEK_SET);
|
fseek(file, 40, SEEK_SET);
|
||||||
Write(audio_size);
|
Write(audio_size);
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
file = 0;
|
file = 0;
|
||||||
}
|
}
|
||||||
@ -116,9 +122,12 @@ void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, int count)
|
|||||||
{
|
{
|
||||||
if (!file)
|
if (!file)
|
||||||
PanicAlert("WaveFileWriter - file not open.");
|
PanicAlert("WaveFileWriter - file not open.");
|
||||||
|
|
||||||
if (count > BUF_SIZE * 2)
|
if (count > BUF_SIZE * 2)
|
||||||
PanicAlert("WaveFileWriter - buffer too small (count = %i).", count);
|
PanicAlert("WaveFileWriter - buffer too small (count = %i).", count);
|
||||||
if (skip_silence) {
|
|
||||||
|
if (skip_silence)
|
||||||
|
{
|
||||||
bool all_zero = true;
|
bool all_zero = true;
|
||||||
for (int i = 0; i < count * 2; i++)
|
for (int i = 0; i < count * 2; i++)
|
||||||
if (sample_data[i])
|
if (sample_data[i])
|
||||||
@ -126,9 +135,10 @@ void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, int count)
|
|||||||
if (all_zero)
|
if (all_zero)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < count * 2; i++) {
|
|
||||||
|
for (int i = 0; i < count * 2; i++)
|
||||||
conv_buffer[i] = Common::swap16((u16)sample_data[i]);
|
conv_buffer[i] = Common::swap16((u16)sample_data[i]);
|
||||||
}
|
|
||||||
fwrite(conv_buffer, count * 4, 1, file);
|
fwrite(conv_buffer, count * 4, 1, file);
|
||||||
audio_size += count * 4;
|
audio_size += count * 4;
|
||||||
}
|
}
|
||||||
|
@ -15,17 +15,18 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// WaveFileWriter
|
// ---------------------------------------------------------------------------------
|
||||||
|
// Class: WaveFileWriter
|
||||||
// Simple utility class to make it easy to write long 16-bit stereo
|
// Description: Simple utility class to make it easy to write long 16-bit stereo
|
||||||
// audio streams to disk.
|
// audio streams to disk.
|
||||||
// Use Start() to start recording to a file, and AddStereoSamples to add wave data.
|
// Use Start() to start recording to a file, and AddStereoSamples to add wave data.
|
||||||
// The float variant will convert from -1.0-1.0 range and clamp.
|
// The float variant will convert from -1.0-1.0 range and clamp.
|
||||||
// Alternatively, AddSamplesBE for big endian wave data.
|
// Alternatively, AddSamplesBE for big endian wave data.
|
||||||
// If Stop is not called when it destructs, the destructor will call Stop().
|
// If Stop is not called when it destructs, the destructor will call Stop().
|
||||||
|
// ---------------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifndef _WAVEFILE_H
|
#ifndef _WAVEFILE_H_
|
||||||
#define _WAVEFILE_H
|
#define _WAVEFILE_H_
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -52,4 +53,4 @@ public:
|
|||||||
u32 GetAudioSize() { return audio_size; }
|
u32 GetAudioSize() { return audio_size; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WAVEFILE_H
|
#endif // _WAVEFILE_H_
|
||||||
|
@ -51,12 +51,12 @@
|
|||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
PrecompiledHeaderThrough="stdafx.h"
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -124,12 +124,12 @@
|
|||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
PrecompiledHeaderThrough="stdafx.h"
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -191,18 +191,18 @@
|
|||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
FavorSizeOrSpeed="2"
|
FavorSizeOrSpeed="2"
|
||||||
AdditionalIncludeDirectories="../../PluginSpecs"
|
AdditionalIncludeDirectories="../../PluginSpecs"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
|
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableEnhancedInstructionSet="2"
|
EnableEnhancedInstructionSet="2"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
RuntimeTypeInfo="false"
|
RuntimeTypeInfo="false"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
PrecompiledHeaderThrough="stdafx.h"
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -265,18 +265,18 @@
|
|||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="../../PluginSpecs"
|
AdditionalIncludeDirectories="../../PluginSpecs"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;WIN32_LEAN_AND_MEAN"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableEnhancedInstructionSet="0"
|
EnableEnhancedInstructionSet="0"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
PrecompiledHeaderThrough="stdafx.h"
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -337,16 +337,16 @@
|
|||||||
Optimization="3"
|
Optimization="3"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="../../PluginSpecs"
|
AdditionalIncludeDirectories="../../PluginSpecs"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;DEBUGFAST;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;DEBUGFAST;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;WIN32_LEAN_AND_MEAN"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableEnhancedInstructionSet="2"
|
EnableEnhancedInstructionSet="2"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
PrecompiledHeaderThrough="stdafx.h"
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -408,15 +408,15 @@
|
|||||||
Optimization="3"
|
Optimization="3"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="../../PluginSpecs"
|
AdditionalIncludeDirectories="../../PluginSpecs"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;DEBUGFAST;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;DEBUGFAST;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;WIN32_LEAN_AND_MEAN"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
PrecompiledHeaderThrough="stdafx.h"
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -720,62 +720,6 @@
|
|||||||
RelativePath=".\Src\Setup.h"
|
RelativePath=".\Src\Setup.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\Src\stdafx.cpp"
|
|
||||||
>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="DebugFast|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="DebugFast|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\Src\stdafx.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\Src\StringUtil.cpp"
|
RelativePath=".\Src\StringUtil.cpp"
|
||||||
>
|
>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _JIT_ABI_H
|
#ifndef _JIT_ABI_H_
|
||||||
#define _JIT_ABI_H
|
#define _JIT_ABI_H_
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
@ -74,10 +74,10 @@
|
|||||||
#define ABI_PARAM5 R8
|
#define ABI_PARAM5 R8
|
||||||
#define ABI_PARAM6 R9
|
#define ABI_PARAM6 R9
|
||||||
|
|
||||||
#endif
|
#endif // WIN32
|
||||||
|
|
||||||
#endif
|
#endif // X86
|
||||||
|
|
||||||
#endif // _JIT_ABI_H
|
#endif // _JIT_ABI_H_
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
/* Most of the code in this file was shamelessly ripped from libcdio
|
// Most of the code in this file was shamelessly ripped from libcdio With minor adjustments
|
||||||
With minor adjustments */
|
|
||||||
|
|
||||||
#include "CDUtils.h"
|
#include "CDUtils.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
/*!
|
// Follow symlinks until we have the real device file (idea taken from libunieject).
|
||||||
Follow symlinks until we have the real device file
|
|
||||||
(idea taken from libunieject).
|
|
||||||
*/
|
|
||||||
void cdio_follow_symlink(const char * src, char * dst) {
|
void cdio_follow_symlink(const char * src, char * dst) {
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
char tmp_src[PATH_MAX+1];
|
char tmp_src[PATH_MAX+1];
|
||||||
@ -32,10 +29,9 @@ void cdio_follow_symlink(const char * src, char * dst) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Add/allocate a drive to the end of drives.
|
// Add/allocate a drive to the end of drives.
|
||||||
Use cdio_free_device_list() to free this device_list.
|
// Use cdio_free_device_list() to free this device_list.
|
||||||
*/
|
|
||||||
void cdio_add_device_list(char **device_list[], const char *drive,
|
void cdio_add_device_list(char **device_list[], const char *drive,
|
||||||
unsigned int *num_drives) {
|
unsigned int *num_drives) {
|
||||||
if (NULL != drive) {
|
if (NULL != drive) {
|
||||||
@ -53,7 +49,7 @@ void cdio_add_device_list(char **device_list[], const char *drive,
|
|||||||
/* Drive not in list. Add it. */
|
/* Drive not in list. Add it. */
|
||||||
(*num_drives)++;
|
(*num_drives)++;
|
||||||
*device_list = (char **)realloc(*device_list, (*num_drives) * sizeof(char *));
|
*device_list = (char **)realloc(*device_list, (*num_drives) * sizeof(char *));
|
||||||
(*device_list)[*num_drives-1] = strdup(drive);
|
(*device_list)[*num_drives-1] = __strdup(drive);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -67,10 +63,8 @@ void cdio_add_device_list(char **device_list[], const char *drive,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
// Free device list returned by cdio_get_devices or
|
||||||
Free device list returned by cdio_get_devices or
|
// cdio_get_devices_with_cap.
|
||||||
cdio_get_devices_with_cap.
|
|
||||||
*/
|
|
||||||
void cdio_free_device_list(char * ppsz_device_list[]) {
|
void cdio_free_device_list(char * ppsz_device_list[]) {
|
||||||
char **ppsz_device_list_save=ppsz_device_list;
|
char **ppsz_device_list_save=ppsz_device_list;
|
||||||
if (!ppsz_device_list) return;
|
if (!ppsz_device_list) return;
|
||||||
@ -83,10 +77,8 @@ void cdio_free_device_list(char * ppsz_device_list[]) {
|
|||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
/*
|
// Returns a string that can be used in a CreateFile call if
|
||||||
Returns a string that can be used in a CreateFile call if
|
// c_drive letter is a character. If not NULL is returned.
|
||||||
c_drive letter is a character. If not NULL is returned.
|
|
||||||
*/
|
|
||||||
const char *is_cdrom_win32(const char c_drive_letter) {
|
const char *is_cdrom_win32(const char c_drive_letter) {
|
||||||
|
|
||||||
UINT uDriveType;
|
UINT uDriveType;
|
||||||
@ -103,7 +95,7 @@ const char *is_cdrom_win32(const char c_drive_letter) {
|
|||||||
case DRIVE_CDROM: {
|
case DRIVE_CDROM: {
|
||||||
char sz_win32_drive_full[] = "\\\\.\\X:";
|
char sz_win32_drive_full[] = "\\\\.\\X:";
|
||||||
sz_win32_drive_full[4] = c_drive_letter;
|
sz_win32_drive_full[4] = c_drive_letter;
|
||||||
return strdup(&sz_win32_drive_full[4]);
|
return __strdup(&sz_win32_drive_full[4]);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
//cdio_debug("Drive %c is not a CD-ROM", c_drive_letter);
|
//cdio_debug("Drive %c is not a CD-ROM", c_drive_letter);
|
||||||
@ -111,17 +103,14 @@ const char *is_cdrom_win32(const char c_drive_letter) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Returns a pointer to an array of strings with the device names
|
||||||
Returns a pointer to an array of strings with the device names
|
|
||||||
*/
|
|
||||||
char ** cdio_get_devices_win32() {
|
char ** cdio_get_devices_win32() {
|
||||||
char **drives = NULL;
|
char **drives = NULL;
|
||||||
unsigned int num_drives=0;
|
unsigned int num_drives=0;
|
||||||
char drive_letter;
|
char drive_letter;
|
||||||
|
|
||||||
/* Scan the system for CD-ROM drives.
|
// Scan the system for CD-ROM drives.
|
||||||
Not always 100% reliable, so use the USE_MNTENT code above first.
|
// Not always 100% reliable, so use the USE_MNTENT code above first.
|
||||||
*/
|
|
||||||
for (drive_letter='A'; drive_letter <= 'Z'; drive_letter++) {
|
for (drive_letter='A'; drive_letter <= 'Z'; drive_letter++) {
|
||||||
const char *drive_str=is_cdrom_win32(drive_letter);
|
const char *drive_str=is_cdrom_win32(drive_letter);
|
||||||
if (drive_str != NULL) {
|
if (drive_str != NULL) {
|
||||||
@ -305,7 +294,7 @@ static char *check_mounts_linux(const char *mtab)
|
|||||||
tmp = strstr(mntent->mnt_opts, "fs=");
|
tmp = strstr(mntent->mnt_opts, "fs=");
|
||||||
if ( tmp ) {
|
if ( tmp ) {
|
||||||
free(mnt_type);
|
free(mnt_type);
|
||||||
mnt_type = strdup(tmp + strlen("fs="));
|
mnt_type = __strdup(tmp + strlen("fs="));
|
||||||
if ( mnt_type ) {
|
if ( mnt_type ) {
|
||||||
tmp = strchr(mnt_type, ',');
|
tmp = strchr(mnt_type, ',');
|
||||||
if ( tmp ) {
|
if ( tmp ) {
|
||||||
@ -316,7 +305,7 @@ static char *check_mounts_linux(const char *mtab)
|
|||||||
tmp = strstr(mntent->mnt_opts, "dev=");
|
tmp = strstr(mntent->mnt_opts, "dev=");
|
||||||
if ( tmp ) {
|
if ( tmp ) {
|
||||||
free(mnt_dev);
|
free(mnt_dev);
|
||||||
mnt_dev = strdup(tmp + strlen("dev="));
|
mnt_dev = __strdup(tmp + strlen("dev="));
|
||||||
if ( mnt_dev ) {
|
if ( mnt_dev ) {
|
||||||
tmp = strchr(mnt_dev, ',');
|
tmp = strchr(mnt_dev, ',');
|
||||||
if ( tmp ) {
|
if ( tmp ) {
|
||||||
@ -340,9 +329,7 @@ static char *check_mounts_linux(const char *mtab)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Returns a pointer to an array of strings with the device names
|
||||||
Returns a pointer to an array of strings with the device names
|
|
||||||
*/
|
|
||||||
char **cdio_get_devices_linux () {
|
char **cdio_get_devices_linux () {
|
||||||
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -351,8 +338,7 @@ char **cdio_get_devices_linux () {
|
|||||||
char **drives = NULL;
|
char **drives = NULL;
|
||||||
unsigned int num_drives=0;
|
unsigned int num_drives=0;
|
||||||
|
|
||||||
/* Scan the system for CD-ROM drives.
|
// Scan the system for CD-ROM drives.
|
||||||
*/
|
|
||||||
for ( i=0; strlen(checklist1[i]) > 0; ++i ) {
|
for ( i=0; strlen(checklist1[i]) > 0; ++i ) {
|
||||||
sprintf(drive, "/dev/%s", checklist1[i]);
|
sprintf(drive, "/dev/%s", checklist1[i]);
|
||||||
if ( is_cdrom_linux(drive, NULL) > 0 ) {
|
if ( is_cdrom_linux(drive, NULL) > 0 ) {
|
||||||
@ -372,9 +358,8 @@ char **cdio_get_devices_linux () {
|
|||||||
free(ret_drive);
|
free(ret_drive);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scan the system for CD-ROM drives.
|
// Scan the system for CD-ROM drives.
|
||||||
Not always 100% reliable, so use the USE_MNTENT code above first.
|
// Not always 100% reliable, so use the USE_MNTENT code above first.
|
||||||
*/
|
|
||||||
for ( i=0; checklist2[i].format; ++i ) {
|
for ( i=0; checklist2[i].format; ++i ) {
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
for ( j=checklist2[i].num_min; j<=checklist2[i].num_max; ++j ) {
|
for ( j=checklist2[i].num_min; j<=checklist2[i].num_max; ++j ) {
|
||||||
@ -389,9 +374,7 @@ char **cdio_get_devices_linux () {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
// Returns a pointer to an array of strings with the device names
|
||||||
Returns a pointer to an array of strings with the device names
|
|
||||||
*/
|
|
||||||
char **cdio_get_devices() {
|
char **cdio_get_devices() {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
return cdio_get_devices_win32();
|
return cdio_get_devices_win32();
|
||||||
@ -405,9 +388,9 @@ char **cdio_get_devices() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Need to be tested, does calling this function twice cause any damage?
|
// Need to be tested, does calling this function twice cause any damage?
|
||||||
/*
|
|
||||||
Returns true if device is cdrom/dvd
|
// Returns true if device is cdrom/dvd
|
||||||
*/
|
|
||||||
bool cdio_is_cdrom(const char *device) {
|
bool cdio_is_cdrom(const char *device) {
|
||||||
char **devices = cdio_get_devices();
|
char **devices = cdio_get_devices();
|
||||||
bool res = false;
|
bool res = false;
|
||||||
@ -421,7 +404,9 @@ bool cdio_is_cdrom(const char *device) {
|
|||||||
cdio_free_device_list(devices);
|
cdio_free_device_list(devices);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Can we remove this?
|
||||||
/*
|
/*
|
||||||
int main() {
|
int main() {
|
||||||
char** res = cdio_get_devices();
|
char** res = cdio_get_devices();
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
#ifndef CDUTILS_H
|
#ifndef _CDUTILS_H_
|
||||||
#define CDUTILS_H
|
#define _CDUTILS_H_
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "windows.h"
|
#include <windows.h>
|
||||||
#define PATH_MAX MAX_PATH
|
#define PATH_MAX MAX_PATH
|
||||||
|
|
||||||
#elif __APPLE__
|
#elif __APPLE__
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
#include <IOKit/IOKitLib.h>
|
#include <IOKit/IOKitLib.h>
|
||||||
#include <IOKit/storage/IOCDMedia.h>
|
#include <IOKit/storage/IOCDMedia.h>
|
||||||
@ -17,16 +18,10 @@
|
|||||||
#include <IOKit/IOBSD.h>
|
#include <IOKit/IOBSD.h>
|
||||||
|
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <mntent.h>
|
#include <mntent.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
@ -34,20 +29,14 @@
|
|||||||
#include <linux/cdrom.h>
|
#include <linux/cdrom.h>
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
/*
|
// Returns a pointer to an array of strings with the device names
|
||||||
Returns a pointer to an array of strings with the device names
|
|
||||||
*/
|
|
||||||
char **cdio_get_devices();
|
char **cdio_get_devices();
|
||||||
|
|
||||||
/*!
|
// Free device list returned by cdio_get_devices or
|
||||||
Free device list returned by cdio_get_devices or
|
// cdio_get_devices_with_cap.
|
||||||
cdio_get_devices_with_cap.
|
|
||||||
*/
|
|
||||||
void cdio_free_device_list(char * ppsz_device_list[]);
|
void cdio_free_device_list(char * ppsz_device_list[]);
|
||||||
|
|
||||||
/*
|
// Returns true if device is cdrom/dvd
|
||||||
Returns true if device is cdrom/dvd
|
|
||||||
*/
|
|
||||||
bool cdio_is_cdrom(const char *device);
|
bool cdio_is_cdrom(const char *device);
|
||||||
|
|
||||||
#endif // CDUTILS_H
|
#endif // _CDUTILS_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -16,8 +16,8 @@
|
|||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Detect the cpu, so we'll know which optimizations to use
|
// Detect the cpu, so we'll know which optimizations to use
|
||||||
#ifndef _CPUDETECT_H
|
#ifndef _CPUDETECT_H_
|
||||||
#define _CPUDETECT_H
|
#define _CPUDETECT_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -62,4 +62,4 @@ struct CPUInfo
|
|||||||
|
|
||||||
extern CPUInfo cpu_info;
|
extern CPUInfo cpu_info;
|
||||||
|
|
||||||
#endif
|
#endif // _CPUDETECT_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _POINTERWRAP_H
|
#ifndef _POINTERWRAP_H_
|
||||||
#define _POINTERWRAP_H
|
#define _POINTERWRAP_H_
|
||||||
|
|
||||||
// Extremely simple serialization framework.
|
// Extremely simple serialization framework.
|
||||||
|
|
||||||
@ -271,4 +271,4 @@ private:
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _POINTERWRAP_H
|
#endif // _POINTERWRAP_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _COLORUTIL_H
|
#ifndef _COLORUTIL_H_
|
||||||
#define _COLORUTIL_H
|
#define _COLORUTIL_H_
|
||||||
|
|
||||||
namespace ColorUtil
|
namespace ColorUtil
|
||||||
{
|
{
|
||||||
@ -25,4 +25,4 @@ u32 Decode5A3(u16 val);
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif
|
#endif // _COLORUTIL_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _COMMON_H
|
#ifndef _COMMON_H_
|
||||||
#define _COMMON_H
|
#define _COMMON_H_
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -40,6 +40,15 @@
|
|||||||
#include "CommonPaths.h"
|
#include "CommonPaths.h"
|
||||||
#include "CommonFuncs.h"
|
#include "CommonFuncs.h"
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define __strdup _strdup
|
||||||
|
#define __getcwd _getcwd
|
||||||
|
#define __chdir _chdir
|
||||||
|
#else
|
||||||
|
#define __strdup strdup
|
||||||
|
#define __getcwd getcwd
|
||||||
|
#define __chdir chdir
|
||||||
|
#endif
|
||||||
|
|
||||||
// Darwin ABI requires that stack frames be aligned to 16-byte boundaries.
|
// Darwin ABI requires that stack frames be aligned to 16-byte boundaries.
|
||||||
// This probably wouldn't break anyone either, but hey
|
// This probably wouldn't break anyone either, but hey
|
||||||
@ -50,7 +59,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
// Check MSC ver
|
// Check MSC ver
|
||||||
#if !defined _MSC_VER || _MSC_VER <= 1000
|
#if !defined _MSC_VER || _MSC_VER <= 1000
|
||||||
#error needs at least version 1000 of MSC
|
#error needs at least version 1000 of MSC
|
||||||
@ -124,4 +132,4 @@ namespace
|
|||||||
TypeName(const TypeName&); \
|
TypeName(const TypeName&); \
|
||||||
void operator=(const TypeName&)
|
void operator=(const TypeName&)
|
||||||
|
|
||||||
#endif // COMMON_H
|
#endif // _COMMON_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef COMMONFUNCS_H
|
#ifndef _COMMONFUNCS_H_
|
||||||
#define COMMONFUNCS_H
|
#define _COMMONFUNCS_H_
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define SLEEP(x) Sleep(x)
|
#define SLEEP(x) Sleep(x)
|
||||||
@ -111,6 +111,6 @@ inline u16 swap16(const u8* _pData) {return swap16(*(const u16*)_pData);}
|
|||||||
inline u32 swap32(const u8* _pData) {return swap32(*(const u32*)_pData);}
|
inline u32 swap32(const u8* _pData) {return swap32(*(const u32*)_pData);}
|
||||||
inline u64 swap64(const u8* _pData) {return swap64(*(const u64*)_pData);}
|
inline u64 swap64(const u8* _pData) {return swap64(*(const u64*)_pData);}
|
||||||
|
|
||||||
} // namespace Common
|
} // Namespace Common
|
||||||
|
|
||||||
#endif // COMMONFUNCS
|
#endif // _COMMONFUNCS_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef COMMON_PATHS_H
|
#ifndef _COMMON_PATHS_H_
|
||||||
#define COMMON_PATHS_H
|
#define _COMMON_PATHS_H_
|
||||||
|
|
||||||
// Library suffix/prefix
|
// Library suffix/prefix
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -165,4 +165,4 @@
|
|||||||
|
|
||||||
#define FULL_WII_MENU_DIR FULL_WII_USER_DIR "title" DIR_SEP "00000001" DIR_SEP "00000002" DIR_SEP "content"
|
#define FULL_WII_MENU_DIR FULL_WII_USER_DIR "title" DIR_SEP "00000001" DIR_SEP "00000002" DIR_SEP "content"
|
||||||
|
|
||||||
#endif // COMMON_PATHS_H
|
#endif // _COMMON_PATHS_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -20,8 +20,8 @@
|
|||||||
// core and the plugin specs. Any definitions that are only used by the core
|
// core and the plugin specs. Any definitions that are only used by the core
|
||||||
// should be placed in "Common.h" instead.
|
// should be placed in "Common.h" instead.
|
||||||
|
|
||||||
#ifndef _COMMONTYPES_H
|
#ifndef _COMMONTYPES_H_
|
||||||
#define _COMMONTYPES_H
|
#define _COMMONTYPES_H_
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
@ -55,4 +55,4 @@ typedef long long s64;
|
|||||||
|
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#endif // _COMMONTYPES_H
|
#endif // _COMMONTYPES_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -40,7 +40,7 @@ ConsoleListener::~ConsoleListener()
|
|||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//100, 100, "Dolphin Log Console"
|
// 100, 100, "Dolphin Log Console"
|
||||||
// Open console window - width and height is the size of console window
|
// Open console window - width and height is the size of console window
|
||||||
// Name is the window title
|
// Name is the window title
|
||||||
void ConsoleListener::Open(int width, int height, char *title)
|
void ConsoleListener::Open(int width, int height, char *title)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -163,5 +163,3 @@ void* DynamicLibrary::Get(const char* funcname) const
|
|||||||
funcname);
|
funcname);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DYNAMICLIBRARY_H
|
#ifndef _DYNAMICLIBRARY_H_
|
||||||
#define _DYNAMICLIBRARY_H
|
#define _DYNAMICLIBRARY_H_
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -56,4 +56,4 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DYNAMICLIBRARY
|
#endif // _DYNAMICLIBRARY_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////////////
|
// --------------------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Written by Zoltan Csizmadia, zoltan_csizmadia@yahoo.com
|
// Written by Zoltan Csizmadia, zoltan_csizmadia@yahoo.com
|
||||||
// For companies(Austin,TX): If you would like to get my resume, send an email.
|
// For companies(Austin,TX): If you would like to get my resume, send an email.
|
||||||
@ -10,14 +10,7 @@
|
|||||||
// 1.1 WhineCube version Masken
|
// 1.1 WhineCube version Masken
|
||||||
// 1.2 Dolphin version Masken
|
// 1.2 Dolphin version Masken
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
// --------------------------------------------------------------------------------------
|
||||||
//
|
|
||||||
// ExtendedTrace.cpp
|
|
||||||
//
|
|
||||||
|
|
||||||
// Include StdAfx.h, if you're using precompiled
|
|
||||||
// header through StdAfx.h
|
|
||||||
//#include "stdafx.h"
|
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////////////
|
// -----------------------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Written by Zoltan Csizmadia, zoltan_csizmadia@yahoo.com
|
// Written by Zoltan Csizmadia, zoltan_csizmadia@yahoo.com
|
||||||
// For companies(Austin,TX): If you would like to get my resume, send an email.
|
// For companies(Austin,TX): If you would like to get my resume, send an email.
|
||||||
@ -10,13 +10,10 @@
|
|||||||
// 1.1 WhineCube version Masken
|
// 1.1 WhineCube version Masken
|
||||||
// 1.2 Dolphin version Masken
|
// 1.2 Dolphin version Masken
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
// ----------------------------------------------------------------------------------------
|
||||||
//
|
|
||||||
// ExtendedTrace.h
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef EXTENDEDTRACE_H_INCLUDED
|
#ifndef _EXTENDEDTRACE_H_INCLUDED_
|
||||||
#define EXTENDEDTRACE_H_INCLUDED
|
#define _EXTENDEDTRACE_H_INCLUDED_
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
|
|
||||||
@ -31,26 +28,26 @@
|
|||||||
#define EXTENDEDTRACEUNINITIALIZE() UninitSymInfo()
|
#define EXTENDEDTRACEUNINITIALIZE() UninitSymInfo()
|
||||||
#define STACKTRACE(file) StackTrace( GetCurrentThread(), _T(""), file)
|
#define STACKTRACE(file) StackTrace( GetCurrentThread(), _T(""), file)
|
||||||
#define STACKTRACE2(file, eip, esp, ebp) StackTrace(GetCurrentThread(), _T(""), file, eip, esp, ebp)
|
#define STACKTRACE2(file, eip, esp, ebp) StackTrace(GetCurrentThread(), _T(""), file, eip, esp, ebp)
|
||||||
//class File;
|
// class File;
|
||||||
|
|
||||||
BOOL InitSymInfo( PCSTR );
|
BOOL InitSymInfo( PCSTR );
|
||||||
BOOL UninitSymInfo();
|
BOOL UninitSymInfo();
|
||||||
void StackTrace( HANDLE, LPCTSTR, FILE *file);
|
void StackTrace( HANDLE, LPCTSTR, FILE *file);
|
||||||
void StackTrace( HANDLE, LPCTSTR, FILE *file, DWORD eip, DWORD esp, DWORD ebp);
|
void StackTrace( HANDLE, LPCTSTR, FILE *file, DWORD eip, DWORD esp, DWORD ebp);
|
||||||
|
|
||||||
//functions by Masken
|
// functions by Masken
|
||||||
void etfprintf(FILE *file, const char *format, ...);
|
void etfprintf(FILE *file, const char *format, ...);
|
||||||
void etfprint(FILE *file, const std::string &text);
|
void etfprint(FILE *file, const std::string &text);
|
||||||
#define UEFBUFSIZE 2048
|
#define UEFBUFSIZE 2048
|
||||||
extern char g_uefbuf[UEFBUFSIZE];
|
extern char g_uefbuf[UEFBUFSIZE];
|
||||||
|
|
||||||
#else //not WIN32
|
#else // not WIN32
|
||||||
|
|
||||||
#define EXTENDEDTRACEINITIALIZE( IniSymbolPath ) ((void)0)
|
#define EXTENDEDTRACEINITIALIZE( IniSymbolPath ) ((void)0)
|
||||||
#define EXTENDEDTRACEUNINITIALIZE() ((void)0)
|
#define EXTENDEDTRACEUNINITIALIZE() ((void)0)
|
||||||
#define STACKTRACE(file) ((void)0)
|
#define STACKTRACE(file) ((void)0)
|
||||||
#define STACKTRACE2(file, eip, esp, ebp) ((void)0)
|
#define STACKTRACE2(file, eip, esp, ebp) ((void)0)
|
||||||
|
|
||||||
#endif //WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
#endif //EXTENDEDTRACE_H_INCLUDED
|
#endif // _EXTENDEDTRACE_H_INCLUDED_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -115,5 +115,3 @@ const CFileSearch::XStringVector& CFileSearch::GetFileNames() const
|
|||||||
{
|
{
|
||||||
return(m_FileNames);
|
return(m_FileNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef __FILESEARCH_H_
|
#ifndef _FILESEARCH_H_
|
||||||
#define __FILESEARCH_H_
|
#define _FILESEARCH_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -40,5 +40,5 @@ class CFileSearch
|
|||||||
XStringVector m_FileNames;
|
XStringVector m_FileNames;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _FILESEARCH_H_
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -45,11 +45,10 @@
|
|||||||
#ifndef S_ISDIR
|
#ifndef S_ISDIR
|
||||||
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
|
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
|
||||||
#endif
|
#endif
|
||||||
/*
|
|
||||||
This namespace has various generic functions related to files and paths.
|
// This namespace has various generic functions related to files and paths.
|
||||||
The code still needs a ton of cleanup.
|
// The code still needs a ton of cleanup.
|
||||||
REMEMBER: strdup considered harmful!
|
// REMEMBER: strdup considered harmful!
|
||||||
*/
|
|
||||||
namespace File
|
namespace File
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -70,7 +69,7 @@ bool Exists(const char *filename)
|
|||||||
{
|
{
|
||||||
struct stat file_info;
|
struct stat file_info;
|
||||||
|
|
||||||
char *copy = StripTailDirSlashes(strdup(filename));
|
char *copy = StripTailDirSlashes(__strdup(filename));
|
||||||
int result = stat(copy, &file_info);
|
int result = stat(copy, &file_info);
|
||||||
free(copy);
|
free(copy);
|
||||||
|
|
||||||
@ -82,7 +81,7 @@ bool IsDirectory(const char *filename)
|
|||||||
{
|
{
|
||||||
struct stat file_info;
|
struct stat file_info;
|
||||||
|
|
||||||
char *copy = StripTailDirSlashes(strdup(filename));
|
char *copy = StripTailDirSlashes(__strdup(filename));
|
||||||
|
|
||||||
int result = stat(copy, &file_info);
|
int result = stat(copy, &file_info);
|
||||||
free(copy);
|
free(copy);
|
||||||
@ -488,7 +487,7 @@ const char *GetCurrentDirectory()
|
|||||||
{
|
{
|
||||||
const char *dir;
|
const char *dir;
|
||||||
// Get the current working directory (getcwd uses malloc)
|
// Get the current working directory (getcwd uses malloc)
|
||||||
if (!(dir = getcwd(NULL, 0))) {
|
if (!(dir = __getcwd(NULL, 0))) {
|
||||||
|
|
||||||
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s",
|
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s",
|
||||||
GetLastErrorMsg());
|
GetLastErrorMsg());
|
||||||
@ -500,7 +499,7 @@ const char *GetCurrentDirectory()
|
|||||||
// Sets the current directory to the given directory
|
// Sets the current directory to the given directory
|
||||||
bool SetCurrentDirectory(const char *_rDirectory)
|
bool SetCurrentDirectory(const char *_rDirectory)
|
||||||
{
|
{
|
||||||
return chdir(_rDirectory) == 0;
|
return __chdir(_rDirectory) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
@ -603,4 +602,3 @@ const char *GetUserDirectory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _FILEUTIL_H
|
#ifndef _FILEUTIL_H_
|
||||||
#define _FILEUTIL_H
|
#define _FILEUTIL_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -24,9 +24,6 @@
|
|||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
/*
|
|
||||||
This namespace has various generic functions related to files and paths.
|
|
||||||
*/
|
|
||||||
namespace File
|
namespace File
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _FIXED_SIZE_QUEUE_H
|
#ifndef _FIXED_SIZE_QUEUE_H_
|
||||||
#define _FIXED_SIZE_QUEUE_H
|
#define _FIXED_SIZE_QUEUE_H_
|
||||||
|
|
||||||
// STL-look-a-like interface, but name is mixed case to distinguish it clearly from the
|
// STL-look-a-like interface, but name is mixed case to distinguish it clearly from the
|
||||||
// real STL classes.
|
// real STL classes.
|
||||||
@ -83,5 +83,5 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _FIXED_SIZE_QUEUE_H
|
#endif // _FIXED_SIZE_QUEUE_H_
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -41,7 +41,7 @@ u32 HashFletcher(const u8* data_u8, size_t length)
|
|||||||
sum2 = (sum2 & 0xffff) + (sum2 >> 16);
|
sum2 = (sum2 & 0xffff) + (sum2 >> 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Second reduction step to reduce sums to 16 bits */
|
// Second reduction step to reduce sums to 16 bits
|
||||||
sum1 = (sum1 & 0xffff) + (sum1 >> 16);
|
sum1 = (sum1 & 0xffff) + (sum1 >> 16);
|
||||||
sum2 = (sum2 & 0xffff) + (sum2 >> 16);
|
sum2 = (sum2 & 0xffff) + (sum2 >> 16);
|
||||||
return(sum2 << 16 | sum1);
|
return(sum2 << 16 | sum1);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _HASH_H
|
#ifndef _HASH_H_
|
||||||
#define _HASH_H
|
#define _HASH_H_
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
@ -25,4 +25,4 @@ u32 HashAdler32(const u8* data, size_t len); // Fairly accurate, slightl
|
|||||||
u32 HashFNV(const u8* ptr, int length); // Another fast and decent hash
|
u32 HashFNV(const u8* ptr, int length); // Another fast and decent hash
|
||||||
u32 HashEctor(const u8* ptr, int length); // JUNK. DO NOT USE FOR NEW THINGS
|
u32 HashEctor(const u8* ptr, int length); // JUNK. DO NOT USE FOR NEW THINGS
|
||||||
|
|
||||||
#endif
|
#endif // _HASH_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -16,9 +16,6 @@
|
|||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
// see IniFile.h
|
// see IniFile.h
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Include
|
|
||||||
// ------------
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -30,24 +27,13 @@
|
|||||||
|
|
||||||
#include "StringUtil.h"
|
#include "StringUtil.h"
|
||||||
#include "IniFile.h"
|
#include "IniFile.h"
|
||||||
///////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Class
|
|
||||||
// ------------
|
|
||||||
IniFile::IniFile()
|
IniFile::IniFile()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
IniFile::~IniFile()
|
IniFile::~IniFile()
|
||||||
{}
|
{}
|
||||||
///////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Section functions used locally only
|
|
||||||
// ------------
|
|
||||||
Section::Section()
|
Section::Section()
|
||||||
: lines(), name(""), comment("") {}
|
: lines(), name(""), comment("") {}
|
||||||
|
|
||||||
@ -91,7 +77,6 @@ Section* IniFile::GetOrCreateSection(const char* sectionName)
|
|||||||
|
|
||||||
return(section);
|
return(section);
|
||||||
}
|
}
|
||||||
///////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
bool IniFile::DeleteSection(const char* sectionName)
|
bool IniFile::DeleteSection(const char* sectionName)
|
||||||
@ -115,7 +100,6 @@ bool IniFile::DeleteSection(const char* sectionName)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut) const
|
void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut) const
|
||||||
{
|
{
|
||||||
// allow many types of commenting
|
// allow many types of commenting
|
||||||
@ -153,7 +137,6 @@ void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string* IniFile::GetLine(Section* section, const char* key, std::string* valueOut, std::string* commentOut)
|
std::string* IniFile::GetLine(Section* section, const char* key, std::string* valueOut, std::string* commentOut)
|
||||||
{
|
{
|
||||||
for (std::vector<std::string>::iterator iter = section->lines.begin(); iter != section->lines.end(); ++iter)
|
for (std::vector<std::string>::iterator iter = section->lines.begin(); iter != section->lines.end(); ++iter)
|
||||||
@ -283,10 +266,6 @@ void IniFile::SortSections()
|
|||||||
std::sort(sections.begin(), sections.end());
|
std::sort(sections.begin(), sections.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Load and save file
|
|
||||||
// ------------
|
|
||||||
bool IniFile::Load(const char* filename)
|
bool IniFile::Load(const char* filename)
|
||||||
{
|
{
|
||||||
// Maximum number of letters in a line
|
// Maximum number of letters in a line
|
||||||
@ -382,12 +361,7 @@ bool IniFile::Save(const char* filename)
|
|||||||
out.close();
|
out.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Get and set elements
|
|
||||||
// ------------
|
|
||||||
void IniFile::Set(const char* sectionName, const char* key, const char* newValue)
|
void IniFile::Set(const char* sectionName, const char* key, const char* newValue)
|
||||||
{
|
{
|
||||||
Section* section = GetOrCreateSection(sectionName);
|
Section* section = GetOrCreateSection(sectionName);
|
||||||
@ -544,10 +518,9 @@ bool IniFile::Get(const char* sectionName, const char* key, bool* value, bool de
|
|||||||
*value = defaultValue;
|
*value = defaultValue;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: Keep this code below?
|
||||||
/*
|
/*
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -567,4 +540,3 @@ bool IniFile::Get(const char* sectionName, const char* key, bool* value, bool de
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _INIFILE_H
|
#ifndef _INIFILE_H_
|
||||||
#define _INIFILE_H
|
#define _INIFILE_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -88,4 +88,4 @@ private:
|
|||||||
void CreateSection(const char* section);
|
void CreateSection(const char* section);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _INIFILE_H_
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _LOG_H
|
#ifndef _LOG_H_
|
||||||
#define _LOG_H
|
#define _LOG_H_
|
||||||
|
|
||||||
#define NOTICE_LEVEL 1 // VERY important information that is NOT errors. Like startup and OSReports.
|
#define NOTICE_LEVEL 1 // VERY important information that is NOT errors. Like startup and OSReports.
|
||||||
#define ERROR_LEVEL 2 // Critical errors
|
#define ERROR_LEVEL 2 // Critical errors
|
||||||
@ -165,4 +165,4 @@ enum LOG_LEVELS {
|
|||||||
}
|
}
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
#endif // LOG_H
|
#endif // _LOG_H_
|
||||||
|
@ -1,3 +1,20 @@
|
|||||||
|
// Copyright (C) 2003-2009 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/
|
||||||
|
|
||||||
#include "LogManager.h"
|
#include "LogManager.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _LOGMANAGER_H
|
#ifndef _LOGMANAGER_H_
|
||||||
#define _LOGMANAGER_H
|
#define _LOGMANAGER_H_
|
||||||
|
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Thread.h"
|
#include "Thread.h"
|
||||||
@ -187,4 +187,4 @@ public:
|
|||||||
~LogManager();
|
~LogManager();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LOGMANAGER_H
|
#endif // _LOGMANAGER_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -230,4 +230,4 @@ IMappedFile* IMappedFile::CreateMappedFileDEPRECATED(void)
|
|||||||
{
|
{
|
||||||
return(new CMappedFile);
|
return(new CMappedFile);
|
||||||
}
|
}
|
||||||
} // end of namespace Common
|
} // namespace Common
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -14,14 +14,16 @@
|
|||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
|
// ------------------------------------------------------
|
||||||
// Handles giant memory mapped files
|
// Handles giant memory mapped files
|
||||||
// Through some trickery, allows lock on byte boundaries
|
// Through some trickery, allows lock on byte boundaries
|
||||||
// instead of allocation granularity boundaries
|
// instead of allocation granularity boundaries
|
||||||
// for ease of use
|
// for ease of use
|
||||||
//
|
// ------------------------------------------------------
|
||||||
|
|
||||||
#ifndef _MAPPED_FILE_H
|
#ifndef _MAPPED_FILE_H_
|
||||||
#define _MAPPED_FILE_H
|
#define _MAPPED_FILE_H_
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
@ -44,4 +46,4 @@ public:
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif
|
#endif // _MAPPED_FILE_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -40,5 +40,3 @@ void SaveSSEState()
|
|||||||
{
|
{
|
||||||
saved_sse_state = _mm_getcsr();
|
saved_sse_state = _mm_getcsr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _MATH_UTIL_H
|
#ifndef _MATH_UTIL_H_
|
||||||
#define _MATH_UTIL_H
|
#define _MATH_UTIL_H_
|
||||||
|
|
||||||
#include <xmmintrin.h>
|
#include <xmmintrin.h>
|
||||||
|
|
||||||
@ -36,4 +36,4 @@ void LoadDefaultSSEState();
|
|||||||
|
|
||||||
#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1))
|
#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1))
|
||||||
|
|
||||||
#endif
|
#endif // _MATH_UTIL_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _MEMARENA_H
|
#ifndef _MEMARENA_H_
|
||||||
#define _MEMARENA_H
|
#define _MEMARENA_H_
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -49,4 +49,4 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _MEMARENA_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -41,9 +41,8 @@ void SetEnableAlert(bool enable) {
|
|||||||
correct windows is shown */
|
correct windows is shown */
|
||||||
bool MsgAlert(const char* caption, bool yes_no, int Style, const char* format, ...)
|
bool MsgAlert(const char* caption, bool yes_no, int Style, const char* format, ...)
|
||||||
{
|
{
|
||||||
// ---------------------------------
|
|
||||||
// Read message and write it to the log
|
// Read message and write it to the log
|
||||||
// -----------
|
|
||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
@ -75,4 +74,3 @@ bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, int S
|
|||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef MSGHANDLER_H
|
#ifndef _MSGHANDLER_H_
|
||||||
#define MSGHANDLER_H
|
#define _MSGHANDLER_H_
|
||||||
// Message alerts
|
// Message alerts
|
||||||
enum MSG_TYPE
|
enum MSG_TYPE
|
||||||
{
|
{
|
||||||
@ -43,4 +43,4 @@ void SetEnableAlert(bool enable);
|
|||||||
#define AskYesNo(format, ...) MsgAlert("Question", true, QUESTION, format, ##__VA_ARGS__)
|
#define AskYesNo(format, ...) MsgAlert("Question", true, QUESTION, format, ##__VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //MSGHANDLER
|
#endif // _MSGHANDLER_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,11 +15,11 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
////////////////////////////////////////////////
|
// --------------------------------------------------------------------------------------------
|
||||||
// This is the common Plugin class that links to the functions that are
|
// This is the common Plugin class that links to the functions that are
|
||||||
// common to all plugins. This class is inherited by all plugin classes. But it's only created
|
// common to all plugins. This class is inherited by all plugin classes. But it's only created
|
||||||
// directly in PluginManager.cpp when we check if a plugin is valid or not.
|
// directly in PluginManager.cpp when we check if a plugin is valid or not.
|
||||||
///////////////////////////////////////////////
|
// --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "Plugin.h"
|
#include "Plugin.h"
|
||||||
|
|
||||||
@ -124,4 +124,4 @@ void CPlugin::Shutdown()
|
|||||||
m_Shutdown();
|
m_Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of namespace Common
|
} // Namespace
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _PLUGIN_H
|
#ifndef _PLUGIN_H_
|
||||||
#define _PLUGIN_H
|
#define _PLUGIN_H_
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "PluginSpecs.h"
|
#include "PluginSpecs.h"
|
||||||
@ -67,6 +67,6 @@ private:
|
|||||||
TShutdown m_Shutdown;
|
TShutdown m_Shutdown;
|
||||||
TDoState m_DoState;
|
TDoState m_DoState;
|
||||||
};
|
};
|
||||||
} // end of namespace Common
|
} // Namespace
|
||||||
|
|
||||||
#endif
|
#endif // _PLUGIN_H_
|
||||||
|
@ -1,3 +1,20 @@
|
|||||||
|
// Copyright (C) 2003-2009 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/
|
||||||
|
|
||||||
#include "PluginDSP.h"
|
#include "PluginDSP.h"
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
@ -1,5 +1,22 @@
|
|||||||
#ifndef _PLUGINDSP_H
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
#define _PLUGINDSP_H
|
|
||||||
|
// 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 _PLUGINDSP_H_
|
||||||
|
#define _PLUGINDSP_H_
|
||||||
|
|
||||||
#include "pluginspecs_dsp.h"
|
#include "pluginspecs_dsp.h"
|
||||||
#include "Plugin.h"
|
#include "Plugin.h"
|
||||||
@ -38,4 +55,4 @@ private:
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif
|
#endif // _PLUGINDSP_H_
|
||||||
|
@ -1,3 +1,20 @@
|
|||||||
|
// Copyright (C) 2003-2009 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/
|
||||||
|
|
||||||
#include "PluginPAD.h"
|
#include "PluginPAD.h"
|
||||||
|
|
||||||
namespace Common
|
namespace Common
|
||||||
@ -21,4 +38,4 @@ namespace Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
PluginPAD::~PluginPAD() {}
|
PluginPAD::~PluginPAD() {}
|
||||||
}
|
} // Namespace
|
||||||
|
@ -1,5 +1,22 @@
|
|||||||
#ifndef _PLUGINPAD_H
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
#define _PLUGINPAD_H
|
|
||||||
|
// 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 _PLUGINPAD_H_
|
||||||
|
#define _PLUGINPAD_H_
|
||||||
|
|
||||||
#include "pluginspecs_pad.h"
|
#include "pluginspecs_pad.h"
|
||||||
#include "Plugin.h"
|
#include "Plugin.h"
|
||||||
@ -29,4 +46,4 @@ private:
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif
|
#endif // _PLUGINPAD_H_
|
||||||
|
@ -1,3 +1,20 @@
|
|||||||
|
// Copyright (C) 2003-2009 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/
|
||||||
|
|
||||||
#include "PluginVideo.h"
|
#include "PluginVideo.h"
|
||||||
|
|
||||||
namespace Common
|
namespace Common
|
||||||
|
@ -1,5 +1,22 @@
|
|||||||
#ifndef _PLUGINVIDEO_H
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
#define _PLUGINVIDEO_H
|
|
||||||
|
// 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 _PLUGINVIDEO_H_
|
||||||
|
#define _PLUGINVIDEO_H_
|
||||||
|
|
||||||
#include "pluginspecs_video.h"
|
#include "pluginspecs_video.h"
|
||||||
#include "Plugin.h"
|
#include "Plugin.h"
|
||||||
@ -36,4 +53,4 @@ private:
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif
|
#endif // _PLUGINVIDEO_H_
|
||||||
|
@ -1,3 +1,20 @@
|
|||||||
|
// Copyright (C) 2003-2009 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/
|
||||||
|
|
||||||
#include "PluginWiimote.h"
|
#include "PluginWiimote.h"
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
@ -21,7 +38,6 @@ PluginWiimote::PluginWiimote(const char *_Filename)
|
|||||||
validWiimote = true;
|
validWiimote = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginWiimote::~PluginWiimote() {
|
PluginWiimote::~PluginWiimote() { }
|
||||||
}
|
|
||||||
|
|
||||||
}
|
} // Namespace
|
||||||
|
@ -1,5 +1,22 @@
|
|||||||
#ifndef _PLUGINWIIMOTE_H
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
#define _PLUGINWIIMOTE_H
|
|
||||||
|
// 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 _PLUGINWIIMOTE_H_
|
||||||
|
#define _PLUGINWIIMOTE_H_
|
||||||
|
|
||||||
#include "pluginspecs_wiimote.h"
|
#include "pluginspecs_wiimote.h"
|
||||||
#include "Plugin.h"
|
#include "Plugin.h"
|
||||||
@ -29,4 +46,4 @@ private:
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif
|
#endif // _PLUGINWIIMOTE_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,23 +15,19 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef __SETUP_h__
|
#ifndef _SETUP_H_
|
||||||
#define __SETUP_h__
|
#define _SETUP_H_
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
// -----------------------------------------------------------------------------------------------------
|
||||||
// File description
|
// File description:
|
||||||
/* ¯¯¯¯¯¯¯¯¯¯¯¯
|
// Compilation settings. I avoid placing this in Common.h or some place where lots of files needs
|
||||||
|
// to be rebuilt if any of these settings are changed. I'd rather have it in as few files as possible.
|
||||||
|
// This file can be kept on the ignore list in your SVN program. It allows local optional settings
|
||||||
|
// depending on what works on your computer.
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Compilation settings. I avoid placing this in Common.h or some place where lots of files needs
|
// -----------------------------------------------------------------------------------------------------
|
||||||
to be rebuilt if any of these settings are changed. I'd rather have it in as few files as possible.
|
// Settings:
|
||||||
This file can be kept on the ignore list in your SVN program. It allows local optional settings
|
|
||||||
depending on what works on your computer.
|
|
||||||
|
|
||||||
////////////////////////*/
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Settings
|
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯
|
|
||||||
|
|
||||||
// This may remove sound artifacts in Wario Land Shake It and perhaps other games
|
// This may remove sound artifacts in Wario Land Shake It and perhaps other games
|
||||||
//#define SETUP_AVOID_SOUND_ARTIFACTS
|
//#define SETUP_AVOID_SOUND_ARTIFACTS
|
||||||
@ -64,7 +60,7 @@
|
|||||||
// Build with music modification
|
// Build with music modification
|
||||||
//#define MUSICMOD
|
//#define MUSICMOD
|
||||||
|
|
||||||
///////////////////////////
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#endif // __SETUP_h__
|
#endif // _SETUP_H_
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -66,10 +66,7 @@ bool AsciiToHex(const char* _szValue, u32& result)
|
|||||||
return (true);
|
return (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Convert AB to it's ascii table entry numbers 0x4142
|
// Convert AB to it's ascii table entry numbers 0x4142
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
|
||||||
u32 Ascii2Hex(std::string _Text)
|
u32 Ascii2Hex(std::string _Text)
|
||||||
{
|
{
|
||||||
// Reset the return value zero
|
// Reset the return value zero
|
||||||
@ -100,8 +97,6 @@ std::string Hex2Ascii(u32 _Text)
|
|||||||
std::string StrResult = Result;
|
std::string StrResult = Result;
|
||||||
return StrResult;
|
return StrResult;
|
||||||
}
|
}
|
||||||
///////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list args)
|
bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list args)
|
||||||
{
|
{
|
||||||
@ -119,7 +114,6 @@ bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list ar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Expensive!
|
// Expensive!
|
||||||
void ToStringFromFormat(std::string* out, const char* format, ...)
|
void ToStringFromFormat(std::string* out, const char* format, ...)
|
||||||
{
|
{
|
||||||
@ -183,9 +177,7 @@ std::string StringFromFormat(const char* format, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ===================================================
|
// For Debugging. Read out an u8 array.
|
||||||
/* For Debugging. Read out an u8 array. */
|
|
||||||
// ----------------
|
|
||||||
std::string ArrayToString(const u8 *data, u32 size, u32 offset, int line_len, bool Spaces)
|
std::string ArrayToString(const u8 *data, u32 size, u32 offset, int line_len, bool Spaces)
|
||||||
{
|
{
|
||||||
std::string Tmp, Spc;
|
std::string Tmp, Spc;
|
||||||
@ -197,8 +189,6 @@ std::string ArrayToString(const u8 *data, u32 size, u32 offset, int line_len, bo
|
|||||||
}
|
}
|
||||||
return Tmp;
|
return Tmp;
|
||||||
}
|
}
|
||||||
// ================
|
|
||||||
|
|
||||||
|
|
||||||
// Turns " hej " into "hej". Also handles tabs.
|
// Turns " hej " into "hej". Also handles tabs.
|
||||||
std::string StripSpaces(const std::string &str)
|
std::string StripSpaces(const std::string &str)
|
||||||
@ -459,5 +449,3 @@ std::string ThS(int Integer, bool Unsigned)
|
|||||||
}
|
}
|
||||||
return sbuf;
|
return sbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _STRINGUTIL_H
|
#ifndef _STRINGUTIL_H_
|
||||||
#define _STRINGUTIL_H
|
#define _STRINGUTIL_H_
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
@ -75,4 +75,4 @@ bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _
|
|||||||
void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename);
|
void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif // _STRINGUTIL_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -18,14 +18,11 @@
|
|||||||
#include "Setup.h"
|
#include "Setup.h"
|
||||||
#include "Thread.h"
|
#include "Thread.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
// -----------------------------------------
|
|
||||||
#ifdef SETUP_TIMER_WAITING
|
#ifdef SETUP_TIMER_WAITING
|
||||||
// -----------------
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "ConsoleWindow.h"
|
#include "ConsoleWindow.h"
|
||||||
EventCallBack FunctionPointer[10];
|
EventCallBack FunctionPointer[10];
|
||||||
#endif
|
#endif
|
||||||
// ------------------------
|
|
||||||
|
|
||||||
namespace Common
|
namespace Common
|
||||||
{
|
{
|
||||||
@ -68,7 +65,6 @@ void CriticalSection::Leave()
|
|||||||
LeaveCriticalSection(§ion);
|
LeaveCriticalSection(§ion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Thread::Thread(ThreadFunc function, void* arg)
|
Thread::Thread(ThreadFunc function, void* arg)
|
||||||
: m_hThread(NULL), m_threadId(0)
|
: m_hThread(NULL), m_threadId(0)
|
||||||
{
|
{
|
||||||
@ -106,10 +102,7 @@ void Thread::SetCurrentThreadAffinity(int mask)
|
|||||||
SetThreadAffinityMask(GetCurrentThread(), mask);
|
SetThreadAffinityMask(GetCurrentThread(), mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Regular same thread loop based waiting
|
// Regular same thread loop based waiting
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
|
||||||
Event::Event()
|
Event::Event()
|
||||||
{
|
{
|
||||||
m_hEvent = 0;
|
m_hEvent = 0;
|
||||||
@ -186,14 +179,9 @@ void Event::MsgWait()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/* Separate thread timer based waiting, instead of same thread loop waiting. The downside with this
|
/* Separate thread timer based waiting, instead of same thread loop waiting. The downside with this
|
||||||
is that it's less convenient to use because we can't stall any threads with a loop. The positive
|
is that it's less convenient to use because we can't stall any threads with a loop. The positive
|
||||||
is that we don't cause these incredibly annoying WaitForEternity() hangings. */
|
is that we don't cause these incredibly annoying WaitForEternity() hangings. */
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
|
||||||
#ifdef SETUP_TIMER_WAITING
|
#ifdef SETUP_TIMER_WAITING
|
||||||
/* I could not figure out how to place this in the class to, CreateTimerQueueTimer() would complain
|
/* I could not figure out how to place this in the class to, CreateTimerQueueTimer() would complain
|
||||||
about some kind of type casting, anyone have any ideas about how to do it? */
|
about some kind of type casting, anyone have any ideas about how to do it? */
|
||||||
@ -280,14 +268,8 @@ void Event::SetTimer()
|
|||||||
if (StartWait) DoneWaiting = true;
|
if (StartWait) DoneWaiting = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Supporting functions
|
// Supporting functions
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
|
||||||
|
|
||||||
void SleepCurrentThread(int ms)
|
void SleepCurrentThread(int ms)
|
||||||
{
|
{
|
||||||
Sleep(ms);
|
Sleep(ms);
|
||||||
@ -350,8 +332,6 @@ LONG SyncInterlockedExchange(LONG *Dest, LONG Val)
|
|||||||
{
|
{
|
||||||
return InterlockedExchange(Dest, Val);
|
return InterlockedExchange(Dest, Val);
|
||||||
}
|
}
|
||||||
////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
#else // !WIN32, so must be POSIX threads
|
#else // !WIN32, so must be POSIX threads
|
||||||
|
|
||||||
@ -572,4 +552,4 @@ LONG SyncInterlockedExchange(LONG *Dest, LONG Val)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // end of namespace Common
|
} // namespace Common
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,12 +15,9 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _THREAD_H
|
#ifndef _THREAD_H_
|
||||||
#define _THREAD_H
|
#define _THREAD_H_
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Includes
|
|
||||||
// ------------
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define THREAD_RETURN DWORD WINAPI
|
#define THREAD_RETURN DWORD WINAPI
|
||||||
@ -39,9 +36,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Definitions
|
|
||||||
// ------------
|
|
||||||
// This may not be defined outside _WIN32
|
// This may not be defined outside _WIN32
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#ifndef INFINITE
|
#ifndef INFINITE
|
||||||
@ -124,9 +118,7 @@ public:
|
|||||||
void MsgWait() {Wait();}
|
void MsgWait() {Wait();}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// -----------------------------------------
|
|
||||||
#ifdef SETUP_TIMER_WAITING
|
#ifdef SETUP_TIMER_WAITING
|
||||||
// -----------------
|
|
||||||
bool TimerWait(EventCallBack WaitCB, int Id = 0, bool OptCondition = true);
|
bool TimerWait(EventCallBack WaitCB, int Id = 0, bool OptCondition = true);
|
||||||
bool DoneWait();
|
bool DoneWait();
|
||||||
void SetTimer();
|
void SetTimer();
|
||||||
@ -136,7 +128,6 @@ public:
|
|||||||
HANDLE hTimer;
|
HANDLE hTimer;
|
||||||
HANDLE hTimerQueue;
|
HANDLE hTimerQueue;
|
||||||
#endif
|
#endif
|
||||||
// ---------------------------
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -163,6 +154,6 @@ LONG SyncInterlockedExchangeAdd(LONG *Dest, LONG Val);
|
|||||||
LONG SyncInterlockedExchange(LONG *Dest, LONG Val);
|
LONG SyncInterlockedExchange(LONG *Dest, LONG Val);
|
||||||
LONG SyncInterlockedIncrement(LONG *Dest);
|
LONG SyncInterlockedIncrement(LONG *Dest);
|
||||||
|
|
||||||
} // end of namespace Common
|
} // namespace Common
|
||||||
|
|
||||||
#endif
|
#endif // _STRINGUTIL_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _THUNK_H
|
#ifndef _THUNK_H_
|
||||||
#define _THUNK_H
|
#define _THUNK_H_
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
@ -52,4 +52,4 @@ public:
|
|||||||
|
|
||||||
extern ThunkManager thunks;
|
extern ThunkManager thunks;
|
||||||
|
|
||||||
#endif
|
#endif // _THUNK_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -39,9 +39,9 @@ u32 timeGetTime()
|
|||||||
namespace Common
|
namespace Common
|
||||||
{
|
{
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
// --------------------------------------------
|
||||||
// Initiate, Start, Stop, and Update the time
|
// Initiate, Start, Stop, and Update the time
|
||||||
// ---------------
|
// --------------------------------------------
|
||||||
|
|
||||||
// Set initial values for the class
|
// Set initial values for the class
|
||||||
Timer::Timer()
|
Timer::Timer()
|
||||||
@ -75,13 +75,12 @@ void Timer::Update()
|
|||||||
m_LastTime = timeGetTime();
|
m_LastTime = timeGetTime();
|
||||||
//TODO(ector) - QPF
|
//TODO(ector) - QPF
|
||||||
}
|
}
|
||||||
/////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
// -------------------------------------
|
||||||
// Get time difference and elapsed time
|
// Get time difference and elapsed time
|
||||||
// ---------------
|
// -------------------------------------
|
||||||
|
|
||||||
// Get the number of milliseconds since the last Update()
|
// Get the number of milliseconds since the last Update()
|
||||||
s64 Timer::GetTimeDifference()
|
s64 Timer::GetTimeDifference()
|
||||||
@ -138,13 +137,7 @@ std::string Timer::GetTimeElapsedFormatted() const
|
|||||||
return TmpStr;
|
return TmpStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Get current time
|
// Get current time
|
||||||
// ---------------
|
|
||||||
void Timer::IncreaseResolution()
|
void Timer::IncreaseResolution()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -212,4 +205,4 @@ std::string Timer::GetTimeFormatted()
|
|||||||
return std::string(formattedTime);
|
return std::string(formattedTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of namespace Common
|
} // Namespace Common
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,8 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _TIMER_H
|
#ifndef _TIMER_H_
|
||||||
#define _TIMER_H
|
#define _TIMER_H_
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -53,10 +53,10 @@ public:
|
|||||||
bool m_Running;
|
bool m_Running;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace Common
|
} // Namespace Common
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
u32 timeGetTime();
|
u32 timeGetTime();
|
||||||
#endif
|
#endif // GNUC
|
||||||
|
|
||||||
#endif
|
#endif // _TIMER_H_
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
// Copyright (C) 2003-2008 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/
|
|
||||||
|
|
||||||
#include "stdafx.h"
|
|
@ -1,35 +0,0 @@
|
|||||||
// Copyright (C) 2003-2008 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/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#ifndef _WIN32_WINNT
|
|
||||||
#define _WIN32_WINNT 0x501
|
|
||||||
#endif
|
|
||||||
#ifndef _WIN32_IE
|
|
||||||
#define _WIN32_IE 0x0500 // Default value is 0x0400
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
|
||||||
|
|
||||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
|
||||||
#define _CRT_NONSTDC_NO_DEPRECATE 1
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
#include <tchar.h>
|
|
||||||
#include <vector>
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "x64Analyzer.h"
|
#include "x64Analyzer.h"
|
||||||
|
|
||||||
bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int accessType)
|
bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int accessType)
|
||||||
@ -227,6 +228,3 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
|
|||||||
info.instructionSize = (int)(codePtr - startCodePtr);
|
info.instructionSize = (int)(codePtr - startCodePtr);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -14,8 +14,9 @@
|
|||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
#ifndef _X64ANALYZER_H
|
|
||||||
#define _X64ANALYZER_H
|
#ifndef _X64ANALYZER_H_
|
||||||
|
#define _X64ANALYZER_H_
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
@ -53,4 +54,4 @@ enum AccessType{
|
|||||||
|
|
||||||
bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int accessType);
|
bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int accessType);
|
||||||
|
|
||||||
#endif
|
#endif // _X64ANALYZER_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
// WARNING - THIS LIBRARY IS NOT THREAD SAFE!!!
|
// WARNING - THIS LIBRARY IS NOT THREAD SAFE!!!
|
||||||
|
|
||||||
#ifndef _DOLPHIN_INTEL_CODEGEN
|
#ifndef _DOLPHIN_INTEL_CODEGEN_
|
||||||
#define _DOLPHIN_INTEL_CODEGEN
|
#define _DOLPHIN_INTEL_CODEGEN_
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "MemoryUtil.h"
|
#include "MemoryUtil.h"
|
||||||
@ -721,4 +721,4 @@ public:
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif
|
#endif // _DOLPHIN_INTEL_CODEGEN_
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9,00"
|
Version="9.00"
|
||||||
Name="Core"
|
Name="Core"
|
||||||
ProjectGUID="{F0B874CB-4476-4199-9315-8343D05AE684}"
|
ProjectGUID="{F0B874CB-4476-4199-9315-8343D05AE684}"
|
||||||
RootNamespace="Core"
|
RootNamespace="Core"
|
||||||
@ -52,11 +52,12 @@
|
|||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
BufferSecurityCheck="true"
|
BufferSecurityCheck="true"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -122,11 +123,12 @@
|
|||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
BufferSecurityCheck="true"
|
BufferSecurityCheck="true"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -196,11 +198,12 @@
|
|||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableEnhancedInstructionSet="2"
|
EnableEnhancedInstructionSet="2"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -272,11 +275,12 @@
|
|||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableEnhancedInstructionSet="0"
|
EnableEnhancedInstructionSet="0"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -345,11 +349,12 @@
|
|||||||
BufferSecurityCheck="true"
|
BufferSecurityCheck="true"
|
||||||
EnableEnhancedInstructionSet="2"
|
EnableEnhancedInstructionSet="2"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -418,11 +423,12 @@
|
|||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -492,11 +498,12 @@
|
|||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableEnhancedInstructionSet="2"
|
EnableEnhancedInstructionSet="2"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -568,11 +575,12 @@
|
|||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableEnhancedInstructionSet="0"
|
EnableEnhancedInstructionSet="0"
|
||||||
FloatingPointModel="0"
|
FloatingPointModel="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderThrough=""
|
||||||
AssemblerListingLocation="$(IntDir)\"
|
AssemblerListingLocation="$(IntDir)\"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
ForcedIncludeFiles="stdafx.h"
|
ForcedIncludeFiles=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
@ -2292,78 +2300,6 @@
|
|||||||
RelativePath=".\Src\State.h"
|
RelativePath=".\Src\State.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\Src\stdafx.cpp"
|
|
||||||
>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="DebugFast|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="DebugFast|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release_JITIL|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release_JITIL|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
UsePrecompiledHeader="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\Src\stdafx.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\Src\Tracer.cpp"
|
RelativePath=".\Src\Tracer.cpp"
|
||||||
>
|
>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// Most of the code in this file is from:
|
// Most of the code in this file is from:
|
||||||
// GCNcrypt - Gamecube AR Crypto Program
|
// GCNcrypt - Gamecube AR Crypto Program
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -15,16 +15,21 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------
|
||||||
// Partial Action Replay code system implementation.
|
// Partial Action Replay code system implementation.
|
||||||
|
|
||||||
// Will never be able to support some AR codes - specifically those that patch the running
|
// Will never be able to support some AR codes - specifically those that patch the running
|
||||||
// Action Replay engine itself - yes they do exist!!!
|
// Action Replay engine itself - yes they do exist!!!
|
||||||
|
|
||||||
// Action Replay actually is a small virtual machine with a limited number of commands.
|
// Action Replay actually is a small virtual machine with a limited number of commands.
|
||||||
// It probably is Turing complete - but what does that matter when AR codes can write
|
// It probably is Turning complete - but what does that matter when AR codes can write
|
||||||
// actual PowerPC code...
|
// actual PowerPC code...
|
||||||
|
// -----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// THIS FILE IS GROSS!!!
|
// -------------------------------------------------------------------------------------------------------------
|
||||||
|
// Codes Types:
|
||||||
|
// (Unconditonal) Normal Codes (0): this one has subtypes inside
|
||||||
|
// (Conditional) Normal Codes (1 - 7): these just compare values and set the line skip info
|
||||||
|
// Zero Codes: any code with no address. These codes are used to do special operations like memory copy, etc
|
||||||
|
// -------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -40,6 +45,16 @@
|
|||||||
|
|
||||||
namespace ActionReplay
|
namespace ActionReplay
|
||||||
{
|
{
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
EQUAL = 0,
|
||||||
|
NOT_EQUAL,
|
||||||
|
LESS_THAN_SIGNED,
|
||||||
|
GREATER_THAN_SIGNED,
|
||||||
|
LESS_THAN_UNSIGNED,
|
||||||
|
GREATER_THAN_UNSIGNED,
|
||||||
|
LOGICAL_AND
|
||||||
|
};
|
||||||
|
|
||||||
static std::vector<AREntry>::const_iterator iter;
|
static std::vector<AREntry>::const_iterator iter;
|
||||||
static ARCode code;
|
static ARCode code;
|
||||||
@ -49,28 +64,20 @@ static std::vector<ARCode> activeCodes;
|
|||||||
static bool logSelf = false;
|
static bool logSelf = false;
|
||||||
static std::vector<std::string> arLog;
|
static std::vector<std::string> arLog;
|
||||||
|
|
||||||
|
|
||||||
void LogInfo(const char *format, ...);
|
void LogInfo(const char *format, ...);
|
||||||
// --- Codes ---
|
|
||||||
// SubTypes (Normal 0 Codes)
|
|
||||||
bool Subtype_RamWriteAndFill(u32 addr, u32 data);
|
bool Subtype_RamWriteAndFill(u32 addr, u32 data);
|
||||||
bool Subtype_WriteToPointer(u32 addr, u32 data);
|
bool Subtype_WriteToPointer(u32 addr, u32 data);
|
||||||
bool Subtype_AddCode(u32 addr, u32 data);
|
bool Subtype_AddCode(u32 addr, u32 data);
|
||||||
bool Subtype_MasterCodeAndWriteToCCXXXXXX();
|
bool Subtype_MasterCodeAndWriteToCCXXXXXX();
|
||||||
// Zero Codes
|
|
||||||
bool ZeroCode_FillAndSlide(u32 val_last, u32 addr, u32 data);
|
bool ZeroCode_FillAndSlide(u32 val_last, u32 addr, u32 data);
|
||||||
bool ZeroCode_MemoryCopy(u32 val_last, u32 addr, u32 data);
|
bool ZeroCode_MemoryCopy(u32 val_last, u32 addr, u32 data);
|
||||||
// Normal Codes
|
bool NormalCode(u8 subtype, u32 addr, u32 data);
|
||||||
bool NormalCode_Type_0(u8 subtype, u32 addr, u32 data);
|
bool ConditionalCode(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip, int compareType);
|
||||||
bool NormalCode_Type_1(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip);
|
|
||||||
bool NormalCode_Type_2(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip);
|
|
||||||
bool NormalCode_Type_3(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip);
|
|
||||||
bool NormalCode_Type_4(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip);
|
|
||||||
bool NormalCode_Type_5(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip);
|
|
||||||
bool NormalCode_Type_6(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip);
|
|
||||||
bool NormalCode_Type_7(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip);
|
|
||||||
bool SetLineSkip(int codetype, u8 subtype, bool *pSkip, bool skip, int *pCount);
|
bool SetLineSkip(int codetype, u8 subtype, bool *pSkip, bool skip, int *pCount);
|
||||||
|
bool CompareValues(u32 val1, u32 val2, int type);
|
||||||
|
|
||||||
|
// ----------------------
|
||||||
|
// AR Remote Functions
|
||||||
void LoadCodes(IniFile &ini, bool forceLoad)
|
void LoadCodes(IniFile &ini, bool forceLoad)
|
||||||
{
|
{
|
||||||
// Parses the Action Replay section of a game ini file.
|
// Parses the Action Replay section of a game ini file.
|
||||||
@ -174,6 +181,7 @@ void LoadCodes(std::vector<ARCode> &_arCodes, IniFile &ini)
|
|||||||
_arCodes = arCodes;
|
_arCodes = arCodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LogInfo(const char *format, ...)
|
void LogInfo(const char *format, ...)
|
||||||
{
|
{
|
||||||
if (!b_RanOnce)
|
if (!b_RanOnce)
|
||||||
@ -197,6 +205,7 @@ void LogInfo(const char *format, ...)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RunAllActive()
|
void RunAllActive()
|
||||||
{
|
{
|
||||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats) {
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats) {
|
||||||
@ -241,9 +250,7 @@ bool RunCode(const ARCode &arcode) {
|
|||||||
if (count == -1 || count < -2 || count > (int)code.ops.size())
|
if (count == -1 || count < -2 || count > (int)code.ops.size())
|
||||||
{
|
{
|
||||||
LogInfo("Bad Count: %i", count);
|
LogInfo("Bad Count: %i", count);
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
PanicAlert("Action Replay: Bad Count: %i (%s)", count, code.name.c_str());
|
||||||
PanicAlert("Action Replay: Bad Count: %i (%s)", count, code.name.c_str());
|
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,42 +353,42 @@ bool RunCode(const ARCode &arcode) {
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case 0x0:
|
case 0x0:
|
||||||
if (!NormalCode_Type_0(subtype, addr, data))
|
if (!NormalCode(subtype, addr, data))
|
||||||
return false;
|
return false;
|
||||||
continue;
|
continue;
|
||||||
case 0x1:
|
case 0x1:
|
||||||
LogInfo("Type 1: If Equal");
|
LogInfo("Type 1: If Equal");
|
||||||
if (!NormalCode_Type_1(subtype, addr, data, &count, &skip))
|
if (!ConditionalCode(subtype, addr, data, &count, &skip, EQUAL))
|
||||||
return false;
|
return false;
|
||||||
continue;
|
continue;
|
||||||
case 0x2:
|
case 0x2:
|
||||||
LogInfo("Type 2: If Not Equal");
|
LogInfo("Type 2: If Not Equal");
|
||||||
if (!NormalCode_Type_2(subtype, addr, data, &count, &skip))
|
if (!ConditionalCode(subtype, addr, data, &count, &skip, NOT_EQUAL))
|
||||||
return false;
|
return false;
|
||||||
continue;
|
continue;
|
||||||
case 0x3:
|
case 0x3:
|
||||||
LogInfo("Type 3: If Less Than (Signed)");
|
LogInfo("Type 3: If Less Than (Signed)");
|
||||||
if (!NormalCode_Type_3(subtype, addr, data, &count, &skip))
|
if (!ConditionalCode(subtype, addr, data, &count, &skip, LESS_THAN_SIGNED))
|
||||||
return false;
|
return false;
|
||||||
continue;
|
continue;
|
||||||
case 0x4:
|
case 0x4:
|
||||||
LogInfo("Type 4: If Greater Than (Signed)");
|
LogInfo("Type 4: If Greater Than (Signed)");
|
||||||
if (!NormalCode_Type_4(subtype, addr, data, &count, &skip))
|
if (!ConditionalCode(subtype, addr, data, &count, &skip, GREATER_THAN_SIGNED))
|
||||||
return false;
|
return false;
|
||||||
continue;
|
continue;
|
||||||
case 0x5:
|
case 0x5:
|
||||||
LogInfo("Type 5: If Less Than (Unsigned)");
|
LogInfo("Type 5: If Less Than (Unsigned)");
|
||||||
if (!NormalCode_Type_5(subtype, addr, data, &count, &skip))
|
if (!ConditionalCode(subtype, addr, data, &count, &skip, LESS_THAN_UNSIGNED))
|
||||||
return false;
|
return false;
|
||||||
continue;
|
continue;
|
||||||
case 0x6:
|
case 0x6:
|
||||||
LogInfo("Type 6: If Greater Than (Unsigned)");
|
LogInfo("Type 6: If Greater Than (Unsigned)");
|
||||||
if (!NormalCode_Type_6(subtype, addr, data, &count, &skip))
|
if (!ConditionalCode(subtype, addr, data, &count, &skip, GREATER_THAN_UNSIGNED))
|
||||||
return false;
|
return false;
|
||||||
continue;
|
continue;
|
||||||
case 0x7:
|
case 0x7:
|
||||||
LogInfo("Type 7: If AND");
|
LogInfo("Type 7: If AND");
|
||||||
if (!NormalCode_Type_7(subtype, addr, data, &count, &skip))
|
if (!ConditionalCode(subtype, addr, data, &count, &skip, LOGICAL_AND))
|
||||||
return false;
|
return false;
|
||||||
continue;
|
continue;
|
||||||
default:
|
default:
|
||||||
@ -395,8 +402,60 @@ bool RunCode(const ARCode &arcode) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
size_t GetCodeListSize()
|
||||||
|
{
|
||||||
|
return arCodes.size();
|
||||||
|
}
|
||||||
|
|
||||||
// Subtypes
|
ARCode GetARCode(size_t index)
|
||||||
|
{
|
||||||
|
if (index > arCodes.size())
|
||||||
|
{
|
||||||
|
PanicAlert("GetARCode: Index is greater than ar code list size %i", index);
|
||||||
|
return ARCode();
|
||||||
|
}
|
||||||
|
return arCodes[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetARCode_IsActive(bool active, size_t index)
|
||||||
|
{
|
||||||
|
if (index > arCodes.size())
|
||||||
|
{
|
||||||
|
PanicAlert("SetARCode_IsActive: Index is greater than ar code list size %i", index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
arCodes[index].active = active;
|
||||||
|
UpdateActiveList();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateActiveList()
|
||||||
|
{
|
||||||
|
b_RanOnce = false;
|
||||||
|
activeCodes.clear();
|
||||||
|
for (size_t i = 0; i < arCodes.size(); i++)
|
||||||
|
{
|
||||||
|
if (arCodes[i].active)
|
||||||
|
activeCodes.push_back(arCodes[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void EnableSelfLogging(bool enable)
|
||||||
|
{
|
||||||
|
logSelf = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::vector<std::string> &GetSelfLog()
|
||||||
|
{
|
||||||
|
return arLog;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsSelfLogging()
|
||||||
|
{
|
||||||
|
return logSelf;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------
|
||||||
|
// Code Functions
|
||||||
bool Subtype_RamWriteAndFill(u32 addr, u32 data)
|
bool Subtype_RamWriteAndFill(u32 addr, u32 data)
|
||||||
{
|
{
|
||||||
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000); // real GC address
|
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000); // real GC address
|
||||||
@ -557,7 +616,6 @@ bool Subtype_MasterCodeAndWriteToCCXXXXXX()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zero Codes
|
|
||||||
bool ZeroCode_FillAndSlide(u32 val_last, u32 addr, u32 data) // This needs more testing
|
bool ZeroCode_FillAndSlide(u32 val_last, u32 addr, u32 data) // This needs more testing
|
||||||
{
|
{
|
||||||
u32 new_addr = (val_last & 0x81FFFFFF);
|
u32 new_addr = (val_last & 0x81FFFFFF);
|
||||||
@ -693,8 +751,7 @@ bool ZeroCode_MemoryCopy(u32 val_last, u32 addr, u32 data) // Has not been teste
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normal Codes
|
bool NormalCode(u8 subtype, u32 addr, u32 data)
|
||||||
bool NormalCode_Type_0(u8 subtype, u32 addr, u32 data)
|
|
||||||
{
|
{
|
||||||
switch (subtype)
|
switch (subtype)
|
||||||
{
|
{
|
||||||
@ -725,8 +782,7 @@ bool NormalCode_Type_0(u8 subtype, u32 addr, u32 data)
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Conditional Codes
|
bool ConditionalCode(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip, int compareType)
|
||||||
bool NormalCode_Type_1(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip)
|
|
||||||
{
|
{
|
||||||
u8 size = (addr >> 25) & 0x03;
|
u8 size = (addr >> 25) & 0x03;
|
||||||
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000);
|
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000);
|
||||||
@ -735,203 +791,20 @@ bool NormalCode_Type_1(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip)
|
|||||||
bool con = true;
|
bool con = true;
|
||||||
switch (size)
|
switch (size)
|
||||||
{
|
{
|
||||||
case 0x0: con = (Memory::Read_U8(new_addr) == (u8)(data & 0xFF)); break;
|
case 0x0: con = CompareValues((u32)Memory::Read_U8(new_addr), (data & 0xFF), compareType); break;
|
||||||
case 0x1: con = (Memory::Read_U16(new_addr) == (u16)(data & 0xFFFF)); break;
|
case 0x1: con = CompareValues((u32)Memory::Read_U16(new_addr), (data & 0xFFFF), compareType); break;
|
||||||
case 0x3:
|
case 0x3:
|
||||||
case 0x2: con = (Memory::Read_U32(new_addr) == data); break;
|
case 0x2: con = CompareValues(Memory::Read_U32(new_addr), data, compareType); break;
|
||||||
default:
|
default:
|
||||||
LogInfo("Bad Size");
|
LogInfo("Bad Size");
|
||||||
PanicAlert("Action Replay: Normal Code 1: Invalid Size %08x (%s)", size, code.name.c_str());
|
PanicAlert("Action Replay: Conditional Code: Invalid Size %08x (%s)", size, code.name.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SetLineSkip(1, subtype, pSkip, con, pCount);
|
return SetLineSkip(1, subtype, pSkip, con, pCount);
|
||||||
}
|
}
|
||||||
|
// ----------------------
|
||||||
bool NormalCode_Type_2(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip)
|
// Internal Functions
|
||||||
{
|
|
||||||
u8 size = (addr >> 25) & 0x03;
|
|
||||||
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000);
|
|
||||||
LogInfo("Size: %08x", size);
|
|
||||||
LogInfo("Hardware Address: %08x", new_addr);
|
|
||||||
bool con = true;
|
|
||||||
switch (size)
|
|
||||||
{
|
|
||||||
case 0x0: con = (Memory::Read_U8(new_addr) != (u8)(data & 0xFF)); break;
|
|
||||||
case 0x1: con = (Memory::Read_U16(new_addr) != (u16)(data & 0xFFFF)); break;
|
|
||||||
case 0x3:
|
|
||||||
case 0x2: con = (Memory::Read_U32(new_addr) != data); break;
|
|
||||||
default:
|
|
||||||
LogInfo("Bad Size");
|
|
||||||
PanicAlert("Action Replay: Normal Code 2: Invalid Size %08x (%s)", size, code.name.c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SetLineSkip(2, subtype, pSkip, con, pCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NormalCode_Type_3(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip)
|
|
||||||
{
|
|
||||||
u8 size = (addr >> 25) & 0x03;
|
|
||||||
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000);
|
|
||||||
LogInfo("Size: %08x", size);
|
|
||||||
LogInfo("Hardware Address: %08x", new_addr);
|
|
||||||
bool con = true;
|
|
||||||
switch (size)
|
|
||||||
{
|
|
||||||
case 0x0: con = ((char)Memory::Read_U8(new_addr) < (char)(data & 0xFF)); break;
|
|
||||||
case 0x1: con = ((short)Memory::Read_U16(new_addr) < (short)(data & 0xFFFF)); break;
|
|
||||||
case 0x3:
|
|
||||||
case 0x2: con = ((int)Memory::Read_U32(new_addr) < (int)data); break;
|
|
||||||
default:
|
|
||||||
LogInfo("Bad Size");
|
|
||||||
PanicAlert("Action Replay: Normal Code 3: Invalid Size %08x (%s)", size, code.name.c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SetLineSkip(3, subtype, pSkip, con, pCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NormalCode_Type_4(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip)
|
|
||||||
{
|
|
||||||
u8 size = (addr >> 25) & 0x03;
|
|
||||||
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000);
|
|
||||||
LogInfo("Size: %08x", size);
|
|
||||||
LogInfo("Hardware Address: %08x", new_addr);
|
|
||||||
bool con = true;
|
|
||||||
switch (size)
|
|
||||||
{
|
|
||||||
case 0x0: con = ((char)Memory::Read_U8(new_addr) > (char)(data & 0xFF)); break;
|
|
||||||
case 0x1: con = ((short)Memory::Read_U16(new_addr) > (short)(data & 0xFFFF)); break;
|
|
||||||
case 0x3:
|
|
||||||
case 0x2: con = ((int)Memory::Read_U32(new_addr) > (int)data); break;
|
|
||||||
default:
|
|
||||||
LogInfo("Bad Size");
|
|
||||||
PanicAlert("Action Replay: Normal Code 4: Invalid Size %08x (%s)", size, code.name.c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SetLineSkip(4, subtype, pSkip, con, pCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NormalCode_Type_5(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip)
|
|
||||||
{
|
|
||||||
u8 size = (addr >> 25) & 0x03;
|
|
||||||
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000);
|
|
||||||
LogInfo("Size: %08x", size);
|
|
||||||
LogInfo("Hardware Address: %08x", new_addr);
|
|
||||||
bool con = true;
|
|
||||||
switch (size)
|
|
||||||
{
|
|
||||||
case 0x0: con = (Memory::Read_U8(new_addr) < (data & 0xFF)); break;
|
|
||||||
case 0x1: con = (Memory::Read_U16(new_addr) < (data & 0xFFFF)); break;
|
|
||||||
case 0x3:
|
|
||||||
case 0x2: con = (Memory::Read_U32(new_addr) < data); break;
|
|
||||||
default:
|
|
||||||
LogInfo("Bad Size");
|
|
||||||
PanicAlert("Action Replay: Normal Code 5: Invalid Size %08x (%s)", size, code.name.c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SetLineSkip(5, subtype, pSkip, con, pCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NormalCode_Type_6(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip)
|
|
||||||
{
|
|
||||||
u8 size = (addr >> 25) & 0x03;
|
|
||||||
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000);
|
|
||||||
LogInfo("Size: %08x", size);
|
|
||||||
LogInfo("Hardware Address: %08x", new_addr);
|
|
||||||
bool con = true;
|
|
||||||
switch (size)
|
|
||||||
{
|
|
||||||
case 0x0: con = (Memory::Read_U8(new_addr) > (data & 0xFF)); break;
|
|
||||||
case 0x1: con = (Memory::Read_U16(new_addr) > (data & 0xFFFF)); break;
|
|
||||||
case 0x3:
|
|
||||||
case 0x2: con = (Memory::Read_U32(new_addr) > data); break;
|
|
||||||
default:
|
|
||||||
LogInfo("Bad Size");
|
|
||||||
PanicAlert("Action Replay: Normal Code 6: Invalid Size %08x (%s)", size, code.name.c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SetLineSkip(6, subtype, pSkip, con, pCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NormalCode_Type_7(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip)
|
|
||||||
{
|
|
||||||
u8 size = (addr >> 25) & 0x03;
|
|
||||||
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000);
|
|
||||||
LogInfo("Size: %08x", size);
|
|
||||||
LogInfo("Hardware Address: %08x", new_addr);
|
|
||||||
bool con = true;
|
|
||||||
switch (size)
|
|
||||||
{
|
|
||||||
case 0x0: con = ((Memory::Read_U8(new_addr) & (data & 0xFF)) != 0); break;
|
|
||||||
case 0x1: con = ((Memory::Read_U16(new_addr) & (data & 0xFFFF)) != 0); break;
|
|
||||||
case 0x3:
|
|
||||||
case 0x2: con = ((Memory::Read_U32(new_addr) & data) != 0); break;
|
|
||||||
default:
|
|
||||||
LogInfo("Bad Size");
|
|
||||||
PanicAlert("Action Replay: Normal Code 7: Invalid Size %08x (%s)", size, code.name.c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SetLineSkip(7, subtype, pSkip, con, pCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t GetCodeListSize()
|
|
||||||
{
|
|
||||||
return arCodes.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
ARCode GetARCode(size_t index)
|
|
||||||
{
|
|
||||||
if (index > arCodes.size())
|
|
||||||
{
|
|
||||||
PanicAlert("GetARCode: Index is greater than ar code list size %i", index);
|
|
||||||
return ARCode();
|
|
||||||
}
|
|
||||||
return arCodes[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetARCode_IsActive(bool active, size_t index)
|
|
||||||
{
|
|
||||||
if (index > arCodes.size())
|
|
||||||
{
|
|
||||||
PanicAlert("SetARCode_IsActive: Index is greater than ar code list size %i", index);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
arCodes[index].active = active;
|
|
||||||
UpdateActiveList();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateActiveList()
|
|
||||||
{
|
|
||||||
b_RanOnce = false;
|
|
||||||
activeCodes.clear();
|
|
||||||
for (size_t i = 0; i < arCodes.size(); i++)
|
|
||||||
{
|
|
||||||
if (arCodes[i].active)
|
|
||||||
activeCodes.push_back(arCodes[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnableSelfLogging(bool enable)
|
|
||||||
{
|
|
||||||
logSelf = enable;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::vector<std::string> &GetSelfLog()
|
|
||||||
{
|
|
||||||
return arLog;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsSelfLogging()
|
|
||||||
{
|
|
||||||
return logSelf;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SetLineSkip(int codetype, u8 subtype, bool *pSkip, bool skip, int *pCount)
|
bool SetLineSkip(int codetype, u8 subtype, bool *pSkip, bool skip, int *pCount)
|
||||||
{
|
{
|
||||||
*pSkip = !skip; // set skip
|
*pSkip = !skip; // set skip
|
||||||
@ -951,4 +824,18 @@ bool SetLineSkip(int codetype, u8 subtype, bool *pSkip, bool skip, int *pCount)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
bool CompareValues(u32 val1, u32 val2, int type)
|
||||||
|
{
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case 0: return (val1 == val2);
|
||||||
|
case 1: return (val1 != val2);
|
||||||
|
case 2: return ((int)val1 < (int)val2);
|
||||||
|
case 3: return ((int)val1 > (int)val2);
|
||||||
|
case 4: return (val1 < val2);
|
||||||
|
case 5: return (val1 > val2);
|
||||||
|
case 6: return (val1 && val2);
|
||||||
|
default: LogInfo("Unknown Compare type"); return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
} // namespace ActionReplay
|
} // namespace ActionReplay
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
@ -49,4 +49,4 @@ const std::vector<std::string> &GetSelfLog();
|
|||||||
bool IsSelfLogging();
|
bool IsSelfLogging();
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif //_ACTIONREPLAY_H_
|
#endif // _ACTIONREPLAY_H_
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
// Copyright (C) 2003-2009 Dolphin Project.
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user