VOGONS


First post, by Malvineous

User metadata
Rank Oldbie
Rank
Oldbie

Hi all,

I'm just starting to look at the new .DRO Adlib capture format in the CVS version of DOSBox, but as I'm starting to figure out how it works, I'm beginning to wonder what the reason was behind its implementation.

As far as I can tell, it's a more optimised version of the original .dro format. It won't write out values if they have no effect, such as a game writing the same value to the same register, or writing to an unused register. It also compacts values so instead of writing out the actual registers used, you have to look up a code table to find out what the original registers were.

Now this is all well and good, but I'm beginning to wonder why it's necessary to have this level of optimisation in DOSBox itself. Okay, it probably won't slow things down that much, but it would seem to bloat DOSBox just a little, all for the benefit of a few kilobytes saved in capture files (which, if it's that important, you could use a standalone utility for - I wrote one myself years back to remove redundant data from .raw files.)

The main reason why I'm not so keen on this optimisation happening inside DOSBox is because people like me who write Adlib utilities will find it limits the discoveries that can be made using DOSBox. Speaking from my own experiences, often seeing all the irrelevant data written to the OPL ports is a great way to understand how a program or game is working internally - but once the new capture format optimises all that away, it'll be that much harder to work out why a program outputs what it does. Of course it goes without saying that because of the code table, there's no chance of opening up a new .dro file in a hex editor to examine the raw Adlib data - something I frequently do when trying to reverse engineer a music format.

Perhaps I'm missing some great reason why the optimisation is important - maybe someone involved with the new capture format could shed some light on this?

Reply 1 of 3, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well as i recall you actually said sometime ago that you wanted a different format since they could be smaller and seeing as the original format was flawed anyway with certain registers missing. I thought i might as well just make something new that supports everything and has smaller files. Dunno if supporting hex editors is really that much of an issue either, if you have a dro editor you can just create some sort of time line with events and flashy buttons indicatin active channels and what not.
Although i could probably make the lookup table fixed as well, but now you could just make dro files that at least have the first opl register set in their regular location if you'd wanted something like that.You just can't have writes to non existing registers.

Reply 2 of 3, by Malvineous

User metadata
Rank Oldbie
Rank
Oldbie

Did I say that? I don't think it was me, I didn't have any problem with the original .dro format, it has escapes in there to allow all registers to be used.

I certainly don't mind the more efficient layout - as you say I could create some sort of utility to examine the format in more detail instead of using a hex editor, I guess my main issue is with the optimisation, which loses data sent to invalid registers, and doesn't write out superfluous data.

So I guess it boils down to this: Is there any possibility of having some sort of option that allows a complete OPL capture, invalid ports, extra data and all? Could the new format cope with all 256 registers being used? If that were possible then I wouldn't have a problem with the new format. (Also it'd be good if, when using this option, the capture started at the first write to the OPL port, so you don't lose all the init data that gets sent before the first note - very useful when reverse engineering OPL instrument formats.)

Reply 3 of 3, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well there are still some codes left, i guess you could come up with something for adding extra functionality.
So 1 code that will set the lower data address, then 1 code for writing to that address, same for the higher address range. Think there should still be 4 codes left for that.