mirror of
https://github.com/mikage-emu/mikage-dev.git
synced 2025-01-09 06:50:59 +01:00
30 lines
629 B
C++
30 lines
629 B
C++
#pragma once
|
|
|
|
#include "pxi_fs.hpp"
|
|
|
|
namespace HLE {
|
|
|
|
namespace PXI {
|
|
|
|
namespace FS {
|
|
|
|
class FileBufferInEmulatedMemory : public FileBuffer {
|
|
OS::FakeThread& thread;
|
|
PXIBuffer buffer;
|
|
|
|
public:
|
|
FileBufferInEmulatedMemory(OS::FakeThread& thread, const PXIBuffer& buffer) : thread(thread), buffer(buffer) {
|
|
}
|
|
|
|
void Write(char* source, uint32_t num_bytes) override {
|
|
for (uint32_t buffer_offset = 0; buffer_offset < num_bytes; ++buffer_offset) {
|
|
buffer.Write<uint8_t>(thread, buffer_offset, source[buffer_offset]);
|
|
}
|
|
}
|
|
};
|
|
|
|
} // namespace FS
|
|
|
|
} // namespace PXI
|
|
|
|
} // namespace HLE
|