Skip to content

Commit

Permalink
Abstract tick so to not invoke unneeded python overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 authored and Baekalfen committed Dec 8, 2023
1 parent a6545e2 commit f765f2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyboy/pyboy.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ cdef class PyBoy:
cdef list recorded_input
cdef list external_input

@cython.locals(t_start=int64_t, t_pre=int64_t, t_tick=int64_t, t_post=int64_t, nsecs=int64_t)
cpdef bint tick(self) noexcept
@cython.locals(t_start=int64_t, t_pre=int64_t, t_tick=int64_t, t_post=int64_t, nsecs=int64_t)
cdef bint tick_internal(self) noexcept
cpdef void stop(self, save=*) noexcept

@cython.locals(state_path=str)
Expand Down
3 changes: 3 additions & 0 deletions pyboy/pyboy.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ def __init__(
self.initialized = True

def tick(self):
return self.tick_internal()

def tick_internal(self):
"""
Progresses the emulator ahead by one frame.
Expand Down

0 comments on commit f765f2c

Please sign in to comment.