mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
IOS: Rewrite FS to use FileSystem
This is the large change in the branch. This lets us use either the host filesystem or (in the future) a NAND image exactly the same way, and make sure the IPC emulation code behaves identically. Less duplicated code. Note that "FileIO" and "FS" were merged, because it actually doesn't make a lot of sense to split them: IOS handles requests for both /dev/fs and files in the same resource manager, and as it turns out, /dev/fs commands can *also* be sent to non /dev/fs file descriptors! If we kept /dev/fs and files split, there would be no way to emulate that correctly. I'm not aware of anything that does that (yet?) but I think it's important to be correct.
This commit is contained in:
@ -166,4 +166,16 @@ inline T FromBigEndian(T data)
|
||||
swap<sizeof(data)>(reinterpret_cast<u8*>(&data));
|
||||
return data;
|
||||
}
|
||||
|
||||
template <typename value_type>
|
||||
struct BigEndianValue
|
||||
{
|
||||
static_assert(std::is_arithmetic<value_type>(), "value_type must be an arithmetic type");
|
||||
BigEndianValue() = default;
|
||||
explicit BigEndianValue(value_type val) { *this = val; }
|
||||
operator value_type() const { return FromBigEndian(raw); }
|
||||
void operator=(value_type v) { raw = FromBigEndian(v); }
|
||||
private:
|
||||
value_type raw;
|
||||
};
|
||||
} // Namespace Common
|
||||
|
Reference in New Issue
Block a user