Random fixes and cleanups
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5297 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
b452bf7051
commit
f727139ebf
|
@ -74,17 +74,13 @@ void CFileSearch::FindFiles(const std::string& _searchString, const std::string&
|
|||
size_t dot_pos = _searchString.rfind(".");
|
||||
|
||||
if (dot_pos == std::string::npos)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::string ext = _searchString.substr(dot_pos);
|
||||
DIR* dir = opendir(_strPath.c_str());
|
||||
|
||||
if (!dir)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dirent* dp;
|
||||
|
||||
|
@ -93,9 +89,7 @@ void CFileSearch::FindFiles(const std::string& _searchString, const std::string&
|
|||
dp = readdir(dir);
|
||||
|
||||
if (!dp)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
std::string s(dp->d_name);
|
||||
|
||||
|
@ -118,5 +112,5 @@ void CFileSearch::FindFiles(const std::string& _searchString, const std::string&
|
|||
|
||||
const CFileSearch::XStringVector& CFileSearch::GetFileNames() const
|
||||
{
|
||||
return(m_FileNames);
|
||||
return m_FileNames;
|
||||
}
|
||||
|
|
|
@ -23,20 +23,16 @@
|
|||
|
||||
class CFileSearch
|
||||
{
|
||||
public:
|
||||
|
||||
public:
|
||||
typedef std::vector<std::string>XStringVector;
|
||||
|
||||
CFileSearch(const XStringVector& _rSearchStrings, const XStringVector& _rDirectories);
|
||||
|
||||
const XStringVector& GetFileNames() const;
|
||||
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
void FindFiles(const std::string& _searchString, const std::string& _strPath);
|
||||
|
||||
|
||||
XStringVector m_FileNames;
|
||||
};
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ bool Delete(const char *filename)
|
|||
}
|
||||
#else
|
||||
if (unlink(filename) == -1) {
|
||||
WARN_LOG(COMMON, "Delete: DeleteFile failed on %s: %s",
|
||||
WARN_LOG(COMMON, "Delete: unlink failed on %s: %s",
|
||||
filename, GetLastErrorMsg());
|
||||
return false;
|
||||
}
|
||||
|
@ -594,7 +594,6 @@ std::string GetPluginsDirectory()
|
|||
|
||||
INFO_LOG(COMMON, "GetPluginsDirectory: Setting to %s:", pluginsDir.c_str());
|
||||
return pluginsDir;
|
||||
|
||||
}
|
||||
|
||||
// Returns the path to where the sys file are
|
||||
|
|
|
@ -35,8 +35,6 @@ int total;
|
|||
const char *filter = "0123456789ABCDEFGHJKMNPQRTUVWXYZILOS";
|
||||
|
||||
u32 genseeds[0x20];
|
||||
//u8 globalvar=0;
|
||||
//u8 globalvar2=0;
|
||||
|
||||
|
||||
const u8 bitstringlen[0x08] = {
|
||||
|
@ -408,9 +406,7 @@ bool batchdecrypt(u32 *codes, u16 size)
|
|||
|
||||
int GetVal(const char *flt, char chr)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = (int)(strchr(flt,chr) - flt);
|
||||
int ret = (int)(strchr(flt,chr) - flt);
|
||||
switch (ret)
|
||||
{
|
||||
case 32: // 'I'
|
||||
|
@ -424,7 +420,6 @@ int GetVal(const char *flt, char chr)
|
|||
ret = 5;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -516,4 +511,5 @@ void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry> &ops)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace ActionReplay
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
// -----------------------------------------------------------------------------------------
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------
|
||||
// Codes Types:
|
||||
// Code 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
|
||||
|
@ -45,6 +45,7 @@
|
|||
|
||||
namespace ActionReplay
|
||||
{
|
||||
|
||||
enum
|
||||
{
|
||||
// Zero Code Types
|
||||
|
@ -217,7 +218,7 @@ void LogInfo(const char *format, ...)
|
|||
if (logSelf)
|
||||
{
|
||||
std::string text = temp;
|
||||
text += "\n";
|
||||
text += '\n';
|
||||
arLog.push_back(text.c_str());
|
||||
}
|
||||
}
|
||||
|
@ -238,12 +239,12 @@ void RunAllActive()
|
|||
}
|
||||
}
|
||||
|
||||
if (!b_RanOnce)
|
||||
b_RanOnce = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool RunCode(const ARCode &arcode) {
|
||||
bool RunCode(const ARCode &arcode)
|
||||
{
|
||||
// The mechanism is different than what the real AR uses, so there may be compatibility problems.
|
||||
u8 cmd;
|
||||
u32 addr;
|
||||
|
@ -281,7 +282,6 @@ bool RunCode(const ARCode &arcode) {
|
|||
if (!skip && count > 0) count--; // execute n lines
|
||||
// if -2 : execute all lines
|
||||
|
||||
if (b_RanOnce)
|
||||
b_RanOnce = false;
|
||||
}
|
||||
|
||||
|
@ -464,7 +464,8 @@ bool Subtype_RamWriteAndFill(u32 addr, u32 data)
|
|||
LogInfo("8-bit Write");
|
||||
LogInfo("--------");
|
||||
u32 repeat = data >> 8;
|
||||
for (u32 i = 0; i <= repeat; i++) {
|
||||
for (u32 i = 0; i <= repeat; i++)
|
||||
{
|
||||
Memory::Write_U8(data & 0xFF, new_addr + i);
|
||||
LogInfo("Wrote %08x to address %08x", data & 0xFF, new_addr + i);
|
||||
}
|
||||
|
@ -477,7 +478,8 @@ bool Subtype_RamWriteAndFill(u32 addr, u32 data)
|
|||
LogInfo("16-bit Write");
|
||||
LogInfo("--------");
|
||||
u32 repeat = data >> 16;
|
||||
for (u32 i = 0; i <= repeat; i++) {
|
||||
for (u32 i = 0; i <= repeat; i++)
|
||||
{
|
||||
Memory::Write_U16(data & 0xFFFF, new_addr + i * 2);
|
||||
LogInfo("Wrote %08x to address %08x", data & 0xFFFF, new_addr + i * 2);
|
||||
}
|
||||
|
@ -558,7 +560,7 @@ bool Subtype_WriteToPointer(u32 addr, u32 data)
|
|||
|
||||
bool Subtype_AddCode(u32 addr, u32 data)
|
||||
{
|
||||
// Used to incrment a value in memory
|
||||
// Used to increment a value in memory
|
||||
u32 new_addr = (addr & 0x81FFFFFF);
|
||||
u8 size = (addr >> 25) & 0x03;
|
||||
LogInfo("Hardware Address: %08x", new_addr);
|
||||
|
@ -657,7 +659,8 @@ bool ZeroCode_FillAndSlide(u32 val_last, u32 addr, u32 data) // This needs more
|
|||
case DATATYPE_16BIT:
|
||||
LogInfo("16-bit Write");
|
||||
LogInfo("--------");
|
||||
for (int i=0; i < write_num; i++) {
|
||||
for (int i=0; i < write_num; i++)
|
||||
{
|
||||
Memory::Write_U16(val & 0xFFFF, curr_addr);
|
||||
LogInfo("Write %08x to address %08x", val & 0xFFFF, curr_addr);
|
||||
curr_addr += addr_incr * 2;
|
||||
|
@ -670,7 +673,8 @@ bool ZeroCode_FillAndSlide(u32 val_last, u32 addr, u32 data) // This needs more
|
|||
case DATATYPE_32BIT:
|
||||
LogInfo("32-bit Write");
|
||||
LogInfo("--------");
|
||||
for (int i = 0; i < write_num; i++) {
|
||||
for (int i = 0; i < write_num; i++)
|
||||
{
|
||||
Memory::Write_U32(val, curr_addr);
|
||||
LogInfo("Write %08x to address %08x", val, curr_addr);
|
||||
curr_addr += addr_incr * 4;
|
||||
|
@ -688,8 +692,8 @@ bool ZeroCode_FillAndSlide(u32 val_last, u32 addr, u32 data) // This needs more
|
|||
return true;
|
||||
}
|
||||
|
||||
// Looks like this is new??
|
||||
bool ZeroCode_MemoryCopy(u32 val_last, u32 addr, u32 data) // Has not been tested
|
||||
// Looks like this is new?? - untested
|
||||
bool ZeroCode_MemoryCopy(u32 val_last, u32 addr, u32 data)
|
||||
{
|
||||
u32 addr_dest = val_last | 0x06000000;
|
||||
u32 addr_src = (addr & 0x01FFFFFF) | 0x80000000;
|
||||
|
@ -704,7 +708,8 @@ bool ZeroCode_MemoryCopy(u32 val_last, u32 addr, u32 data) // Has not been teste
|
|||
{ // Memory Copy With Pointers Support
|
||||
LogInfo("Memory Copy With Pointers Support");
|
||||
LogInfo("--------");
|
||||
for (int i = 0; i < 138; i++) {
|
||||
for (int i = 0; i < 138; i++)
|
||||
{
|
||||
Memory::Write_U8(Memory::Read_U8(addr_src + i), addr_dest + i);
|
||||
LogInfo("Wrote %08x to address %08x", Memory::Read_U8(addr_src + i), addr_dest + i);
|
||||
}
|
||||
|
|
|
@ -23,14 +23,16 @@
|
|||
namespace ActionReplay
|
||||
{
|
||||
|
||||
struct AREntry {
|
||||
struct AREntry
|
||||
{
|
||||
AREntry() {}
|
||||
AREntry(u32 _addr, u32 _value) : cmd_addr(_addr), value(_value) {}
|
||||
u32 cmd_addr;
|
||||
u32 value;
|
||||
};
|
||||
|
||||
struct ARCode {
|
||||
struct ARCode
|
||||
{
|
||||
std::string name;
|
||||
std::vector<AREntry> ops;
|
||||
bool active;
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
|
||||
void CBoot::Load_FST(bool _bIsWii)
|
||||
{
|
||||
if (VolumeHandler::IsValid())
|
||||
{
|
||||
if (!VolumeHandler::IsValid()) return;
|
||||
|
||||
// copy first 20 bytes of disc to start of Mem 1
|
||||
VolumeHandler::ReadToPtr(Memory::GetPointer(0x80000000), 0, 0x20);
|
||||
|
||||
|
@ -72,7 +72,6 @@ void CBoot::Load_FST(bool _bIsWii)
|
|||
VolumeHandler::ReadToPtr(Memory::GetPointer(arenaHigh), fstOffset, fstSize);
|
||||
Memory::Write_U32(arenaHigh, 0x00000038);
|
||||
Memory::Write_U32(maxFstSize, 0x0000003c);
|
||||
}
|
||||
}
|
||||
|
||||
void CBoot::UpdateDebugger_MapLoaded(const char *_gameID)
|
||||
|
@ -96,8 +95,8 @@ std::string CBoot::GenerateMapFilename()
|
|||
sprintf(tmpBuffer, "%08x_%08x", (u32)(TitleID >> 32) & 0xFFFFFFFF , (u32)TitleID & 0xFFFFFFFF );
|
||||
return std::string(File::GetUserPath(D_MAPS_IDX)) + std::string(tmpBuffer) + ".map";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SCoreStartupParameter::BOOT_ELF:
|
||||
case SCoreStartupParameter::BOOT_DOL:
|
||||
|
@ -170,7 +169,6 @@ bool CBoot::BootUp()
|
|||
switch (_StartupPara.m_BootType)
|
||||
{
|
||||
// GCM and Wii
|
||||
// ===================================================================================
|
||||
case SCoreStartupParameter::BOOT_ISO:
|
||||
{
|
||||
DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(_StartupPara.m_strFilename);
|
||||
|
@ -214,11 +212,10 @@ bool CBoot::BootUp()
|
|||
|
||||
// We don't need the volume any more
|
||||
delete pVolume;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// DOL
|
||||
// ===================================================================================
|
||||
case SCoreStartupParameter::BOOT_DOL:
|
||||
{
|
||||
// Check if we have gotten a Wii file or not
|
||||
|
@ -257,11 +254,11 @@ bool CBoot::BootUp()
|
|||
|
||||
if (LoadMapFromFilename(_StartupPara.m_strFilename))
|
||||
HLE::PatchFunctions();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// ELF
|
||||
// ===================================================================================
|
||||
case SCoreStartupParameter::BOOT_ELF:
|
||||
{
|
||||
if(!File::Exists(_StartupPara.m_strFilename.c_str()))
|
||||
|
@ -291,18 +288,19 @@ bool CBoot::BootUp()
|
|||
}
|
||||
|
||||
// load image or create virtual drive from directory
|
||||
if (!_StartupPara.m_strDVDRoot.empty()) {
|
||||
if (!_StartupPara.m_strDVDRoot.empty())
|
||||
{
|
||||
NOTICE_LOG(BOOT, "Setting DVDRoot %s", _StartupPara.m_strDVDRoot.c_str());
|
||||
// TODO: auto-convert elf to dol, so we can load them :)
|
||||
VolumeHandler::SetVolumeDirectory(_StartupPara.m_strDVDRoot, elfWii);
|
||||
BS2Success = EmulatedBS2(elfWii);
|
||||
}
|
||||
else if (!_StartupPara.m_strDefaultGCM.empty()) {
|
||||
else if (!_StartupPara.m_strDefaultGCM.empty())
|
||||
{
|
||||
NOTICE_LOG(BOOT, "Loading default ISO %s", _StartupPara.m_strDefaultGCM.c_str());
|
||||
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultGCM);
|
||||
}
|
||||
else
|
||||
VolumeHandler::SetVolumeDirectory(_StartupPara.m_strFilename, elfWii);
|
||||
else VolumeHandler::SetVolumeDirectory(_StartupPara.m_strFilename, elfWii);
|
||||
|
||||
DVDInterface::SetDiscInside(VolumeHandler::IsValid());
|
||||
|
||||
|
@ -317,11 +315,10 @@ bool CBoot::BootUp()
|
|||
}
|
||||
UpdateDebugger_MapLoaded();
|
||||
Dolphin_Debugger::AddAutoBreakpoints();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Wii WAD
|
||||
// ===================================================================================
|
||||
case SCoreStartupParameter::BOOT_WII_NAND:
|
||||
Boot_WiiWAD(_StartupPara.m_strFilename.c_str());
|
||||
|
||||
|
@ -335,12 +332,10 @@ bool CBoot::BootUp()
|
|||
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultGCM);
|
||||
|
||||
DVDInterface::SetDiscInside(VolumeHandler::IsValid());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
// Bootstrap 2 (AKA: Initial Program Loader, "BIOS")
|
||||
// ===================================================================================
|
||||
case SCoreStartupParameter::BOOT_BS2:
|
||||
{
|
||||
DVDInterface::SetDiscInside(VolumeHandler::IsValid());
|
||||
|
@ -353,8 +348,8 @@ bool CBoot::BootUp()
|
|||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
|
|
|
@ -51,9 +51,9 @@ bool CDolLoader::Initialize(u8* _pBuffer, u32 _Size)
|
|||
p[i] = Common::swap32(p[i]);
|
||||
|
||||
// load all text (code) sections
|
||||
for(int i = 0; i < DOL_NUM_TEXT; i++)
|
||||
for (int i = 0; i < DOL_NUM_TEXT; i++)
|
||||
{
|
||||
if(m_dolheader.textOffset[i] != 0)
|
||||
if (m_dolheader.textOffset[i] != 0)
|
||||
{
|
||||
u8* pTemp = &_pBuffer[m_dolheader.textOffset[i]];
|
||||
for (u32 num = 0; num < m_dolheader.textSize[i]; num++)
|
||||
|
@ -62,9 +62,9 @@ bool CDolLoader::Initialize(u8* _pBuffer, u32 _Size)
|
|||
}
|
||||
|
||||
// load all data sections
|
||||
for(int i = 0; i < DOL_NUM_DATA; i++)
|
||||
for (int i = 0; i < DOL_NUM_DATA; i++)
|
||||
{
|
||||
if(m_dolheader.dataOffset[i] != 0)
|
||||
if (m_dolheader.dataOffset[i] != 0)
|
||||
{
|
||||
u8* pTemp = &_pBuffer[m_dolheader.dataOffset[i]];
|
||||
for (u32 num = 0; num < m_dolheader.dataSize[i]; num++)
|
||||
|
|
|
@ -59,13 +59,14 @@ bool CBoot::Boot_ELF(const char *filename)
|
|||
{
|
||||
if (LoadMapFromFilename(filename))
|
||||
HLE::PatchFunctions();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
HLE::PatchFunctions();
|
||||
}
|
||||
|
||||
PC = reader.GetEntryPoint();
|
||||
delete [] mem;
|
||||
delete []mem;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,8 @@ bool CBoot::Install_WiiWAD(const char* _pFilename)
|
|||
sprintf(APPFileName, "%s%08x.app", ContentPath, Content.m_ContentID);
|
||||
|
||||
FILE* pAPPFile = fopen(APPFileName, "wb");
|
||||
if (pAPPFile == NULL) {
|
||||
if (pAPPFile == NULL)
|
||||
{
|
||||
PanicAlert("WAD installation failed: error creating %s", APPFileName);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ ElfReader::ElfReader(void *ptr)
|
|||
const char *ElfReader::GetSectionName(int section) const
|
||||
{
|
||||
if (sections[section].sh_type == SHT_NULL)
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
int nameOffset = sections[section].sh_name;
|
||||
char *ptr = (char*)GetSectionDataPtr(header->e_shstrndx);
|
||||
|
@ -102,7 +102,7 @@ const char *ElfReader::GetSectionName(int section) const
|
|||
if (ptr)
|
||||
return ptr + nameOffset;
|
||||
else
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void addrToHiLo(u32 addr, u16 &hi, s16 &lo)
|
||||
|
@ -207,7 +207,7 @@ SectionID ElfReader::GetSectionByName(const char *name, int firstSection) const
|
|||
{
|
||||
const char *secname = GetSectionName(i);
|
||||
|
||||
if (secname != 0 && strcmp(name, secname) == 0)
|
||||
if (secname != NULL && strcmp(name, secname) == 0)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
|
|
|
@ -57,10 +57,9 @@ void SConfig::SaveSettings()
|
|||
{
|
||||
NOTICE_LOG(BOOT, "Saving Settings to %s", File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // yes we must load first to not kill unknown stuff
|
||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff
|
||||
|
||||
// General
|
||||
{
|
||||
ini.Set("General", "LastFilename", m_LastFilename);
|
||||
|
||||
// ISO folders
|
||||
|
@ -74,9 +73,7 @@ void SConfig::SaveSettings()
|
|||
}
|
||||
|
||||
ini.Set("General", "RecersiveGCMPaths", m_RecursiveISOFolder);
|
||||
}
|
||||
|
||||
{
|
||||
// Interface
|
||||
ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
|
||||
ini.Set("Interface", "UsePanicHandlers", m_LocalCoreStartupParameter.bUsePanicHandlers);
|
||||
|
@ -142,10 +139,8 @@ void SConfig::SaveSettings()
|
|||
ini.Set("Core", "DSPPlugin", m_LocalCoreStartupParameter.m_strDSPPlugin);
|
||||
ini.Set("Core", "PadPlugin", m_LocalCoreStartupParameter.m_strPadPlugin[0]);
|
||||
ini.Set("Core", "WiiMotePlugin",m_LocalCoreStartupParameter.m_strWiimotePlugin[0]);
|
||||
}
|
||||
|
||||
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
|
||||
m_SYSCONF->Save();
|
||||
}
|
||||
|
||||
|
|
|
@ -111,11 +111,7 @@ struct SConfig
|
|||
static void Shutdown();
|
||||
|
||||
private:
|
||||
|
||||
// constructor
|
||||
SConfig();
|
||||
|
||||
// destructor
|
||||
~SConfig();
|
||||
|
||||
static SConfig* m_Instance;
|
||||
|
|
|
@ -104,7 +104,8 @@ void Patch(u32 address, const char *hle_func_name)
|
|||
{
|
||||
for (u32 i = 0; i < sizeof(OSPatches) / sizeof(SPatch); i++)
|
||||
{
|
||||
if (!strcmp(OSPatches[i].m_szPatchName, hle_func_name)) {
|
||||
if (!strcmp(OSPatches[i].m_szPatchName, hle_func_name))
|
||||
{
|
||||
u32 HLEPatchValue = (1 & 0x3f) << 26;
|
||||
Memory::Write_U32(HLEPatchValue | i, address);
|
||||
return;
|
||||
|
@ -121,7 +122,8 @@ void PatchFunctions()
|
|||
if (symbol > 0)
|
||||
{
|
||||
u32 HLEPatchValue = (1 & 0x3f) << 26;
|
||||
for (u32 addr = symbol->address; addr < symbol->address + symbol->size; addr += 4) {
|
||||
for (u32 addr = symbol->address; addr < symbol->address + symbol->size; addr += 4)
|
||||
{
|
||||
orig_instruction[addr] = Memory::ReadUnchecked_U32(addr);
|
||||
Memory::Write_U32(HLEPatchValue | i, addr);
|
||||
}
|
||||
|
@ -166,4 +168,4 @@ u32 GetOrigInstruction(u32 addr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
} // end of namespace HLE
|
||||
|
|
|
@ -120,8 +120,8 @@ void GetStringVA(std::string& _rOutBuffer, u32 strReg)
|
|||
{
|
||||
//u64 Double = Memory::Read_U64(Parameter);
|
||||
_rOutBuffer += StringFromFormat(ArgumentBuffer, Parameter);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 'f':
|
||||
{
|
||||
|
@ -129,8 +129,8 @@ void GetStringVA(std::string& _rOutBuffer, u32 strReg)
|
|||
rPS0(FloatingParameterCounter));
|
||||
FloatingParameterCounter++;
|
||||
ParameterCounter--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 'p':
|
||||
// Override, so 64bit dolphin prints 32bit pointers, since the ppc is 32bit :)
|
||||
|
@ -153,4 +153,4 @@ void GetStringVA(std::string& _rOutBuffer, u32 strReg)
|
|||
_rOutBuffer.resize(_rOutBuffer.length() - 1);
|
||||
}
|
||||
|
||||
}
|
||||
} // end of namespace HLE_OS
|
||||
|
|
|
@ -240,7 +240,7 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress)
|
|||
u32 addr = CommandBuffer.PayloadBuffer.at(0).m_Address;
|
||||
Memory::WriteBigEData((const u8*)&m_Ifconfig, addr, 8);
|
||||
addr += 8;
|
||||
for (unsigned int i = 0;i < 3; i++)
|
||||
for (unsigned int i = 0; i < 3; i++)
|
||||
{
|
||||
netcfg_connection_t *conn = &m_Ifconfig.connection[i];
|
||||
|
||||
|
@ -349,10 +349,12 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress)
|
|||
// Handle /dev/net/ip/top requests
|
||||
CWII_IPC_HLE_Device_net_ip_top::CWII_IPC_HLE_Device_net_ip_top(u32 _DeviceID, const std::string& _rDeviceName)
|
||||
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
CWII_IPC_HLE_Device_net_ip_top::~CWII_IPC_HLE_Device_net_ip_top()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
bool CWII_IPC_HLE_Device_net_ip_top::Open(u32 _CommandAddress, u32 _Mode)
|
||||
{
|
||||
|
@ -424,8 +426,8 @@ u32 CWII_IPC_HLE_Device_net_ip_top::ExecuteCommand(u32 _Command, u32 _BufferIn,
|
|||
// u32 Unk1 = Memory::Read_U32(_BufferIn + 0x04 * 3);
|
||||
u32 Socket = (u32)socket(AF, TYPE, PROT);
|
||||
return Common::swap32(Socket); // So it doesn't get mangled later on
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IOCTL_SO_BIND:
|
||||
{
|
||||
|
@ -439,8 +441,8 @@ u32 CWII_IPC_HLE_Device_net_ip_top::ExecuteCommand(u32 _Command, u32 _BufferIn,
|
|||
int Return = bind(addr->socket, (sockaddr*)&address, sizeof(address));
|
||||
return Return;
|
||||
//int bind(int s, struct sockaddr *addr, int addrlen);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IOCTL_SO_LISTEN:
|
||||
{
|
||||
|
@ -448,8 +450,8 @@ u32 CWII_IPC_HLE_Device_net_ip_top::ExecuteCommand(u32 _Command, u32 _BufferIn,
|
|||
u32 BACKLOG = Memory::Read_U32(_BufferIn + 0x04);
|
||||
u32 Return = listen(S, BACKLOG);
|
||||
return Return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IOCTL_SO_ACCEPT:
|
||||
{
|
||||
|
@ -468,7 +470,6 @@ u32 CWII_IPC_HLE_Device_net_ip_top::ExecuteCommand(u32 _Command, u32 _BufferIn,
|
|||
//int accept(int s, struct sockaddr *addr, int *addrlen);
|
||||
///dev/net/ip/top::IOCtl request 0x1 (BufferIn: (000318c0, 4), BufferOut: (00058a4c, 8)
|
||||
}
|
||||
break;
|
||||
|
||||
case IOCTL_SO_GETHOSTID:
|
||||
return 127 << 24 | 1;
|
||||
|
@ -504,6 +505,5 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtlV(u32 _CommandAddress)
|
|||
}
|
||||
|
||||
Memory::Write_U32(ReturnValue, _CommandAddress+4);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ void InstallExceptionHandler()
|
|||
#endif
|
||||
}
|
||||
|
||||
#else // _WIN32)
|
||||
#else // _WIN32
|
||||
|
||||
//
|
||||
// backtrace useful function
|
||||
|
@ -165,7 +165,7 @@ void print_trace(const char * msg)
|
|||
|
||||
size = backtrace(array, 100);
|
||||
strings = backtrace_symbols(array, size);
|
||||
printf("%s Obtained %zd stack frames.\n", msg, size);
|
||||
printf("%s Obtained %u stack frames.\n", msg, size);
|
||||
for (i = 0; i < size; i++)
|
||||
printf("--> %s\n", strings[i]);
|
||||
free(strings);
|
||||
|
|
|
@ -161,7 +161,8 @@ THREAD_RETURN CompressAndDumpState(void *pArgs)
|
|||
delete saveArg;
|
||||
|
||||
// Moving to last overwritten save-state
|
||||
if (File::Exists(cur_filename.c_str())) {
|
||||
if (File::Exists(cur_filename.c_str()))
|
||||
{
|
||||
if (File::Exists((std::string(File::GetUserPath(D_STATESAVES_IDX)) + "lastState.sav").c_str()))
|
||||
File::Delete((std::string(File::GetUserPath(D_STATESAVES_IDX)) + "lastState.sav").c_str());
|
||||
|
||||
|
@ -170,9 +171,10 @@ THREAD_RETURN CompressAndDumpState(void *pArgs)
|
|||
}
|
||||
|
||||
FILE *f = fopen(filename.c_str(), "wb");
|
||||
if (f == NULL) {
|
||||
if (f == NULL)
|
||||
{
|
||||
Core::DisplayMessage("Could not save state", 2000);
|
||||
delete [] buffer;
|
||||
delete []buffer;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -181,11 +183,13 @@ THREAD_RETURN CompressAndDumpState(void *pArgs)
|
|||
header.sz = bCompressed ? sz : 0;
|
||||
|
||||
fwrite(&header, sizeof(state_header), 1, f);
|
||||
if (bCompressed) {
|
||||
if (bCompressed)
|
||||
{
|
||||
lzo_uint cur_len = 0;
|
||||
lzo_uint i = 0;
|
||||
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
if ((i + IN_LEN) >= sz)
|
||||
cur_len = sz - i;
|
||||
else
|
||||
|
@ -202,7 +206,6 @@ THREAD_RETURN CompressAndDumpState(void *pArgs)
|
|||
break;
|
||||
i += cur_len;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -210,8 +213,7 @@ THREAD_RETURN CompressAndDumpState(void *pArgs)
|
|||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
delete [] buffer;
|
||||
delete []buffer;
|
||||
|
||||
Core::DisplayMessage(StringFromFormat("Saved State to %s",
|
||||
filename.c_str()).c_str(), 2000);
|
||||
|
@ -288,7 +290,6 @@ void LoadStateCallback(u64 userdata, int cyclesLate)
|
|||
gameID), 2000);
|
||||
|
||||
fclose(f);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -300,14 +301,15 @@ void LoadStateCallback(u64 userdata, int cyclesLate)
|
|||
|
||||
lzo_uint i = 0;
|
||||
buffer = new u8[sz];
|
||||
if (!buffer) {
|
||||
if (!buffer)
|
||||
{
|
||||
PanicAlert("Error allocating buffer");
|
||||
return;
|
||||
}
|
||||
while (true)
|
||||
{
|
||||
lzo_uint cur_len = 0;
|
||||
lzo_uint new_len = 0;
|
||||
lzo_uint cur_len = 0; // number of bytes to read
|
||||
lzo_uint new_len = 0; // number of bytes to write
|
||||
if (fread(&cur_len, 1, sizeof(int), f) == 0)
|
||||
break;
|
||||
if (feof(f))
|
||||
|
@ -324,7 +326,6 @@ void LoadStateCallback(u64 userdata, int cyclesLate)
|
|||
return;
|
||||
}
|
||||
|
||||
// The size of the data to read to our buffer is 'new_len'
|
||||
i += new_len;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ void StopTrace()
|
|||
if (tracefile)
|
||||
{
|
||||
fclose(tracefile);
|
||||
tracefile = 0;
|
||||
tracefile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,5 +143,5 @@ int SyncTrace()
|
|||
return 1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} // end of namespace Core
|
||||
|
|
|
@ -23,7 +23,8 @@ namespace VolumeHandler
|
|||
|
||||
DiscIO::IVolume* g_pVolume = NULL;
|
||||
|
||||
DiscIO::IVolume *GetVolume() {
|
||||
DiscIO::IVolume *GetVolume()
|
||||
{
|
||||
return g_pVolume;
|
||||
}
|
||||
|
||||
|
@ -50,7 +51,7 @@ bool SetVolumeName(const std::string& _rFullPath)
|
|||
|
||||
g_pVolume = DiscIO::CreateVolumeFromFilename(_rFullPath);
|
||||
|
||||
return g_pVolume != NULL;
|
||||
return (g_pVolume != NULL);
|
||||
}
|
||||
|
||||
void SetVolumeDirectory(const std::string& _rFullPath, bool _bIsWii, const std::string& _rApploader, const std::string& _rDOL)
|
||||
|
@ -82,7 +83,6 @@ bool ReadToPtr(u8* ptr, u64 _dwOffset, u64 _dwLength)
|
|||
g_pVolume->Read(_dwOffset, _dwLength, ptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -93,13 +93,12 @@ bool RAWReadToPtr( u8* ptr, u64 _dwOffset, u64 _dwLength )
|
|||
g_pVolume->RAWRead(_dwOffset, _dwLength, ptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsValid()
|
||||
{
|
||||
return g_pVolume != NULL;
|
||||
return (g_pVolume != NULL);
|
||||
}
|
||||
|
||||
bool IsWii()
|
||||
|
@ -110,4 +109,4 @@ bool IsWii()
|
|||
return false;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // end of namespace VolumeHandler
|
||||
|
|
|
@ -42,6 +42,6 @@ DiscIO::IVolume *GetVolume();
|
|||
|
||||
void EjectVolume();
|
||||
|
||||
} // namespace
|
||||
} // end of namespace VolumeHandler
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue