Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
- ===================================================================
- --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp (revision 6634)
- +++ Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp (working copy)
- @@ -25,6 +25,10 @@
- #include <algorithm>
- #include <fstream>
- +#include <sys/types.h>
- +#include <sys/stat.h>
- +#include <fcntl.h>
- +
- typedef std::pair<char, std::string> replace_t;
- typedef std::vector<replace_t> replace_v;
- static replace_v replacements;
- @@ -146,9 +150,16 @@
- switch(_Mode)
- {
- case ISFS_OPEN_READ: m_pFileHandle = fopen(m_Filename.c_str(), "rb"); break;
- - case ISFS_OPEN_WRITE: m_pFileHandle = fopen(m_Filename.c_str(), "r+b"); break;
- + case ISFS_OPEN_WRITE: /* m_pFileHandle = fopen(m_Filename.c_str(), "r+b"); break; */
- // MK Wii gets here corrupting its saves, however using rb+ mode works fine
- // TODO : figure it properly...
- + {
- + int fd = open(m_Filename.c_str(), O_WRONLY);
- + if (fd != -1) m_pFileHandle = fdopen(fd, "wb");
- + // fd is not duplicated, thus will be closed
- + // when fclose is called on m_pFileHandle
- + }
- + break;
- case ISFS_OPEN_RW: m_pFileHandle = fopen(m_Filename.c_str(), "r+b"); break;
- default: PanicAlert("FileIO: Unknown open mode : 0x%02x", _Mode); break;
- }
- @@ -182,7 +193,7 @@
- s32 SeekPosition = Memory::Read_U32(_CommandAddress + 0xC);
- s32 Mode = Memory::Read_U32(_CommandAddress + 0x10);
- - INFO_LOG(WII_IPC_FILEIO, "FileIO: Seek Pos: 0x%08x, Mode: %i (%s, Length=0x%08x)", SeekPosition, Mode, m_Name.c_str(), m_FileLength);
- + INFO_LOG(WII_IPC_FILEIO, "FileIO: Seek Pos: 0x%08x, Mode: %i (%s)", SeekPosition, Mode, m_Name.c_str());
- /* TODO: Check if the new changes and the removed hack
- "magically" fixes Zelda - Twilight Princess as well */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement