Some code cleanup

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2768 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
omegadox 2009-03-28 08:57:34 +00:00
parent bdabcd4bf5
commit eb0cab140f
258 changed files with 936 additions and 1275 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="Bochs_disasm"
ProjectGUID="{29C2ABC1-ADA5-42CD-A5FC-96022D52A510}"
RootNamespace="Bochs_disasm"
@ -44,15 +44,16 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="4"
ForcedIncludeFiles="stdafx.h"
ForcedUsingFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -108,15 +109,16 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedUsingFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -172,13 +174,14 @@
<Tool
Name="VCCLCompilerTool"
WholeProgramOptimization="false"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedUsingFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -237,13 +240,14 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
WholeProgramOptimization="false"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
ForcedUsingFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -299,13 +303,14 @@
<Tool
Name="VCCLCompilerTool"
WholeProgramOptimization="false"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedUsingFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -364,13 +369,14 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
WholeProgramOptimization="false"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE=1;WIN32_LEAN_AND_MEAN"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedUsingFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -444,62 +450,6 @@
RelativePath=".\resolve.cpp"
>
</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
RelativePath=".\syntax.cpp"
>

View File

@ -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

View File

@ -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

View File

@ -15,8 +15,8 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __AOSOUNDSTREAM_H__
#define __AOSOUNDSTREAM_H__
#ifndef _AOSOUNDSTREAM_H_
#define _AOSOUNDSTREAM_H_
#include "SoundStream.h"
@ -69,4 +69,4 @@ public:
#endif
};
#endif //__AOSOUNDSTREAM_H__
#endif //_AOSOUNDSTREAM_H_

View File

@ -1,87 +1,104 @@
#include "AudioCommon.h"
#include "Mixer.h"
#include "AOSoundStream.h"
#include "DSoundStream.h"
#include "NullSoundStream.h"
#include "OpenALStream.h"
namespace AudioCommon {
SoundStream *InitSoundStream(std::string backend, CMixer *mixer) {
if (!mixer) {
mixer = new CMixer();
}
if (backend == "DSound") {
if (DSound::isValid())
soundStream = new DSound(mixer, g_dspInitialize.hWnd);
}
else if (backend == "AOSound") {
if (AOSound::isValid())
soundStream = new AOSound(mixer);
}
else if (backend == "OpenAL") {
if (OpenALStream::isValid())
soundStream = new OpenALStream(mixer);
}
else if (backend == "NullSound") {
soundStream = new NullSound(mixer);
}
else {
PanicAlert("Cannot recognize backend %s", backend.c_str());
return NULL;
}
if (soundStream) {
if (!soundStream->Start()) {
PanicAlert("Could not initialize backend %s, falling back to NULL",
backend.c_str());
delete soundStream;
soundStream = new NullSound(mixer);
soundStream->Start();
}
}
else {
PanicAlert("Sound backend %s is not valid, falling back to NULL",
backend.c_str());
delete soundStream;
soundStream = new NullSound(mixer);
soundStream->Start();
}
return soundStream;
}
void ShutdownSoundStream() {
NOTICE_LOG(DSPHLE, "Shutting down sound stream");
if (soundStream) {
soundStream->Stop();
soundStream->StopLogAudio();
delete soundStream;
soundStream = NULL;
}
// Check that soundstream already is stopped.
while (soundStream) {
ERROR_LOG(DSPHLE, "Waiting for sound stream");
Common::SleepCurrentThread(2000);
}
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
// 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 "AudioCommon.h"
#include "Mixer.h"
#include "AOSoundStream.h"
#include "DSoundStream.h"
#include "NullSoundStream.h"
#include "OpenALStream.h"
namespace AudioCommon
{
SoundStream *InitSoundStream(std::string backend, CMixer *mixer) {
if (!mixer) {
mixer = new CMixer();
}
if (backend == "DSound") {
if (DSound::isValid())
soundStream = new DSound(mixer, g_dspInitialize.hWnd);
}
else if (backend == "AOSound") {
if (AOSound::isValid())
soundStream = new AOSound(mixer);
}
else if (backend == "OpenAL") {
if (OpenALStream::isValid())
soundStream = new OpenALStream(mixer);
}
else if (backend == "NullSound") {
soundStream = new NullSound(mixer);
}
else {
PanicAlert("Cannot recognize backend %s", backend.c_str());
return NULL;
}
if (soundStream) {
if (!soundStream->Start()) {
PanicAlert("Could not initialize backend %s, falling back to NULL",
backend.c_str());
delete soundStream;
soundStream = new NullSound(mixer);
soundStream->Start();
}
}
else {
PanicAlert("Sound backend %s is not valid, falling back to NULL",
backend.c_str());
delete soundStream;
soundStream = new NullSound(mixer);
soundStream->Start();
}
return soundStream;
}
void ShutdownSoundStream() {
NOTICE_LOG(DSPHLE, "Shutting down sound stream");
if (soundStream) {
soundStream->Stop();
soundStream->StopLogAudio();
delete soundStream;
soundStream = NULL;
}
// Check that soundstream already is stopped.
while (soundStream) {
ERROR_LOG(DSPHLE, "Waiting for sound stream");
Common::SleepCurrentThread(2000);
}
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

View File

@ -1,5 +1,22 @@
#ifndef _AUDIO_COMMON_H
#define _AUDIO_COMMON_H
// 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/
#ifndef _AUDIO_COMMON_H_
#define _AUDIO_COMMON_H_
#include "Common.h"
#include "../../../PluginSpecs/pluginspecs_dsp.h"
@ -17,4 +34,4 @@ namespace AudioCommon {
std::vector<std::string> GetSoundBackends();
} // Namespace
#endif // AUDIO_COMMON
#endif // _AUDIO_COMMON_H_

View File

@ -15,26 +15,22 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __DSOUNDSTREAM_H__
#define __DSOUNDSTREAM_H__
#include "SoundStream.h"
#ifndef _DSOUNDSTREAM_H_
#define _DSOUNDSTREAM_H_
#include "SoundStream.h"
#include "Thread.h"
#ifdef _WIN32
#include "stdafx.h"
#include <mmsystem.h>
#include <dsound.h>
#define BUFSIZE 32768
#define MAXWAIT 70 //ms
#define MAXWAIT 70 // miliseconds
#endif
class DSound : public SoundStream
{
#ifdef _WIN32
Common::Thread *thread;
Common::CriticalSection soundCriticalSection;
Common::Event soundSyncEvent;
@ -77,12 +73,6 @@ public:
static bool isValid() { return true; }
virtual bool usesMixer() const { return true; }
virtual void Update();
#else
public:
DSound(CMixer *mixer, void *hWnd = NULL) :
SoundStream(mixer) {}
#endif
};
#endif //__DSOUNDSTREAM_H__
#endif //_DSOUNDSTREAM_H_

View 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
// 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();
}

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _MIXER_H
#define _MIXER_H
#ifndef _MIXER_H_
#define _MIXER_H_
#include "FixedSizeQueue.h"
@ -42,10 +42,10 @@ public:
void SetThrottle(bool use) { m_throttle = use;}
// FIXME do we need this
// TODO: do we need this
bool IsHLEReady() { return m_HLEready;}
void SetHLEReady(bool ready) { m_HLEready = ready;}
//////
// ---------------------
protected:
int m_sampleRate;
@ -63,5 +63,4 @@ private:
};
#endif
#endif // _MIXER_H_

View File

@ -15,8 +15,8 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __NULLSOUNDSTREAM_H__
#define __NULLSOUNDSTREAM_H__
#ifndef _NULLSOUNDSTREAM_H_
#define _NULLSOUNDSTREAM_H_
#include "SoundStream.h"
@ -39,4 +39,4 @@ public:
}
};
#endif //__NULLSOUNDSTREAM_H__
#endif //_NULLSOUNDSTREAM_H_

View File

@ -44,4 +44,4 @@ void OpenALStream::Update()
void OpenALStream::SoundThread()
{
}
}

View File

@ -15,8 +15,9 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __OPENALSTREAM_H__
#define __OPENALSTREAM_H__
#ifndef _OPENALSTREAM_H_
#define _OPENALSTREAM_H_
#include "SoundStream.h"
#include "Thread.h"
@ -49,4 +50,4 @@ private:
Common::Event soundSyncEvent;
};
#endif
#endif

View File

@ -15,8 +15,8 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __SOUNDSTREAM_H__
#define __SOUNDSTREAM_H__
#ifndef _SOUNDSTREAM_H_
#define _SOUNDSTREAM_H_
#include "Common.h"
#include "Mixer.h"
@ -65,4 +65,4 @@ public:
}
};
#endif
#endif // _SOUNDSTREAM_H_

View 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
// 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;
}
// ---------------------------------------------------------
// -----------------
// Write file header
// ---------------
// -----------------
Write4("RIFF");
Write(100 * 1000 * 1000); // write big value in case the file gets truncated
Write4("WAVE");
Write4("fmt ");
Write(16); // size of fmt block
Write(0x00020001); //two channels, uncompressed
//const u32 sample_rate = 32000;
const u32 sample_rate = 48000;
Write(sample_rate);
Write(sample_rate * 2 * 2); //two channels, 16bit
Write(0x00100004);
Write4("data");
Write(100 * 1000 * 1000 - 32);
// We are now at offset 44
if (ftell(file) != 44)
PanicAlert("wrong offset: %i", ftell(file));
// ---------------------------
return true;
}
@ -79,11 +82,14 @@ void WaveFileWriter::Stop()
{
if (!file)
return;
// u32 file_size = (u32)ftell(file);
// u32 file_size = (u32)ftell(file);
fseek(file, 4, SEEK_SET);
Write(audio_size + 36);
fseek(file, 40, SEEK_SET);
Write(audio_size);
fclose(file);
file = 0;
}
@ -116,9 +122,12 @@ void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, int count)
{
if (!file)
PanicAlert("WaveFileWriter - file not open.");
if (count > BUF_SIZE * 2)
PanicAlert("WaveFileWriter - buffer too small (count = %i).", count);
if (skip_silence) {
if (skip_silence)
{
bool all_zero = true;
for (int i = 0; i < count * 2; i++)
if (sample_data[i])
@ -126,9 +135,10 @@ void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, int count)
if (all_zero)
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]);
}
fwrite(conv_buffer, count * 4, 1, file);
audio_size += count * 4;
}

View File

@ -15,17 +15,18 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
// WaveFileWriter
// Simple utility class to make it easy to write long 16-bit stereo
// ---------------------------------------------------------------------------------
// Class: WaveFileWriter
// Description: Simple utility class to make it easy to write long 16-bit stereo
// audio streams to disk.
// 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.
// Alternatively, AddSamplesBE for big endian wave data.
// If Stop is not called when it destructs, the destructor will call Stop().
// ---------------------------------------------------------------------------------
#ifndef _WAVEFILE_H
#define _WAVEFILE_H
#ifndef _WAVEFILE_H_
#define _WAVEFILE_H_
#include <stdio.h>
@ -52,4 +53,4 @@ public:
u32 GetAudioSize() { return audio_size; }
};
#endif // _WAVEFILE_H
#endif // _WAVEFILE_H_

View File

@ -51,12 +51,12 @@
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -124,12 +124,12 @@
RuntimeLibrary="1"
BufferSecurityCheck="false"
FloatingPointModel="0"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -191,18 +191,18 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
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"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2"
FloatingPointModel="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -265,18 +265,18 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
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"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="0"
FloatingPointModel="0"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -337,16 +337,16 @@
Optimization="3"
FavorSizeOrSpeed="1"
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"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -408,15 +408,15 @@
Optimization="3"
FavorSizeOrSpeed="1"
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"
FloatingPointModel="0"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -720,62 +720,6 @@
RelativePath=".\Src\Setup.h"
>
</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
RelativePath=".\Src\StringUtil.cpp"
>

View 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
// it under the terms of the GNU General Public License as published by

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _JIT_ABI_H
#define _JIT_ABI_H
#ifndef _JIT_ABI_H_
#define _JIT_ABI_H_
#include "Common.h"
@ -74,10 +74,10 @@
#define ABI_PARAM5 R8
#define ABI_PARAM6 R9
#endif
#endif // WIN32
#endif
#endif // X86
#endif // _JIT_ABI_H
#endif // _JIT_ABI_H_

View File

@ -1,12 +1,9 @@
/* Most of the code in this file was shamelessly ripped from libcdio
With minor adjustments */
// Most of the code in this file was shamelessly ripped from libcdio With minor adjustments
#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) {
#ifndef _WIN32
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.
Use cdio_free_device_list() to free this device_list.
*/
// Add/allocate a drive to the end of drives.
// Use cdio_free_device_list() to free this device_list.
void cdio_add_device_list(char **device_list[], const char *drive,
unsigned int *num_drives) {
if (NULL != drive) {
@ -53,7 +49,7 @@ void cdio_add_device_list(char **device_list[], const char *drive,
/* Drive not in list. Add it. */
(*num_drives)++;
*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 {
@ -67,10 +63,8 @@ void cdio_add_device_list(char **device_list[], const char *drive,
}
}
/*!
Free device list returned by cdio_get_devices or
cdio_get_devices_with_cap.
*/
// Free device list returned by cdio_get_devices or
// cdio_get_devices_with_cap.
void cdio_free_device_list(char * ppsz_device_list[]) {
char **ppsz_device_list_save=ppsz_device_list;
if (!ppsz_device_list) return;
@ -83,10 +77,8 @@ void cdio_free_device_list(char * ppsz_device_list[]) {
#ifdef _WIN32
/*
Returns a string that can be used in a CreateFile call if
c_drive letter is a character. If not NULL is returned.
*/
// Returns a string that can be used in a CreateFile call if
// c_drive letter is a character. If not NULL is returned.
const char *is_cdrom_win32(const char c_drive_letter) {
UINT uDriveType;
@ -103,7 +95,7 @@ const char *is_cdrom_win32(const char c_drive_letter) {
case DRIVE_CDROM: {
char sz_win32_drive_full[] = "\\\\.\\X:";
sz_win32_drive_full[4] = c_drive_letter;
return strdup(&sz_win32_drive_full[4]);
return __strdup(&sz_win32_drive_full[4]);
}
default:
//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 **drives = NULL;
unsigned int num_drives=0;
char drive_letter;
/* Scan the system for CD-ROM drives.
Not always 100% reliable, so use the USE_MNTENT code above first.
*/
// Scan the system for CD-ROM drives.
// Not always 100% reliable, so use the USE_MNTENT code above first.
for (drive_letter='A'; drive_letter <= 'Z'; drive_letter++) {
const char *drive_str=is_cdrom_win32(drive_letter);
if (drive_str != NULL) {
@ -305,7 +294,7 @@ static char *check_mounts_linux(const char *mtab)
tmp = strstr(mntent->mnt_opts, "fs=");
if ( tmp ) {
free(mnt_type);
mnt_type = strdup(tmp + strlen("fs="));
mnt_type = __strdup(tmp + strlen("fs="));
if ( mnt_type ) {
tmp = strchr(mnt_type, ',');
if ( tmp ) {
@ -316,7 +305,7 @@ static char *check_mounts_linux(const char *mtab)
tmp = strstr(mntent->mnt_opts, "dev=");
if ( tmp ) {
free(mnt_dev);
mnt_dev = strdup(tmp + strlen("dev="));
mnt_dev = __strdup(tmp + strlen("dev="));
if ( mnt_dev ) {
tmp = strchr(mnt_dev, ',');
if ( tmp ) {
@ -340,9 +329,7 @@ static char *check_mounts_linux(const char *mtab)
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 () {
unsigned int i;
@ -351,8 +338,7 @@ char **cdio_get_devices_linux () {
char **drives = NULL;
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 ) {
sprintf(drive, "/dev/%s", checklist1[i]);
if ( is_cdrom_linux(drive, NULL) > 0 ) {
@ -372,9 +358,8 @@ char **cdio_get_devices_linux () {
free(ret_drive);
}
/* Scan the system for CD-ROM drives.
Not always 100% reliable, so use the USE_MNTENT code above first.
*/
// Scan the system for CD-ROM drives.
// Not always 100% reliable, so use the USE_MNTENT code above first.
for ( i=0; checklist2[i].format; ++i ) {
unsigned int j;
for ( j=checklist2[i].num_min; j<=checklist2[i].num_max; ++j ) {
@ -389,9 +374,7 @@ char **cdio_get_devices_linux () {
}
#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() {
#ifdef _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?
/*
Returns true if device is cdrom/dvd
*/
// Returns true if device is cdrom/dvd
bool cdio_is_cdrom(const char *device) {
char **devices = cdio_get_devices();
bool res = false;
@ -421,7 +404,9 @@ bool cdio_is_cdrom(const char *device) {
cdio_free_device_list(devices);
return res;
}
// Can we remove this?
/*
int main() {
char** res = cdio_get_devices();

View File

@ -1,15 +1,16 @@
#ifndef CDUTILS_H
#define CDUTILS_H
#ifndef _CDUTILS_H_
#define _CDUTILS_H_
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include "windows.h"
#include <windows.h>
#define PATH_MAX MAX_PATH
#elif __APPLE__
#include <paths.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <Carbon/Carbon.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/storage/IOCDMedia.h>
@ -17,16 +18,10 @@
#include <IOKit/IOBSD.h>
#elif __linux__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mntent.h>
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ioctl.h>
@ -34,20 +29,14 @@
#include <linux/cdrom.h>
#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();
/*!
Free device list returned by cdio_get_devices or
cdio_get_devices_with_cap.
*/
// Free device list returned by cdio_get_devices or
// cdio_get_devices_with_cap.
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);
#endif // CDUTILS_H
#endif // _CDUTILS_H_

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by
@ -16,8 +16,8 @@
// http://code.google.com/p/dolphin-emu/
// Detect the cpu, so we'll know which optimizations to use
#ifndef _CPUDETECT_H
#define _CPUDETECT_H
#ifndef _CPUDETECT_H_
#define _CPUDETECT_H_
#include <string>
@ -62,4 +62,4 @@ struct CPUInfo
extern CPUInfo cpu_info;
#endif
#endif // _CPUDETECT_H_

View 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
// it under the terms of the GNU General Public License as published by

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _POINTERWRAP_H
#define _POINTERWRAP_H
#ifndef _POINTERWRAP_H_
#define _POINTERWRAP_H_
// Extremely simple serialization framework.
@ -271,4 +271,4 @@ private:
};
};
#endif // _POINTERWRAP_H
#endif // _POINTERWRAP_H_

View 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
// it under the terms of the GNU General Public License as published by

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _COLORUTIL_H
#define _COLORUTIL_H
#ifndef _COLORUTIL_H_
#define _COLORUTIL_H_
namespace ColorUtil
{
@ -25,4 +25,4 @@ u32 Decode5A3(u16 val);
} // namespace
#endif
#endif // _COLORUTIL_H_

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _COMMON_H
#define _COMMON_H
#ifndef _COMMON_H_
#define _COMMON_H_
#include <stdlib.h>
#include <stdio.h>
@ -40,6 +40,15 @@
#include "CommonPaths.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.
// This probably wouldn't break anyone either, but hey
@ -50,7 +59,6 @@
#endif
#ifdef _WIN32
// Check MSC ver
#if !defined _MSC_VER || _MSC_VER <= 1000
#error needs at least version 1000 of MSC
@ -124,4 +132,4 @@ namespace
TypeName(const TypeName&); \
void operator=(const TypeName&)
#endif // COMMON_H
#endif // _COMMON_H_

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef COMMONFUNCS_H
#define COMMONFUNCS_H
#ifndef _COMMONFUNCS_H_
#define _COMMONFUNCS_H_
#ifdef _WIN32
#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 u64 swap64(const u8* _pData) {return swap64(*(const u64*)_pData);}
} // namespace Common
} // Namespace Common
#endif // COMMONFUNCS
#endif // _COMMONFUNCS_H_

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef COMMON_PATHS_H
#define COMMON_PATHS_H
#ifndef _COMMON_PATHS_H_
#define _COMMON_PATHS_H_
// Library suffix/prefix
#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"
#endif // COMMON_PATHS_H
#endif // _COMMON_PATHS_H_

View 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
// 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
// should be placed in "Common.h" instead.
#ifndef _COMMONTYPES_H
#define _COMMONTYPES_H
#ifndef _COMMONTYPES_H_
#define _COMMONTYPES_H_
#ifdef _WIN32
@ -55,4 +55,4 @@ typedef long long s64;
#endif // _WIN32
#endif // _COMMONTYPES_H
#endif // _COMMONTYPES_H_

View 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
// it under the terms of the GNU General Public License as published by
@ -40,7 +40,7 @@ ConsoleListener::~ConsoleListener()
Close();
}
//100, 100, "Dolphin Log Console"
// 100, 100, "Dolphin Log Console"
// Open console window - width and height is the size of console window
// Name is the window title
void ConsoleListener::Open(int width, int height, char *title)

View 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
// 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);
return retval;
}

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _DYNAMICLIBRARY_H
#define _DYNAMICLIBRARY_H
#ifndef _DYNAMICLIBRARY_H_
#define _DYNAMICLIBRARY_H_
#ifdef _WIN32
#include <windows.h>
@ -56,4 +56,4 @@ private:
#endif
};
#endif // DYNAMICLIBRARY
#endif // _DYNAMICLIBRARY_H_

View File

@ -1,4 +1,4 @@
//////////////////////////////////////////////////////////////////////////////////////
// --------------------------------------------------------------------------------------
//
// Written by Zoltan Csizmadia, zoltan_csizmadia@yahoo.com
// 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.2 Dolphin version Masken
//
//////////////////////////////////////////////////////////////////////////////////////
//
// ExtendedTrace.cpp
//
// Include StdAfx.h, if you're using precompiled
// header through StdAfx.h
//#include "stdafx.h"
// --------------------------------------------------------------------------------------
#if defined(WIN32)

View File

@ -1,4 +1,4 @@
//////////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------------------
//
// Written by Zoltan Csizmadia, zoltan_csizmadia@yahoo.com
// 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.2 Dolphin version Masken
//
//////////////////////////////////////////////////////////////////////////////////////
//
// ExtendedTrace.h
//
// ----------------------------------------------------------------------------------------
#ifndef EXTENDEDTRACE_H_INCLUDED
#define EXTENDEDTRACE_H_INCLUDED
#ifndef _EXTENDEDTRACE_H_INCLUDED_
#define _EXTENDEDTRACE_H_INCLUDED_
#if defined(WIN32)
@ -31,26 +28,26 @@
#define EXTENDEDTRACEUNINITIALIZE() UninitSymInfo()
#define STACKTRACE(file) StackTrace( GetCurrentThread(), _T(""), file)
#define STACKTRACE2(file, eip, esp, ebp) StackTrace(GetCurrentThread(), _T(""), file, eip, esp, ebp)
//class File;
// class File;
BOOL InitSymInfo( PCSTR );
BOOL UninitSymInfo();
void StackTrace( HANDLE, LPCTSTR, FILE *file);
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 etfprint(FILE *file, const std::string &text);
#define UEFBUFSIZE 2048
extern char g_uefbuf[UEFBUFSIZE];
#else //not WIN32
#else // not WIN32
#define EXTENDEDTRACEINITIALIZE( IniSymbolPath ) ((void)0)
#define EXTENDEDTRACEUNINITIALIZE() ((void)0)
#define STACKTRACE(file) ((void)0)
#define STACKTRACE2(file, eip, esp, ebp) ((void)0)
#endif //WIN32
#endif // WIN32
#endif //EXTENDEDTRACE_H_INCLUDED
#endif // _EXTENDEDTRACE_H_INCLUDED_

View 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
// 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);
}

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef __FILESEARCH_H_
#define __FILESEARCH_H_
#ifndef _FILESEARCH_H_
#define _FILESEARCH_H_
#include <string>
#include <vector>
@ -40,5 +40,5 @@ class CFileSearch
XStringVector m_FileNames;
};
#endif
#endif // _FILESEARCH_H_

View 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
// it under the terms of the GNU General Public License as published by
@ -45,11 +45,10 @@
#ifndef S_ISDIR
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
#endif
/*
This namespace has various generic functions related to files and paths.
The code still needs a ton of cleanup.
REMEMBER: strdup considered harmful!
*/
// This namespace has various generic functions related to files and paths.
// The code still needs a ton of cleanup.
// REMEMBER: strdup considered harmful!
namespace File
{
@ -70,7 +69,7 @@ bool Exists(const char *filename)
{
struct stat file_info;
char *copy = StripTailDirSlashes(strdup(filename));
char *copy = StripTailDirSlashes(__strdup(filename));
int result = stat(copy, &file_info);
free(copy);
@ -82,7 +81,7 @@ bool IsDirectory(const char *filename)
{
struct stat file_info;
char *copy = StripTailDirSlashes(strdup(filename));
char *copy = StripTailDirSlashes(__strdup(filename));
int result = stat(copy, &file_info);
free(copy);
@ -488,7 +487,7 @@ const char *GetCurrentDirectory()
{
const char *dir;
// Get the current working directory (getcwd uses malloc)
if (!(dir = getcwd(NULL, 0))) {
if (!(dir = __getcwd(NULL, 0))) {
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s",
GetLastErrorMsg());
@ -500,7 +499,7 @@ const char *GetCurrentDirectory()
// Sets the current directory to the given directory
bool SetCurrentDirectory(const char *_rDirectory)
{
return chdir(_rDirectory) == 0;
return __chdir(_rDirectory) == 0;
}
#if defined(__APPLE__)
@ -603,4 +602,3 @@ const char *GetUserDirectory()
}
} // namespace

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _FILEUTIL_H
#define _FILEUTIL_H
#ifndef _FILEUTIL_H_
#define _FILEUTIL_H_
#include <string>
#include <vector>
@ -24,9 +24,6 @@
#include "Common.h"
/*
This namespace has various generic functions related to files and paths.
*/
namespace File
{

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _FIXED_SIZE_QUEUE_H
#define _FIXED_SIZE_QUEUE_H
#ifndef _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
// real STL classes.
@ -83,5 +83,5 @@ public:
}
};
#endif // _FIXED_SIZE_QUEUE_H
#endif // _FIXED_SIZE_QUEUE_H_

View 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
// 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);
}
/* Second reduction step to reduce sums to 16 bits */
// Second reduction step to reduce sums to 16 bits
sum1 = (sum1 & 0xffff) + (sum1 >> 16);
sum2 = (sum2 & 0xffff) + (sum2 >> 16);
return(sum2 << 16 | sum1);

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _HASH_H
#define _HASH_H
#ifndef _HASH_H_
#define _HASH_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 HashEctor(const u8* ptr, int length); // JUNK. DO NOT USE FOR NEW THINGS
#endif
#endif // _HASH_H_

View 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
// it under the terms of the GNU General Public License as published by
@ -16,9 +16,6 @@
// http://code.google.com/p/dolphin-emu/
// see IniFile.h
//////////////////////////////////////////////////////////////////////////////////////
// Include
// ------------
#include <stdlib.h>
#include <stdio.h>
@ -30,24 +27,13 @@
#include "StringUtil.h"
#include "IniFile.h"
///////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
// Class
// ------------
IniFile::IniFile()
{}
IniFile::~IniFile()
{}
///////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
// Section functions used locally only
// ------------
Section::Section()
: lines(), name(""), comment("") {}
@ -91,7 +77,6 @@ Section* IniFile::GetOrCreateSection(const char* sectionName)
return(section);
}
///////////////////////////////
bool IniFile::DeleteSection(const char* sectionName)
@ -115,7 +100,6 @@ bool IniFile::DeleteSection(const char* sectionName)
return false;
}
void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut) const
{
// 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)
{
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());
}
//////////////////////////////////////////////////////////////////////////////////////
// Load and save file
// ------------
bool IniFile::Load(const char* filename)
{
// Maximum number of letters in a line
@ -382,12 +361,7 @@ bool IniFile::Save(const char* filename)
out.close();
return true;
}
//////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
// Get and set elements
// ------------
void IniFile::Set(const char* sectionName, const char* key, const char* newValue)
{
Section* section = GetOrCreateSection(sectionName);
@ -544,10 +518,9 @@ bool IniFile::Get(const char* sectionName, const char* key, bool* value, bool de
*value = defaultValue;
return false;
}
////////////////////////////////////////
// TODO: Keep this code below?
/*
int main()
{
@ -567,4 +540,3 @@ bool IniFile::Get(const char* sectionName, const char* key, bool* value, bool de
return 0;
}
*/

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _INIFILE_H
#define _INIFILE_H
#ifndef _INIFILE_H_
#define _INIFILE_H_
#include <string>
#include <vector>
@ -88,4 +88,4 @@ private:
void CreateSection(const char* section);
};
#endif
#endif // _INIFILE_H_

View File

@ -15,8 +15,8 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _LOG_H
#define _LOG_H
#ifndef _LOG_H_
#define _LOG_H_
#define NOTICE_LEVEL 1 // VERY important information that is NOT errors. Like startup and OSReports.
#define ERROR_LEVEL 2 // Critical errors
@ -165,4 +165,4 @@ enum LOG_LEVELS {
}
#endif // WIN32
#endif // LOG_H
#endif // _LOG_H_

View File

@ -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 "Timer.h"

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _LOGMANAGER_H
#define _LOGMANAGER_H
#ifndef _LOGMANAGER_H_
#define _LOGMANAGER_H_
#include "Log.h"
#include "Thread.h"
@ -187,4 +187,4 @@ public:
~LogManager();
};
#endif // LOGMANAGER_H
#endif // _LOGMANAGER_H_

View 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
// it under the terms of the GNU General Public License as published by
@ -230,4 +230,4 @@ IMappedFile* IMappedFile::CreateMappedFileDEPRECATED(void)
{
return(new CMappedFile);
}
} // end of namespace Common
} // namespace Common

View 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
// 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
// http://code.google.com/p/dolphin-emu/
// ------------------------------------------------------
// Handles giant memory mapped files
// Through some trickery, allows lock on byte boundaries
// instead of allocation granularity boundaries
// for ease of use
//
// ------------------------------------------------------
#ifndef _MAPPED_FILE_H
#define _MAPPED_FILE_H
#ifndef _MAPPED_FILE_H_
#define _MAPPED_FILE_H_
#include <map>
@ -44,4 +46,4 @@ public:
} // namespace
#endif
#endif // _MAPPED_FILE_H_

View 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
// it under the terms of the GNU General Public License as published by
@ -40,5 +40,3 @@ void SaveSSEState()
{
saved_sse_state = _mm_getcsr();
}

View File

@ -15,8 +15,8 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _MATH_UTIL_H
#define _MATH_UTIL_H
#ifndef _MATH_UTIL_H_
#define _MATH_UTIL_H_
#include <xmmintrin.h>
@ -36,4 +36,4 @@ void LoadDefaultSSEState();
#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1))
#endif
#endif // _MATH_UTIL_H_

View 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
// it under the terms of the GNU General Public License as published by

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _MEMARENA_H
#define _MEMARENA_H
#ifndef _MEMARENA_H_
#define _MEMARENA_H_
#ifdef _WIN32
#include <windows.h>
@ -49,4 +49,4 @@ private:
#endif
};
#endif
#endif // _MEMARENA_H_

View 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
// it under the terms of the GNU General Public License as published by

View 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
// 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 */
bool MsgAlert(const char* caption, bool yes_no, int Style, const char* format, ...)
{
// ---------------------------------
// Read message and write it to the log
// -----------
char buffer[2048];
bool ret = true;
@ -75,4 +74,3 @@ bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, int S
return true;
#endif
}

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef MSGHANDLER_H
#define MSGHANDLER_H
#ifndef _MSGHANDLER_H_
#define _MSGHANDLER_H_
// Message alerts
enum MSG_TYPE
{
@ -43,4 +43,4 @@ void SetEnableAlert(bool enable);
#define AskYesNo(format, ...) MsgAlert("Question", true, QUESTION, format, ##__VA_ARGS__)
#endif
#endif //MSGHANDLER
#endif // _MSGHANDLER_H_

View 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
// 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
// http://code.google.com/p/dolphin-emu/
////////////////////////////////////////////////
// --------------------------------------------------------------------------------------------
// 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
// directly in PluginManager.cpp when we check if a plugin is valid or not.
///////////////////////////////////////////////
// --------------------------------------------------------------------------------------------
#include "Plugin.h"
@ -124,4 +124,4 @@ void CPlugin::Shutdown()
m_Shutdown();
}
} // end of namespace Common
} // Namespace

View File

@ -15,8 +15,8 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _PLUGIN_H
#define _PLUGIN_H
#ifndef _PLUGIN_H_
#define _PLUGIN_H_
#include "Common.h"
#include "PluginSpecs.h"
@ -67,6 +67,6 @@ private:
TShutdown m_Shutdown;
TDoState m_DoState;
};
} // end of namespace Common
} // Namespace
#endif
#endif // _PLUGIN_H_

View File

@ -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"
namespace Common {

View File

@ -1,5 +1,22 @@
#ifndef _PLUGINDSP_H
#define _PLUGINDSP_H
// 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/
#ifndef _PLUGINDSP_H_
#define _PLUGINDSP_H_
#include "pluginspecs_dsp.h"
#include "Plugin.h"
@ -38,4 +55,4 @@ private:
} // namespace
#endif
#endif // _PLUGINDSP_H_

View File

@ -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"
namespace Common
@ -21,4 +38,4 @@ namespace Common
}
PluginPAD::~PluginPAD() {}
}
} // Namespace

View File

@ -1,5 +1,22 @@
#ifndef _PLUGINPAD_H
#define _PLUGINPAD_H
// 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/
#ifndef _PLUGINPAD_H_
#define _PLUGINPAD_H_
#include "pluginspecs_pad.h"
#include "Plugin.h"
@ -29,4 +46,4 @@ private:
} // namespace
#endif
#endif // _PLUGINPAD_H_

View File

@ -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"
namespace Common

View File

@ -1,5 +1,22 @@
#ifndef _PLUGINVIDEO_H
#define _PLUGINVIDEO_H
// 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/
#ifndef _PLUGINVIDEO_H_
#define _PLUGINVIDEO_H_
#include "pluginspecs_video.h"
#include "Plugin.h"
@ -36,4 +53,4 @@ private:
} // namespace
#endif
#endif // _PLUGINVIDEO_H_

View File

@ -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"
namespace Common {
@ -21,7 +38,6 @@ PluginWiimote::PluginWiimote(const char *_Filename)
validWiimote = true;
}
PluginWiimote::~PluginWiimote() {
}
PluginWiimote::~PluginWiimote() { }
}
} // Namespace

View File

@ -1,5 +1,22 @@
#ifndef _PLUGINWIIMOTE_H
#define _PLUGINWIIMOTE_H
// 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/
#ifndef _PLUGINWIIMOTE_H_
#define _PLUGINWIIMOTE_H_
#include "pluginspecs_wiimote.h"
#include "Plugin.h"
@ -29,4 +46,4 @@ private:
} // namespace
#endif
#endif // _PLUGINWIIMOTE_H_

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef __SETUP_h__
#define __SETUP_h__
#ifndef _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.
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
// ¯¯¯¯¯¯¯¯¯¯¯¯
// -----------------------------------------------------------------------------------------------------
// Settings:
// This may remove sound artifacts in Wario Land Shake It and perhaps other games
//#define SETUP_AVOID_SOUND_ARTIFACTS
@ -64,7 +60,7 @@
// Build with music modification
//#define MUSICMOD
///////////////////////////
// -----------------------------------------------------------------------------------------------------
#endif // __SETUP_h__
#endif // _SETUP_H_

