Replies: 4 comments 3 replies
-
So, I've been thinking about this today, and was thinking one idea might be to take inspiration from how EPUB files are packaged as a conceptual model. As a background, I'm heavily involved in ebooks, so I'm rather familiar with the basics of EPUB packaging. The EPUB format is a standard zip archive. There is one standard, uncompressed file stored in The OPF file is a combined ebook metadata, file manifest and (because it matters for ebooks) xhtml file order. Any files not listed in the manifest are ignored. Apart from the mandatory Obviously, any potential Dosbox format would probably be quite different technically. For example, much more aggressive compression. I notice that ZStandard is now an official compression algorithm allowed in ZIP archives for example. And Dosbox would probably use it's own metadata and manifest formats. |
Beta Was this translation helpful? Give feedback.
-
Help! I've been thinking again, and had an idea. Note the following is very much an initial idea, and would require a lot of refinement. Idea: A SQLite based container format This is an idea to create a 'ROM' format using SQLite as the container. Why SQLite? It is a very stable, well tested, single file SQL database which allows plenty of flexibility as a file format. The SQLite library is available for basically every platform under the sun. One file format that uses SQLite as its container is MBTiles, a file that can contain millions of map tiles. SQLite would allow anybody to easily "peek under the hood" using standard SQLite tooling. The following is the beginnings of a proposed format schema. Metadata TableCREATE TABLE metadata (
format_version INT,
json_metadata VARCHAR
) Store metadata about the game or application. Idea is to keep it as a json file for easy extendability. Maybe include minimum versions of dosbox supported etc. Config TableCREATE TABLE config (
id INT,
name VARCHAR,
config VARCHAR
) Store one or more dosbox configs. The first config would have ID File TableCREATE TABLE file (
id INT,
path VARCHAR,
mimetype VARCHAR,
uncompressed_size INT,
uncompressed_hash VARCHAR,
uncompressed_chunk_size INT,
num_chunks INT,
compression_type INT,
uncompressed_hash VARCHAR
) Store a listing of all files in the container. This table determines how a file should be mounted, and how it's contents are stored in the File Content TableCREATE TABLE file_content (
file_id INT,
variant INT, --config id, support multiple variants of the same file
chunk_num INT,
chunk BLOB
) Store the contents of files. A file may have multiple variants which correspond to the loaded config. Each chunk when uncompressed is the size specified in the |
Beta Was this translation helpful? Give feedback.
-
I propose that we revisit the fundamentals and draft a set of requirements for our request. It is important that we draft a comprehensive set of requirements to guide our efforts. While I have some initial ideas on how to achieve our objectives, it is essential to approach them with a degree of caution. To provide clarity, I will break down this proposal into four distinct components:
.dosrom:It serves as the ROM image for a game. Once created, it should remain untouched unless there's a valid reason to modify it. When it comes to packaging, we must consider that many DOS games were modified during setup or initial runs. Within other console emulators, each game version became its own ROM, leading to cases where there might be 20 ROM releases during its run. To put it another way, there are 880 Sega Genesis ROMs, but there have been 5872 ROM releases. While it's not the responsibility of DosBox Staging, should we acknowledge that some users desire a complete copy of a game from its original release to the latest user-made patch, all packaged together? Should we consider internal reversioning for the ROM? For instance, Sierra On-Line's game "Hero's Quest" had significant patches that altered gameplay. Additionally, there were compatibility issues between 5.25-inch disk saves and 3.5-inch disk saves due to resource file splitting during packaging. Furthermore, the game underwent at least five patches and a rebranding during its initial run. There's also the concept of post-vendor patching, where unofficial fan patches are applied. Games like "Quest for Glory 3" were released incomplete, where in-game classes were unable to reach 100% completion. The fan community has taken it upon themselves to rectify these issues, but the patch requires the original game files. I see this as a trend that will continue. I suggest that whatever format the ".dosrom" file should take, it should support basic reversioning options mentioned earlier, via support for Hard Links or symbolic links to remove duplication inside the ".dosrom" file. While I agree that space is cheap, I don’t foresee someone wanting to save or transfer an additional 5GB for video or audio data that is the same between patches of a DVD. If agreed, we may want to come up with a way to constantly craft the ".dosrom" file to maintain consistence, a project space where we keep a SHA value and directory structure of all the files and then submit them to the project? .dosconf:This file serves as configuration data for the ROM file. While not mandatory, it can be optionally distributed alongside the .dosrom. It contains additional metadata for DosBox or other settings pertinent to customizing the game within DosBox. This includes but is not limited to:
.dossave:The .dossave serves as a repository for storing save game data or any other configuration data generated by the program within DosBox. To address patch-related save issues, such as those encountered with Hero's Quest, which suffered compatibility problems between 5.25-inch disk saves and 3.5-inch disk saves due to resource file splitting during packaging, the .dossave file should support multiple save hierarchies. This can be achieved by associating each save with the corresponding patch version of the game. Moreover, it should provide the capability to overcome save limitations within a game by incorporating a method to manage split save data. For instance, in games like Wing Commander, which offer only 8 save slots, players often duplicated save files and swapped them to access older saves. To accommodate this, there should be an option to load additional saves (replacing the SAVEGAME.WLD), which could be seamlessly integrated into the OSD as an extra feature. .dosplay:I'm presenting this concept because I'm a supporter of the TAS (Tool-Assisted Speedrunning) and speedrunning community. If DosBox were to attain 100% reproducible RNG or the capability to inject pseudo-RNG for games utilizing RNG, it would become possible to record a gameplay session and precisely replay it, maintaining a one-to-one correspondence with the original. |
Beta Was this translation helpful? Give feedback.
-
Have you considered adopting this? https://github.com/schellingb/dosbox-pure?tab=readme-ov-file#load-games-from-zip |
Beta Was this translation helpful? Give feedback.
-
A ROM package holds the game's files and metadata inside it.
In order to elegantly support this, DOSBox's existing file IO calls should be wrapped on a 1-to-1 basis, sending them through an IO backend.
The IO backend can then operate on files on the host (as the calls current do), in the writable overlay area, or held in the ROM package.
DOSBox has thousands of IO calls, So this issue tracks the effort of simply wrapping such calls, so when we finalize the ROM package's container and compression format we will be ready to simply drop it into this IO backend.
IO calls also exist inside 3rd party code (such as the audio codecs, MT32, and FluidSynth) that we currently use when we pass those libraries a filename and let them perform IO calls themselves. To avoid those, we will need to use load-from-memory type API calls (allowing us to perform the file read beforehand), or pass them IO callbacks, which some libraries provide, such as the CD-DA codecs.
This issue allows us to discuss details of how we want to go about this.
Beta Was this translation helpful? Give feedback.
All reactions