diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 7e92b8642b..8acd8de425 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -1845,12 +1845,12 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const } break; - // Windows Clipping + // Windows Clipping (Doesn't seem to be relevant?) case NV4097_SET_WINDOW_OFFSET: { const u16 x = ARGS(0); const u16 y = ARGS(0) >> 16; - LOG_WARNING(RSX, "TODO: NV4097_SET_WINDOW_OFFSET: x=%d, y=%d", x, y); + //LOG_WARNING(RSX, "TODO: NV4097_SET_WINDOW_OFFSET: x=%d, y=%d", x, y); } break; diff --git a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp index e96037f8f5..9e79e0015c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp @@ -10,6 +10,14 @@ #include "Loader/PSF.h" #include "cellSaveData.h" +#ifdef _WIN32 + #include + #undef CreateFile +#else + #include + #include +#endif + extern Module *cellSysutil; // Auxiliary Classes @@ -39,7 +47,6 @@ public: } }; - // Auxiliary Functions u64 getSaveDataSize(const std::string& dirName) { @@ -69,6 +76,28 @@ void addSaveDataEntry(std::vector& saveEntries, const std::string std::string localPath; Emu.GetVFS().GetDevice(saveDir + "/ICON0.PNG", localPath); + u64 atime = 0; + u64 mtime = 0; + u64 ctime = 0; + + cellSysutil->Error("Running _stat in cellSaveData. Please report this to a RPCS3 developer!"); + + std::string pathy; + + Emu.GetVFS().GetDevice("dev_hdd0", pathy); + + struct stat buf; + int result = stat((pathy.substr(0, pathy.length() - 9) + f.GetPath()).c_str(), &buf); + + if (result != 0) + cellSysutil->Error("_stat failed! (%s)", (pathy.substr(0, pathy.length() - 9) + f.GetPath()).c_str()); + else + { + atime = buf.st_atime; + mtime = buf.st_mtime; + ctime = buf.st_ctime; + } + SaveDataEntry saveEntry; saveEntry.dirName = psf.GetString("SAVEDATA_DIRECTORY"); saveEntry.listParam = psf.GetString("SAVEDATA_LIST_PARAM"); @@ -76,9 +105,9 @@ void addSaveDataEntry(std::vector& saveEntries, const std::string saveEntry.subtitle = psf.GetString("SUB_TITLE"); saveEntry.details = psf.GetString("DETAIL"); saveEntry.sizeKB = (u32)(getSaveDataSize(saveDir) / 1024); - saveEntry.st_atime_ = 0; // TODO - saveEntry.st_mtime_ = 0; // TODO - saveEntry.st_ctime_ = 0; // TODO + saveEntry.st_atime_ = atime; + saveEntry.st_mtime_ = mtime; + saveEntry.st_ctime_ = ctime; saveEntry.iconBuf = NULL; // TODO: Here should be the PNG buffer saveEntry.iconBufSize = 0; // TODO: Size of the PNG file saveEntry.isNew = false; diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index d620fd22ab..5afa9e72dc 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -289,9 +289,9 @@ int cellVideoOutGetResolutionAvailability(u32 videoOut, u32 resolutionId, u32 as cellSysutil->Warning("cellVideoOutGetResolutionAvailability(videoOut=%d, resolutionId=0x%x, option_addr=0x%x, aspect=%d, option=%d)", videoOut, resolutionId, aspect, option); - if (!Ini.GS3DTV.GetValue() && resolutionId == CELL_VIDEO_OUT_RESOLUTION_720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_1024x720_3D_FRAME_PACKING || + if (!Ini.GS3DTV.GetValue() && (resolutionId == CELL_VIDEO_OUT_RESOLUTION_720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_1024x720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_960x720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_800x720_3D_FRAME_PACKING || - resolutionId == CELL_VIDEO_OUT_RESOLUTION_640x720_3D_FRAME_PACKING) + resolutionId == CELL_VIDEO_OUT_RESOLUTION_640x720_3D_FRAME_PACKING)) return 0; switch(videoOut) diff --git a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp index 6a67a2c334..071497cfe3 100644 --- a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp @@ -9,6 +9,14 @@ #include "Emu/FS/vfsDir.h" #include "lv2Fs.h" +#ifdef _WIN32 + #include + #undef CreateFile +#else + #include + #include +#endif + extern Module *sys_fs; struct FsRingBufferConfig @@ -235,16 +243,66 @@ s32 cellFsStat(vm::ptr path, vm::ptr sb) const std::string _path = path.get_ptr(); + u32 mode = 0; + s32 uid = 0; + s32 gid = 0; + u64 atime = 0; + u64 mtime = 0; + u64 ctime = 0; + u64 size = 0; + + int device = -1; + + if (_path.substr(1, 8) == "dev_hdd0") + device = 0; + else if (_path.substr(1, 8) == "dev_hdd1") + device = 1; + else if (_path.substr(1, 8) == "dev_bdvd") + device = 2; + + std::string pathy; + + if (device == 0) + Emu.GetVFS().GetDevice("dev_hdd0", pathy); + else if (device == 1) + Emu.GetVFS().GetDevice("dev_hdd1", pathy); + else if (device == 2) + Emu.GetVFS().GetDevice("dev_bdvd", pathy); + + struct stat buf; + int result = 1; + + if (device == 2) + result = stat((pathy + _path.substr(9, _path.length())).c_str(), &buf); + else + result = stat((pathy.substr(0, pathy.length() - 9) + _path).c_str(), &buf); + + if (result != 0) + sys_fs->Error("_stat failed! (%s)", (pathy.substr(0, pathy.length() - 9) + _path).c_str()); + else + { + mode = buf.st_mode; + uid = buf.st_uid; + gid = buf.st_gid; + atime = buf.st_atime; + mtime = buf.st_mtime; + ctime = buf.st_ctime; + size = buf.st_size; + } + sb->st_mode = CELL_FS_S_IRUSR | CELL_FS_S_IWUSR | CELL_FS_S_IXUSR | CELL_FS_S_IRGRP | CELL_FS_S_IWGRP | CELL_FS_S_IXGRP | CELL_FS_S_IROTH | CELL_FS_S_IWOTH | CELL_FS_S_IXOTH; - sb->st_uid = 0; - sb->st_gid = 0; - sb->st_atime_ = 0; //TODO - sb->st_mtime_ = 0; //TODO - sb->st_ctime_ = 0; //TODO + if (sb->st_mode == mode) + sys_fs->Error("Mode is the same. Report this to a RPCS3 developer! (%d)", mode); + + sb->st_uid = uid; + sb->st_gid = gid; + sb->st_atime_ = atime; + sb->st_mtime_ = mtime; + sb->st_ctime_ = ctime; sb->st_blksize = 4096; { @@ -266,6 +324,9 @@ s32 cellFsStat(vm::ptr path, vm::ptr sb) } } + if (sb->st_size == size && size != 0) + sys_fs->Error("Size is the same. Report this to a RPCS3 developer! (%d)", size); + sys_fs->Warning("cellFsStat: \"%s\" not found.", path.get_ptr()); return CELL_ENOENT; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_process.cpp b/rpcs3/Emu/SysCalls/lv2/sys_process.cpp index f74b438775..c8781b56c4 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_process.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_process.cpp @@ -109,6 +109,8 @@ void sys_game_process_exitspawn(vm::ptr path, u32 argv_addr, u32 env device = 0; else if (_path.substr(1, 8) == "dev_hdd1") device = 1; + else if (_path.substr(1, 8) == "dev_bdvd") + device = 2; if (device != 0) Emu.BootGame(_path.c_str(), true, device); @@ -189,6 +191,8 @@ void sys_game_process_exitspawn2(vm::ptr path, u32 argv_addr, u32 en device = 0; else if (_path.substr(1, 8) == "dev_hdd1") device = 1; + else if (_path.substr(1, 8) == "dev_bdvd") + device = 2; Emu.BootGame(_path.c_str(), true, device); diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 05adca06f5..f1dd6d79e1 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -181,6 +181,8 @@ bool Emulator::BootGame(const std::string& path, bool direct, int device) Emu.GetVFS().GetDevice("dev_hdd0", pathy); else if (device == 1) Emu.GetVFS().GetDevice("dev_hdd1", pathy); + else if (device == 2) + Emu.GetVFS().GetDevice("dev_bdvd", pathy); curpath = pathy.substr(0, pathy.length() - 9) + path;