-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lseek: let the host OS set lseek errors #2370
base: main
Are you sure you want to change the base?
Conversation
found where game is crashed - i occasionally set Log Filter to "*:Debug" - empty filter will game playable. |
@@ -321,6 +321,10 @@ s64 PS4_SYSV_ABI posix_lseek(int d, s64 offset, int whence) { | |||
if (result < 0) { | |||
LOG_ERROR(Kernel_Pthread, "posix_lseek: error = {}", result); | |||
ErrSceToPosix(result); | |||
// Workaround for XNA AudioEngine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t know if this is just how you worded it, but there shouldn’t be any “workaround for (specific engine)”. If the engine code works on real hardware, we should figure out why and implement the behavior as the real lseek does it, not add custom workarounds like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i checked on usual .NET, the code
reader.BaseStream.Seek( (long)4294967295, SeekOrigin.Begin);
returns 4294967295 with no exception (the same with others offsets bigger than file itself)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like on ubuntu lseek doesn't even set the error
wl@DESKTOP-0004IRP:~$ cat ./file.txt
abcd
wl@DESKTOP-0004IRP:~$ cat main.cpp
#include <unistd.h>
#include <fcntl.h>
#include <iostream>
#include <string.h>
int main() {
int fd = open("./file.txt", O_RDONLY);
auto off = lseek(fd, 4555555555, SEEK_SET);
std::cout << "fd:" << fd << ", off: " << off << ", err: " << strerror(errno) << std::endl;
close(fd);
}
wl@DESKTOP-0004IRP:~$ g++ main.cpp
wl@DESKTOP-0004IRP:~$ ./a.out
fd:3, off: 4555555555, err: Success
wl@DESKTOP-0004IRP:~$
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment was less about the outward behavior of the function and more what is going on inside of it to make that happen.
[Kernel.Fs] file_system.cpp:179 sceKernelClose: Closing /app0/VEHICLES/COMPETITORSOUNDS.BNDL Yes, that's not C#, but also seek problem in NFS Hot Pursuit Remastered. May you know something about this? |
with this PR NFS Hot Pursuit Remastered works, but i undestood, i made wrong implemetation. need to leave system seek function set errors by itself |
This error is displayed on all versions of the emulator, I just thought maybe you know something about this error) |
Bugs in NFS HP Remastered... В общем у меня баги какие-то в ней, может это из-за 1050 ti, может быть из-за той ошибки. В гонке верхняя половина не рендерится. С твоим билдом всё ок, это на всех сборках так. Вот я и решил спросить, может быть знаешь хоть что-то о ней. Хотя у знакомого тоже такая же ошибка, но у него 2070 и всё ок. |
к сожалению, не смогу подсказать, в графике я полный ноль, но shadPS4 выставляет очень высокие требования к видеокарте - Vulkan 1.4, с большим количеством расширений |
In game Timespinner, the code:
bad C# u32>s64 conversion leads to huge offset, and in C-code it compares to (s32)(-1), too, which not equal (s64)(-1) and then crash.
But, as you may see, in C# code, result of Seek() to not checked at all, and even not used, so, we can pass needed result/error to C-code.
I did some other changes, which made the game playable, but i do not know, which helps, will make pr for it later