mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
[FS] Implement GetFileSize [PTM] Stub step functions
This commit is contained in:
parent
49dcc25795
commit
e052c16a36
5 changed files with 76 additions and 7 deletions
|
@ -75,17 +75,17 @@ public:
|
|||
return write(data, count, sizeof(std::uint8_t));
|
||||
}
|
||||
|
||||
std::uint64_t size() {
|
||||
if (!isOpen()) return 0;
|
||||
std::optional<std::uint64_t> size() {
|
||||
if (!isOpen()) return {};
|
||||
|
||||
std::uint64_t pos = ftello(handle);
|
||||
if (fseeko(handle, 0, SEEK_END) != 0) {
|
||||
return 0;
|
||||
return {};
|
||||
}
|
||||
|
||||
std::uint64_t size = ftello(handle);
|
||||
if ((size != pos) && (fseeko(handle, pos, SEEK_SET) != 0)) {
|
||||
return 0;
|
||||
return {};
|
||||
}
|
||||
|
||||
return size;
|
||||
|
|
|
@ -120,6 +120,7 @@ private:
|
|||
void handleFileOperation(u32 messagePointer, Handle file);
|
||||
void closeFile(u32 messagePointer, Handle file);
|
||||
void readFile(u32 messagePointer, Handle file);
|
||||
void writeFile(u32 messagePointer, Handle file);
|
||||
void getFileSize(u32 messagePointer, Handle file);
|
||||
|
||||
public:
|
||||
|
|
|
@ -10,6 +10,8 @@ class PTMService {
|
|||
MAKE_LOG_FUNCTION(log, ptmLogger)
|
||||
|
||||
// Service commands
|
||||
void getStepHistory(u32 messagePointer);
|
||||
void getTotalStepCount(u32 messagePointer);
|
||||
|
||||
public:
|
||||
PTMService(Memory& mem) : mem(mem) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue