mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-02 05:16:19 +12:00
FS: Add missing file seeks
This commit is contained in:
parent
8d33dcaa8e
commit
5a2d71553c
1 changed files with 2 additions and 1 deletions
|
@ -14,7 +14,6 @@ namespace FileOps {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Kernel::handleFileOperation(u32 messagePointer, Handle file) {
|
void Kernel::handleFileOperation(u32 messagePointer, Handle file) {
|
||||||
const u32 cmd = mem.read32(messagePointer);
|
const u32 cmd = mem.read32(messagePointer);
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
@ -89,6 +88,7 @@ void Kernel::readFile(u32 messagePointer, Handle fileHandle) {
|
||||||
if (file->fd) {
|
if (file->fd) {
|
||||||
std::unique_ptr<u8[]> data(new u8[size]);
|
std::unique_ptr<u8[]> data(new u8[size]);
|
||||||
IOFile f(file->fd);
|
IOFile f(file->fd);
|
||||||
|
f.seek(offset);
|
||||||
|
|
||||||
auto [success, bytesRead] = f.readBytes(data.get(), size);
|
auto [success, bytesRead] = f.readBytes(data.get(), size);
|
||||||
|
|
||||||
|
@ -146,6 +146,7 @@ void Kernel::writeFile(u32 messagePointer, Handle fileHandle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
IOFile f(file->fd);
|
IOFile f(file->fd);
|
||||||
|
f.seek(offset);
|
||||||
auto [success, bytesWritten] = f.writeBytes(data.get(), size);
|
auto [success, bytesWritten] = f.writeBytes(data.get(), size);
|
||||||
|
|
||||||
// TODO: Should this check only the byte?
|
// TODO: Should this check only the byte?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue