Skip to content

Commit

Permalink
IOP HLE: Set pos to 0 on invalid handles during sstave save.
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes committed Oct 8, 2024
1 parent 324b146 commit 94d880e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pcsx2/IopBios.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,11 @@ bool SaveStateBase::handleFreeze()
//save the current file position
const u32 fd = R3000A::handles[i].fd_index;
IOManFile* file = R3000A::ioman::getfd<IOManFile>(fd + firstfd);
s32 pos = file->lseek(0, SEEK_CUR);
s32 pos;

// Some files may have never existed, but we still need to save their handle
// UlaunchELF 4.4 can do this with LAUNCHELF.CNF
pos = file ? file->lseek(0, SEEK_CUR) : 0;
Freeze(pos);

//save the parameters for opening the file
Expand Down

0 comments on commit 94d880e

Please sign in to comment.