View 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
// 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);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Convert AB to it's ascii table entry numbers 0x4142
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
u32 Ascii2Hex(std::string _Text)
{
// Reset the return value zero
@ -100,8 +97,6 @@ std::string Hex2Ascii(u32 _Text)
std::string StrResult = Result;
return StrResult;
}
///////////////////////////
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!
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 Tmp, Spc;
@ -197,8 +189,6 @@ std::string ArrayToString(const u8 *data, u32 size, u32 offset, int line_len, bo
}
return Tmp;
}
// ================
// Turns " hej " into "hej". Also handles tabs.
std::string StripSpaces(const std::string &str)
@ -459,5 +449,3 @@ std::string ThS(int Integer, bool Unsigned)
}
return sbuf;
}

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _STRINGUTIL_H
#define _STRINGUTIL_H
#ifndef _STRINGUTIL_H_
#define _STRINGUTIL_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);
#endif
#endif // _STRINGUTIL_H_

View 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
// it under the terms of the GNU General Public License as published by
@ -18,14 +18,11 @@
#include "Setup.h"
#include "Thread.h"
#include "Log.h"
// -----------------------------------------
#ifdef SETUP_TIMER_WAITING
// -----------------
#include <windows.h>
#include "ConsoleWindow.h"
EventCallBack FunctionPointer[10];
#endif
// ------------------------
namespace Common
{
@ -68,7 +65,6 @@ void CriticalSection::Leave()
LeaveCriticalSection(&section);
}
Thread::Thread(ThreadFunc function, void* arg)
: m_hThread(NULL), m_threadId(0)
{
@ -106,10 +102,7 @@ void Thread::SetCurrentThreadAffinity(int mask)
SetThreadAffinityMask(GetCurrentThread(), mask);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Regular same thread loop based waiting
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Event::Event()
{
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
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. */
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
#ifdef SETUP_TIMER_WAITING
/* 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? */
@ -280,14 +268,8 @@ void Event::SetTimer()
if (StartWait) DoneWaiting = true;
}
#endif
////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Supporting functions
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void SleepCurrentThread(int ms)
{
Sleep(ms);
@ -350,8 +332,6 @@ LONG SyncInterlockedExchange(LONG *Dest, LONG Val)
{
return InterlockedExchange(Dest, Val);
}
////////////////////////////////////////
#else // !WIN32, so must be POSIX threads
@ -572,4 +552,4 @@ LONG SyncInterlockedExchange(LONG *Dest, LONG Val)
#endif
} // end of namespace Common
} // namespace Common

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _THREAD_H
#define _THREAD_H
#ifndef _THREAD_H_
#define _THREAD_H_
//////////////////////////////////////////////////////////////////////////////////////////
// Includes
// ------------
#ifdef _WIN32
#include <windows.h>
#define THREAD_RETURN DWORD WINAPI
@ -39,9 +36,6 @@
#include <stdio.h>
#include <string.h>
/////////////////////////////////////////////////////////////////////////////////////////
// Definitions
// ------------
// This may not be defined outside _WIN32
#ifndef _WIN32
#ifndef INFINITE
@ -124,9 +118,7 @@ public:
void MsgWait() {Wait();}
#endif
// -----------------------------------------
#ifdef SETUP_TIMER_WAITING
// -----------------
bool TimerWait(EventCallBack WaitCB, int Id = 0, bool OptCondition = true);
bool DoneWait();
void SetTimer();
@ -136,7 +128,6 @@ public:
HANDLE hTimer;
HANDLE hTimerQueue;
#endif
// ---------------------------
private:
#ifdef _WIN32
@ -163,6 +154,6 @@ LONG SyncInterlockedExchangeAdd(LONG *Dest, LONG Val);
LONG SyncInterlockedExchange(LONG *Dest, LONG Val);
LONG SyncInterlockedIncrement(LONG *Dest);
} // end of namespace Common
} // namespace Common
#endif
#endif // _STRINGUTIL_H_

View 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
// it under the terms of the GNU General Public License as published by

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _THUNK_H
#define _THUNK_H
#ifndef _THUNK_H_
#define _THUNK_H_
#include <map>
@ -52,4 +52,4 @@ public:
extern ThunkManager thunks;
#endif
#endif // _THUNK_H_

View 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
// it under the terms of the GNU General Public License as published by
@ -39,9 +39,9 @@ u32 timeGetTime()
namespace Common
{
//////////////////////////////////////////////////////////////////////////////////////////
// --------------------------------------------
// Initiate, Start, Stop, and Update the time
// ---------------
// --------------------------------------------
// Set initial values for the class
Timer::Timer()
@ -75,13 +75,12 @@ void Timer::Update()
m_LastTime = timeGetTime();
//TODO(ector) - QPF
}
/////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// -------------------------------------
// Get time difference and elapsed time
// ---------------
// -------------------------------------
// Get the number of milliseconds since the last Update()
s64 Timer::GetTimeDifference()
@ -138,13 +137,7 @@ std::string Timer::GetTimeElapsedFormatted() const
return TmpStr;
}
/////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Get current time
// ---------------
void Timer::IncreaseResolution()
{
#ifdef _WIN32
@ -212,4 +205,4 @@ std::string Timer::GetTimeFormatted()
return std::string(formattedTime);
}
} // end of namespace Common
} // Namespace Common

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _TIMER_H
#define _TIMER_H
#ifndef _TIMER_H_
#define _TIMER_H_
#include "Common.h"
#include <string>
@ -53,10 +53,10 @@ public:
bool m_Running;
};
} // end of namespace Common
} // Namespace Common
#ifdef __GNUC__
u32 timeGetTime();
#endif
#endif // GNUC
#endif
#endif // _TIMER_H_

View File

@ -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"

View File

@ -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>

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#include "x64Analyzer.h"
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);
return true;
}

View 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
// 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
// http://code.google.com/p/dolphin-emu/
#ifndef _X64ANALYZER_H
#define _X64ANALYZER_H
#ifndef _X64ANALYZER_H_
#define _X64ANALYZER_H_
#include "Common.h"
@ -53,4 +54,4 @@ enum AccessType{
bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int accessType);
#endif
#endif // _X64ANALYZER_H_

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by
@ -17,8 +17,8 @@
// WARNING - THIS LIBRARY IS NOT THREAD SAFE!!!
#ifndef _DOLPHIN_INTEL_CODEGEN
#define _DOLPHIN_INTEL_CODEGEN
#ifndef _DOLPHIN_INTEL_CODEGEN_
#define _DOLPHIN_INTEL_CODEGEN_
#include "Common.h"
#include "MemoryUtil.h"
@ -721,4 +721,4 @@ public:
} // namespace
#endif
#endif // _DOLPHIN_INTEL_CODEGEN_

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="Core"
ProjectGUID="{F0B874CB-4476-4199-9315-8343D05AE684}"
RootNamespace="Core"
@ -52,11 +52,12 @@
RuntimeLibrary="1"
BufferSecurityCheck="true"
FloatingPointModel="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="4"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -122,11 +123,12 @@
RuntimeLibrary="1"
BufferSecurityCheck="true"
FloatingPointModel="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -196,11 +198,12 @@
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2"
FloatingPointModel="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -272,11 +275,12 @@
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="0"
FloatingPointModel="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -345,11 +349,12 @@
BufferSecurityCheck="true"
EnableEnhancedInstructionSet="2"
FloatingPointModel="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -418,11 +423,12 @@
RuntimeLibrary="0"
BufferSecurityCheck="false"
FloatingPointModel="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -492,11 +498,12 @@
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2"
FloatingPointModel="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -568,11 +575,12 @@
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="0"
FloatingPointModel="0"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="stdafx.h"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -2292,78 +2300,6 @@
RelativePath=".\Src\State.h"
>
</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
RelativePath=".\Src\Tracer.cpp"
>

View File

@ -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:
// GCNcrypt - Gamecube AR Crypto Program

View 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
// it under the terms of the GNU General Public License as published by

View 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
// 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
// http://code.google.com/p/dolphin-emu/
// -----------------------------------------------------------------------------------------
// Partial Action Replay code system implementation.
// 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 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...
// -----------------------------------------------------------------------------------------
// 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 <vector>
@ -40,6 +45,16 @@
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 ARCode code;
@ -49,28 +64,20 @@ static std::vector<ARCode> activeCodes;
static bool logSelf = false;
static std::vector<std::string> arLog;
void LogInfo(const char *format, ...);
// --- Codes ---
// SubTypes (Normal 0 Codes)
bool Subtype_RamWriteAndFill(u32 addr, u32 data);
bool Subtype_WriteToPointer(u32 addr, u32 data);
bool Subtype_AddCode(u32 addr, u32 data);
bool Subtype_MasterCodeAndWriteToCCXXXXXX();
// Zero Codes
bool ZeroCode_FillAndSlide(u32 val_last, u32 addr, u32 data);
bool ZeroCode_MemoryCopy(u32 val_last, u32 addr, u32 data);
// Normal Codes
bool NormalCode_Type_0(u8 subtype, u32 addr, u32 data);
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 NormalCode(u8 subtype, u32 addr, u32 data);
bool ConditionalCode(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip, int compareType);
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)
{
// Parses the Action Replay section of a game ini file.
@ -174,6 +181,7 @@ void LoadCodes(std::vector<ARCode> &_arCodes, IniFile &ini)
_arCodes = arCodes;
}
void LogInfo(const char *format, ...)
{
if (!b_RanOnce)
@ -197,6 +205,7 @@ void LogInfo(const char *format, ...)
}
}
void RunAllActive()
{
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())
{
LogInfo("Bad Count: %i", count);
#if defined(_DEBUG) || defined(DEBUGFAST)
PanicAlert("Action Replay: Bad Count: %i (%s)", count, code.name.c_str());
#endif
PanicAlert("Action Replay: Bad Count: %i (%s)", count, code.name.c_str());
return false;
}
@ -346,42 +353,42 @@ bool RunCode(const ARCode &arcode) {
switch (type)
{
case 0x0:
if (!NormalCode_Type_0(subtype, addr, data))
if (!NormalCode(subtype, addr, data))
return false;
continue;
case 0x1:
LogInfo("Type 1: If Equal");
if (!NormalCode_Type_1(subtype, addr, data, &count, &skip))
if (!ConditionalCode(subtype, addr, data, &count, &skip, EQUAL))
return false;
continue;
case 0x2:
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;
continue;
case 0x3:
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;
continue;
case 0x4:
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;
continue;
case 0x5:
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;
continue;
case 0x6:
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;
continue;
case 0x7:
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;
continue;
default:
@ -395,8 +402,60 @@ bool RunCode(const ARCode &arcode) {
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)
{
u32 new_addr = ((addr & 0x7FFFFF) | 0x80000000); // real GC address
@ -557,7 +616,6 @@ bool Subtype_MasterCodeAndWriteToCCXXXXXX()
return false;
}
// Zero Codes
bool ZeroCode_FillAndSlide(u32 val_last, u32 addr, u32 data) // This needs more testing
{
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;
}
// Normal Codes
bool NormalCode_Type_0(u8 subtype, u32 addr, u32 data)
bool NormalCode(u8 subtype, u32 addr, u32 data)
{
switch (subtype)
{
@ -725,8 +782,7 @@ bool NormalCode_Type_0(u8 subtype, u32 addr, u32 data)
}
return true;
}
// Conditional Codes
bool NormalCode_Type_1(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip)
bool ConditionalCode(u8 subtype, u32 addr, u32 data, int *pCount, bool *pSkip, int compareType)
{
u8 size = (addr >> 25) & 0x03;
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;
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 0x0: con = CompareValues((u32)Memory::Read_U8(new_addr), (data & 0xFF), compareType); break;
case 0x1: con = CompareValues((u32)Memory::Read_U16(new_addr), (data & 0xFFFF), compareType); break;
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:
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 SetLineSkip(1, subtype, pSkip, con, pCount);
}
bool NormalCode_Type_2(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) != (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;
}
// ----------------------
// Internal Functions
bool SetLineSkip(int codetype, u8 subtype, bool *pSkip, bool skip, int *pCount)
{
*pSkip = !skip; // set skip
@ -951,4 +824,18 @@ bool SetLineSkip(int codetype, u8 subtype, bool *pSkip, bool skip, int *pCount)
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

View 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
// 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();
} // namespace
#endif //_ACTIONREPLAY_H_
#endif // _ACTIONREPLAY_H_

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// it under the terms of the GNU General Public License as published by

View 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
// 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