remove the remaining parts of the hack from r1327

the original issue was fixed some time ago
no functionality changes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6636 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99 2010-12-21 22:27:38 +00:00
parent 6087987f85
commit e9e86abed6
4 changed files with 4 additions and 30 deletions

View File

@ -316,30 +316,12 @@ void ExecuteCommand(u32 _Address)
}
else
{
CmdSuccess = true;
// The device is already created
pDevice = AccessDeviceByID(DeviceID);
// F|RES: prolly the re-open is just a mode change
pDevice = AccessDeviceByID(DeviceID);
CmdSuccess = pDevice->Open(_Address, Mode);
INFO_LOG(WII_IPC_FILEIO, "IOP: ReOpen (Device=%s, DeviceID=%08x, Mode=%i)",
pDevice->GetDeviceName().c_str(), DeviceID, Mode);
if (pDevice->IsHardware())
{
pDevice->Open(_Address, Mode);
}
else
{
// We may not have a file handle at this point, in Mario Kart I got a
// Open > Failed > ... other stuff > ReOpen call sequence, in that case
// we have no file and no file handle, so we call Open again to basically
// get a -106 error so that the game call CreateFile and then ReOpen again.
if (pDevice->ReturnFileHandle())
Memory::Write_U32(DeviceID, _Address + 4);
else
pDevice->Open(_Address, Mode);
}
}
}
break;

View File

@ -91,8 +91,6 @@ public:
virtual u32 Update() { return 0; }
virtual bool ReturnFileHandle() { return false; }
virtual bool IsHardware() { return m_Hardware; }
virtual bool IsOpened() { return m_Active; }

View File

@ -147,7 +147,7 @@ bool CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _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;
// MK Wii gets here corrupting its saves, however using rb+ mode works fine
// MK Wii gets here corrupting its saves (truncating rksys.dat), however using rb+ mode works fine
// TODO : figure it properly...
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 +182,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
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, Length=0x%08x)", SeekPosition, Mode, m_Name.c_str(), File::GetSize(m_pFileHandle));
/* TODO: Check if the new changes and the removed hack
"magically" fixes Zelda - Twilight Princess as well */
@ -299,11 +299,6 @@ bool CWII_IPC_HLE_Device_FileIO::IOCtl(u32 _CommandAddress)
return true;
}
bool CWII_IPC_HLE_Device_FileIO::ReturnFileHandle()
{
return (m_pFileHandle) ? true : false;
}
void CWII_IPC_HLE_Device_FileIO::DoState(PointerWrap &p)
{
if (p.GetMode() == PointerWrap::MODE_WRITE)

View File

@ -35,7 +35,6 @@ public:
bool Read(u32 _CommandAddress);
bool Write(u32 _CommandAddress);
bool IOCtl(u32 _CommandAddress);
bool ReturnFileHandle();
void DoState(PointerWrap &p);
private: