Files
UnleashedRecomp-hedge-dev/UnleashedRecomp/api/SWA.inl
Hyper 8f525b571b Implemented guest-to-host function pointers (#7)
* Implemented guest-to-host function pointers (WIP)

Co-Authored-By: Skyth (Asilkan) <19259897+blueskythlikesclouds@users.noreply.github.com>

* function: support more types for function pointers

* api: ported BlueBlur headers and misc. research

* Move over function-pointers changes from options-menu branch.

---------

Co-authored-by: Skyth (Asilkan) <19259897+blueskythlikesclouds@users.noreply.github.com>
2024-11-25 13:50:10 +03:00

17 lines
483 B
C++

#pragma once
#include <cpu/guest_code.h>
#include <cpu/guest_stack_var.h>
#include <kernel/function.h>
#define SWA__CONCAT2(x, y) x##y
#define SWA_CONCAT2(x, y) _CONCAT(x, y)
#define SWA_INSERT_PADDING(length) \
uint8_t SWA_CONCAT2(pad, __LINE__)[length]
#define SWA_VIRTUAL_FUNCTION(returnType, virtualIndex, ...) \
GuestToHostFunction<returnType>(*(be<uint32_t>*)(g_memory.Translate(*(be<uint32_t>*)(this) + (4 * virtualIndex))), __VA_ARGS__)
struct swa_null_ctor {};