Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add emulator reset #30

Merged
merged 2 commits into from
Feb 5, 2023
Merged

Add emulator reset #30

merged 2 commits into from
Feb 5, 2023

Conversation

JimB16
Copy link

@JimB16 JimB16 commented Jan 28, 2023

Added a python function to reset the emulator as talked about in #8
The function works the same way as the Reset function that is available through the GUI.

A short example that resets the emulation every 20 seconds.

from dolphin import event

waittime = 0

while True:
    waittime += 1
    await event.frameadvance()
    if(waittime > 60*20):
        waittime = 0
        print("Reset")
        event.system_reset()

@Felk
Copy link
Owner

Felk commented Jan 30, 2023

Looks good, thanks! The only issue I have with this is that it's put into the "event" module, but it's not really an event.
If you don't mind I'll still merge this as-is and move it to some other module at a later time. I'm not sure what I'd call that yet though, maybe "emulation"?

@JimB16
Copy link
Author

JimB16 commented Jan 31, 2023

I also wasn't sure in which module I should put the function, so place it wherever it fits the best in your opinion. An "emulation" module is probably a good idea. There might be other GUI functions that I think could be helpful to have available through python.

@Felk Felk merged commit af12d1f into Felk:master Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants