Post subject: Console savestates?
Joined: 8/9/2004
Posts: 139
Location: Washington State
How hard would it be to create a program for say (a modded xbox), where durring a game you could hold down a certain combonation of buttons as a macro that would back up the entire memory values of gameplay and save it to a state that could be loaded later?
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Task-switching in multitasking OSes (which the xbox has too) does something like this (the task-switcher saves the state of the current process, interrupts it to do something else, then restores the state and continues the process) so in theory it could be possible. The only difficulty I see is storing and restoring the entire contents of the graphics card, which might prove difficult (because it might not be enough to just copy the contents of the readable RAM of the graphics card). Also if the game uses temp files (which at least in theory could be possible), that might be difficult to detect and save/restore). (Of course if the temp files are kept in the HD as they are, then it might work. Perhaps.)
Former player
Joined: 3/30/2004
Posts: 1354
Location: Heather's imagination
Save it to what? Game consoles use all the memory they have, er, playing the game.
someone is out there who will like you. take off your mask so they can find you faster. I support the new Nekketsu Kouha Kunio-kun.
Former player
Joined: 8/1/2004
Posts: 2687
Location: Seattle, WA
Boco wrote:
Save it to what? Game consoles use all the memory they have, er, playing the game.
If using a modded xbox, which was used as an example, you could have extra RAM available to you.
hi nitrodon streamline: cyn-chine
Player (206)
Joined: 5/29/2004
Posts: 5712
Ooh, then I guess you'll need to use an extra console to store the savestate!
put yourself in my rocketpack if that poochie is one outrageous dude
upthorn
He/Him
Emulator Coder, Active player (391)
Joined: 3/24/2006
Posts: 1802
XBoxes have hard drives.
How fleeting are all human passions compared with the massive continuity of ducks.
nesrocks
He/Him
Player (246)
Joined: 5/1/2004
Posts: 4096
Location: Rio, Brazil
Bag of Magic Food wrote:
Ooh, then I guess you'll need to use an extra console to store the savestate!
Not a bad idea i guess hehe.. Use a NES to play and another for a savestate.
Joined: 8/9/2004
Posts: 139
Location: Washington State
that's why i suggested an xbox, you could just have the program compile the memory values and store it onto the harddrive... then use that program to boot the game and inject the memory values to continue from that state. like the save game feature only for anypoint in the game.
Joined: 10/11/2006
Posts: 35
Just a consideration, when this combo is pressed to do the save, will there be any lag in the game? If there is, will it show up when savestates are loaded?
Emulator Coder, Site Developer, Former player
Joined: 11/6/2004
Posts: 833
The idea is that the save-state command would likely put the CPU in interrupt blocking mode, and nothing could disrupt the program until it finishes. Atomically copy all of RAM, the CPU state, and the state of any other hardware to the hard drive (with interrupts disabled? Go with the extra RAM idea), restore the interrupt status and return from the interrupt handler. It's easier in a multitasking OS where a separate application can just go grab everything from the first via debugging mechanisms. My view of the problem is that from the point of view of an X-Box, it's based on a regular computer and has a lot of the same issues as doing save-states with Wine or DosBOX or etc. Among other things, you might want to save the state of the system clock so that the game doesn't notice a shock in the flow of time. You wouldn't be able to use this in any kind of network play (though modding an X-Box is usually a death sentence for internet play). Warp's issue of disk state saving can be fixed by using copy-on-write, but then you have to rewrite the disk IO handler. I'm putting this on the "not happening" list.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
I think that the issue I mentioned about the graphics hardware may be relevant too. I don't know exactly what the CPU can and cannot read from the GPU (in a PC architecture such as the xbox), but I'm pretty certain that simply storing (and later restoring) the RAM of the graphics card is not enough. You have to also store the entire state of the GPU, which is something I'm not at all sure the CPU can do (if my guess is correct that the CPU cannot read the state flags of the GPU). After all, there's much more going on in a graphics card than just what is stored in its RAM.
Emulator Coder, Former player
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
DeHackEd wrote:
My view of the problem is that from the point of view of an X-Box, it's based on a regular computer and has a lot of the same issues as doing save-states with Wine or DosBOX or etc.
So are you saying it's not feasible to do savestates from something like DosBOX? The hardware requirements for a lot of those old games is rather low, so you'd think on newer machines it shouldn't be too difficult to buffer the state and restore it later. I don't know much about this process though, so consider this a question, not a comment ;)
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Since DosBOX emulates *everything* then it may be possible. However, if DosBOX uses multithreading then trying to make a non-desyncing recording may be very difficult. If it's a single-threaded program then it may be possible.
Joined: 8/27/2006
Posts: 883
It would be impossible for the xbox. First unless you are hot, I never heard of upgrading ram. Also, if the game uses all the ram, where would be the software to save to HD the state of the ram. Again, even with a second xbox, how would you connect ? Because ftp connection or anyway need a software loaded. And again, how would you read the entire memory ?
Player (36)
Joined: 9/11/2004
Posts: 2630
ZeXr0 wrote:
And again, how would you read the entire memory ?
Two words, hibernate mode.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Joined: 8/27/2006
Posts: 883
Hibernate on a xbox ? Never saw this feature on my xbox. I might just have miss something, as I recall, if a game takes the entire memory, what would be executing the hibernation code ? Because on windows it's not built-in on the computer, it's the operating system (Read here, the game of the xbox) that would have to have the code.)
Joined: 8/28/2006
Posts: 50
This is impossible on SNES, because the SPC700 RAM can't be directly read back.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
ZeXr0 wrote:
Hibernate on a xbox ? Never saw this feature on my xbox. I might just have miss something, as I recall, if a game takes the entire memory, what would be executing the hibernation code ? Because on windows it's not built-in on the computer, it's the operating system (Read here, the game of the xbox) that would have to have the code.)
Xboxes have an OS too, and the game does not take the entire memory. We are not talking about a NES here.
Joined: 8/27/2006
Posts: 883
Xboxes may have an OS, but I don't think it is loaded when the game start. Also it's only an executable that allow you to modify data, or start a game, which I think close the dashboard.xbe .
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Of course it's loaded. The OS handles task scheduling, memory allocation, plus it provides system services to the program such as access to the hardware (including things like the hard drive, graphics acceleration, the sound card and reading the gamepad). If I'm not mistaken, the xbox offers the full DirectX API to the games.
Joined: 8/27/2006
Posts: 883
yeah, but by that, I don't think you have direct access to memory. So that would be impossible, unless you modify the dashboard, but even then, I don't think it's possible either.