mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-26 07:01:02 +00:00
Merge remote-tracking branch 'origin/main' into multi-platform-support
# Conflicts: # src/analyzer/main.cpp # src/emulator/memory_region.hpp # src/windows-emulator/io_device.cpp # src/windows-emulator/module/module_mapping.cpp # src/windows-emulator/process_context.hpp # src/windows-emulator/syscalls.cpp # src/windows-emulator/windows_emulator.cpp
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
// TODO: Replace with pointer handling structure for future 32 bit support
|
||||
using emulator_pointer = uint64_t;
|
||||
|
||||
template<typename T>
|
||||
template <typename T>
|
||||
class object_wrapper
|
||||
{
|
||||
T* obj_;
|
||||
@@ -101,6 +101,14 @@ public:
|
||||
this->emu_->write_memory(this->address_ + index * this->size(), &value, sizeof(value));
|
||||
}
|
||||
|
||||
void write_if_valid(const T& value, const size_t index = 0) const
|
||||
{
|
||||
if (this->operator bool())
|
||||
{
|
||||
this->write(value, index);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
void access(const F& accessor, const size_t index = 0) const
|
||||
{
|
||||
@@ -122,6 +130,11 @@ public:
|
||||
buffer.read(this->address_);
|
||||
}
|
||||
|
||||
void set_address(const uint64_t address)
|
||||
{
|
||||
this->address_ = address;
|
||||
}
|
||||
|
||||
private:
|
||||
emulator* emu_{};
|
||||
uint64_t address_{};
|
||||
|
||||
Reference in New Issue
Block a user