mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 13:47:57 +03:00
Formatting fixes.
This commit is contained in:
parent
1b10823988
commit
14b6421cf6
9 changed files with 50 additions and 51 deletions
|
@ -873,25 +873,24 @@ bool CIopBios::TryGetImageVersionFromContents(const std::string& imagePath, unsi
|
|||
static const std::string ioprpPatternString = "ioprp";
|
||||
|
||||
auto tryMatchVersionPattern =
|
||||
[result](auto moduleVersionString, const std::string& patternString)
|
||||
{
|
||||
if(!strncmp(moduleVersionString, patternString.c_str(), patternString.size()))
|
||||
{
|
||||
//Found something
|
||||
unsigned int imageVersion = atoi(moduleVersionString + patternString.size());
|
||||
if(imageVersion < 1000) return false;
|
||||
if(result)
|
||||
{
|
||||
(*result) = imageVersion;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
[result](auto moduleVersionString, const std::string& patternString) {
|
||||
if(!strncmp(moduleVersionString, patternString.c_str(), patternString.size()))
|
||||
{
|
||||
//Found something
|
||||
unsigned int imageVersion = atoi(moduleVersionString + patternString.size());
|
||||
if(imageVersion < 1000) return false;
|
||||
if(result)
|
||||
{
|
||||
(*result) = imageVersion;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Iop::Ioman::CScopedFile file(fd, *m_ioman);
|
||||
auto stream = m_ioman->GetFileStream(file);
|
||||
while(1)
|
||||
|
|
|
@ -246,7 +246,7 @@ uint32 CFileIoHandler2200::InvokeWrite(uint32* args, uint32 argsSize, uint32* re
|
|||
assert(argsSize >= 48);
|
||||
assert(retSize == 4);
|
||||
auto command = reinterpret_cast<WRITECOMMAND*>(args);
|
||||
|
||||
|
||||
assert(command->unalignedSize == 0);
|
||||
uint32 writeAddress = command->buffer & (PS2::EE_RAM_SIZE - 1);
|
||||
auto result = m_ioman->Write(command->fd, command->size, reinterpret_cast<const void*>(ram + writeAddress));
|
||||
|
@ -296,7 +296,7 @@ uint32 CFileIoHandler2200::InvokeRmdir(uint32* args, uint32 argsSize, uint32* re
|
|||
assert(retSize == 4);
|
||||
auto command = reinterpret_cast<CCODECOMMAND*>(args);
|
||||
auto result = 0;
|
||||
|
||||
|
||||
CLog::GetInstance().Print(LOG_NAME, "Rmdir('%s');\r\n", command->path);
|
||||
|
||||
PrepareGenericReply(ram, command->header, COMMANDID_RMDIR, result);
|
||||
|
@ -379,7 +379,7 @@ uint32 CFileIoHandler2200::InvokeChstat(uint32* args, uint32 argsSize, uint32* r
|
|||
{
|
||||
assert(retSize == 4);
|
||||
auto command = reinterpret_cast<CHSTATCOMMAND*>(args);
|
||||
|
||||
|
||||
CLog::GetInstance().Print(LOG_NAME, "Chstat('%s', %d);\r\n", command->path, command->flags);
|
||||
|
||||
auto result = 0;
|
||||
|
@ -393,13 +393,13 @@ uint32 CFileIoHandler2200::InvokeFormat(uint32* args, uint32 argsSize, uint32* r
|
|||
{
|
||||
assert(argsSize >= 0xC10);
|
||||
assert(retSize == 4);
|
||||
|
||||
|
||||
auto command = reinterpret_cast<FORMATCOMMAND*>(args);
|
||||
|
||||
|
||||
//This is a stub and is not implemented yet
|
||||
CLog::GetInstance().Print(LOG_NAME, "Format(device = '%s', blockDevice = '%s', args, argsSize = %d);\r\n",
|
||||
command->device, command->blockDevice, command->argsSize);
|
||||
|
||||
command->device, command->blockDevice, command->argsSize);
|
||||
|
||||
PrepareGenericReply(ram, command->header, COMMANDID_FORMAT, 0);
|
||||
SendSifReply();
|
||||
return 1;
|
||||
|
@ -424,7 +424,7 @@ uint32 CFileIoHandler2200::InvokeSync(uint32* args, uint32 argsSize, uint32* ret
|
|||
assert(argsSize >= 0x414);
|
||||
assert(retSize == 4);
|
||||
auto command = reinterpret_cast<SYNCCOMMAND*>(args);
|
||||
|
||||
|
||||
//Seems deviceName can be either a string or a fd (FFX)
|
||||
CLog::GetInstance().Print(LOG_NAME, "Sync(...);\r\n");
|
||||
|
||||
|
@ -495,7 +495,7 @@ uint32 CFileIoHandler2200::InvokeDevctl(uint32* args, uint32 argsSize, uint32* r
|
|||
uint32 result = 0;
|
||||
|
||||
CLog::GetInstance().Print(LOG_NAME, "DevCtl('%s') -> ", command->device);
|
||||
|
||||
|
||||
switch(command->cmdId)
|
||||
{
|
||||
case DEVCTL_CDVD_GETERROR:
|
||||
|
@ -554,7 +554,7 @@ uint32 CFileIoHandler2200::InvokeIoctl2(uint32* args, uint32 argsSize, uint32* r
|
|||
CLog::GetInstance().Warn(LOG_NAME, "IoCtl2 -> Unknown(cmd = %08X);\r\n", command->cmdId);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
PrepareGenericReply(ram, command->header, COMMANDID_IOCTL2, 0);
|
||||
SendSifReply();
|
||||
return 1;
|
||||
|
|
|
@ -106,7 +106,7 @@ namespace Iop
|
|||
uint32 unalignedSize;
|
||||
uint8 unalignedData[64];
|
||||
};
|
||||
|
||||
|
||||
struct SEEKCOMMAND
|
||||
{
|
||||
COMMANDHEADER header;
|
||||
|
@ -164,7 +164,7 @@ namespace Iop
|
|||
char args[0x400];
|
||||
uint32 argsSize;
|
||||
};
|
||||
|
||||
|
||||
struct CCODECOMMAND
|
||||
{
|
||||
COMMANDHEADER header;
|
||||
|
@ -241,7 +241,7 @@ namespace Iop
|
|||
uint32 unknown3 = 0;
|
||||
uint32 unknown4 = 0;
|
||||
};
|
||||
|
||||
|
||||
struct CLOSEREPLY
|
||||
{
|
||||
REPLYHEADER header;
|
||||
|
@ -276,7 +276,7 @@ namespace Iop
|
|||
uint32 dstPtr;
|
||||
Ioman::STAT stat;
|
||||
};
|
||||
|
||||
|
||||
struct SEEK64REPLY
|
||||
{
|
||||
REPLYHEADER header;
|
||||
|
|
|
@ -483,8 +483,8 @@ uint32 CIoman::DelDrv(uint32 drvNamePtr)
|
|||
int32 CIoman::Mount(const char* fsName, const char* devicePath)
|
||||
{
|
||||
CLog::GetInstance().Print(LOG_NAME, FUNCTION_MOUNT "(fsName = '%s', devicePath = '%s');\r\n",
|
||||
fsName, devicePath);
|
||||
|
||||
fsName, devicePath);
|
||||
|
||||
auto pathInfo = SplitPath(devicePath);
|
||||
auto deviceIterator = m_devices.find(pathInfo.deviceName);
|
||||
if(deviceIterator == m_devices.end())
|
||||
|
@ -520,24 +520,24 @@ int32 CIoman::Umount(const char* deviceName)
|
|||
auto mountedDeviceName = std::string(deviceName);
|
||||
//Strip any colons we might have in the string
|
||||
mountedDeviceName.erase(std::remove(mountedDeviceName.begin(), mountedDeviceName.end(), ':'), mountedDeviceName.end());
|
||||
|
||||
|
||||
auto deviceIterator = m_devices.find(mountedDeviceName);
|
||||
if(deviceIterator == std::end(m_devices))
|
||||
{
|
||||
//Device not found
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//We maybe need to make sure we don't have outstanding fds?
|
||||
m_devices.erase(deviceIterator);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 CIoman::Seek64(uint32 handle, int64 position, uint32 whence)
|
||||
{
|
||||
CLog::GetInstance().Print(LOG_NAME, FUNCTION_SEEK64 "(handle = %d, position = %ld, whence = %d);\r\n",
|
||||
handle, position, whence);
|
||||
handle, position, whence);
|
||||
|
||||
uint64 result = -1ULL;
|
||||
assert(!IsUserDeviceFileHandle(handle));
|
||||
|
|
|
@ -201,7 +201,7 @@ int32 CModload::SearchModuleByName(uint32 moduleNamePtr)
|
|||
int32 CModload::AllocLoadMemory(uint32 unknown1, uint32 size, uint32 unknown2)
|
||||
{
|
||||
CLog::GetInstance().Print(LOG_NAME, FUNCTION_ALLOCLOADMEMORY "(unknown1 = %d, size = 0x%08X, unknown2 = %d);\r\n",
|
||||
unknown1, size, unknown2);
|
||||
unknown1, size, unknown2);
|
||||
auto sysmem = m_bios.GetSysmem();
|
||||
uint32 result = sysmem->AllocateMemory(size, 0, 0);
|
||||
return result;
|
||||
|
|
|
@ -167,9 +167,9 @@ void CSysclib::Invoke(CMIPS& context, unsigned int functionId)
|
|||
case 15:
|
||||
//bcmp
|
||||
context.m_State.nGPR[CMIPS::V0].nD0 = static_cast<int32>(__memcmp(
|
||||
context.m_State.nGPR[CMIPS::A0].nV0,
|
||||
context.m_State.nGPR[CMIPS::A1].nV0,
|
||||
context.m_State.nGPR[CMIPS::A2].nV0));
|
||||
context.m_State.nGPR[CMIPS::A0].nV0,
|
||||
context.m_State.nGPR[CMIPS::A1].nV0,
|
||||
context.m_State.nGPR[CMIPS::A2].nV0));
|
||||
break;
|
||||
case 16:
|
||||
//bcopy
|
||||
|
|
|
@ -11,17 +11,17 @@ namespace Iop
|
|||
{
|
||||
public:
|
||||
CHardDiskDevice();
|
||||
|
||||
|
||||
Framework::CStream* GetFile(uint32, const char*) override;
|
||||
Directory GetDirectory(const char*) override;
|
||||
fs::path GetMountPath(const char*) override;
|
||||
|
||||
|
||||
private:
|
||||
void CreatePartition(const std::vector<std::string>&);
|
||||
|
||||
|
||||
fs::path m_basePath;
|
||||
};
|
||||
|
||||
|
||||
class CHardDiskPartition : public Framework::CStream
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Iop
|
|||
{
|
||||
public:
|
||||
CPathDirectoryDevice(const fs::path& basePath)
|
||||
: m_basePath(basePath)
|
||||
: m_basePath(basePath)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace Iop
|
|||
{
|
||||
return m_basePath;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
fs::path m_basePath;
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Iop
|
|||
{
|
||||
public:
|
||||
CPreferenceDirectoryDevice(const char* basePathPreferenceName)
|
||||
: m_basePathPreferenceName(basePathPreferenceName)
|
||||
: m_basePathPreferenceName(basePathPreferenceName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace Iop
|
|||
{
|
||||
return CAppConfig::GetInstance().GetPreferencePath(m_basePathPreferenceName.c_str());
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
std::string m_basePathPreferenceName;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue