diff --git a/_dolphin_memory_engine.pyx b/_dolphin_memory_engine.pyx index a3f6ef2..64cb176 100644 --- a/_dolphin_memory_engine.pyx +++ b/_dolphin_memory_engine.pyx @@ -28,8 +28,8 @@ cdef extern from "Common/CommonUtils.h" namespace "Common": uint32_t offsetToDolphinAddr(uint32_t, c_bool) -cdef extern from "DolphinProcess/DolphinAccessor.h" namespace "DolphinComm::DolphinStatus": - cdef enum DolphinStatus: +cdef extern from "DolphinProcess/DolphinAccessor.h" namespace "DolphinComm": + cpdef enum class DolphinStatus: hooked notRunning noEmu @@ -134,6 +134,9 @@ def assert_hooked(): if not is_hooked(): raise RuntimeError("not hooked") +def get_status() -> DolphinStatus: + return DolphinAccessor.getStatus() + def follow_pointers(console_address: int, pointer_offsets: List[int]) -> int: assert_hooked() @@ -225,4 +228,4 @@ def write_double(console_address: int, value: double): def write_bytes(console_address: int, memory: bytes): assert_hooked() if not DolphinAccessor.writeToRAM(dolphinAddrToOffset(console_address, DolphinAccessor.isARAMAccessible()), memory, len(memory), False): - raise RuntimeError(f"Could not write memory at {console_address}") \ No newline at end of file + raise RuntimeError(f"Could not write memory at {console_address}") diff --git a/python_src/dolphin_memory_engine/__init__.py b/python_src/dolphin_memory_engine/__init__.py index e418c4a..7cba49e 100644 --- a/python_src/dolphin_memory_engine/__init__.py +++ b/python_src/dolphin_memory_engine/__init__.py @@ -2,6 +2,7 @@ MemWatch, assert_hooked, follow_pointers, + get_status, hook, is_hooked, read_byte, @@ -24,6 +25,7 @@ "hook", "un_hook", "is_hooked", + "get_status", "read_byte", "read_bytes", "read_double",