summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2013-02-17 13:52:04 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2013-02-17 13:52:04 -0600
commitd0ea94a2aaa1909a4b53b158a4a8250ee7578ae4 (patch)
tree21f8a2cb4bb67c919fb65554afb06ed5ab603f75 /Source/Core
parentfa9aafeed8753b0fd8f039d3d740b97c1bfad4dd (diff)
WII_IPC_HLE_Device_FileIO: don't rebuild the filename on every operation.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp11
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.h2
2 files changed, 9 insertions, 4 deletions
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
index d65a009a2a..711d360874 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
@@ -118,17 +118,18 @@ bool CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode)
"Read and Write"
};
+ m_filepath = HLE_IPC_BuildFilename(m_Name, 64);
+
// The file must exist before we can open it
// It should be created by ISFS_CreateFile, not here
- auto const filename = HLE_IPC_BuildFilename(m_Name, 64);
- if (File::Exists(filename))
+ if (File::Exists(m_filepath))
{
INFO_LOG(WII_IPC_FILEIO, "FileIO: Open %s (%s == %08X)", m_Name.c_str(), Modes[_Mode], _Mode);
ReturnValue = m_DeviceID;
}
else
{
- WARN_LOG(WII_IPC_FILEIO, "FileIO: Open (%s) failed - File doesn't exist %s", Modes[_Mode], filename.c_str());
+ WARN_LOG(WII_IPC_FILEIO, "FileIO: Open (%s) failed - File doesn't exist %s", Modes[_Mode], m_filepath.c_str());
ReturnValue = FS_FILE_NOT_EXIST;
}
@@ -158,7 +159,7 @@ File::IOFile CWII_IPC_HLE_Device_FileIO::OpenFile()
break;
}
- return File::IOFile(HLE_IPC_BuildFilename(m_Name, 64), open_mode);
+ return File::IOFile(m_filepath, open_mode);
}
bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
@@ -344,4 +345,6 @@ void CWII_IPC_HLE_Device_FileIO::DoState(PointerWrap &p)
p.Do(m_Mode);
p.Do(m_SeekPos);
+
+ m_filepath = HLE_IPC_BuildFilename(m_Name, 64);
}
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.h
index 1ac839e70d..3698d05c9f 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.h
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.h
@@ -77,6 +77,8 @@ private:
u32 m_Mode;
u32 m_SeekPos;
+
+ std::string m_filepath;
};
#endif