Closed truite-codeuse closed 1 year ago
Hi! If you just call the emulator loop in a loop without explicitly waiting, it will run the emulator as fast as possible. You'll need to sleep your program in between frames.
Thanks a lot ! In case anyone was wondering this is the code I use to run the game at normal speed (approximately) :
from desmume.emulator import DeSmuME
import time
emu = DeSmuME()
emu.open('rom/PokemonPlatine.nds')
emu.volume_set(5)
# Create the window for the emulator
window = emu.create_sdl_window()
# Starting timer to control the framerate
startime = time.monotonic()
# Refresh rate
refresh = 1/60
while not window.has_quit():
window.process_input() # Controls are the default DeSmuME controls, see below.
emu.cycle()
window.draw()
# Delay
time.sleep(refresh - ((time.monotonic() - startime) % refresh))
I don't know if it's the best solution but it works pretty well !
Hi ! I was wondering if I could modify the emulation speed ? It seems already sped up using the startup code, maybe I missed something in the doc :flushed: