From ec2e53dc6b782adeadc5499f2a816d880a609249 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 20 Jan 2015 02:15:43 +0300 Subject: [PATCH] Formatting changes --- rpcs3/Emu/ARMv7/Modules/sceLibKernel.cpp | 2 +- rpcs3/Emu/Cell/SPURecompilerCore.cpp | 8 +- rpcs3/Emu/RSX/RSXThread.cpp | 4 +- rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/libsynth2.cpp | 7 +- rpcs3/Emu/SysCalls/lv2/cellFs.cpp | 151 +++++++++++----------- rpcs3/Emu/SysCalls/lv2/cellFs.h | 16 +-- 9 files changed, 89 insertions(+), 105 deletions(-) diff --git a/rpcs3/Emu/ARMv7/Modules/sceLibKernel.cpp b/rpcs3/Emu/ARMv7/Modules/sceLibKernel.cpp index 8707320d2a..7ae9f6a2a6 100644 --- a/rpcs3/Emu/ARMv7/Modules/sceLibKernel.cpp +++ b/rpcs3/Emu/ARMv7/Modules/sceLibKernel.cpp @@ -106,7 +106,7 @@ s32 sceKernelCreateThread( new_thread.SetStackSize(stackSize); new_thread.SetName(pName.get_ptr()); - sceLibKernel.Error("*** New ARMv7 Thread [%s] (entry_addr=0x%x)^1: id = %d", pName.get_ptr(), entry, id); + sceLibKernel.Error("*** New ARMv7 Thread [%s] (entry=0x%x)^1: id = %d", pName.get_ptr(), entry, id); new_thread.Run(); diff --git a/rpcs3/Emu/Cell/SPURecompilerCore.cpp b/rpcs3/Emu/Cell/SPURecompilerCore.cpp index 8d733bd8b4..197f42987e 100644 --- a/rpcs3/Emu/Cell/SPURecompilerCore.cpp +++ b/rpcs3/Emu/Cell/SPURecompilerCore.cpp @@ -228,7 +228,7 @@ u8 SPURecompilerCore::DecodeMemory(const u32 address) //need_check = true; } } - //LOG_ERROR(Log::SPU, "SPURecompilerCore::DecodeMemory(ls_addr=0x%x): code has changed", pos * sizeof(u32)); + //LOG_ERROR(Log::SPU, "SPURecompilerCore::DecodeMemory(ls=0x%x): code has changed", pos * sizeof(u32)); } } @@ -239,7 +239,7 @@ u8 SPURecompilerCore::DecodeMemory(const u32 address) did_compile = true; if (entry[pos].valid == 0) { - LOG_ERROR(Log::SPU, "SPURecompilerCore::Compile(ls_addr=0x%x): branch to 0x0 opcode", pos * sizeof(u32)); + LOG_ERROR(Log::SPU, "SPURecompilerCore::Compile(ls=0x%x): branch to 0x0 opcode", pos * sizeof(u32)); Emu.Pause(); return 0; } @@ -255,7 +255,7 @@ u8 SPURecompilerCore::DecodeMemory(const u32 address) //if (did_compile) { - //LOG2_OPCODE("SPURecompilerCore::DecodeMemory(ls_addr=0x%x): NewPC = 0x%llx", address, (u64)res << 2); + //LOG2_OPCODE("SPURecompilerCore::DecodeMemory(ls=0x%x): NewPC = 0x%llx", address, (u64)res << 2); //if (pos == 0x19c >> 2) { //Emu.Pause(); @@ -281,7 +281,7 @@ u8 SPURecompilerCore::DecodeMemory(const u32 address) if (did_compile) { - //LOG2_OPCODE("SPURecompilerCore::DecodeMemory(ls_addr=0x%x): NewPC = 0x%llx", address, (u64)res << 2); + //LOG2_OPCODE("SPURecompilerCore::DecodeMemory(ls=0x%x): NewPC = 0x%llx", address, (u64)res << 2); //if (pos == 0x340 >> 2) { //Emu.Pause(); diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 8043de02e9..906b0281c3 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -2505,7 +2505,7 @@ u32 RSXThread::ReadIO32(u32 addr) u32 value; if (!Memory.RSXIOMem.Read32(addr, &value)) { - throw fmt::Format("%s(rsxio_addr=0x%x): RSXIO memory not mapped", __FUNCTION__, addr); + throw fmt::Format("%s(addr=0x%x): RSXIO memory not mapped", __FUNCTION__, addr); } return value; } @@ -2514,6 +2514,6 @@ void RSXThread::WriteIO32(u32 addr, u32 value) { if (!Memory.RSXIOMem.Write32(addr, value)) { - throw fmt::Format("%s(rsxio_addr=0x%x): RSXIO memory not mapped", __FUNCTION__, addr); + throw fmt::Format("%s(addr=0x%x): RSXIO memory not mapped", __FUNCTION__, addr); } } diff --git a/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp index 8d46d2b917..dc4a63cab1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp @@ -39,7 +39,7 @@ int cellGifDecOpen(u32 mainHandle, vm::ptr subHandle, vm::ptr> fd; - int ret = cellFsOpen(src->fileName.to_le(), 0, fd, vm::ptr::make(0), 0); + int ret = cellFsOpen(src->fileName.to_le(), 0, fd, vm::ptr::make(0), 0); current_subHandle->fd = fd.value(); if (ret != CELL_OK) return CELL_GIFDEC_ERROR_OPEN_FILE; diff --git a/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp index eecc0987a4..963ed69d80 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp @@ -45,7 +45,7 @@ int cellJpgDecOpen(u32 mainHandle, vm::ptr subHandle, vm::ptr> fd; - int ret = cellFsOpen(src->fileName.to_le(), 0, fd, vm::ptr::make(0), 0); + int ret = cellFsOpen(src->fileName.to_le(), 0, fd, vm::ptr::make(0), 0); current_subHandle->fd = fd.value(); if (ret != CELL_OK) return CELL_JPGDEC_ERROR_OPEN_FILE; diff --git a/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp index 93c79343b6..d509f4f6c7 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp @@ -86,7 +86,7 @@ s64 pngDecOpen( case se32(CELL_PNGDEC_FILE): // Get file descriptor vm::var> fd; - int ret = cellFsOpen(src->fileName.to_le(), 0, fd, vm::ptr::make(0), 0); + int ret = cellFsOpen(src->fileName.to_le(), 0, fd, vm::ptr::make(0), 0); stream->fd = fd.value(); if (ret != CELL_OK) return CELL_PNGDEC_ERROR_OPEN_FILE; diff --git a/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp b/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp index 9cc4119865..6c1304868d 100644 --- a/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp @@ -60,13 +60,13 @@ u32 cellSoundSynth2GetAddr(u16 reg) int cellSoundSynth2SetEffectAttr(s16 bus, vm::ptr attr) { - libsynth2.Todo("cellSoundSynth2SetEffectAttr(bus=%d, attr_addr=0x%x)", bus, attr.addr()); + libsynth2.Todo("cellSoundSynth2SetEffectAttr(bus=%d, attr=0x%x)", bus, attr); return CELL_OK; } int cellSoundSynth2SetEffectMode(s16 bus, vm::ptr attr) { - libsynth2.Todo("cellSoundSynth2SetEffectMode(bus=%d, attr_addr=0x%x)", bus, attr.addr()); + libsynth2.Todo("cellSoundSynth2SetEffectMode(bus=%d, attr=0x%x)", bus, attr); return CELL_OK; } @@ -77,8 +77,7 @@ void cellSoundSynth2SetCoreAttr(u16 entry, u16 value) int cellSoundSynth2Generate(u16 samples, u32 L_addr, u32 R_addr, u32 Lr_addr, u32 Rr_addr) { - libsynth2.Todo("cellSoundSynth2Generate(samples=0x%x, left=0x%x, right=0x%x, left_rear=0x%x, right_rear=0x%x)", - samples, L_addr, R_addr, Lr_addr, Rr_addr); + libsynth2.Todo("cellSoundSynth2Generate(samples=0x%x, left=0x%x, right=0x%x, left_rear=0x%x, right_rear=0x%x)", samples, L_addr, R_addr, Lr_addr, Rr_addr); return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/lv2/cellFs.cpp b/rpcs3/Emu/SysCalls/lv2/cellFs.cpp index 3aafb8b2c8..79df2eece7 100644 --- a/rpcs3/Emu/SysCalls/lv2/cellFs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/cellFs.cpp @@ -39,10 +39,9 @@ struct FsRingBufferConfig } fs_config; -s32 cellFsOpen(vm::ptr path, s32 flags, vm::ptr> fd, vm::ptr arg, u64 size) +s32 cellFsOpen(vm::ptr path, s32 flags, vm::ptr> fd, vm::ptr arg, u64 size) { - sys_fs->Log("cellFsOpen(path=\"%s\", flags=0x%x, fd_addr=0x%x, arg_addr=0x%x, size=0x%llx)", - path.get_ptr(), flags, fd.addr(), arg.addr(), size); + sys_fs->Log("cellFsOpen(path=0x%x, flags=0x%x, fd=0x%x, arg=0x%x, size=0x%llx)", path, flags, fd, arg, size); const std::string _path = path.get_ptr(); @@ -97,13 +96,13 @@ s32 cellFsOpen(vm::ptr path, s32 flags, vm::ptr> fd, vm::p if (_oflags != 0) { - sys_fs->Error("\"%s\" has unknown flags! flags: 0x%08x", path.get_ptr(), flags); + sys_fs->Error("cellFsOpen(): '%s' has unknown flags! flags: 0x%08x", path.get_ptr(), flags); return CELL_EINVAL; } if (!Emu.GetVFS().ExistsFile(_path)) { - sys_fs->Error("\"%s\" not found! flags: 0x%08x", path.get_ptr(), flags); + sys_fs->Error("cellFsOpen(): '%s' not found! flags: 0x%08x", path.get_ptr(), flags); return CELL_ENOENT; } @@ -111,21 +110,20 @@ s32 cellFsOpen(vm::ptr path, s32 flags, vm::ptr> fd, vm::p if (!stream || !stream->IsOpened()) { - sys_fs->Error("\"%s\" not found! flags: 0x%08x", path.get_ptr(), flags); + sys_fs->Error("cellFsOpen(): '%s' not found! flags: 0x%08x", path.get_ptr(), flags); return CELL_ENOENT; } u32 id = sys_fs->GetNewId(stream, TYPE_FS_FILE); *fd = id; - sys_fs->Notice("\"%s\" opened: fd = %d", path.get_ptr(), id); + sys_fs->Notice("cellFsOpen(): '%s' opened, id -> 0x%x", path.get_ptr(), id); return CELL_OK; } s32 cellFsRead(u32 fd, vm::ptr buf, u64 nbytes, vm::ptr> nread) { - sys_fs->Log("cellFsRead(fd=%d, buf_addr=0x%x, nbytes=0x%llx, nread_addr=0x%x)", - fd, buf.addr(), nbytes, nread.addr()); + sys_fs->Log("cellFsRead(fd=0x%x, buf=0x%x, nbytes=0x%llx, nread=0x%x)", fd, buf, nbytes, nread); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -145,8 +143,7 @@ s32 cellFsRead(u32 fd, vm::ptr buf, u64 nbytes, vm::ptr> nread) s32 cellFsWrite(u32 fd, vm::ptr buf, u64 nbytes, vm::ptr nwrite) { - sys_fs->Log("cellFsWrite(fd=%d, buf_addr=0x%x, nbytes=0x%llx, nwrite_addr=0x%x)", - fd, buf.addr(), nbytes, nwrite.addr()); + sys_fs->Log("cellFsWrite(fd=0x%x, buf=0x%x, nbytes=0x%llx, nwrite=0x%x)", fd, buf, nbytes, nwrite); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) return CELL_ESRCH; @@ -164,7 +161,7 @@ s32 cellFsWrite(u32 fd, vm::ptr buf, u64 nbytes, vm::ptr nwrite s32 cellFsClose(u32 fd) { - sys_fs->Warning("cellFsClose(fd=%d)", fd); + sys_fs->Warning("cellFsClose(fd=0x%x)", fd); if (!Emu.GetIdManager().RemoveID(fd)) return CELL_ESRCH; @@ -174,7 +171,7 @@ s32 cellFsClose(u32 fd) s32 cellFsOpendir(vm::ptr path, vm::ptr fd) { - sys_fs->Warning("cellFsOpendir(path=\"%s\", fd_addr=0x%x)", path.get_ptr(), fd.addr()); + sys_fs->Warning("cellFsOpendir(path=0x%x, fd=0x%x)", path, fd); std::shared_ptr dir(Emu.GetVFS().OpenDir(path.get_ptr())); if (!dir || !dir->IsOpened()) @@ -188,7 +185,7 @@ s32 cellFsOpendir(vm::ptr path, vm::ptr fd) s32 cellFsReaddir(u32 fd, vm::ptr dir, vm::ptr nread) { - sys_fs->Warning("cellFsReaddir(fd=%d, dir_addr=0x%x, nread_addr=0x%x)", fd, dir.addr(), nread.addr()); + sys_fs->Warning("cellFsReaddir(fd=0x%x, dir=0x%x, nread=0x%x)", fd, dir, nread); std::shared_ptr directory; if (!sys_fs->CheckId(fd, directory)) @@ -212,7 +209,7 @@ s32 cellFsReaddir(u32 fd, vm::ptr dir, vm::ptr nread) s32 cellFsClosedir(u32 fd) { - sys_fs->Warning("cellFsClosedir(fd=%d)", fd); + sys_fs->Warning("cellFsClosedir(fd=0x%x)", fd); if (!Emu.GetIdManager().RemoveID(fd)) return CELL_ESRCH; @@ -222,7 +219,7 @@ s32 cellFsClosedir(u32 fd) s32 cellFsStat(vm::ptr path, vm::ptr sb) { - sys_fs->Warning("cellFsStat(path=\"%s\", sb_addr=0x%x)", path.get_ptr(), sb.addr()); + sys_fs->Warning("cellFsStat(path=0x%x, sb=0x%x)", path, sb); const std::string _path = path.get_ptr(); @@ -242,7 +239,7 @@ s32 cellFsStat(vm::ptr path, vm::ptr sb) if (int result = stat(real_path.c_str(), &buf)) { - sys_fs->Error("stat('%s') failed -> 0x%x", real_path.c_str(), result); + sys_fs->Error("cellFsStat(): stat('%s') failed -> 0x%x", real_path.c_str(), result); } else { @@ -261,7 +258,7 @@ s32 cellFsStat(vm::ptr path, vm::ptr sb) CELL_FS_S_IROTH | CELL_FS_S_IWOTH | CELL_FS_S_IXOTH; if (sb->st_mode == mode) - sys_fs->Error("Mode is the same. Report this to a RPCS3 developer! (%d)", mode); + sys_fs->Error("cellFsStat(): mode is the same (0x%x)", mode); sb->st_uid = uid; sb->st_gid = gid; @@ -290,15 +287,15 @@ 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->Error("cellFsStat(): size is the same (0x%x)", size); - sys_fs->Warning("cellFsStat: \"%s\" not found.", path.get_ptr()); + sys_fs->Warning("cellFsStat(): '%s' not found", path.get_ptr()); return CELL_ENOENT; } s32 cellFsFstat(u32 fd, vm::ptr sb) { - sys_fs->Warning("cellFsFstat(fd=%d, sb_addr=0x%x)", fd, sb.addr()); + sys_fs->Warning("cellFsFstat(fd=0x%x, sb=0x%x)", fd, sb); IDType type; std::shared_ptr file; @@ -324,7 +321,7 @@ s32 cellFsFstat(u32 fd, vm::ptr sb) s32 cellFsMkdir(vm::ptr path, u32 mode) { - sys_fs->Warning("cellFsMkdir(path=\"%s\", mode=0x%x)", path.get_ptr(), mode); + sys_fs->Warning("cellFsMkdir(path=0x%x, mode=0x%x)", path, mode); const std::string _path = path.get_ptr(); @@ -334,12 +331,13 @@ s32 cellFsMkdir(vm::ptr path, u32 mode) if (!Emu.GetVFS().CreateDir(_path)) return CELL_EBUSY; + sys_fs->Notice("cellFsMkdir(): directory '%s' created", path.get_ptr()); return CELL_OK; } s32 cellFsRename(vm::ptr from, vm::ptr to) { - sys_fs->Warning("cellFsRename(from='%s', to='%s')", from.get_ptr(), to.get_ptr()); + sys_fs->Warning("cellFsRename(from=0x%x, to=0x%x)", from, to); std::string _from = from.get_ptr(); std::string _to = to.get_ptr(); @@ -351,6 +349,7 @@ s32 cellFsRename(vm::ptr from, vm::ptr to) if(!dir.Rename(_from, _to)) return CELL_EBUSY; + sys_fs->Notice("cellFsRename(): directory '%s' renamed to '%s'", from.get_ptr(), to.get_ptr()); return CELL_OK; } } @@ -363,6 +362,7 @@ s32 cellFsRename(vm::ptr from, vm::ptr to) if(!f.Rename(_from, _to)) return CELL_EBUSY; + sys_fs->Notice("cellFsRename(): file '%s' renamed to '%s'", from.get_ptr(), to.get_ptr()); return CELL_OK; } } @@ -371,7 +371,7 @@ s32 cellFsRename(vm::ptr from, vm::ptr to) } s32 cellFsChmod(vm::ptr path, u32 mode) { - sys_fs->Todo("cellFsChmod(path=\"%s\", mode=0x%x)", path.get_ptr(), mode); + sys_fs->Todo("cellFsChmod(path=0x%x, mode=0x%x)", path, mode); // TODO: @@ -389,7 +389,7 @@ s32 cellFsFsync(u32 fd) s32 cellFsRmdir(vm::ptr path) { - sys_fs->Warning("cellFsRmdir(path=\"%s\")", path.get_ptr()); + sys_fs->Warning("cellFsRmdir(path=0x%x)", path.get_ptr()); std::string _path = path.get_ptr(); @@ -400,12 +400,13 @@ s32 cellFsRmdir(vm::ptr path) if (!d.Remove(_path)) return CELL_EBUSY; + sys_fs->Notice("cellFsRmdir(): directory '%s' removed", path.get_ptr()); return CELL_OK; } s32 cellFsUnlink(vm::ptr path) { - sys_fs->Warning("cellFsUnlink(path=\"%s\")", path.get_ptr()); + sys_fs->Warning("cellFsUnlink(path=0x%x)", path); std::string _path = path.get_ptr(); @@ -418,12 +419,13 @@ s32 cellFsUnlink(vm::ptr path) if (!Emu.GetVFS().RemoveFile(_path)) return CELL_EACCES; + sys_fs->Notice("cellFsUnlink(): file '%s' removed", path.get_ptr()); return CELL_OK; } s32 cellFsLseek(u32 fd, s64 offset, u32 whence, vm::ptr> pos) { - sys_fs->Log("cellFsLseek(fd=%d, offset=0x%llx, whence=0x%x, pos_addr=0x%x)", fd, offset, whence, pos.addr()); + sys_fs->Log("cellFsLseek(fd=0x%x, offset=0x%llx, whence=0x%x, pos=0x%x)", fd, offset, whence, pos); vfsSeekMode seek_mode; switch(whence) @@ -432,7 +434,7 @@ s32 cellFsLseek(u32 fd, s64 offset, u32 whence, vm::ptr> pos) case CELL_SEEK_CUR: seek_mode = vfsSeekCur; break; case CELL_SEEK_END: seek_mode = vfsSeekEnd; break; default: - sys_fs->Error("cellFsLseek(fd=%d): Unknown seek whence! (0x%x)", fd, whence); + sys_fs->Error("cellFsLseek(fd=0x%x): Unknown seek whence! (0x%x)", fd, whence); return CELL_EINVAL; } @@ -447,7 +449,7 @@ s32 cellFsLseek(u32 fd, s64 offset, u32 whence, vm::ptr> pos) s32 cellFsFtruncate(u32 fd, u64 size) { - sys_fs->Warning("cellFsFtruncate(fd=%d, size=%lld)", fd, size); + sys_fs->Warning("cellFsFtruncate(fd=0x%x, size=0x%llx)", fd, size); IDType type; std::shared_ptr file; @@ -476,12 +478,12 @@ s32 cellFsFtruncate(u32 fd, u64 size) s32 cellFsTruncate(vm::ptr path, u64 size) { - sys_fs->Warning("cellFsTruncate(path=\"%s\", size=%lld)", path.get_ptr(), size); + sys_fs->Warning("cellFsTruncate(path=0x%x, size=0x%llx)", path, size); vfsFile f(path.get_ptr(), vfsReadWrite); if (!f.IsOpened()) { - sys_fs->Warning("cellFsTruncate: \"%s\" not found.", path.get_ptr()); + sys_fs->Warning("cellFsTruncate(): '%s' not found", path.get_ptr()); return CELL_ENOENT; } u64 initialSize = f.GetSize(); @@ -506,8 +508,7 @@ s32 cellFsTruncate(vm::ptr path, u64 size) s32 cellFsFGetBlockSize(u32 fd, vm::ptr sector_size, vm::ptr block_size) { - sys_fs->Warning("cellFsFGetBlockSize(fd=%d, sector_size_addr=0x%x, block_size_addr=0x%x)", - fd, sector_size.addr(), block_size.addr()); + sys_fs->Warning("cellFsFGetBlockSize(fd=0x%x, sector_size=0x%x, block_size=0x%x)", fd, sector_size, block_size); LV2_LOCK(0); @@ -523,8 +524,7 @@ s32 cellFsFGetBlockSize(u32 fd, vm::ptr sector_size, vm::ptr block_siz s32 cellFsGetBlockSize(vm::ptr path, vm::ptr sector_size, vm::ptr block_size) { - sys_fs->Warning("cellFsGetBlockSize(file='%s', sector_size_addr=0x%x, block_size_addr=0x%x)", - path.get_ptr(), sector_size.addr(), block_size.addr()); + sys_fs->Warning("cellFsGetBlockSize(path=0x%x, sector_size=0x%x, block_size=0x%x)", path, sector_size, block_size); *sector_size = 4096; // ? *block_size = 4096; // ? @@ -534,8 +534,7 @@ s32 cellFsGetBlockSize(vm::ptr path, vm::ptr sector_size, vm::p s32 cellFsGetFreeSize(vm::ptr path, vm::ptr block_size, vm::ptr block_count) { - sys_fs->Warning("cellFsGetFreeSize(path=\"%s\", block_size_addr=0x%x, block_count_addr=0x%x)", - path.get_ptr(), block_size.addr(), block_count.addr()); + sys_fs->Warning("cellFsGetFreeSize(path=0x%x, block_size=0x%x, block_count=0x%x)", path, block_size, block_count); // TODO: Get real values. Currently, it always returns 40 GB of free space divided in 4 KB blocks *block_size = 4096; // ? @@ -546,8 +545,7 @@ s32 cellFsGetFreeSize(vm::ptr path, vm::ptr block_size, vm::ptr s32 cellFsGetDirectoryEntries(u32 fd, vm::ptr entries, u32 entries_size, vm::ptr data_count) { - sys_fs->Warning("cellFsGetDirectoryEntries(fd=%d, entries_addr=0x%x, entries_size=0x%x, data_count_addr=0x%x)", - fd, entries.addr(), entries_size, data_count.addr()); + sys_fs->Warning("cellFsGetDirectoryEntries(fd=0x%x, entries=0x%x, entries_size=0x%x, data_count=0x%x)", fd, entries, entries_size, data_count); std::shared_ptr directory; if (!sys_fs->CheckId(fd, directory)) @@ -583,7 +581,7 @@ s32 cellFsGetDirectoryEntries(u32 fd, vm::ptr entries, u32 s32 cellFsStReadInit(u32 fd, vm::ptr ringbuf) { - sys_fs->Warning("cellFsStReadInit(fd=%d, ringbuf_addr=0x%x)", fd, ringbuf.addr()); + sys_fs->Warning("cellFsStReadInit(fd=0x%x, ringbuf=0x%x)", fd, ringbuf); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -608,7 +606,7 @@ s32 cellFsStReadInit(u32 fd, vm::ptr ringbuf) s32 cellFsStReadFinish(u32 fd) { - sys_fs->Warning("cellFsStReadFinish(fd=%d)", fd); + sys_fs->Warning("cellFsStReadFinish(fd=0x%x)", fd); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -622,7 +620,7 @@ s32 cellFsStReadFinish(u32 fd) s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr ringbuf) { - sys_fs->Warning("cellFsStReadGetRingBuf(fd=%d, ringbuf_addr=0x%x)", fd, ringbuf.addr()); + sys_fs->Warning("cellFsStReadGetRingBuf(fd=0x%x, ringbuf=0x%x)", fd, ringbuf); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -630,14 +628,14 @@ s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr ringbuf) *ringbuf = fs_config.m_ring_buffer; - sys_fs->Warning("*** fs stream config: block_size=0x%llx, copy=%d, ringbuf_size=0x%llx, transfer_rate=0x%llx", - (u64)ringbuf->block_size, (u32)ringbuf->copy, (u64)ringbuf->ringbuf_size, (u64)ringbuf->transfer_rate); + sys_fs->Warning("*** fs stream config: block_size=0x%llx, copy=0x%x, ringbuf_size=0x%llx, transfer_rate=0x%llx", + ringbuf->block_size, ringbuf->copy, ringbuf->ringbuf_size, ringbuf->transfer_rate); return CELL_OK; } s32 cellFsStReadGetStatus(u32 fd, vm::ptr status) { - sys_fs->Warning("cellFsStReadGetRingBuf(fd=%d, status_addr=0x%x)", fd, status.addr()); + sys_fs->Warning("cellFsStReadGetRingBuf(fd=0x%x, status=0x%x)", fd, status); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -650,7 +648,7 @@ s32 cellFsStReadGetStatus(u32 fd, vm::ptr status) s32 cellFsStReadGetRegid(u32 fd, vm::ptr regid) { - sys_fs->Warning("cellFsStReadGetRingBuf(fd=%d, regid_addr=0x%x)", fd, regid.addr()); + sys_fs->Warning("cellFsStReadGetRingBuf(fd=0x%x, regid=0x%x)", fd, regid); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -663,7 +661,7 @@ s32 cellFsStReadGetRegid(u32 fd, vm::ptr regid) s32 cellFsStReadStart(u32 fd, u64 offset, u64 size) { - sys_fs->Todo("cellFsStReadStart(fd=%d, offset=0x%llx, size=0x%llx)", fd, offset, size); + sys_fs->Todo("cellFsStReadStart(fd=0x%x, offset=0x%llx, size=0x%llx)", fd, offset, size); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -677,7 +675,7 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size) s32 cellFsStReadStop(u32 fd) { - sys_fs->Warning("cellFsStReadStop(fd=%d)", fd); + sys_fs->Warning("cellFsStReadStop(fd=0x%x)", fd); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -688,9 +686,9 @@ s32 cellFsStReadStop(u32 fd) return CELL_OK; } -s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, vm::ptr rsize) +s32 cellFsStRead(u32 fd, vm::ptr buf, u64 size, vm::ptr rsize) { - sys_fs->Warning("cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr=0x%x)", fd, buf_addr, size, rsize.addr()); + sys_fs->Warning("cellFsStRead(fd=0x%x, buf=0x%x, size=0x%llx, rsize=0x%x)", fd, buf, size, rsize); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -702,14 +700,14 @@ s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, vm::ptr rsize) if (file->Eof()) return CELL_FS_ERANGE; - *rsize = file->Read(vm::get_ptr(buf_addr), size); + *rsize = file->Read(buf.get_ptr(), size); return CELL_OK; } -s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr addr, vm::ptr size) +s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr> addr, vm::ptr size) { - sys_fs->Todo("cellFsStReadGetCurrentAddr(fd=%d, addr_addr=0x%x, size_addr=0x%x)", fd, addr.addr(), size.addr()); + sys_fs->Todo("cellFsStReadGetCurrentAddr(fd=0x%x, addr=0x%x, size=0x%x)", fd, addr, size); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -718,9 +716,9 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr addr, vm::ptr size) return CELL_OK; } -s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size) +s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr addr, u64 size) { - sys_fs->Todo("cellFsStReadPutCurrentAddr(fd=%d, addr_addr=0x%x, size=0x%llx)", fd, addr_addr, size); + sys_fs->Todo("cellFsStReadPutCurrentAddr(fd=0x%x, addr=0x%x, size=0x%llx)", fd, addr, size); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -731,7 +729,7 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size) s32 cellFsStReadWait(u32 fd, u64 size) { - sys_fs->Todo("cellFsStReadWait(fd=%d, size=0x%llx)", fd, size); + sys_fs->Todo("cellFsStReadWait(fd=0x%x, size=0x%llx)", fd, size); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -742,7 +740,7 @@ s32 cellFsStReadWait(u32 fd, u64 size) s32 cellFsStReadWaitCallback(u32 fd, u64 size, vm::ptr func) { - sys_fs->Todo("cellFsStReadWaitCallback(fd=%d, size=0x%llx, func_addr=0x%x)", fd, size, func.addr()); + sys_fs->Todo("cellFsStReadWaitCallback(fd=0x%x, size=0x%llx, func=0x%x)", fd, size, func); std::shared_ptr file; if (!sys_fs->CheckId(fd, file)) @@ -851,10 +849,9 @@ int sdata_unpack(const std::string& packed_file, const std::string& unpacked_fil return CELL_OK; } -int cellFsSdataOpen(vm::ptr path, int flags, vm::ptr> fd, vm::ptr arg, u64 size) +s32 cellFsSdataOpen(vm::ptr path, s32 flags, vm::ptr> fd, vm::ptr arg, u64 size) { - sys_fs->Warning("cellFsSdataOpen(path=\"%s\", flags=0x%x, fd_addr=0x%x, arg_addr=0x%x, size=0x%llx) -> cellFsOpen()", - path.get_ptr(), flags, fd.addr(), arg.addr(), size); + sys_fs->Warning("cellFsSdataOpen(path=0x%x, flags=0x%x, fd=0x%x, arg=0x%x, size=0x%llx) -> cellFsOpen()", path, flags, fd, arg, size); /*if (flags != CELL_O_RDONLY) return CELL_EINVAL; @@ -876,18 +873,17 @@ int cellFsSdataOpen(vm::ptr path, int flags, vm::ptr> fd, return cellFsOpen(path, flags, fd, arg, size); } -int cellFsSdataOpenByFd(int mself_fd, int flags, vm::ptr sdata_fd, u64 offset, vm::ptr arg, u64 size) +s32 cellFsSdataOpenByFd(u32 mself_fd, s32 flags, vm::ptr sdata_fd, u64 offset, vm::ptr arg, u64 size) { - sys_fs->Todo("cellFsSdataOpenByFd(mself_fd=0x%x, flags=0x%x, sdata_fd_addr=0x%x, offset=0x%llx, arg_addr=0x%x, size=0x%llx) -> cellFsOpen()", - mself_fd, flags, sdata_fd.addr(), offset, arg.addr(), size); + sys_fs->Todo("cellFsSdataOpenByFd(mself_fd=0x%x, flags=0x%x, sdata_fd=0x%x, offset=0x%llx, arg=0x%x, size=0x%llx)", mself_fd, flags, sdata_fd, offset, arg, size); // TODO: return CELL_OK; } -std::atomic g_FsAioReadID(0); -std::atomic g_FsAioReadCur(0); +std::atomic g_FsAioReadID(0); +std::atomic g_FsAioReadCur(0); bool aio_init = false; void fsAioRead(u32 fd, vm::ptr aio, int xid, vm::ptr xaio, int error, int xid, u64 size)> func) @@ -930,7 +926,7 @@ void fsAioRead(u32 fd, vm::ptr aio, int xid, vm::ptrLog("*** fsAioRead(fd=%d, offset=0x%llx, buf_addr=0x%x, size=0x%llx, error=0x%x, res=0x%llx, xid=0x%x)", + sys_fs->Log("*** fsAioRead(fd=%d, offset=0x%llx, buf=0x%x, size=0x%llx, error=0x%x, res=0x%llx, xid=0x%x)", fd, aio->offset, aio->buf, aio->size, error, res, xid); } @@ -945,7 +941,7 @@ void fsAioRead(u32 fd, vm::ptr aio, int xid, vm::ptr aio, vm::ptr id, vm::ptr xaio, int error, int xid, u64 size)> func) +s32 cellFsAioRead(vm::ptr aio, vm::ptr id, vm::ptr xaio, s32 error, s32 xid, u64 size)> func) { sys_fs->Warning("cellFsAioRead(aio=0x%x, id=0x%x, func=0x%x)", aio, id, func); @@ -963,42 +959,41 @@ int cellFsAioRead(vm::ptr aio, vm::ptr id, vm::ptr aio, vm::ptr aio_id, vm::ptr xaio, int error, int xid, u64 size)> func) +s32 cellFsAioWrite(vm::ptr aio, vm::ptr id, vm::ptr xaio, s32 error, s32 xid, u64 size)> func) { - sys_fs->Todo("cellFsAioWrite(aio_addr=0x%x, id_addr=0x%x, func_addr=0x%x)", aio.addr(), aio_id.addr(), func.addr()); + sys_fs->Todo("cellFsAioWrite(aio=0x%x, id=0x%x, func=0x%x)", aio, id, func); // TODO: return CELL_OK; } -int cellFsAioInit(vm::ptr mount_point) +s32 cellFsAioInit(vm::ptr mount_point) { - sys_fs->Warning("cellFsAioInit(mount_point_addr=0x%x (%s))", mount_point.addr(), mount_point.get_ptr()); + sys_fs->Warning("cellFsAioInit(mount_point=0x%x)", mount_point); aio_init = true; return CELL_OK; } -int cellFsAioFinish(vm::ptr mount_point) +s32 cellFsAioFinish(vm::ptr mount_point) { - sys_fs->Warning("cellFsAioFinish(mount_point_addr=0x%x (%s))", mount_point.addr(), mount_point.get_ptr()); + sys_fs->Warning("cellFsAioFinish(mount_point=0x%x)", mount_point); - aio_init = false; + //aio_init = false; return CELL_OK; } -int cellFsReadWithOffset(PPUThread& CPU, u32 fd, u64 offset, vm::ptr buf, u64 buffer_size, vm::ptr> nread) +s32 cellFsReadWithOffset(PPUThread& CPU, u32 fd, u64 offset, vm::ptr buf, u64 buffer_size, vm::ptr> nread) { - sys_fs->Warning("cellFsReadWithOffset(fd=%d, offset=0x%llx, buf_addr=0x%x, buffer_size=%lld nread=0x%llx)", - fd, offset, buf.addr(), buffer_size, nread.addr()); + sys_fs->Warning("cellFsReadWithOffset(fd=%d, offset=0x%llx, buf=0x%x, buffer_size=%lld, nread=0x%llx)", fd, offset, buf, buffer_size, nread); int ret; vm::stackvar> oldPos(CPU), newPos(CPU); diff --git a/rpcs3/Emu/SysCalls/lv2/cellFs.h b/rpcs3/Emu/SysCalls/lv2/cellFs.h index 6adb71cdc9..e114ef3464 100644 --- a/rpcs3/Emu/SysCalls/lv2/cellFs.h +++ b/rpcs3/Emu/SysCalls/lv2/cellFs.h @@ -128,7 +128,7 @@ struct CellFsRingBuffer }; // SysCalls -s32 cellFsOpen(vm::ptr path, s32 flags, vm::ptr> fd, vm::ptr arg, u64 size); +s32 cellFsOpen(vm::ptr path, s32 flags, vm::ptr> fd, vm::ptr arg, u64 size); s32 cellFsRead(u32 fd, vm::ptr buf, u64 nbytes, vm::ptr> nread); s32 cellFsWrite(u32 fd, vm::ptr buf, u64 nbytes, vm::ptr nwrite); s32 cellFsClose(u32 fd); @@ -150,15 +150,5 @@ s32 cellFsFGetBlockSize(u32 fd, vm::ptr sector_size, vm::ptr block_siz s32 cellFsGetBlockSize(vm::ptr path, vm::ptr sector_size, vm::ptr block_size); s32 cellFsGetFreeSize(vm::ptr path, vm::ptr block_size, vm::ptr block_count); s32 cellFsGetDirectoryEntries(u32 fd, vm::ptr entries, u32 entries_size, vm::ptr data_count); -s32 cellFsStReadInit(u32 fd, vm::ptr ringbuf); -s32 cellFsStReadFinish(u32 fd); -s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr ringbuf); -s32 cellFsStReadGetStatus(u32 fd, vm::ptr status); -s32 cellFsStReadGetRegid(u32 fd, vm::ptr regid); -s32 cellFsStReadStart(u32 fd, u64 offset, u64 size); -s32 cellFsStReadStop(u32 fd); -s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, vm::ptr rsize); -s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr addr_addr, vm::ptr size); -s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size); -s32 cellFsStReadWait(u32 fd, u64 size); -s32 cellFsStReadWaitCallback(u32 fd, u64 size, vm::ptr func); + +// no need to add every function here