Skip to content

Commit

Permalink
Add state loading
Browse files Browse the repository at this point in the history
  • Loading branch information
msosav committed Jun 23, 2024
1 parent 2e782a2 commit 22e9571
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
from pyboy import PyBoy
from pyboy.utils import WindowEvent


def load_state(path: str, pyboy: PyBoy) -> None:
with open(path, "rb") as state:
pyboy.load_state(state)


if __name__ == "__main__":
pyboy = PyBoy("roms/ZeldaLinksAwakening.gb")

load_state("roms/ZeldaLinksAwakening.gb.state", pyboy)

while pyboy.tick():
pass

Expand Down

0 comments on commit 22e9571

Please sign in to comment.