diff --git a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp index 984aa82eee..7027b6775d 100644 --- a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp @@ -491,10 +491,10 @@ void GLFragmentDecompilerThread::Task() case RSX_FP_OPCODE_DDY: SetDst("dFdy($0)"); break; case RSX_FP_OPCODE_NRM: SetDst("normalize($0)"); break; case RSX_FP_OPCODE_TEX: SetDst("texture($t, $0.xy)"); break; - case RSX_FP_OPCODE_TXP: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXP"); break; + case RSX_FP_OPCODE_TXP: LOG_ERROR(RSX, "TEX_SRB texture projection used. Please report this to a RPCS3 developer!"); SetDst("textureProj($t, $0.xy, $1)"); break; //TODO: Test this case RSX_FP_OPCODE_TXD: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXD"); break; - case RSX_FP_OPCODE_TXB: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXB"); break; - case RSX_FP_OPCODE_TXL: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXL"); break; + case RSX_FP_OPCODE_TXB: SetDst("texture($t, $0.xy, $1)"); break; + case RSX_FP_OPCODE_TXL: SetDst("textureLod($t, $0.xy, $1.x)"); break; case RSX_FP_OPCODE_UP2: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UP2"); break; case RSX_FP_OPCODE_UP4: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UP4"); break; case RSX_FP_OPCODE_UP16: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UP16"); break; diff --git a/rpcs3/Emu/RSX/RSXFragmentProgram.h b/rpcs3/Emu/RSX/RSXFragmentProgram.h index 970d4a5727..70b17b8768 100644 --- a/rpcs3/Emu/RSX/RSXFragmentProgram.h +++ b/rpcs3/Emu/RSX/RSXFragmentProgram.h @@ -49,7 +49,7 @@ enum RSX_FP_OPCODE_PKG = 0x2C, // Pack with sRGB transformation RSX_FP_OPCODE_UPG = 0x2D, // Unpack gamma RSX_FP_OPCODE_DP2A = 0x2E, // 2-component dot product with scalar addition - RSX_FP_OPCODE_TXL = 0x2F, // Texture sample with LOD + RSX_FP_OPCODE_TXL = 0x2F, // Texture sample with explicit LOD RSX_FP_OPCODE_TXB = 0x31, // Texture sample with bias RSX_FP_OPCODE_TEXBEM = 0x33, RSX_FP_OPCODE_TXPBEM = 0x34, diff --git a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp index 9e79e0015c..58d0df01d0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp @@ -82,15 +82,13 @@ void addSaveDataEntry(std::vector& saveEntries, const std::string cellSysutil->Error("Running _stat in cellSaveData. Please report this to a RPCS3 developer!"); - std::string pathy; - - Emu.GetVFS().GetDevice("dev_hdd0", pathy); - + std::string real_path; 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()); + Emu.GetVFS().GetDevice(f.GetPath(), real_path); + + if (stat(real_path.c_str(), &buf) != 0) + cellSysutil->Error("stat failed! (%s)", real_path.c_str()); else { atime = buf.st_atime; diff --git a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp index 071497cfe3..38606e9b5c 100644 --- a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp @@ -251,34 +251,13 @@ s32 cellFsStat(vm::ptr path, vm::ptr sb) 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); - + std::string real_path; 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); + Emu.GetVFS().GetDevice(_path, real_path); - if (result != 0) - sys_fs->Error("_stat failed! (%s)", (pathy.substr(0, pathy.length() - 9) + _path).c_str()); + if (stat(real_path.c_str(), &buf) != 0) + sys_fs->Error("stat failed! (%s)", real_path.c_str()); else { mode = buf.st_mode; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_process.cpp b/rpcs3/Emu/SysCalls/lv2/sys_process.cpp index c8781b56c4..b3169ea1d7 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_process.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_process.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/FS/VFS.h" #include "Emu/Memory/Memory.h" #include "Emu/System.h" #include "Emu/SysCalls/SysCalls.h" @@ -103,17 +104,11 @@ void sys_game_process_exitspawn(vm::ptr path, u32 argv_addr, u32 env Emu.Stop(); }); - int device = -1; + std::string real_path; - 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; + Emu.GetVFS().GetDevice(_path.c_str(), real_path); - if (device != 0) - Emu.BootGame(_path.c_str(), true, device); + Emu.BootGame(real_path, true); return; } @@ -185,16 +180,11 @@ void sys_game_process_exitspawn2(vm::ptr path, u32 argv_addr, u32 en Emu.Stop(); }); - int device = -1; + std::string real_path; - 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; + Emu.GetVFS().GetDevice(_path.c_str(), real_path); - Emu.BootGame(_path.c_str(), true, device); + Emu.BootGame(real_path, true); return; } diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index f1dd6d79e1..5efec19085 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -145,7 +145,7 @@ void Emulator::CheckStatus() } } -bool Emulator::BootGame(const std::string& path, bool direct, int device) +bool Emulator::BootGame(const std::string& path, bool direct) { static const char* elf_path[6] = { @@ -158,34 +158,21 @@ bool Emulator::BootGame(const std::string& path, bool direct, int device) }; auto curpath = path; - if (!direct) + if (direct) { - for (int i = 0; i < sizeof(elf_path) / sizeof(*elf_path); i++) + if (rFile::Access(curpath, rFile::read)) { - curpath = path + elf_path[i]; + SetPath(curpath); + Load(); - if (rFile::Access(curpath, rFile::read)) - { - SetPath(curpath); - Load(); - - return true; - } + return true; } } - else + + for (int i = 0; i < sizeof(elf_path) / sizeof(*elf_path); i++) { - 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); - - curpath = pathy.substr(0, pathy.length() - 9) + path; - + curpath = path + elf_path[i]; + if (rFile::Access(curpath, rFile::read)) { SetPath(curpath); diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index b9a9d4b638..21c44ce3a4 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -207,7 +207,7 @@ public: u32 GetCPUThreadStop() const { return m_cpu_thr_stop; } void CheckStatus(); - bool BootGame(const std::string& path, bool direct = false, int device = 0); + bool BootGame(const std::string& path, bool direct = false); void Load(); void Run();