diff --git a/UnleashedRecomp/kernel/memory.h b/UnleashedRecomp/kernel/memory.h index 8ff4504c..0a1eba22 100644 --- a/UnleashedRecomp/kernel/memory.h +++ b/UnleashedRecomp/kernel/memory.h @@ -16,13 +16,17 @@ public: void* Translate(size_t offset) const noexcept { - assert(offset < 0x100000000ull); + if (offset) + assert(offset < 0x100000000ull); + return base + offset; } uint32_t MapVirtual(void* host) const noexcept { - assert(host >= base && host < (base + size)); + if (host) + assert(host >= base && host < (base + size)); + return static_cast(static_cast(host) - base); } };