mirror of
https://github.com/encounter/dolphin.git
synced 2026-03-30 11:08:26 -07:00
Various changes suggested by cppcheck
- remove unused variables - reduce the scope where it makes sense - correct limits (did you know that strcat()'s last parameter does not include the \0 that is always added?) - set some free()'d pointers to NULL
This commit is contained in:
@@ -15,22 +15,19 @@ soundtouch::SoundTouch soundTouch;
|
||||
//
|
||||
bool OpenALStream::Start()
|
||||
{
|
||||
ALDeviceList *pDeviceList = NULL;
|
||||
ALCcontext *pContext = NULL;
|
||||
ALCdevice *pDevice = NULL;
|
||||
bool bReturn = false;
|
||||
|
||||
pDeviceList = new ALDeviceList();
|
||||
ALDeviceList *pDeviceList = new ALDeviceList();
|
||||
if ((pDeviceList) && (pDeviceList->GetNumDevices()))
|
||||
{
|
||||
char *defDevName = pDeviceList->GetDeviceName(pDeviceList->GetDefaultDevice());
|
||||
|
||||
WARN_LOG(AUDIO, "Found OpenAL device %s", defDevName);
|
||||
|
||||
pDevice = alcOpenDevice(defDevName);
|
||||
ALCdevice *pDevice = alcOpenDevice(defDevName);
|
||||
if (pDevice)
|
||||
{
|
||||
pContext = alcCreateContext(pDevice, NULL);
|
||||
ALCcontext *pContext = alcCreateContext(pDevice, NULL);
|
||||
if (pContext)
|
||||
{
|
||||
// Used to determine an appropriate period size (2x period = total buffer size)
|
||||
|
||||
@@ -42,10 +42,6 @@
|
||||
ALDeviceList::ALDeviceList()
|
||||
{
|
||||
ALDEVICEINFO ALDeviceInfo;
|
||||
char *devices;
|
||||
s32 index;
|
||||
const char *defaultDeviceName = NULL;
|
||||
const char *actualDeviceName = NULL;
|
||||
|
||||
// DeviceInfo vector stores, for each enumerated device, it's device name, selection status, spec version #, and extension support
|
||||
vDeviceInfo.clear();
|
||||
@@ -57,11 +53,10 @@ ALDeviceList::ALDeviceList()
|
||||
//if (LoadOAL10Library(NULL, &ALFunction) == TRUE) {
|
||||
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT"))
|
||||
{
|
||||
devices = (char *)alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
||||
defaultDeviceName = (char *)alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
index = 0;
|
||||
const char *devices = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
||||
const char *defaultDeviceName = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
// go through device list (each device terminated with a single NULL, list terminated with double NULL)
|
||||
while (devices != NULL && strlen(devices) > 0)
|
||||
for (s32 index = 0; devices != NULL && strlen(devices) > 0; index++, devices += strlen(devices) + 1)
|
||||
{
|
||||
if (strcmp(defaultDeviceName, devices) == 0)
|
||||
{
|
||||
@@ -75,7 +70,7 @@ ALDeviceList::ALDeviceList()
|
||||
{
|
||||
alcMakeContextCurrent(context);
|
||||
// if new actual device name isn't already in the list, then add it...
|
||||
actualDeviceName = alcGetString(device, ALC_DEVICE_SPECIFIER);
|
||||
const char *actualDeviceName = alcGetString(device, ALC_DEVICE_SPECIFIER);
|
||||
bool bNewName = true;
|
||||
for (s32 i = 0; i < GetNumDevices(); i++)
|
||||
{
|
||||
@@ -130,8 +125,6 @@ ALDeviceList::ALDeviceList()
|
||||
}
|
||||
alcCloseDevice(device);
|
||||
}
|
||||
devices += strlen(devices) + 1;
|
||||
index += 1;
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
@@ -735,8 +735,8 @@ public:
|
||||
{
|
||||
#ifndef __SYMBIAN32__
|
||||
FreeMemoryPages(region, region_size);
|
||||
#endif
|
||||
region = NULL;
|
||||
#endif
|
||||
region_size = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ std::vector<std::string> cdio_get_devices ()
|
||||
for (unsigned int j = checklist[i].num_min; j <= checklist[i].num_max; ++j)
|
||||
{
|
||||
std::string drive = StringFromFormat(checklist[i].format, j);
|
||||
if ( (is_cdrom(drive, NULL)) > 0 )
|
||||
if (is_cdrom(drive, NULL))
|
||||
{
|
||||
drives.push_back(std::move(drive));
|
||||
}
|
||||
|
||||
@@ -25,6 +25,14 @@ extern const char *netplay_dolphin_ver;
|
||||
#define LOGGING 1
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || __clang__
|
||||
// Disable "unused function" warnings for the ones manually marked as such.
|
||||
#define UNUSED __attribute__((unused))
|
||||
#else
|
||||
// Not sure MSVC even checks this...
|
||||
#define UNUSED
|
||||
#endif
|
||||
|
||||
#define STACKALIGN
|
||||
|
||||
#if __cplusplus >= 201103 || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
|
||||
@@ -362,8 +362,6 @@ void StackTrace(HANDLE hThread, const char* lpszMessage, FILE *file, DWORD eip,
|
||||
{
|
||||
STACKFRAME callStack;
|
||||
BOOL bResult;
|
||||
TCHAR symInfo[BUFFERSIZE] = _T("?");
|
||||
TCHAR srcInfo[BUFFERSIZE] = _T("?");
|
||||
HANDLE hProcess = GetCurrentProcess();
|
||||
|
||||
// If it's not this thread, let's suspend it, and resume it at the end
|
||||
|
||||
@@ -20,11 +20,11 @@ namespace FPURoundMode
|
||||
PREC_53 = 1,
|
||||
PREC_64 = 2
|
||||
};
|
||||
void SetRoundMode(enum RoundModes mode);
|
||||
void SetRoundMode(RoundModes mode);
|
||||
|
||||
void SetPrecisionMode(enum PrecisionModes mode);
|
||||
void SetPrecisionMode(PrecisionModes mode);
|
||||
|
||||
void SetSIMDMode(enum RoundModes rounding_mode, bool non_ieee_mode);
|
||||
void SetSIMDMode(RoundModes rounding_mode, bool non_ieee_mode);
|
||||
|
||||
/*
|
||||
* There are two different flavors of float to int conversion:
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
// Generic, do nothing
|
||||
namespace FPURoundMode
|
||||
{
|
||||
void SetRoundMode(enum RoundModes mode)
|
||||
void SetRoundMode(RoundModes mode)
|
||||
{
|
||||
}
|
||||
void SetPrecisionMode(enum PrecisionModes mode)
|
||||
void SetPrecisionMode(PrecisionModes mode)
|
||||
{
|
||||
}
|
||||
void SetSIMDMode(enum RoundModes rounding_mode, bool non_ieee_mode)
|
||||
void SetSIMDMode(RoundModes rounding_mode, bool non_ieee_mode)
|
||||
{
|
||||
}
|
||||
void SaveSIMDState()
|
||||
|
||||
@@ -124,13 +124,12 @@ bool IniFile::Section::Get(const std::string& key, std::vector<std::string>& out
|
||||
}
|
||||
// ignore starting , if any
|
||||
size_t subStart = temp.find_first_not_of(",");
|
||||
size_t subEnd;
|
||||
|
||||
// split by ,
|
||||
while (subStart != std::string::npos)
|
||||
{
|
||||
// Find next ,
|
||||
subEnd = temp.find_first_of(",", subStart);
|
||||
size_t subEnd = temp.find_first_of(",", subStart);
|
||||
if (subStart != subEnd)
|
||||
// take from first char until next ,
|
||||
out.push_back(StripSpaces(temp.substr(subStart, subEnd - subStart)));
|
||||
|
||||
@@ -36,7 +36,7 @@ int AshmemCreateFileMapping(const char *name, size_t size)
|
||||
return fd;
|
||||
|
||||
// We don't really care if we can't set the name, it is optional
|
||||
ret = ioctl(fd, ASHMEM_SET_NAME, name);
|
||||
ioctl(fd, ASHMEM_SET_NAME, name);
|
||||
|
||||
ret = ioctl(fd, ASHMEM_SET_SIZE, size);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -129,11 +129,10 @@ void FreeMemoryPages(void* ptr, size_t size)
|
||||
if (ptr)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
||||
if (!VirtualFree(ptr, 0, MEM_RELEASE))
|
||||
{
|
||||
PanicAlert("FreeMemoryPages failed!\n%s", GetLastErrorMsg());
|
||||
ptr = NULL; // Is this our responsibility?
|
||||
|
||||
}
|
||||
#else
|
||||
munmap(ptr, size);
|
||||
#endif
|
||||
@@ -145,9 +144,9 @@ void FreeAlignedMemory(void* ptr)
|
||||
if (ptr)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
_aligned_free(ptr);
|
||||
_aligned_free(ptr);
|
||||
#else
|
||||
free(ptr);
|
||||
free(ptr);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace FPURoundMode
|
||||
static u32 saved_sse_state = _mm_getcsr();
|
||||
static const u32 default_sse_state = _mm_getcsr();
|
||||
|
||||
void SetRoundMode(enum RoundModes mode)
|
||||
void SetRoundMode(RoundModes mode)
|
||||
{
|
||||
// Set FPU rounding mode to mimic the PowerPC's
|
||||
#ifdef _M_IX86
|
||||
@@ -49,7 +49,7 @@ namespace FPURoundMode
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetPrecisionMode(enum PrecisionModes mode)
|
||||
void SetPrecisionMode(PrecisionModes mode)
|
||||
{
|
||||
#ifdef _M_IX86
|
||||
// sets the floating-point lib to 53-bit
|
||||
@@ -75,7 +75,7 @@ namespace FPURoundMode
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSIMDMode(enum RoundModes rounding_mode, bool non_ieee_mode)
|
||||
void SetSIMDMode(RoundModes rounding_mode, bool non_ieee_mode)
|
||||
{
|
||||
// OR-mask for disabling FPU exceptions (bits 7-12 in the MXCSR register)
|
||||
const u32 EXCEPTION_MASK = 0x1F80;
|
||||
|
||||
@@ -145,51 +145,56 @@ const u32 table7[0x40] = {
|
||||
|
||||
void generateseeds(u32 *seeds, const u8 *seedtable, u8 doreverse)
|
||||
{
|
||||
int i,j;
|
||||
u32 tmp3;
|
||||
u8 array0[0x38],array1[0x38],array2[0x08];
|
||||
u8 tmp,tmp2;
|
||||
|
||||
i = 0;
|
||||
while (i < 0x38)
|
||||
for (int i = 0; i < 0x38; ++i)
|
||||
{
|
||||
tmp = (gentable0[i] - 1);
|
||||
array0[i++] = ((u32)(0-(seedtable[tmp>>3] & gentable1[tmp&7])) >> 31);
|
||||
array0[i] = ((u32)(0-(seedtable[tmp>>3] & gentable1[tmp&7])) >> 31);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while (i < 0x10)
|
||||
for (int i = 0; i < 0x10; ++i)
|
||||
{
|
||||
memset(array2,0,8);
|
||||
tmp2 = gentable2[i];
|
||||
|
||||
for (j = 0; j < 0x38; j++)
|
||||
for (int j = 0; j < 0x38; j++)
|
||||
{
|
||||
tmp = (tmp2+j);
|
||||
|
||||
if (j > 0x1B)
|
||||
{
|
||||
if (tmp > 0x37) tmp-=0x1C;
|
||||
if (tmp > 0x37)
|
||||
{
|
||||
tmp-=0x1C;
|
||||
}
|
||||
}
|
||||
else if (tmp > 0x1B)
|
||||
{
|
||||
tmp-=0x1C;
|
||||
}
|
||||
else if (tmp > 0x1B) tmp-=0x1C;
|
||||
|
||||
array1[j] = array0[tmp];
|
||||
}
|
||||
for (j = 0; j < 0x30; j++)
|
||||
for (int j = 0; j < 0x30; j++)
|
||||
{
|
||||
if (!array1[gentable3[j]-1]) continue;
|
||||
if (!array1[gentable3[j]-1])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
tmp = (((j*0x2AAB)>>16) - (j>>0x1F));
|
||||
array2[tmp] |= (gentable1[j-(tmp*6)]>>2);
|
||||
}
|
||||
seeds[i<<1] = ((array2[0]<<24)|(array2[2]<<16)|(array2[4]<<8)|array2[6]);
|
||||
seeds[(i<<1)+1] = ((array2[1]<<24)|(array2[3]<<16)|(array2[5]<<8)|array2[7]);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!doreverse)
|
||||
{
|
||||
j = 0x1F;
|
||||
for (i = 0; i < 16; i+=2)
|
||||
int j = 0x1F;
|
||||
for (int i = 0; i < 16; i+=2)
|
||||
{
|
||||
tmp3 = seeds[i];
|
||||
seeds[i] = seeds[j-1];
|
||||
@@ -222,20 +227,17 @@ void setcode(u32 *dst, u32 addr, u32 val)
|
||||
|
||||
u16 gencrc16(u32 *codes, u16 size)
|
||||
{
|
||||
u16 ret=0;
|
||||
u8 tmp=0,tmp2;
|
||||
int i;
|
||||
u16 ret = 0;
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
while (tmp < size)
|
||||
for (u8 tmp = 0; tmp < size; ++tmp)
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
tmp2 = ((codes[tmp] >> (i<<3))^ret);
|
||||
u8 tmp2 = ((codes[tmp] >> (i<<3))^ret);
|
||||
ret = ((crctable0[(tmp2>>4)&0x0F]^crctable1[tmp2&0x0F])^(ret>>8));
|
||||
}
|
||||
tmp++;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@@ -243,9 +245,7 @@ u16 gencrc16(u32 *codes, u16 size)
|
||||
|
||||
u8 verifycode(u32 *codes, u16 size)
|
||||
{
|
||||
u16 tmp;
|
||||
|
||||
tmp = gencrc16(codes,size);
|
||||
u16 tmp = gencrc16(codes,size);
|
||||
return (((tmp>>12)^(tmp>>8)^(tmp>>4)^tmp)&0x0F);
|
||||
}
|
||||
|
||||
@@ -338,7 +338,10 @@ bool getbitstring(u32 *ctrl, u32 *out, u8 len)
|
||||
ctrl[1]++;
|
||||
tmp = (ctrl[0]+(ctrl[1]<<2));
|
||||
}
|
||||
if (ctrl[1] >= ctrl[3]) return false;
|
||||
if (ctrl[1] >= ctrl[3])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
*out = ((*out<<1) | ((tmp >> (0x1F-ctrl[2])) & 1));
|
||||
ctrl[2]++;
|
||||
}
|
||||
@@ -372,13 +375,16 @@ bool batchdecrypt(u32 *codes, u16 size)
|
||||
getbitstring(tmparray,tmparray2+5,2); // Region
|
||||
|
||||
// Grab gameid and region from the last decrypted code
|
||||
// Maybe check this against dolphin's GameID? - "code is for wrong game" type msg
|
||||
// TODO: Maybe check this against dolphin's GameID? - "code is for wrong game" type msg
|
||||
//gameid = tmparray2[1];
|
||||
//region = tmparray2[5];
|
||||
|
||||
tmp = codes[0];
|
||||
codes[0] &= 0x0FFFFFFF;
|
||||
if ((tmp>>28) != verifycode(codes,size)) return false;
|
||||
if ((tmp>>28) != verifycode(codes,size))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -406,23 +412,24 @@ int GetVal(const char *flt, char chr)
|
||||
|
||||
int alphatobin(u32 *dst, std::vector<std::string> alpha, int size)
|
||||
{
|
||||
int i,j=0,k;
|
||||
int ret=0,org=(size+1);
|
||||
int j = 0;
|
||||
int ret = 0;
|
||||
int org = size + 1;
|
||||
u32 bin[2];
|
||||
u8 parity;
|
||||
|
||||
while (size)
|
||||
for (; size; --size)
|
||||
{
|
||||
bin[0]=0;
|
||||
for (i = 0; i < 6; i++)
|
||||
bin[0] = 0;
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
bin[0] |= (GetVal(filter,alpha[j>>1][i]) << (((5-i)*5)+2));
|
||||
}
|
||||
bin[0] |= (GetVal(filter,alpha[j>>1][6]) >> 3);
|
||||
dst[j++] = bin[0];
|
||||
|
||||
bin[1]=0;
|
||||
for (i = 0; i < 6; i++)
|
||||
bin[1] = 0;
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
bin[1] |= (GetVal(filter,alpha[j>>1][i+6]) << (((5-i)*5)+4));
|
||||
}
|
||||
@@ -430,16 +437,20 @@ int alphatobin(u32 *dst, std::vector<std::string> alpha, int size)
|
||||
dst[j++] = bin[1];
|
||||
|
||||
//verify parity bit
|
||||
k=0;
|
||||
parity=0;
|
||||
for (i = 0; i < 64; i++)
|
||||
int k = 0;
|
||||
parity = 0;
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
if (i == 32) k++;
|
||||
if (i == 32)
|
||||
{
|
||||
k++;
|
||||
}
|
||||
parity ^= (bin[k] >> (i-(k<<5)));
|
||||
}
|
||||
if ((parity&1) != (GetVal(filter,alpha[(j-2)>>1][12])&1)) ret=(org-size);
|
||||
|
||||
size--;
|
||||
if ((parity&1) != (GetVal(filter,alpha[(j-2)>>1][12])&1))
|
||||
{
|
||||
ret=(org-size);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -451,12 +462,11 @@ void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry> &ops)
|
||||
buildseeds();
|
||||
|
||||
u32 uCodes[1200];
|
||||
u32 i,ret;
|
||||
u32 ret;
|
||||
|
||||
for(i = 0; i < vCodes.size(); ++i)
|
||||
for (std::string& s : vCodes)
|
||||
{
|
||||
transform(vCodes[i].begin(), vCodes[i].end(), vCodes[i].begin(), toupper);
|
||||
//PanicAlert("Encrypted AR Code\n%s", vCodes[i].c_str());
|
||||
std::transform(s.begin(), s.end(), s.begin(), toupper);
|
||||
}
|
||||
|
||||
if ((ret=alphatobin(uCodes, vCodes, (int)vCodes.size())))
|
||||
@@ -470,7 +480,7 @@ void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry> &ops)
|
||||
//PanicAlert("Action Replay Code Decryption Error:\nCRC Check Failed\n\n"
|
||||
// "First Code in Block(should be verification code):\n%s", vCodes[0].c_str());
|
||||
|
||||
for (i = 0; i < (vCodes.size()<<1); i+=2)
|
||||
for (size_t i = 0; i < (vCodes.size()<<1); i+=2)
|
||||
{
|
||||
AREntry op;
|
||||
op.cmd_addr = uCodes[i];
|
||||
@@ -482,7 +492,7 @@ void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry> &ops)
|
||||
else
|
||||
{
|
||||
// Skip passing the verification code back
|
||||
for (i = 2; i < (vCodes.size()<<1); i+=2)
|
||||
for (size_t i = 2; i < (vCodes.size()<<1); i+=2)
|
||||
{
|
||||
AREntry op;
|
||||
op.cmd_addr = uCodes[i];
|
||||
|
||||
@@ -100,14 +100,14 @@ struct ARAddr
|
||||
};
|
||||
|
||||
void LogInfo(const char *format, ...);
|
||||
bool Subtype_RamWriteAndFill(const ARAddr addr, const u32 data);
|
||||
bool Subtype_WriteToPointer(const ARAddr addr, const u32 data);
|
||||
bool Subtype_AddCode(const ARAddr addr, const u32 data);
|
||||
bool Subtype_MasterCodeAndWriteToCCXXXXXX(const ARAddr addr, const u32 data);
|
||||
bool ZeroCode_FillAndSlide(const u32 val_last, const ARAddr addr, const u32 data);
|
||||
bool ZeroCode_MemoryCopy(const u32 val_last, const ARAddr addr, const u32 data);
|
||||
bool NormalCode(const ARAddr addr, const u32 data);
|
||||
bool ConditionalCode(const ARAddr addr, const u32 data, int* const pSkipCount);
|
||||
bool Subtype_RamWriteAndFill(const ARAddr& addr, const u32 data);
|
||||
bool Subtype_WriteToPointer(const ARAddr& addr, const u32 data);
|
||||
bool Subtype_AddCode(const ARAddr& addr, const u32 data);
|
||||
bool Subtype_MasterCodeAndWriteToCCXXXXXX(const ARAddr& addr, const u32 data);
|
||||
bool ZeroCode_FillAndSlide(const u32 val_last, const ARAddr& addr, const u32 data);
|
||||
bool ZeroCode_MemoryCopy(const u32 val_last, const ARAddr& addr, const u32 data);
|
||||
bool NormalCode(const ARAddr& addr, const u32 data);
|
||||
bool ConditionalCode(const ARAddr& addr, const u32 data, int* const pSkipCount);
|
||||
bool CompareValues(const u32 val1, const u32 val2, const int type);
|
||||
|
||||
// ----------------------
|
||||
@@ -487,7 +487,7 @@ bool IsSelfLogging()
|
||||
|
||||
// ----------------------
|
||||
// Code Functions
|
||||
bool Subtype_RamWriteAndFill(const ARAddr addr, const u32 data)
|
||||
bool Subtype_RamWriteAndFill(const ARAddr& addr, const u32 data)
|
||||
{
|
||||
const u32 new_addr = addr.GCAddress();
|
||||
|
||||
@@ -544,7 +544,7 @@ bool Subtype_RamWriteAndFill(const ARAddr addr, const u32 data)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Subtype_WriteToPointer(const ARAddr addr, const u32 data)
|
||||
bool Subtype_WriteToPointer(const ARAddr& addr, const u32 data)
|
||||
{
|
||||
const u32 new_addr = addr.GCAddress();
|
||||
const u32 ptr = Memory::Read_U32(new_addr);
|
||||
@@ -603,7 +603,7 @@ bool Subtype_WriteToPointer(const ARAddr addr, const u32 data)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Subtype_AddCode(const ARAddr addr, const u32 data)
|
||||
bool Subtype_AddCode(const ARAddr& addr, const u32 data)
|
||||
{
|
||||
// Used to increment/decrement a value in memory
|
||||
const u32 new_addr = addr.GCAddress();
|
||||
@@ -663,7 +663,7 @@ bool Subtype_AddCode(const ARAddr addr, const u32 data)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Subtype_MasterCodeAndWriteToCCXXXXXX(const ARAddr addr, const u32 data)
|
||||
bool Subtype_MasterCodeAndWriteToCCXXXXXX(const ARAddr& addr, const u32 data)
|
||||
{
|
||||
// code not yet implemented - TODO
|
||||
// u32 new_addr = (addr & 0x01FFFFFF) | 0x80000000;
|
||||
@@ -675,7 +675,7 @@ bool Subtype_MasterCodeAndWriteToCCXXXXXX(const ARAddr addr, const u32 data)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ZeroCode_FillAndSlide(const u32 val_last, const ARAddr addr, const u32 data) // This needs more testing
|
||||
bool ZeroCode_FillAndSlide(const u32 val_last, const ARAddr& addr, const u32 data) // This needs more testing
|
||||
{
|
||||
const u32 new_addr = ((ARAddr*)&val_last)->GCAddress();
|
||||
const u8 size = ((ARAddr*)&val_last)->size;
|
||||
@@ -750,7 +750,7 @@ bool ZeroCode_FillAndSlide(const u32 val_last, const ARAddr addr, const u32 data
|
||||
}
|
||||
|
||||
// Looks like this is new?? - untested
|
||||
bool ZeroCode_MemoryCopy(const u32 val_last, const ARAddr addr, const u32 data)
|
||||
bool ZeroCode_MemoryCopy(const u32 val_last, const ARAddr& addr, const u32 data)
|
||||
{
|
||||
const u32 addr_dest = val_last | 0x06000000;
|
||||
const u32 addr_src = addr.GCAddress();
|
||||
@@ -796,7 +796,7 @@ bool ZeroCode_MemoryCopy(const u32 val_last, const ARAddr addr, const u32 data)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NormalCode(const ARAddr addr, const u32 data)
|
||||
bool NormalCode(const ARAddr& addr, const u32 data)
|
||||
{
|
||||
switch (addr.subtype)
|
||||
{
|
||||
@@ -834,7 +834,7 @@ bool NormalCode(const ARAddr addr, const u32 data)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConditionalCode(const ARAddr addr, const u32 data, int* const pSkipCount)
|
||||
bool ConditionalCode(const ARAddr& addr, const u32 data, int* const pSkipCount)
|
||||
{
|
||||
const u32 new_addr = addr.GCAddress();
|
||||
|
||||
|
||||
@@ -392,7 +392,6 @@ bool CBoot::EmulatedBS2_Wii()
|
||||
Memory::Write_U32(firmwareVer ? firmwareVer : 0x00090204, 0x00003140);
|
||||
|
||||
// Load patches and run startup patches
|
||||
std::string gameID = VolumeHandler::GetVolume()->GetUniqueID();
|
||||
PatchEngine::LoadPatches();
|
||||
|
||||
// return
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace BootManager
|
||||
struct ConfigCache
|
||||
{
|
||||
bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bDCBZOFF, m_EnableJIT, bDSPThread,
|
||||
bVBeamSpeedHack, bSyncGPU, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bHLE_BS2, bTLBHack, bUseFPS;
|
||||
bVBeamSpeedHack, bSyncGPU, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bHLE_BS2, bTLBHack;
|
||||
int iCPUCore, Volume;
|
||||
int iWiimoteSource[MAX_BBMOTES];
|
||||
SIDevices Pads[MAX_SI_CHANNELS];
|
||||
|
||||
@@ -134,6 +134,7 @@ static void DSPCore_FreeMemoryPages()
|
||||
FreeMemoryPages(g_dsp.iram, DSP_IRAM_BYTE_SIZE);
|
||||
FreeMemoryPages(g_dsp.dram, DSP_DRAM_BYTE_SIZE);
|
||||
FreeMemoryPages(g_dsp.coef, DSP_COEF_BYTE_SIZE);
|
||||
g_dsp.irom = g_dsp.iram = g_dsp.dram = g_dsp.coef = NULL;
|
||||
}
|
||||
|
||||
bool DSPCore_Init(const char *irom_filename, const char *coef_filename,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -59,8 +59,10 @@ void FifoPlaybackAnalyzer::AnalyzeFrames(FifoDataFile *file, std::vector<Analyze
|
||||
u32 cmdStart = 0;
|
||||
u32 nextMemUpdate = 0;
|
||||
|
||||
#if LOG_FIFO_CMDS
|
||||
// Debugging
|
||||
vector<CmdData> prevCmds;
|
||||
#endif
|
||||
|
||||
while (cmdStart < frame.fifoDataSize)
|
||||
{
|
||||
@@ -75,7 +77,7 @@ void FifoPlaybackAnalyzer::AnalyzeFrames(FifoDataFile *file, std::vector<Analyze
|
||||
|
||||
u32 cmdSize = DecodeCommand(&frame.fifoData[cmdStart]);
|
||||
|
||||
#if (LOG_FIFO_CMDS)
|
||||
#if LOG_FIFO_CMDS
|
||||
CmdData cmdData;
|
||||
cmdData.offset = cmdStart;
|
||||
cmdData.ptr = &frame.fifoData[cmdStart];
|
||||
@@ -118,7 +120,7 @@ void FifoPlaybackAnalyzer::AddMemoryUpdate(MemoryUpdate memUpdate, AnalyzedFrame
|
||||
for (const auto& range : m_WrittenMemory)
|
||||
{
|
||||
if (range.begin < end &&
|
||||
range.end > begin)
|
||||
range.end > begin)
|
||||
{
|
||||
s32 preSize = range.begin - begin;
|
||||
s32 postSize = end - range.end;
|
||||
@@ -210,7 +212,9 @@ u32 FifoPlaybackAnalyzer::DecodeCommand(u8 *data)
|
||||
FifoAnalyzer::LoadBPReg(bp, m_BpMem);
|
||||
|
||||
if (bp.address == BPMEM_TRIGGER_EFB_COPY)
|
||||
{
|
||||
StoreEfbCopyRegion();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -256,9 +260,13 @@ void FifoPlaybackAnalyzer::StoreEfbCopyRegion()
|
||||
{
|
||||
format |= _GX_TF_ZTF;
|
||||
if (copyfmt == 11)
|
||||
{
|
||||
format = GX_TF_Z16;
|
||||
}
|
||||
else if (format < GX_TF_Z8 || format > GX_TF_Z24X8)
|
||||
{
|
||||
format |= _GX_TF_CTF;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -280,8 +280,10 @@ void Init(bool hle)
|
||||
void Shutdown()
|
||||
{
|
||||
if (!g_ARAM.wii_mode)
|
||||
{
|
||||
FreeMemoryPages(g_ARAM.ptr, g_ARAM.size);
|
||||
g_ARAM.ptr = NULL;
|
||||
g_ARAM.ptr = NULL;
|
||||
}
|
||||
|
||||
dsp_emulator->Shutdown();
|
||||
delete dsp_emulator;
|
||||
@@ -563,7 +565,7 @@ void Do_ARAM_DMA()
|
||||
{
|
||||
while (g_arDMA.Cnt.count)
|
||||
{
|
||||
// These are logically seperated in code to show that a memory map has been set up
|
||||
// These are logically separated in code to show that a memory map has been set up
|
||||
// See below in the write section for more information
|
||||
if ((g_ARAM_Info.Hex & 0xf) == 3)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user