Skip to content

Commit

Permalink
Merge pull request #56 from Miepee/main
Browse files Browse the repository at this point in the history
Expose getStatus
  • Loading branch information
henriquegemignani authored Mar 24, 2024
2 parents 0c8b1fe + 01ddd25 commit fb82e3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions _dolphin_memory_engine.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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}")
raise RuntimeError(f"Could not write memory at {console_address}")
2 changes: 2 additions & 0 deletions python_src/dolphin_memory_engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
MemWatch,
assert_hooked,
follow_pointers,
get_status,
hook,
is_hooked,
read_byte,
Expand All @@ -24,6 +25,7 @@
"hook",
"un_hook",
"is_hooked",
"get_status",
"read_byte",
"read_bytes",
"read_double",
Expand Down

0 comments on commit fb82e3f

Please sign in to comment.