diff options
author | bunnei <bunneidev@gmail.com> | 2014-12-16 04:15:08 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-12-16 04:15:08 +0100 |
commit | cd2a31eaf4a35568a18840eba7d3cdac59881d2f (patch) | |
tree | 37a4d61adebae300e8ef172538c6a2d2eae80ff1 /src/core/file_sys/file_romfs.cpp | |
parent | Update README.md (diff) | |
parent | Work around libstdc++'s lack of support for std::hash on enums (diff) | |
download | yuzu-cd2a31eaf4a35568a18840eba7d3cdac59881d2f.tar yuzu-cd2a31eaf4a35568a18840eba7d3cdac59881d2f.tar.gz yuzu-cd2a31eaf4a35568a18840eba7d3cdac59881d2f.tar.bz2 yuzu-cd2a31eaf4a35568a18840eba7d3cdac59881d2f.tar.lz yuzu-cd2a31eaf4a35568a18840eba7d3cdac59881d2f.tar.xz yuzu-cd2a31eaf4a35568a18840eba7d3cdac59881d2f.tar.zst yuzu-cd2a31eaf4a35568a18840eba7d3cdac59881d2f.zip |
Diffstat (limited to 'src/core/file_sys/file_romfs.cpp')
-rw-r--r-- | src/core/file_sys/file_romfs.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/file_sys/file_romfs.cpp b/src/core/file_sys/file_romfs.cpp index b55708df4..5f38c2704 100644 --- a/src/core/file_sys/file_romfs.cpp +++ b/src/core/file_sys/file_romfs.cpp @@ -5,24 +5,19 @@ #include "common/common_types.h" #include "core/file_sys/file_romfs.h" +#include "core/file_sys/archive_romfs.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace namespace FileSys { -File_RomFS::File_RomFS() { -} - -File_RomFS::~File_RomFS() { -} - /** * Open the file * @return true if the file opened correctly */ bool File_RomFS::Open() { - return false; + return true; } /** @@ -33,7 +28,9 @@ bool File_RomFS::Open() { * @return Number of bytes read */ size_t File_RomFS::Read(const u64 offset, const u32 length, u8* buffer) const { - return -1; + LOG_TRACE(Service_FS, "called offset=%llu, length=%d", offset, length); + memcpy(buffer, &archive->raw_data[(u32)offset], length); + return length; } /** @@ -45,7 +42,8 @@ size_t File_RomFS::Read(const u64 offset, const u32 length, u8* buffer) const { * @return Number of bytes written */ size_t File_RomFS::Write(const u64 offset, const u32 length, const u32 flush, const u8* buffer) const { - return -1; + LOG_WARNING(Service_FS, "Attempted to write to ROMFS."); + return 0; } /** @@ -53,7 +51,7 @@ size_t File_RomFS::Write(const u64 offset, const u32 length, const u32 flush, co * @return Size of the file in bytes */ size_t File_RomFS::GetSize() const { - return -1; + return sizeof(u8) * archive->raw_data.size(); } /** @@ -62,6 +60,7 @@ size_t File_RomFS::GetSize() const { * @return true if successful */ bool File_RomFS::SetSize(const u64 size) const { + LOG_WARNING(Service_FS, "Attempted to set the size of ROMFS"); return false; } |