mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 13:01:50 +01:00
Another minor code clean up, because I'm dumb
This commit is contained in:
parent
f10e4463fe
commit
be79abd213
@ -26,14 +26,14 @@ namespace core::memory {
|
|||||||
// TODO: Boundary checks
|
// TODO: Boundary checks
|
||||||
void Write(void* data, uint64_t offset, size_t size) { std::memcpy((void*)(offset), data, size); }
|
void Write(void* data, uint64_t offset, size_t size) { std::memcpy((void*)(offset), data, size); }
|
||||||
|
|
||||||
void WriteU8 (uint8_t value, uint64_t offset) { Write(reinterpret_cast<void*>(&value), offset, 1); }
|
void WriteU8(uint8_t value, uint64_t offset) { Write(reinterpret_cast<void*>(&value), offset, 1); }
|
||||||
void WriteU16(uint16_t value, uint64_t offset) { Write(reinterpret_cast<void*>(&value), offset, 2); }
|
void WriteU16(uint16_t value, uint64_t offset) { Write(reinterpret_cast<void*>(&value), offset, 2); }
|
||||||
void WriteU32(uint32_t value, uint64_t offset) { Write(reinterpret_cast<void*>(&value), offset, 4); }
|
void WriteU32(uint32_t value, uint64_t offset) { Write(reinterpret_cast<void*>(&value), offset, 4); }
|
||||||
void WriteU64(uint64_t value, uint64_t offset) { Write(reinterpret_cast<void*>(&value), offset, 8); }
|
void WriteU64(uint64_t value, uint64_t offset) { Write(reinterpret_cast<void*>(&value), offset, 8); }
|
||||||
|
|
||||||
void Read(void* destination, uint64_t offset, size_t size) { std::memcpy(destination, (void*)(offset), size); }
|
void Read(void* destination, uint64_t offset, size_t size) { std::memcpy(destination, (void*)(offset), size); }
|
||||||
|
|
||||||
uint8_t ReadU8 (uint64_t offset) { uint8_t value; Read(reinterpret_cast<void*>(&value), offset, 1); return value; }
|
uint8_t ReadU8(uint64_t offset) { uint8_t value; Read(reinterpret_cast<void*>(&value), offset, 1); return value; }
|
||||||
uint16_t ReadU16(uint64_t offset) { uint16_t value; Read(reinterpret_cast<void*>(&value), offset, 2); return value; }
|
uint16_t ReadU16(uint64_t offset) { uint16_t value; Read(reinterpret_cast<void*>(&value), offset, 2); return value; }
|
||||||
uint32_t ReadU32(uint64_t offset) { uint32_t value; Read(reinterpret_cast<void*>(&value), offset, 4); return value; }
|
uint32_t ReadU32(uint64_t offset) { uint32_t value; Read(reinterpret_cast<void*>(&value), offset, 4); return value; }
|
||||||
uint64_t ReadU64(uint64_t offset) { uint64_t value; Read(reinterpret_cast<void*>(&value), offset, 8); return value; }
|
uint64_t ReadU64(uint64_t offset) { uint64_t value; Read(reinterpret_cast<void*>(&value), offset, 8); return value; }
|
||||||
|
@ -168,7 +168,8 @@ namespace core::kernel {
|
|||||||
{
|
{
|
||||||
std::pair<int, uint32_t(*)()>* result = &(svcTable[svc]);
|
std::pair<int, uint32_t(*)()>* result = &(svcTable[svc]);
|
||||||
|
|
||||||
if (result->second) {
|
if (result->second)
|
||||||
|
{
|
||||||
uint32_t returnCode = result->second();
|
uint32_t returnCode = result->second();
|
||||||
SetRegister(UC_ARM64_REG_W0, returnCode);
|
SetRegister(UC_ARM64_REG_W0, returnCode);
|
||||||
return returnCode;
|
return returnCode;
|
||||||
|
Loading…
Reference in New Issue
Block a user