First post, by Nazo
- Rank
- Member
I was playing a game that did a lot of reading/writing from the harddisk at times and would kind of freeze up while it waited for the reading/writing to finish and a thought struck me. In this modern day, most of us have 1GiB or even more of memory -- even the worst cases often have at least 512MiB. That's enough to fit many games in their entirity into a RAM drive even accounting for the OS and emulation each using a fair bit of that memory.
I tried the idea out with Daggerfall, which was the one that kept freezing up on me, and where it would very noticably jerk when someone added an entry to my map, there was an almost imperceptable hitch and while saving would really jerk and halt like crazy with a long delay between me hitting save and it getting back into the game (complete with the music sounding kind of funky as notes get sustained longer than they were intended to be due to the way MIDI works) after I put it on a ramdrive, it too had an almost completely imperceptable pause, though it was admitedly more noticable than the map entries. Overall the game ran quite noticably smoother with minimal hitching for reading or writing and I felt like it was worth going to all the trouble to make it work like that.
Handling the RAM drive internally in DOSBox would make handling images a lot easier obviously, but what's more, since we're talking about handling images for multiple games, it really makes a difference as there would likely be several images since anyone using this would probably want to use it for several games. Whereas you only need one command, let's say "imgmount e dagger.img -t hdd -ramdisk" if it were done in DOSBox (and even this could be simplified further by tossing it into a batch file,) to handle this for multiple image types in an external program like RamDiskXP, you have to dig through their configurations and change which image file is loaded for every single game (unless you can create a ramdrive so huge that it fits every game that needs it into one image, but I think that's probably unlikely since most of the games that need it are fairly large.) Besides harddrive images for really big games like Daggerfall (some of which can be made to run fully off of harddrive as I'm doing with Daggerfall atm,) I probably don't have to tell you how many games could benefit from mounting a CD-ROM image into memory... Yes, even running the games and CD images from a harddrive isn't always the best way depending on how busy or slow the drive is or perhaps even fragmentation.
The only catch that I can think of is that it really needs to save any changes so savegames don't get lost for the harddrive or floppy images. It struck me that if it could smoothly write in the background, that would be best since it would mean that most crashes would be no more harmful than they normally would be. Even if that were too much to actually implement (I imagine that to keep it from making games get a little jerky as it saves it would be pretty tough to implement,) a save on exit would be effective enough for most games except for the few that like to freeze a system on exit (well, I've seen it in the past, but I admit it doesn't happen much.) Maybe a key that would force a manual save could be useful even? Just as long as there's some way it can at least semi-automatically handle saving so people don't have to worry about forgetting to save manually. Even if it required running some command like say "imgsave" or something, that could just be put into a batch file with the imgmount command itself so the user wouldn't have to worry about forgetting, and isn't so hard to type by hand either.
I'm not sure, but it also struck me that DOSBox would probably handle such a thing a little more efficiently with less overhead as it doesn't have to try to work backwards with an OS, but can actually work at a more low level without much need for trickery. At least the program I was using seemed to use some 17MiB or so of overhead in RAM, which isn't much, but I'm thinking that in some of the worst situations memory could be a little tight for some with really large games (for example, Daggerfall is using well over 500MiB for me after moving all the files from the CD to the harddrive and patching it to the latest version and all) or for people with lower amounts of memory.
It's just a thought anyway, but I think it could really be nice for DOSBox to have such a thing.