2014-09-11 22:42:59 +00:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-17 05:38:14 +00:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-09-11 22:42:59 +00:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "common/common_types.h"
|
|
|
|
|
|
|
|
#include "core/file_sys/file_romfs.h"
|
2014-12-15 08:41:02 +00:00
|
|
|
#include "core/file_sys/archive_romfs.h"
|
2014-09-11 22:42:59 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// FileSys namespace
|
|
|
|
|
|
|
|
namespace FileSys {
|
|
|
|
|
2014-09-27 19:21:48 +00:00
|
|
|
bool File_RomFS::Open() {
|
2014-12-15 08:41:02 +00:00
|
|
|
return true;
|
2014-09-27 19:21:48 +00:00
|
|
|
}
|
|
|
|
|
2014-09-11 22:42:59 +00:00
|
|
|
size_t File_RomFS::Read(const u64 offset, const u32 length, u8* buffer) const {
|
2014-12-15 08:41:02 +00:00
|
|
|
LOG_TRACE(Service_FS, "called offset=%llu, length=%d", offset, length);
|
|
|
|
memcpy(buffer, &archive->raw_data[(u32)offset], length);
|
|
|
|
return length;
|
2014-09-11 22:42:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
size_t File_RomFS::Write(const u64 offset, const u32 length, const u32 flush, const u8* buffer) const {
|
2014-12-15 08:41:02 +00:00
|
|
|
LOG_WARNING(Service_FS, "Attempted to write to ROMFS.");
|
|
|
|
return 0;
|
2014-09-11 22:42:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
size_t File_RomFS::GetSize() const {
|
2014-12-15 08:41:02 +00:00
|
|
|
return sizeof(u8) * archive->raw_data.size();
|
2014-09-11 22:42:59 +00:00
|
|
|
}
|
|
|
|
|
2014-09-27 19:16:51 +00:00
|
|
|
bool File_RomFS::SetSize(const u64 size) const {
|
2014-12-15 08:41:02 +00:00
|
|
|
LOG_WARNING(Service_FS, "Attempted to set the size of ROMFS");
|
2014-09-27 19:16:51 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-09-11 22:42:59 +00:00
|
|
|
bool File_RomFS::Close() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace FileSys
|