mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-28 07:21:02 +00:00
Small fixes and additions
This commit is contained in:
@@ -5,22 +5,23 @@
|
||||
// TODO: Replace with pointer handling structure for future 32 bit support
|
||||
using emulator_pointer = uint64_t;
|
||||
|
||||
class x64_emulator_wrapper
|
||||
template<typename T>
|
||||
class object_wrapper
|
||||
{
|
||||
x64_emulator* emu_;
|
||||
T* obj_;
|
||||
|
||||
public:
|
||||
x64_emulator_wrapper(x64_emulator& emu)
|
||||
: emu_(&emu)
|
||||
object_wrapper(T& obj)
|
||||
: obj_(&obj)
|
||||
{
|
||||
}
|
||||
|
||||
x64_emulator& get() const
|
||||
T& get() const
|
||||
{
|
||||
return *this->emu_;
|
||||
return *this->obj_;
|
||||
}
|
||||
|
||||
operator x64_emulator&() const
|
||||
operator T&() const
|
||||
{
|
||||
return this->get();
|
||||
}
|
||||
@@ -34,6 +35,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class windows_emulator;
|
||||
|
||||
using x64_emulator_wrapper = object_wrapper<x64_emulator>;
|
||||
using windows_emulator_wrapper = object_wrapper<windows_emulator>;
|
||||
|
||||
template <typename T>
|
||||
class emulator_object
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ void syscall_dispatcher::add_handlers()
|
||||
{
|
||||
std::map<std::string, syscall_handler> handler_mapping{};
|
||||
|
||||
this->add_handlers(handler_mapping);
|
||||
syscall_dispatcher::add_handlers(handler_mapping);
|
||||
|
||||
for (auto& entry : this->handlers_)
|
||||
{
|
||||
|
||||
@@ -1051,6 +1051,11 @@ void windows_emulator::deserialize(utils::buffer_deserializer& buffer)
|
||||
return x64_emulator_wrapper{this->emu()};
|
||||
});
|
||||
|
||||
buffer.register_factory<windows_emulator_wrapper>([this]
|
||||
{
|
||||
return windows_emulator_wrapper{*this};
|
||||
});
|
||||
|
||||
buffer.read(this->use_relative_time_);
|
||||
|
||||
this->emu().deserialize(buffer);
|
||||
|
||||
Reference in New Issue
Block a user