Dump memory into a file

By mtini

Master (143)

mtini's picture

08-07-2019, 13:23

Is there any way to make a memory dump of what is running on blueMSX and write this content to a ROM-like file?

For example, when placing the Antarctic Adventure ROM in blueMSX, dump the image and generate a new .ROM?

Thank you

Login or register to post comments

By Grauw

Ascended (10821)

Grauw's picture

08-07-2019, 14:39

A ROM is read-only data, so it will not change during run-time and there’s no point in re-saving it.

I think what you would like is to store a snapshot of the RAM memory, however that would 1. not be a .ROM file, and 2. even if you would save and reload it, it would be overwritten when the system boots the game.

However you are probably looking for the save states emulator function. This makes a snapshot of the entire state of the machine (memory, CPU, VDP, etc.). In openMSX you can make a save state with the following commands:

https://openmsx.org/manual/user.html#savestate
https://openmsx.org/manual/commands.html#savestate

If you want to share a save state with someone else, I think you can just send them the .oms file that’s in ~/.openMSX/savestates (MacOS, Linux) or C:\Users\(...)\Documents\openMSX\savestates (Windows).

By ricbit

Champion (438)

ricbit's picture

08-07-2019, 16:05

If you want to extract the ram from an openmsx save state, I wrote this script some time ago:

https://github.com/ricbit/Oldies/blob/master/2015-01-getram/getram.py

By shram86

Expert (117)

shram86's picture

08-07-2019, 16:23

ricbit wrote:

If you want to extract the ram from an openmsx save state, I wrote this script some time ago:

https://github.com/ricbit/Oldies/blob/master/2015-01-getram/getram.py

Super useful, thanks for sharing this

By Grauw

Ascended (10821)

Grauw's picture

08-07-2019, 16:34

Note that in openMSX you can also dump the contents of any debuggable (including RAM) using the debug commands (see "help debug"), and you can save a debuggable to a file using the save_debuggable command (see "help save_debuggable").

By mtini

Master (143)

mtini's picture

09-07-2019, 02:32

My idea is to save the ROM that is being executed for the purpose of converting games. For example. If we run the program SG2MSX filename.sg the program is loaded into the already converted MSX ROM. The idea would be to extract this ROM that has already been converted into another .ROM file and so we would have an automatic conversion program.

In the case of conversions of Coleco for example, we have the MISSION emulator. Making use of Mission.com and running it via command line in MSX-DOS would have in memory of MSX the .ROM file already converted. For example:

MISSION.COM filename.ROM

Mission does all the conversion work. The final product is a ROM that will be in MSX (read only) memory. The idea is to just extract this ROM and save to disk. This product ROM of this conversion will be the ROM converted.

From then on we could just run the new ROM with the command EXECROM filename.ROM because we would have a file already converted.

That's why I commented on whether it is possible to do this or not. In relation to having no meaning, the meaning is this. It's an idea, which can streamline the entire process of converting games from one platform to another.

Since I do not understand how to do it, I wonder if there is any way to do this. Or even make MISSION itself or SG2MSX generate an OUTPUT ROM file.

Thanks in advance.

By NYYRIKKI

Enlighted (6093)

NYYRIKKI's picture

09-07-2019, 08:37

Yes, this kind of can be done, but with heavy limitations:
- You can not create the snapshot on real hardware, only on emulator (openmsx would be better for this purpose than BlueMSX)
- You can store such a snapshot on MegaROM, flash cartridge or other media big enough to store it and restore the snapshot from there
- No program to do that is available, you have to do that your self.
- The configuration in emulator while making the snapshot must match the configuration of the machine you are loading the snapshot. This means you can't ie. emulate some Panasonic model and then load the snapshot to ie. Spectravideo MSX. Openmsx already knows about 170 different machines, but you may have to edit the configuration files if your target machine has after market mods.

By gdx

Enlighted (6438)

gdx's picture

09-07-2019, 10:38

When you save a game, blueMSX create a file .STA. This file is in fact a archive ZIP. Rename STA with ZIP and you will see the backup of RAM and VRAM but that does not mean that you can copy an area of RAM to make a ROM. For example Colecovision Roms require Coleco Bios patched for MSX, and Mission adds also routines scattered in RAM. You have to put all this together to make a ROM.

That would give you a lot of work for nothing since Coleco Roma have already been adapted for MSX here, and they work much better than with Mission.

About SG-1000 Roms, 100% of games could work if SG2MSX was improved. Currently, SG2MSX applies patches automatically so sometimes it applies them where it should not. I used a method that works 100% on SG1000.COM but the RAM is missing to put the whole database. I did not take the time to improve the method because 96% of games works but the source code is available. You can improve if yourself.

By mtini

Master (143)

mtini's picture

09-07-2019, 23:08

I can not improve the program you mentioned GDX because I do not have assembly programming skills. It would be much more practical for someone who has this knowledge to make an improvement in the program, it would be very helpful. If I had known how to do it, I would have done it.

I talked to TinyYarou and it will make an improvement in SG2MSX, making the program to output a .ROM file, which will already be the modified ROM.

I think the same can be done with Mission, that is, instead of emulating the game in MSX, add an option on the command line to extract an output file.

I would also like to make it clear again that I do not program in assembly and I do not have the competence to do this kind of program in this language. However this idea that I had solved the ports problem, that is, automate the ports.

TinyYarou sent me a link with a project from Tanam that I share with you guys. It is a similar project to SG2MSX, but called COL2MSX that has the same purpose as I mentioned. Generate an output ROM file. There is a C program on the page if someone can compile and make it available.

COL2MSX

This would be very useful.

There are several good Coleco games that have not been converted, examples: Popeye, Frogger 2, Q * Bert, Q * Bert Cubes and several others.

Thanks in advance.

By mtini

Master (143)

mtini's picture

09-07-2019, 23:14

Thank you NYYRIKKI for imformation.

I believe the solution would be to adapt both SG2MSX and MISSION or COL2MSX to generate an output .ROM file. I believe that if this is done we will have practically the whole library of these two platforms available natively on MSX without the need use of emulators.

By mtini

Master (143)

mtini's picture

09-07-2019, 23:18

Thank you GDX for answer and information about the blueMSX STA files. I did not know this information.

About the program, unfortunately I do not have assembly programming skills, I do not even know where to start. I just had this idea. I wrote in another answer about this, in this topic, it would be more practical if someone with this knowledge did this implementation.

I also passed on another response information about the COL2MSX program that has the same purpose.

Thanks in advance.