Can Pyboy load save files?
Hello (yes again), If I were to say make a save file in Pokémon crystal. Would I be able to access that save file on a new instance of emulator?
28 Replies
(I've tried but pyboy doesn't seem to remember it)
Yes. If you notice, when you save, a .ram file is written to your directory. That SRAM dump will be loaded by pyboy. At least it has with my experience
yeah, I saw it
the SRAM doesn't seem to load in
Make sure the ram file is in the same directory you run pyboy in
nope still doesn't work
Hrm. I can experiment later when I'm done with work for the day. You can always use a save state instead
yeah, that's what I'm living on currently
I heavily use save states as it is
but the down side is it doesn't support
--sound
Why do you need sound?
It's more or so I've been playing around with it than run programs with it
I've been meaning to run some stuff with it but one side of me said let's complete a game with it first
so I kinda ran with it
anyways, that's my current predicament
(p.s. I've wanted to write an emulator of a console for a while as well)
anyhow, do you have any idea on why it won't load in the SRAM?
Usually it's an issue involving the sram file being in the wrong directory
If you run it from commandline instead of in a script, what happens? Is there anything in the pyboy help that could be of use?
well, I can using the pyboy binary to run
currently the SRAM, ROM and Save State file are all in the same directory
so with the pyboy binary it works?
and I'm running the pyboy in that same directory
nope
it does not
the binary is the thing I've been using from the start
what if you use --loadstate?
well, I get the loadstate but with no sound
if you do --loadstate and --sound what happens?
that's what usuall happens, it loads into the state and I get an OS erro. Therefore no sound
#Save states not functioning properly when sound flag is used
What happens if you pass the .ram file to --loadstate ?
GitHub
PyBoy/pyboy/core/cartridge/base_mbc.py at acdf27c45f646dbffdbe3d38f...
Game Boy emulator written in Python. Contribute to Baekalfen/PyBoy development by creating an account on GitHub.
hmm never tried that before
You should be able to directly get to it after you start the game with something like
pyboy.mb.cartridge.load_ram(file-like-object)
hmm
I'm kind of guessing at this point. I haven't read that part of the codebase in awhile
ok
I'm going through the docs and code as well on this side
The save file is always created when you close the emulator properly. If you run it from a script, remember to call
pyboy.stop()
The save file will be located next to the ROM file you provided, and automatically loadedah ok
well, I've managed to fix it
well, the thing that happens is that whenever a save state loads in while the sound flag is enabled it gets the error in #Save states not functioning properly when sound flag is used then when I try to exit the window closses but the terminal process does not exit
therefore I need to force exit it, which isn't a proper shut
that's what was happening
so, the root cause was #Save states not functioning properly when sound flag is used