mirror of https://github.com/PCSX2/pcsx2.git
SPU2-X: Added preliminary support for SPU2setLogDir(). Should probably be tested better, but bleh. I so want to rewrite all of this stuff in a nice wx-based cross-platform manner. >_<
DevNotes: converted some code from wstring to wxString to work a little toward cross-platformness. ... and probably broke the Linux build. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3115 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
5e53c9b2c8
commit
bc11d59438
|
@ -52,14 +52,12 @@ static __forceinline bool CoresDump() { return _CoresDump & DebugEnabled; }
|
||||||
static __forceinline bool MemDump() { return _MemDump & DebugEnabled; }
|
static __forceinline bool MemDump() { return _MemDump & DebugEnabled; }
|
||||||
static __forceinline bool RegDump() { return _RegDump & DebugEnabled; }
|
static __forceinline bool RegDump() { return _RegDump & DebugEnabled; }
|
||||||
|
|
||||||
|
extern wxString AccessLogFileName;
|
||||||
extern wchar_t AccessLogFileName[255];
|
extern wxString DMA4LogFileName;
|
||||||
extern wchar_t WaveLogFileName[255];
|
extern wxString DMA7LogFileName;
|
||||||
extern wchar_t DMA4LogFileName[255];
|
extern wxString CoresDumpFileName;
|
||||||
extern wchar_t DMA7LogFileName[255];
|
extern wxString MemDumpFileName;
|
||||||
extern wchar_t CoresDumpFileName[255];
|
extern wxString RegDumpFileName;
|
||||||
extern wchar_t MemDumpFileName[255];
|
|
||||||
extern wchar_t RegDumpFileName[255];
|
|
||||||
|
|
||||||
extern int Interpolation;
|
extern int Interpolation;
|
||||||
extern int ReverbBoost;
|
extern int ReverbBoost;
|
||||||
|
|
|
@ -1,381 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2001-2004 Unicode, Inc.
|
|
||||||
*
|
|
||||||
* Disclaimer
|
|
||||||
*
|
|
||||||
* This source code is provided as is by Unicode, Inc. No claims are
|
|
||||||
* made as to fitness for any particular purpose. No warranties of any
|
|
||||||
* kind are expressed or implied. The recipient agrees to determine
|
|
||||||
* applicability of information provided. If this file has been
|
|
||||||
* purchased on magnetic or optical media from Unicode, Inc., the
|
|
||||||
* sole remedy for any claim will be exchange of defective media
|
|
||||||
* within 90 days of receipt.
|
|
||||||
*
|
|
||||||
* Limitations on Rights to Redistribute This Code
|
|
||||||
*
|
|
||||||
* Unicode, Inc. hereby grants the right to freely use the information
|
|
||||||
* supplied in this file in the creation of products supporting the
|
|
||||||
* Unicode Standard, and to make copies of this file in any form
|
|
||||||
* for internal or external distribution as long as this notice
|
|
||||||
* remains attached.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
Conversions between UTF32, UTF-16, and UTF-8. Source code file.
|
|
||||||
Author: Mark E. Davis, 1994.
|
|
||||||
Rev History: Rick McGowan, fixes & updates May 2001.
|
|
||||||
Sept 2001: fixed const & error conditions per
|
|
||||||
mods suggested by S. Parent & A. Lillich.
|
|
||||||
June 2002: Tim Dodd added detection and handling of incomplete
|
|
||||||
source sequences, enhanced error detection, added casts
|
|
||||||
to eliminate compiler warnings.
|
|
||||||
July 2003: slight mods to back out aggressive FFFE detection.
|
|
||||||
Jan 2004: updated switches in from-UTF8 conversions.
|
|
||||||
Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions.
|
|
||||||
|
|
||||||
See the header file "ConvertUTF.h" for complete documentation.
|
|
||||||
|
|
||||||
------------------------------------------------------------------------ */
|
|
||||||
|
|
||||||
#include "Global.h"
|
|
||||||
#include "ConvertUTF.h"
|
|
||||||
|
|
||||||
using std::string;
|
|
||||||
using std::wstring;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef CVTUTF_DEBUG
|
|
||||||
#include <stdio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Unicode
|
|
||||||
{
|
|
||||||
/* Some fundamental constants */
|
|
||||||
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
|
|
||||||
#define UNI_MAX_BMP (UTF32)0x0000FFFF
|
|
||||||
#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
|
|
||||||
#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
|
|
||||||
#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
|
|
||||||
|
|
||||||
#define UNI_SUR_HIGH_START (UTF32)0xD800
|
|
||||||
#define UNI_SUR_HIGH_END (UTF32)0xDBFF
|
|
||||||
#define UNI_SUR_LOW_START (UTF32)0xDC00
|
|
||||||
#define UNI_SUR_LOW_END (UTF32)0xDFFF
|
|
||||||
|
|
||||||
static const int halfShift = 10; /* used for shifting by 10 bits */
|
|
||||||
|
|
||||||
static const UTF32 halfBase = 0x0010000UL;
|
|
||||||
static const UTF32 halfMask = 0x3FFUL;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Index into the table below with the first byte of a UTF-8 sequence to
|
|
||||||
* get the number of trailing bytes that are supposed to follow it.
|
|
||||||
* Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
|
|
||||||
* left as-is for anyone who may want to do such conversion, which was
|
|
||||||
* allowed in earlier algorithms.
|
|
||||||
*/
|
|
||||||
static const char trailingBytesForUTF8[256] = {
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Magic values subtracted from a buffer value during UTF8 conversion.
|
|
||||||
* This table contains as many values as there might be trailing bytes
|
|
||||||
* in a UTF-8 sequence.
|
|
||||||
*/
|
|
||||||
static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
|
|
||||||
0x03C82080UL, 0xFA082080UL, 0x82082080UL };
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
|
|
||||||
* into the first byte, depending on how many bytes follow. There are
|
|
||||||
* as many entries in this table as there are UTF-8 sequence types.
|
|
||||||
* (I.e., one byte sequence, two byte... etc.). Remember that sequencs
|
|
||||||
* for *legal* UTF-8 will be 4 or fewer bytes total.
|
|
||||||
*/
|
|
||||||
static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
/* The interface converts a whole buffer to avoid function-call overhead.
|
|
||||||
* Constants have been gathered. Loops & conditionals have been removed as
|
|
||||||
* much as possible for efficiency, in favor of drop-through switches.
|
|
||||||
* (See "Note A" at the bottom of the file for equivalent code.)
|
|
||||||
* If your compiler supports it, the "isLegalUTF8" call can be turned
|
|
||||||
* into an inline function.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
void Convert( const wstring& src, string& dest )
|
|
||||||
{
|
|
||||||
const UTF16* source = (UTF16*)src.c_str();
|
|
||||||
const UTF16* sourceEnd = &source[ src.length() ];
|
|
||||||
|
|
||||||
// initialize a four-char packet:
|
|
||||||
std::wstring packet( L" " );
|
|
||||||
|
|
||||||
while (source < sourceEnd)
|
|
||||||
{
|
|
||||||
UTF32 ch;
|
|
||||||
unsigned short bytesToWrite = 0;
|
|
||||||
const UTF32 byteMask = 0xBF;
|
|
||||||
const UTF32 byteMark = 0x80;
|
|
||||||
//const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
|
|
||||||
|
|
||||||
ch = *source++;
|
|
||||||
|
|
||||||
/* If we have a surrogate pair, convert to UTF32 first. */
|
|
||||||
if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END)
|
|
||||||
{
|
|
||||||
/* If the 16 bits following the high surrogate are in the source buffer... */
|
|
||||||
if (source < sourceEnd)
|
|
||||||
{
|
|
||||||
UTF32 ch2 = *source;
|
|
||||||
/* If it's a low surrogate, convert to UTF32. */
|
|
||||||
if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END)
|
|
||||||
{
|
|
||||||
ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
|
|
||||||
+ (ch2 - UNI_SUR_LOW_START) + halfBase;
|
|
||||||
++source;
|
|
||||||
}
|
|
||||||
#ifdef UTF_STRICT
|
|
||||||
else if (flags == strictConversion)
|
|
||||||
{
|
|
||||||
/* it's an unpaired high surrogate */
|
|
||||||
--source; /* return to the illegal value itself */
|
|
||||||
result = SourceIllegal;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* We don't have the 16 bits following the high surrogate. */
|
|
||||||
//--source; /* return to the high surrogate */
|
|
||||||
//result = SourceExhausted;
|
|
||||||
//break;
|
|
||||||
throw Exception::UTFConversion<string>( dest, "UTF16->UTF8 conversion failure: Unexpected end of source string!" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifdef UTF_STRICT
|
|
||||||
else if (flags == strictConversion)
|
|
||||||
{
|
|
||||||
/* UTF-16 surrogate values are illegal in UTF-32 */
|
|
||||||
if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END)
|
|
||||||
{
|
|
||||||
--source; /* return to the illegal value itself */
|
|
||||||
result = sourceIllegal;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Figure out how many bytes the result will require */
|
|
||||||
if (ch < (UTF32)0x80) bytesToWrite = 1;
|
|
||||||
else if (ch < (UTF32)0x800) bytesToWrite = 2;
|
|
||||||
else if (ch < (UTF32)0x10000) bytesToWrite = 3;
|
|
||||||
else if (ch < (UTF32)0x110000) bytesToWrite = 4;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bytesToWrite = 3;
|
|
||||||
ch = UNI_REPLACEMENT_CHAR;
|
|
||||||
}
|
|
||||||
|
|
||||||
packet.clear();
|
|
||||||
switch( bytesToWrite )
|
|
||||||
{
|
|
||||||
/* note: everything falls through. */
|
|
||||||
case 4: packet += (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
|
|
||||||
case 3: packet += (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
|
|
||||||
case 2: packet += (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
|
|
||||||
case 1: packet += (UTF8) (ch | firstByteMark[bytesToWrite]);
|
|
||||||
}
|
|
||||||
dest.append( packet.rbegin(), packet.rend() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Utility routine to tell whether a sequence of bytes is legal UTF-8.
|
|
||||||
* This must be called with the length pre-determined by the first byte.
|
|
||||||
* If not calling this from ConvertUTF8to*, then the length can be set by:
|
|
||||||
* length = trailingBytesForUTF8[*source]+1;
|
|
||||||
* and the sequence is illegal right away if there aren't that many bytes
|
|
||||||
* available.
|
|
||||||
* If presented with a length > 4, this returns false. The Unicode
|
|
||||||
* definition of UTF-8 goes up to 4-byte sequences.
|
|
||||||
*/
|
|
||||||
static bool isLegalUTF8(const UTF8 *source, int length)
|
|
||||||
{
|
|
||||||
UTF8 a;
|
|
||||||
const UTF8 *srcptr = source+length;
|
|
||||||
|
|
||||||
switch (length)
|
|
||||||
{
|
|
||||||
default: return false;
|
|
||||||
/* Everything else falls through when "true"... */
|
|
||||||
case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
|
|
||||||
case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
|
|
||||||
case 2: if ((a = (*--srcptr)) > 0xBF) return false;
|
|
||||||
|
|
||||||
switch (*source)
|
|
||||||
{
|
|
||||||
/* no fall-through in this inner switch */
|
|
||||||
case 0xE0: if (a < 0xA0) return false; break;
|
|
||||||
case 0xED: if (a > 0x9F) return false; break;
|
|
||||||
case 0xF0: if (a < 0x90) return false; break;
|
|
||||||
case 0xF4: if (a > 0x8F) return false; break;
|
|
||||||
default: if (a < 0x80) return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 1: if (*source >= 0x80 && *source < 0xC2) return false;
|
|
||||||
}
|
|
||||||
if (*source > 0xF4) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Exported function to return whether a UTF-8 sequence is legal or not.
|
|
||||||
* This is not used here; it's just exported.
|
|
||||||
*/
|
|
||||||
bool isLegalUTF8Sequence( const UTF8 *source, const UTF8 *sourceEnd )
|
|
||||||
{
|
|
||||||
int length = trailingBytesForUTF8[*source]+1;
|
|
||||||
if (source+length > sourceEnd)
|
|
||||||
return false;
|
|
||||||
return isLegalUTF8(source, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
void Convert( const std::string& src, std::wstring& dest )
|
|
||||||
{
|
|
||||||
const UTF8* source = (UTF8*)src.c_str();
|
|
||||||
const UTF8* sourceEnd = &source[ src.length() ];
|
|
||||||
|
|
||||||
while (source < sourceEnd)
|
|
||||||
{
|
|
||||||
UTF32 ch = 0;
|
|
||||||
u16 extraBytesToRead = trailingBytesForUTF8[*source];
|
|
||||||
|
|
||||||
if( source + extraBytesToRead >= sourceEnd )
|
|
||||||
{
|
|
||||||
throw Exception::UTFConversion<wstring>( dest, "UTF8->UTF16 String Conversion failed: Unexpected end of string data." );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Do this check whether lenient or strict */
|
|
||||||
if (!isLegalUTF8(source, extraBytesToRead+1))
|
|
||||||
{
|
|
||||||
throw Exception::UTFConversion<wstring>( dest, "UTF8->UTF16 String Conversion failed: Illegal UTF8 data encountered!" );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The cases all fall through. See "Note A" below.
|
|
||||||
*/
|
|
||||||
switch (extraBytesToRead)
|
|
||||||
{
|
|
||||||
case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
|
|
||||||
case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
|
|
||||||
case 3: ch += *source++; ch <<= 6;
|
|
||||||
case 2: ch += *source++; ch <<= 6;
|
|
||||||
case 1: ch += *source++; ch <<= 6;
|
|
||||||
case 0: ch += *source++;
|
|
||||||
}
|
|
||||||
ch -= offsetsFromUTF8[extraBytesToRead];
|
|
||||||
|
|
||||||
if (ch <= UNI_MAX_BMP)
|
|
||||||
{
|
|
||||||
/* Target is a character <= 0xFFFF */
|
|
||||||
/* UTF-16 surrogate values are illegal in UTF-32 */
|
|
||||||
if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END)
|
|
||||||
{
|
|
||||||
#ifdef UTF_STRICT
|
|
||||||
if (flags == strictConversion)
|
|
||||||
{
|
|
||||||
source -= (extraBytesToRead+1); /* return to the illegal value itself */
|
|
||||||
result = sourceIllegal;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
dest += UNI_REPLACEMENT_CHAR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dest += (UTF16)ch; /* normal case */
|
|
||||||
}
|
|
||||||
} else if (ch > UNI_MAX_UTF16)
|
|
||||||
{
|
|
||||||
#ifdef UTF_STRICT
|
|
||||||
if (flags == strictConversion)
|
|
||||||
{
|
|
||||||
result = sourceIllegal;
|
|
||||||
source -= (extraBytesToRead+1); /* return to the start */
|
|
||||||
break; /* Bail out; shouldn't continue */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
dest += UNI_REPLACEMENT_CHAR;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
ch -= halfBase;
|
|
||||||
dest += (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
|
|
||||||
dest += (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
Note A.
|
|
||||||
The fall-through switches in UTF-8 reading code save a
|
|
||||||
temp variable, some decrements & conditionals. The switches
|
|
||||||
are equivalent to the following loop:
|
|
||||||
{
|
|
||||||
int tmpBytesToRead = extraBytesToRead+1;
|
|
||||||
do {
|
|
||||||
ch += *source++;
|
|
||||||
--tmpBytesToRead;
|
|
||||||
if (tmpBytesToRead) ch <<= 6;
|
|
||||||
} while (tmpBytesToRead > 0);
|
|
||||||
}
|
|
||||||
In UTF-8 writing code, the switches on "bytesToWrite" are
|
|
||||||
similarly unrolled loops.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
wstring Convert( const string& src )
|
|
||||||
{
|
|
||||||
wstring dest;
|
|
||||||
Convert( src, dest );
|
|
||||||
return dest;
|
|
||||||
}
|
|
||||||
|
|
||||||
string Convert( const wstring& src )
|
|
||||||
{
|
|
||||||
string dest;
|
|
||||||
Convert( src, dest );
|
|
||||||
return dest;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
#ifndef __CONVERTUTF_H__
|
|
||||||
#define __CONVERTUTF_H__
|
|
||||||
|
|
||||||
namespace Unicode
|
|
||||||
{
|
|
||||||
|
|
||||||
typedef unsigned long UTF32; /* at least 32 bits */
|
|
||||||
typedef wchar_t UTF16; /* at least 16 bits */
|
|
||||||
typedef unsigned char UTF8; /* typically 8 bits */
|
|
||||||
|
|
||||||
enum ConversionResult
|
|
||||||
{
|
|
||||||
ConversionOK, /* conversion successful */
|
|
||||||
SourceExhausted, /* partial character in source, but hit end */
|
|
||||||
SourceIllegal /* source sequence is illegal/malformed */
|
|
||||||
};
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Converts from UTF-16 to UTF-8.
|
|
||||||
/// </summary>
|
|
||||||
void Convert( const std::wstring& src, std::string& dest );
|
|
||||||
std::string Convert( const std::wstring& src );
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Converts from UTF-16 to UTF-8.
|
|
||||||
/// </summary>
|
|
||||||
void Convert( const std::string& src, std::wstring& dest );
|
|
||||||
std::wstring Convert( const std::string& src );
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Exception
|
|
||||||
{
|
|
||||||
template< typename ResultType >
|
|
||||||
class UTFConversion : public std::runtime_error
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
const ResultType PartialResult;
|
|
||||||
|
|
||||||
virtual ~UTFConversion() throw() {}
|
|
||||||
UTFConversion( const ResultType& result, const std::string& msg ) :
|
|
||||||
runtime_error( msg ),
|
|
||||||
PartialResult( result ) {}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __CONVERTUTF_H__
|
|
|
@ -21,7 +21,7 @@ int crazy_debug=0;
|
||||||
|
|
||||||
char s[4096];
|
char s[4096];
|
||||||
|
|
||||||
FILE *spu2Log;
|
FILE *spu2Log = NULL;
|
||||||
|
|
||||||
void FileLog(const char *fmt, ...) {
|
void FileLog(const char *fmt, ...) {
|
||||||
#ifdef SPU2_LOG
|
#ifdef SPU2_LOG
|
||||||
|
@ -98,7 +98,7 @@ void DoFullDump()
|
||||||
|
|
||||||
if(MemDump())
|
if(MemDump())
|
||||||
{
|
{
|
||||||
dump = fopen( Unicode::Convert( MemDumpFileName ).c_str(), "wb" );
|
dump = fopen( wxString(MemDumpFileName).ToUTF8(), "wb" );
|
||||||
if (dump)
|
if (dump)
|
||||||
{
|
{
|
||||||
fwrite(_spu2mem,0x200000,1,dump);
|
fwrite(_spu2mem,0x200000,1,dump);
|
||||||
|
@ -107,7 +107,7 @@ void DoFullDump()
|
||||||
}
|
}
|
||||||
if(RegDump())
|
if(RegDump())
|
||||||
{
|
{
|
||||||
dump = fopen( Unicode::Convert( RegDumpFileName ).c_str(), "wb" );
|
dump = fopen( wxString(RegDumpFileName).ToUTF8(), "wb" );
|
||||||
if (dump)
|
if (dump)
|
||||||
{
|
{
|
||||||
fwrite(spu2regs,0x2000,1,dump);
|
fwrite(spu2regs,0x2000,1,dump);
|
||||||
|
@ -116,7 +116,7 @@ void DoFullDump()
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!CoresDump()) return;
|
if(!CoresDump()) return;
|
||||||
dump = fopen( Unicode::Convert( CoresDumpFileName ).c_str(), "wt" );
|
dump = fopen( wxString(CoresDumpFileName).ToUTF8(), "wt" );
|
||||||
if (dump)
|
if (dump)
|
||||||
{
|
{
|
||||||
for(c=0;c<2;c++)
|
for(c=0;c<2;c++)
|
||||||
|
|
|
@ -21,10 +21,14 @@
|
||||||
|
|
||||||
extern FILE *spu2Log;
|
extern FILE *spu2Log;
|
||||||
|
|
||||||
void FileLog(const char *fmt, ...);
|
extern void FileLog(const char *fmt, ...);
|
||||||
void ConLog(const char *fmt, ...);
|
extern void ConLog(const char *fmt, ...);
|
||||||
|
|
||||||
void DoFullDump();
|
extern void DoFullDump();
|
||||||
|
|
||||||
|
extern FILE* OpenBinaryLog( const wxString& logfile );
|
||||||
|
extern FILE* OpenLog( const wxString& logfile );
|
||||||
|
extern FILE* OpenDump( const wxString& logfile );
|
||||||
|
|
||||||
namespace WaveDump
|
namespace WaveDump
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,21 +26,20 @@ static FILE *DMA4LogFile = NULL;
|
||||||
static FILE *DMA7LogFile = NULL;
|
static FILE *DMA7LogFile = NULL;
|
||||||
static FILE *ADMA4LogFile = NULL;
|
static FILE *ADMA4LogFile = NULL;
|
||||||
static FILE *ADMA7LogFile = NULL;
|
static FILE *ADMA7LogFile = NULL;
|
||||||
static FILE *ADMAOutLogFile = NULL;
|
static FILE *ADMAOutLogFile = NULL;
|
||||||
|
|
||||||
static FILE *REGWRTLogFile[2] = {0,0};
|
static FILE *REGWRTLogFile[2] = {0,0};
|
||||||
|
|
||||||
void DMALogOpen()
|
void DMALogOpen()
|
||||||
{
|
{
|
||||||
if(!DMALog()) return;
|
if(!DMALog()) return;
|
||||||
DMA4LogFile = fopen( Unicode::Convert( DMA4LogFileName ).c_str(), "wb");
|
DMA4LogFile = OpenBinaryLog( DMA4LogFileName );
|
||||||
DMA7LogFile = fopen( Unicode::Convert( DMA7LogFileName ).c_str(), "wb");
|
DMA7LogFile = OpenBinaryLog( DMA7LogFileName );
|
||||||
ADMA4LogFile = fopen( "logs/adma4.raw", "wb" );
|
ADMA4LogFile = OpenBinaryLog( L"adma4.raw" );
|
||||||
ADMA7LogFile = fopen( "logs/adma7.raw", "wb" );
|
ADMA7LogFile = OpenBinaryLog( L"adma7.raw" );
|
||||||
ADMAOutLogFile = fopen( "logs/admaOut.raw", "wb" );
|
ADMAOutLogFile = OpenBinaryLog( L"admaOut.raw" );
|
||||||
//REGWRTLogFile[0]=fopen("logs/RegWrite0.raw","wb");
|
|
||||||
//REGWRTLogFile[1]=fopen("logs/RegWrite1.raw","wb");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMA4LogWrite(void *lpData, u32 ulSize) {
|
void DMA4LogWrite(void *lpData, u32 ulSize) {
|
||||||
if(!DMALog()) return;
|
if(!DMALog()) return;
|
||||||
if (!DMA4LogFile) return;
|
if (!DMA4LogFile) return;
|
||||||
|
|
|
@ -42,9 +42,6 @@ namespace soundtouch
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using std::string;
|
|
||||||
using std::wstring;
|
|
||||||
|
|
||||||
// This will be brought in later anyways, but if we bring it in now, it'll avoid
|
// This will be brought in later anyways, but if we bring it in now, it'll avoid
|
||||||
// warnings about redefining __LINUX__.
|
// warnings about redefining __LINUX__.
|
||||||
#include "Utilities/Dependencies.h"
|
#include "Utilities/Dependencies.h"
|
||||||
|
@ -105,8 +102,6 @@ extern void SysMessage(const wchar_t *fmt, ...);
|
||||||
#include "Utilities/Exceptions.h"
|
#include "Utilities/Exceptions.h"
|
||||||
#include "Utilities/SafeArray.h"
|
#include "Utilities/SafeArray.h"
|
||||||
|
|
||||||
#include "ConvertUTF.h"
|
|
||||||
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include "regs.h"
|
#include "regs.h"
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ void CfgWriteInt(const wchar_t* Section, const wchar_t* Name, int Value)
|
||||||
spuConfig->Write(Name, Value);
|
spuConfig->Write(Name, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wstring& Data)
|
void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wxString& Data)
|
||||||
{
|
{
|
||||||
setIni(Section);
|
setIni(Section);
|
||||||
spuConfig->Write(Name, Data);
|
spuConfig->Write(Name, Data);
|
||||||
|
@ -90,7 +90,7 @@ void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wxString& Data, int
|
||||||
Data = spuConfig->Read(Name, Default);
|
Data = spuConfig->Read(Name, Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wstring& Data, int DataSize, const wchar_t* Default)
|
void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wxString& Data, int DataSize, const wchar_t* Default)
|
||||||
{
|
{
|
||||||
wxString temp;
|
wxString temp;
|
||||||
CfgReadStr(Section, Name, temp, DataSize, Default);
|
CfgReadStr(Section, Name, temp, DataSize, Default);
|
||||||
|
|
|
@ -65,8 +65,8 @@ void ReadSettings()
|
||||||
EffectsDisabled = CfgReadBool( L"MIXING", L"Disable_Effects", false );
|
EffectsDisabled = CfgReadBool( L"MIXING", L"Disable_Effects", false );
|
||||||
ReverbBoost = CfgReadInt( L"MIXING",L"Reverb_Boost", 0 );
|
ReverbBoost = CfgReadInt( L"MIXING",L"Reverb_Boost", 0 );
|
||||||
|
|
||||||
wstring temp;
|
wxString temp;
|
||||||
CfgReadStr( L"OUTPUT", L"Output_Module", temp, 127, PortaudioOut->GetIdent() );
|
CfgReadStr( L"OUTPUT", L"Output_Module", temp, PortaudioOut->GetIdent() );
|
||||||
OutputModule = FindOutputModuleById( temp.c_str() );// find the driver index of this module
|
OutputModule = FindOutputModuleById( temp.c_str() );// find the driver index of this module
|
||||||
|
|
||||||
SndOutLatencyMS = CfgReadInt(L"OUTPUT",L"Latency", 150);
|
SndOutLatencyMS = CfgReadInt(L"OUTPUT",L"Latency", 150);
|
||||||
|
|
|
@ -36,30 +36,57 @@ bool _CoresDump=false;
|
||||||
bool _MemDump=false;
|
bool _MemDump=false;
|
||||||
bool _RegDump=false;
|
bool _RegDump=false;
|
||||||
|
|
||||||
wchar_t AccessLogFileName[255];
|
// this is set true if PCSX2 invokes the SetLogDir callback, which tells SPU2-X to use that over
|
||||||
wchar_t WaveLogFileName[255];
|
// the configured crap in the ini file.
|
||||||
|
static bool LogLocationSetByPcsx2 = false;
|
||||||
|
|
||||||
wchar_t DMA4LogFileName[255];
|
static wxDirName LogsFolder;
|
||||||
wchar_t DMA7LogFileName[255];
|
static wxDirName DumpsFolder;
|
||||||
|
|
||||||
wchar_t CoresDumpFileName[255];
|
wxString AccessLogFileName;
|
||||||
wchar_t MemDumpFileName[255];
|
wxString DMA4LogFileName;
|
||||||
wchar_t RegDumpFileName[255];
|
wxString DMA7LogFileName;
|
||||||
|
|
||||||
|
wxString CoresDumpFileName;
|
||||||
|
wxString MemDumpFileName;
|
||||||
|
wxString RegDumpFileName;
|
||||||
|
|
||||||
namespace DebugConfig {
|
namespace DebugConfig {
|
||||||
|
|
||||||
|
void CfgSetLogDir( const char* dir )
|
||||||
|
{
|
||||||
|
LogsFolder = (dir==NULL) ? wxString(L"logs") : fromUTF8(dir);
|
||||||
|
DumpsFolder = (dir==NULL) ? wxString(L"logs") : fromUTF8(dir);
|
||||||
|
LogLocationSetByPcsx2 = (dir!=NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE* OpenBinaryLog( const wxString& logfile )
|
||||||
|
{
|
||||||
|
return wxFopen( Path::Combine(LogsFolder, logfile), L"wb" );
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE* OpenLog( const wxString& logfile )
|
||||||
|
{
|
||||||
|
return wxFopen( Path::Combine(LogsFolder, logfile), L"w" );
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE* OpenDump( const wxString& logfile )
|
||||||
|
{
|
||||||
|
return wxFopen( Path::Combine(DumpsFolder, logfile), L"w" );
|
||||||
|
}
|
||||||
|
|
||||||
static const wchar_t* Section = L"DEBUG";
|
static const wchar_t* Section = L"DEBUG";
|
||||||
|
|
||||||
static void set_default_filenames()
|
static void set_default_filenames()
|
||||||
{
|
{
|
||||||
swprintf(AccessLogFileName, 255, L"logs/SPU2Log.txt");
|
AccessLogFileName = L"SPU2Log.txt";
|
||||||
swprintf(WaveLogFileName, 255, L"logs/SPU2log.wav");
|
WaveLogFileName = L"SPU2log.wav";
|
||||||
swprintf(DMA4LogFileName, 255, L"logs/logs/SPU2dma4.dat");
|
DMA4LogFileName = L"SPU2dma4.dat";
|
||||||
swprintf(DMA7LogFileName, 255, L"logs/SPU2dma7.dat");
|
DMA7LogFileName = L"SPU2dma7.dat";
|
||||||
|
|
||||||
swprintf(CoresDumpFileName, 255, L"logs/SPU2Cores.txt");
|
CoresDumpFileName = L"SPU2Cores.txt";
|
||||||
swprintf(MemDumpFileName, 255, L"logs/SPU2mem.dat");
|
MemDumpFileName = L"SPU2mem.dat";
|
||||||
swprintf(RegDumpFileName, 255, L"logs/SPU2regs.dat");
|
RegDumpFileName = L"SPU2regs.dat";
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReadSettings()
|
void ReadSettings()
|
||||||
|
|
|
@ -29,13 +29,14 @@ namespace DebugConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void CfgSetSettingsDir(const char* dir);
|
extern void CfgSetSettingsDir(const char* dir);
|
||||||
|
extern void CfgSetLogDir(const char* dir);
|
||||||
|
|
||||||
extern void CfgWriteBool(const wchar_t* Section, const wchar_t* Name, bool Value);
|
extern void CfgWriteBool(const wchar_t* Section, const wchar_t* Name, bool Value);
|
||||||
extern void CfgWriteInt(const wchar_t* Section, const wchar_t* Name, int Value);
|
extern void CfgWriteInt(const wchar_t* Section, const wchar_t* Name, int Value);
|
||||||
extern void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wstring& Data);
|
extern void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wxString& Data);
|
||||||
|
|
||||||
extern bool CfgReadBool(const wchar_t *Section,const wchar_t* Name, bool Default);
|
extern bool CfgReadBool(const wchar_t *Section,const wchar_t* Name, bool Default);
|
||||||
extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wstring& Data, int DataSize, const wchar_t* Default);
|
extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wxString& Data, const wchar_t* Default);
|
||||||
//extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wchar_t* Data, int DataSize, const wchar_t* Default);
|
//extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wchar_t* Data, int DataSize, const wchar_t* Default);
|
||||||
extern int CfgReadInt(const wchar_t* Section, const wchar_t* Name,int Default);
|
extern int CfgReadInt(const wchar_t* Section, const wchar_t* Name,int Default);
|
||||||
|
|
||||||
|
|
|
@ -197,6 +197,11 @@ EXPORT_C_(void) CALLBACK SPU2setSettingsDir(const char* dir)
|
||||||
CfgSetSettingsDir( dir );
|
CfgSetSettingsDir( dir );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXPORT_C_(void) CALLBACK SPU2setLogDir(const char* dir)
|
||||||
|
{
|
||||||
|
CfgSetLogDir( dir );
|
||||||
|
}
|
||||||
|
|
||||||
EXPORT_C_(s32) SPU2dmaRead(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed)
|
EXPORT_C_(s32) SPU2dmaRead(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed)
|
||||||
{
|
{
|
||||||
if(channel==4)
|
if(channel==4)
|
||||||
|
@ -299,7 +304,7 @@ EXPORT_C_(s32) SPU2init()
|
||||||
#ifdef SPU2_LOG
|
#ifdef SPU2_LOG
|
||||||
if(AccessLog())
|
if(AccessLog())
|
||||||
{
|
{
|
||||||
spu2Log = fopen( Unicode::Convert( AccessLogFileName ).c_str(), "w" );
|
spu2Log = OpenLog( AccessLogFileName );
|
||||||
setvbuf(spu2Log, NULL, _IONBF, 0);
|
setvbuf(spu2Log, NULL, _IONBF, 0);
|
||||||
FileLog("SPU2init\n");
|
FileLog("SPU2init\n");
|
||||||
}
|
}
|
||||||
|
@ -335,7 +340,7 @@ EXPORT_C_(s32) SPU2init()
|
||||||
|
|
||||||
memcpy(regtable, regtable_original, sizeof(regtable));
|
memcpy(regtable, regtable_original, sizeof(regtable));
|
||||||
|
|
||||||
for(int mem=0;mem<0x800;mem++)
|
for(uint mem=0;mem<0x800;mem++)
|
||||||
{
|
{
|
||||||
u16 *ptr = regtable[mem>>1];
|
u16 *ptr = regtable[mem>>1];
|
||||||
if(!ptr) {
|
if(!ptr) {
|
||||||
|
@ -349,27 +354,8 @@ EXPORT_C_(s32) SPU2init()
|
||||||
Cores[1].Reset(1);
|
Cores[1].Reset(1);
|
||||||
|
|
||||||
DMALogOpen();
|
DMALogOpen();
|
||||||
|
|
||||||
/*for(v=0;v<16384;v++)
|
|
||||||
{
|
|
||||||
logvolume[v]=(s32)(s32)floor(log((double)(v+1))*3376.7);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Initializes lowpass filter for reverb in mixer.cpp
|
|
||||||
//LowPassFilterInit();
|
|
||||||
InitADSR();
|
InitADSR();
|
||||||
|
|
||||||
#ifdef STREAM_DUMP
|
|
||||||
il0=fopen("logs/spu2input0.pcm","wb");
|
|
||||||
il1=fopen("logs/spu2input1.pcm","wb");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef EFFECTS_DUMP
|
|
||||||
el0=fopen("logs/spu2fx0.pcm","wb");
|
|
||||||
el1=fopen("logs/spu2fx1.pcm","wb");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef S2R_ENABLE
|
#ifdef S2R_ENABLE
|
||||||
if(!replay_mode)
|
if(!replay_mode)
|
||||||
s2r_open("replay_dump.s2r");
|
s2r_open("replay_dump.s2r");
|
||||||
|
|
|
@ -41,7 +41,7 @@ private:
|
||||||
// Configuration Vars (unused still)
|
// Configuration Vars (unused still)
|
||||||
|
|
||||||
int m_ApiId;
|
int m_ApiId;
|
||||||
wstring m_Device;
|
wxString m_Device;
|
||||||
|
|
||||||
bool m_UseHardware;
|
bool m_UseHardware;
|
||||||
|
|
||||||
|
@ -293,10 +293,10 @@ public:
|
||||||
|
|
||||||
void ReadSettings()
|
void ReadSettings()
|
||||||
{
|
{
|
||||||
wstring api=L"EMPTYEMPTYEMPTY";
|
wxString api( L"EMPTYEMPTYEMPTY" );
|
||||||
m_Device = L"EMPTYEMPTYEMPTY";
|
m_Device = L"EMPTYEMPTYEMPTY";
|
||||||
CfgReadStr( L"PORTAUDIO", L"HostApi", api, 254, L"Unknown" );
|
CfgReadStr( L"PORTAUDIO", L"HostApi", api, L"Unknown" );
|
||||||
CfgReadStr( L"PORTAUDIO", L"Device", m_Device, 254, L"default" );
|
CfgReadStr( L"PORTAUDIO", L"Device", m_Device, L"default" );
|
||||||
|
|
||||||
m_ApiId = -1;
|
m_ApiId = -1;
|
||||||
if(api == L"InDevelopment") m_ApiId = paInDevelopment; /* use while developing support for a new host API */
|
if(api == L"InDevelopment") m_ApiId = paInDevelopment; /* use while developing support for a new host API */
|
||||||
|
@ -319,7 +319,7 @@ public:
|
||||||
|
|
||||||
void WriteSettings() const
|
void WriteSettings() const
|
||||||
{
|
{
|
||||||
wstring api;
|
wxString api;
|
||||||
switch(m_ApiId)
|
switch(m_ApiId)
|
||||||
{
|
{
|
||||||
case paInDevelopment: api = L"InDevelopment"; break; /* use while developing support for a new host API */
|
case paInDevelopment: api = L"InDevelopment"; break; /* use while developing support for a new host API */
|
||||||
|
|
|
@ -92,9 +92,9 @@ void CfgWriteInt(const TCHAR* Section, const TCHAR* Name, int Value)
|
||||||
WritePrivateProfileString( Section, Name, Data, CfgFile );
|
WritePrivateProfileString( Section, Name, Data, CfgFile );
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
void CfgWriteStr(const TCHAR* Section, const TCHAR* Name, const wstring& Data)
|
void CfgWriteStr(const TCHAR* Section, const TCHAR* Name, const wxString& Data)
|
||||||
{
|
{
|
||||||
WritePrivateProfileString( Section, Name, Data.c_str(), CfgFile );
|
WritePrivateProfileString( Section, Name, Data, CfgFile );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -143,10 +143,10 @@ void CfgReadStr(const TCHAR* Section, const TCHAR* Name, TCHAR* Data, int DataSi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CfgReadStr(const TCHAR* Section, const TCHAR* Name, wstring& Data, int DataSize, const TCHAR* Default)
|
void CfgReadStr(const TCHAR* Section, const TCHAR* Name, wxString& Data, const TCHAR* Default)
|
||||||
{
|
{
|
||||||
wchar_t workspace[512];
|
wchar_t workspace[512];
|
||||||
GetPrivateProfileString(Section,Name,L"",workspace,DataSize,CfgFile);
|
GetPrivateProfileString(Section,Name,L"",workspace,ArraySize(workspace),CfgFile);
|
||||||
|
|
||||||
Data = workspace;
|
Data = workspace;
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ void ReadSettings()
|
||||||
dspPluginEnabled= CfgReadBool(L"DSP PLUGIN",L"Enabled",false);
|
dspPluginEnabled= CfgReadBool(L"DSP PLUGIN",L"Enabled",false);
|
||||||
|
|
||||||
// Read DSOUNDOUT and WAVEOUT configs:
|
// Read DSOUNDOUT and WAVEOUT configs:
|
||||||
CfgReadStr( L"WAVEOUT", L"Device", Config_WaveOut.Device, 254, L"default" );
|
CfgReadStr( L"WAVEOUT", L"Device", Config_WaveOut.Device, L"default" );
|
||||||
Config_WaveOut.NumBuffers = CfgReadInt( L"WAVEOUT", L"Buffer_Count", 4 );
|
Config_WaveOut.NumBuffers = CfgReadInt( L"WAVEOUT", L"Buffer_Count", 4 );
|
||||||
|
|
||||||
DSoundOut->ReadSettings();
|
DSoundOut->ReadSettings();
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
#include "Dialogs.h"
|
#include "Dialogs.h"
|
||||||
|
#include "Utilities\Path.h"
|
||||||
|
|
||||||
|
|
||||||
bool DebugEnabled=false;
|
bool DebugEnabled=false;
|
||||||
|
@ -36,21 +37,49 @@ bool _CoresDump=false;
|
||||||
bool _MemDump=false;
|
bool _MemDump=false;
|
||||||
bool _RegDump=false;
|
bool _RegDump=false;
|
||||||
|
|
||||||
|
// this is set true if PCSX2 invokes the SetLogDir callback, which tells SPU2-X to use that over
|
||||||
|
// the configured crap in the ini file.
|
||||||
|
static bool LogLocationSetByPcsx2 = false;
|
||||||
|
|
||||||
|
static wxString CfgLogsFolder;
|
||||||
|
static wxString CfgDumpsFolder;
|
||||||
|
|
||||||
wchar_t AccessLogFileName[255];
|
static wxDirName LogsFolder;
|
||||||
wchar_t WaveLogFileName[255];
|
static wxDirName DumpsFolder;
|
||||||
|
|
||||||
wchar_t DMA4LogFileName[255];
|
wxString AccessLogFileName;
|
||||||
wchar_t DMA7LogFileName[255];
|
wxString DMA4LogFileName;
|
||||||
|
wxString DMA7LogFileName;
|
||||||
|
|
||||||
wchar_t CoresDumpFileName[255];
|
wxString CoresDumpFileName;
|
||||||
wchar_t MemDumpFileName[255];
|
wxString MemDumpFileName;
|
||||||
wchar_t RegDumpFileName[255];
|
wxString RegDumpFileName;
|
||||||
|
|
||||||
|
void CfgSetLogDir( const char* dir )
|
||||||
|
{
|
||||||
|
LogsFolder = (dir==NULL) ? wxString(L"logs") : fromUTF8(dir);
|
||||||
|
DumpsFolder = (dir==NULL) ? wxString(L"logs") : fromUTF8(dir);
|
||||||
|
LogLocationSetByPcsx2 = (dir!=NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE* OpenBinaryLog( const wxString& logfile )
|
||||||
|
{
|
||||||
|
return wxFopen( Path::Combine(LogsFolder, logfile), L"wb" );
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE* OpenLog( const wxString& logfile )
|
||||||
|
{
|
||||||
|
return wxFopen( Path::Combine(LogsFolder, logfile), L"w" );
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE* OpenDump( const wxString& logfile )
|
||||||
|
{
|
||||||
|
return wxFopen( Path::Combine(DumpsFolder, logfile), L"w" );
|
||||||
|
}
|
||||||
|
|
||||||
namespace DebugConfig {
|
namespace DebugConfig {
|
||||||
|
|
||||||
static const TCHAR* Section = L"DEBUG";
|
static const wxChar* Section = L"DEBUG";
|
||||||
|
|
||||||
void ReadSettings()
|
void ReadSettings()
|
||||||
{
|
{
|
||||||
|
@ -71,14 +100,22 @@ void ReadSettings()
|
||||||
_MemDump = CfgReadBool(Section, L"Dump_Memory",0);
|
_MemDump = CfgReadBool(Section, L"Dump_Memory",0);
|
||||||
_RegDump = CfgReadBool(Section, L"Dump_Regs",0);
|
_RegDump = CfgReadBool(Section, L"Dump_Regs",0);
|
||||||
|
|
||||||
CfgReadStr(Section,L"Access_Log_Filename",AccessLogFileName,255,L"logs\\SPU2Log.txt");
|
CfgReadStr(Section,L"Logs_Folder", CfgLogsFolder, L"logs");
|
||||||
CfgReadStr(Section,L"WaveLog_Filename", WaveLogFileName, 255,L"logs\\SPU2log.wav");
|
CfgReadStr(Section,L"Dumps_Folder",CfgDumpsFolder,L"logs");
|
||||||
CfgReadStr(Section,L"DMA4Log_Filename", DMA4LogFileName, 255,L"logs\\SPU2dma4.dat");
|
|
||||||
CfgReadStr(Section,L"DMA7Log_Filename", DMA7LogFileName, 255,L"logs\\SPU2dma7.dat");
|
|
||||||
|
|
||||||
CfgReadStr(Section,L"Info_Dump_Filename",CoresDumpFileName,255,L"logs\\SPU2Cores.txt");
|
CfgReadStr(Section,L"Access_Log_Filename",AccessLogFileName, L"SPU2Log.txt");
|
||||||
CfgReadStr(Section,L"Mem_Dump_Filename", MemDumpFileName, 255,L"logs\\SPU2mem.dat");
|
CfgReadStr(Section,L"DMA4Log_Filename", DMA4LogFileName, L"SPU2dma4.dat");
|
||||||
CfgReadStr(Section,L"Reg_Dump_Filename", RegDumpFileName, 255,L"logs\\SPU2regs.dat");
|
CfgReadStr(Section,L"DMA7Log_Filename", DMA7LogFileName, L"SPU2dma7.dat");
|
||||||
|
|
||||||
|
CfgReadStr(Section,L"Info_Dump_Filename", CoresDumpFileName, L"SPU2Cores.txt");
|
||||||
|
CfgReadStr(Section,L"Mem_Dump_Filename", MemDumpFileName, L"SPU2mem.dat");
|
||||||
|
CfgReadStr(Section,L"Reg_Dump_Filename", RegDumpFileName, L"SPU2regs.dat");
|
||||||
|
|
||||||
|
if( !LogLocationSetByPcsx2 )
|
||||||
|
{
|
||||||
|
LogsFolder = CfgLogsFolder;
|
||||||
|
DumpsFolder = CfgLogsFolder;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,15 +139,18 @@ void WriteSettings()
|
||||||
CfgWriteBool(Section,L"Dump_Memory",_MemDump);
|
CfgWriteBool(Section,L"Dump_Memory",_MemDump);
|
||||||
CfgWriteBool(Section,L"Dump_Regs", _RegDump);
|
CfgWriteBool(Section,L"Dump_Regs", _RegDump);
|
||||||
|
|
||||||
|
// None of the logs strings are changable via GUI, so no point in bothering to
|
||||||
|
// write them back out.
|
||||||
|
CfgWriteStr(Section,L"Logs_Folder", CfgLogsFolder);
|
||||||
|
CfgWriteStr(Section,L"Dumps_Folder",CfgDumpsFolder);
|
||||||
|
|
||||||
CfgWriteStr(Section,L"Access_Log_Filename",AccessLogFileName);
|
CfgWriteStr(Section,L"Access_Log_Filename",AccessLogFileName);
|
||||||
CfgWriteStr(Section,L"WaveLog_Filename", WaveLogFileName);
|
|
||||||
CfgWriteStr(Section,L"DMA4Log_Filename", DMA4LogFileName);
|
CfgWriteStr(Section,L"DMA4Log_Filename", DMA4LogFileName);
|
||||||
CfgWriteStr(Section,L"DMA7Log_Filename", DMA7LogFileName);
|
CfgWriteStr(Section,L"DMA7Log_Filename", DMA7LogFileName);
|
||||||
|
|
||||||
CfgWriteStr(Section,L"Info_Dump_Filename",CoresDumpFileName);
|
CfgWriteStr(Section,L"Info_Dump_Filename",CoresDumpFileName);
|
||||||
CfgWriteStr(Section,L"Mem_Dump_Filename", MemDumpFileName);
|
CfgWriteStr(Section,L"Mem_Dump_Filename", MemDumpFileName);
|
||||||
CfgWriteStr(Section,L"Reg_Dump_Filename", RegDumpFileName);
|
CfgWriteStr(Section,L"Reg_Dump_Filename", RegDumpFileName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void EnableMessages( HWND hWnd )
|
static void EnableMessages( HWND hWnd )
|
||||||
|
|
|
@ -48,18 +48,19 @@ extern int GetSliderValue( HWND hWnd, int idc );
|
||||||
extern BOOL DoHandleScrollMessage( HWND hwndDisplay, WPARAM wParam, LPARAM lParam );
|
extern BOOL DoHandleScrollMessage( HWND hwndDisplay, WPARAM wParam, LPARAM lParam );
|
||||||
|
|
||||||
extern void CfgSetSettingsDir( const char* dir );
|
extern void CfgSetSettingsDir( const char* dir );
|
||||||
|
extern void CfgSetLogDir( const char* dir );
|
||||||
|
|
||||||
extern bool CfgFindName( const TCHAR *Section, const TCHAR* Name);
|
extern bool CfgFindName( const TCHAR *Section, const TCHAR* Name);
|
||||||
|
|
||||||
extern void CfgWriteBool(const TCHAR* Section, const TCHAR* Name, bool Value);
|
extern void CfgWriteBool(const TCHAR* Section, const TCHAR* Name, bool Value);
|
||||||
extern void CfgWriteInt(const TCHAR* Section, const TCHAR* Name, int Value);
|
extern void CfgWriteInt(const TCHAR* Section, const TCHAR* Name, int Value);
|
||||||
extern void CfgWriteStr(const TCHAR* Section, const TCHAR* Name, const wstring& Data);
|
extern void CfgWriteStr(const TCHAR* Section, const TCHAR* Name, const wxString& Data);
|
||||||
|
|
||||||
extern bool CfgReadBool(const TCHAR *Section,const TCHAR* Name, bool Default);
|
extern bool CfgReadBool(const TCHAR *Section,const TCHAR* Name, bool Default);
|
||||||
extern void CfgReadStr(const TCHAR* Section, const TCHAR* Name, wstring& Data, int DataSize, const TCHAR* Default);
|
extern void CfgReadStr(const TCHAR* Section, const TCHAR* Name, wxString& Data, const TCHAR* Default);
|
||||||
extern void CfgReadStr(const TCHAR* Section, const TCHAR* Name, TCHAR* Data, int DataSize, const TCHAR* Default);
|
extern void CfgReadStr(const TCHAR* Section, const TCHAR* Name, TCHAR* Data, int DataSize, const TCHAR* Default);
|
||||||
extern int CfgReadInt(const TCHAR* Section, const TCHAR* Name,int Default);
|
extern int CfgReadInt(const TCHAR* Section, const TCHAR* Name,int Default);
|
||||||
|
|
||||||
|
|
||||||
// Items Specific to DirectSound
|
// Items Specific to DirectSound
|
||||||
#define STRFY(x) #x
|
#define STRFY(x) #x
|
||||||
#define verifyc(x) Verifyc(x,STRFY(x))
|
#define verifyc(x) Verifyc(x,STRFY(x))
|
||||||
|
@ -68,7 +69,7 @@ extern void Verifyc(HRESULT hr, const char* fn);
|
||||||
|
|
||||||
struct ds_device_data
|
struct ds_device_data
|
||||||
{
|
{
|
||||||
std::wstring name;
|
wxString name;
|
||||||
GUID guid;
|
GUID guid;
|
||||||
bool hasGuid;
|
bool hasGuid;
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,7 +33,7 @@ private:
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Configuration Vars
|
// Configuration Vars
|
||||||
|
|
||||||
wstring m_Device;
|
wxString m_Device;
|
||||||
u8 m_NumBuffers;
|
u8 m_NumBuffers;
|
||||||
bool m_DisableGlobalFocus;
|
bool m_DisableGlobalFocus;
|
||||||
bool m_UseHardware;
|
bool m_UseHardware;
|
||||||
|
@ -455,7 +455,7 @@ public:
|
||||||
|
|
||||||
void ReadSettings()
|
void ReadSettings()
|
||||||
{
|
{
|
||||||
CfgReadStr( L"DSOUNDOUT", L"Device", m_Device, 254, L"default" );
|
CfgReadStr( L"DSOUNDOUT", L"Device", m_Device, L"default" );
|
||||||
m_NumBuffers = CfgReadInt( L"DSOUNDOUT", L"Buffer_Count", 5 );
|
m_NumBuffers = CfgReadInt( L"DSOUNDOUT", L"Buffer_Count", 5 );
|
||||||
m_DisableGlobalFocus = CfgReadBool( L"DSOUNDOUT", L"Disable_Global_Focus", false );
|
m_DisableGlobalFocus = CfgReadBool( L"DSOUNDOUT", L"Disable_Global_Focus", false );
|
||||||
m_UseHardware = CfgReadBool( L"DSOUNDOUT", L"Use_Hardware", false );
|
m_UseHardware = CfgReadBool( L"DSOUNDOUT", L"Use_Hardware", false );
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace Exception
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const HRESULT ErrorCode;
|
const HRESULT ErrorCode;
|
||||||
string m_Message;
|
std::string m_Message;
|
||||||
|
|
||||||
const char* CMessage() const
|
const char* CMessage() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,41 +23,41 @@ EXPORTS
|
||||||
PS2EgetLibType @2
|
PS2EgetLibType @2
|
||||||
PS2EgetLibName @3
|
PS2EgetLibName @3
|
||||||
PS2EgetLibVersion2 @4
|
PS2EgetLibVersion2 @4
|
||||||
|
|
||||||
SPU2init @5
|
SPU2init @5
|
||||||
SPU2shutdown @6
|
SPU2shutdown @6
|
||||||
SPU2open @7
|
SPU2open @7
|
||||||
SPU2close @8
|
SPU2close @8
|
||||||
SPU2write @9
|
|
||||||
SPU2read @10
|
|
||||||
SPU2async @11
|
|
||||||
|
|
||||||
SPU2readDMA4Mem @12
|
SPU2configure @9
|
||||||
SPU2writeDMA4Mem @13
|
SPU2test @10
|
||||||
SPU2readDMA7Mem @14
|
SPU2about @11
|
||||||
SPU2writeDMA7Mem @15
|
SPU2freeze @12
|
||||||
SPU2interruptDMA4 @16
|
|
||||||
SPU2interruptDMA7 @17
|
SPU2setSettingsDir @13
|
||||||
|
SPU2setLogDir @14
|
||||||
|
|
||||||
|
SPU2write @15
|
||||||
|
SPU2read @16
|
||||||
|
SPU2async @17
|
||||||
|
SPU2dmaRead @18
|
||||||
|
SPU2dmaWrite @19
|
||||||
|
SPU2dmaInterrupt @20
|
||||||
|
|
||||||
|
SPU2readDMA4Mem @21
|
||||||
|
SPU2writeDMA4Mem @22
|
||||||
|
SPU2readDMA7Mem @23
|
||||||
|
SPU2writeDMA7Mem @24
|
||||||
|
SPU2interruptDMA4 @25
|
||||||
|
SPU2interruptDMA7 @26
|
||||||
|
|
||||||
|
SPU2irqCallback @27
|
||||||
|
SPU2setupRecording @28
|
||||||
|
|
||||||
SPU2dmaRead
|
SPU2ReadMemAddr @29
|
||||||
SPU2dmaWrite
|
SPU2WriteMemAddr @30
|
||||||
SPU2dmaInterrupt
|
|
||||||
SPU2setSettingsDir
|
|
||||||
|
|
||||||
SPU2irqCallback @18
|
|
||||||
|
|
||||||
SPU2setupRecording @19
|
SPU2setClockPtr @31
|
||||||
|
SPU2setDMABaseAddr @32
|
||||||
SPU2configure @20
|
|
||||||
SPU2test @21
|
|
||||||
SPU2about @22
|
|
||||||
|
|
||||||
SPU2ReadMemAddr @23
|
|
||||||
SPU2WriteMemAddr @24
|
|
||||||
|
|
||||||
SPU2setClockPtr @25
|
|
||||||
|
|
||||||
SPU2setDMABaseAddr @26
|
SPU2replay = s2r_replay @33
|
||||||
|
|
||||||
SPU2replay = s2r_replay @27
|
|
||||||
|
|
||||||
SPU2freeze @28
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9,00"
|
Version="9.00"
|
||||||
Name="SPU2-X"
|
Name="SPU2-X"
|
||||||
ProjectGUID="{5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}"
|
ProjectGUID="{5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}"
|
||||||
RootNamespace="spu2x"
|
RootNamespace="spu2x"
|
||||||
|
@ -368,14 +368,6 @@
|
||||||
RelativePath="..\Config.h"
|
RelativePath="..\Config.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\ConvertUTF.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\ConvertUTF.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\Global.h"
|
RelativePath="..\Global.h"
|
||||||
>
|
>
|
||||||
|
|
|
@ -37,7 +37,7 @@ extern HINSTANCE hInstance;
|
||||||
|
|
||||||
struct CONFIG_XAUDIO2
|
struct CONFIG_XAUDIO2
|
||||||
{
|
{
|
||||||
std::wstring Device;
|
wxString Device;
|
||||||
s8 NumBuffers;
|
s8 NumBuffers;
|
||||||
|
|
||||||
CONFIG_XAUDIO2() :
|
CONFIG_XAUDIO2() :
|
||||||
|
@ -49,7 +49,7 @@ struct CONFIG_XAUDIO2
|
||||||
|
|
||||||
struct CONFIG_WAVEOUT
|
struct CONFIG_WAVEOUT
|
||||||
{
|
{
|
||||||
std::wstring Device;
|
wxString Device;
|
||||||
s8 NumBuffers;
|
s8 NumBuffers;
|
||||||
|
|
||||||
CONFIG_WAVEOUT() :
|
CONFIG_WAVEOUT() :
|
||||||
|
|
Loading…
Reference in New Issue