Wii IPC: Code housekeeping

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3345 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2009-06-06 23:24:41 +00:00
parent 3a4e51b67f
commit e99b687525
3 changed files with 12 additions and 10 deletions

View File

@ -19,6 +19,7 @@
#include "FileUtil.h"
#include "StringUtil.h"
#include "WII_IPC_HLE_Device_fs.h"
#include "WII_IPC_HLE_Device_FileIO.h"
@ -94,7 +95,7 @@ CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode)
// Reading requires the file to exist
if(_Mode == 0x01 && !File::Exists(m_Filename.c_str())) {
ERROR_LOG(WII_IPC_FILEIO, " FileIO failed open for reading: %s - File doesn't exist", m_Filename.c_str());
ReturnValue = -106;
ReturnValue = FS_FILE_NOT_EXIST;
} else {
switch(_Mode)
{
@ -113,7 +114,7 @@ CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode)
else if(ReturnValue == 0)
{
ERROR_LOG(WII_IPC_FILEIO, " FileIO failed open: %s(%s) - I/O Error", m_Filename.c_str(), Modes[_Mode]);
ReturnValue = -101;
ReturnValue = FS_INVALID_ARGUMENT;
}
Memory::Write_U32(ReturnValue, _CommandAddress+4);
@ -141,7 +142,6 @@ CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
if (m_FileLength > 0 && SeekPosition > m_FileLength && Mode == 0)
{
NewSeekPosition = SeekPosition % m_FileLength;
INFO_LOG(WII_IPC_FILEIO, "***********************************:");
}
INFO_LOG(WII_IPC_FILEIO, "FileIO: New Seek Pos: %s, Mode: %i (Device=%s)", ThS(NewSeekPosition).c_str(), Mode, GetDeviceName().c_str());

View File

@ -27,13 +27,6 @@
extern std::string HLE_IPC_BuildFilename(const char* _pFilename, int _size);
#define FS_RESULT_OK (0)
#define FS_DIRFILE_NOT_FOUND (-6)
#define FS_INVALID_ARGUMENT (-101)
#define FS_FILE_EXIST (-105)
#define FS_FILE_NOT_EXIST (-106)
#define FS_RESULT_FATAL (-128)
#define MAX_NAME (12)

View File

@ -19,6 +19,15 @@
#include "WII_IPC_HLE_Device.h"
enum {
FS_RESULT_OK = 0,
FS_DIRFILE_NOT_FOUND = -6,
FS_INVALID_ARGUMENT = -101,
FS_FILE_EXIST = -105,
FS_FILE_NOT_EXIST = -106,
FS_RESULT_FATAL = -128,
};
class CWII_IPC_HLE_Device_fs : public IWII_IPC_HLE_Device
{
public: