[Scummvm-devel] MT-32 emulator progress

Max Horn max at quendi.de
Fri Apr 1 00:34:47 CEST 2011


Am 31.03.2011 um 23:52 schrieb Jerome Fisher:

> On 31/03/11 14:57, Max Horn wrote:
[...]

>> Since you asked about parts that make integration of munt with ScummVM slightly problematic: Your File code assumes the presence of stdio FILE: While it allows using custom file code, it also always and unconditionally includes an ANSIFile class based on FILE; and that class is always compiled in (you can't avoid it without modifying the munt code, as it is right inside file.h/file.cpp.
> 
> Thanks for the great notes. I've been skimming over the scummvm commit 
> logs - I'll go into detail to make sure I've got every useful change 
> later - but this is useful.
> 
> Out of curiosity, what doesn't have stdio FILE?

Our Nintendo DS, PS2 and WinCE ports all "fake" a FILE implementation, so I assume those; plus potentially more (we took care of removing all references to FILE from or main codebase by now, so backends don't need to #define/typedef FILE anymore).

[...]

> I've moved ANSIFile to its own files as you suggested, but for now Synth 
> still uses it as a fallback for backwards compatibility.

Adding a simple #ifdef DISABLE_ANSI_FILE could be used to make it possible to build munt for ScummVM from the same source base as the regular munt. But as you point out, we're just talking about a handful lines anyway. No big deal.

[...]

> There's no need for a default closeFile() callback - if there's no 
> callback it just does file->close() anyway. Why a closeFile() callback 
> exists at all is a pre-VCS mystery that I'll explore some day.

My bet would be that this was a reflex addition without much thought... you know, like "we have an openFile callback, then by symmetry we also need a closeFile callback". or so :). Anyway, doesn't really matter :).

> 
>> Another issue is the support for writing files in your File class. I guess we could implement a dummy mode that just errors out when trying to open a file for writing. Then again, you don't seem to actually *use* that write code anymore (it's only being used in Synth::dumpTimbre, which is called by Synth::dumpTimbres, which in turns is never called). So, maybe you can just remove it.
> 
> Hmm, writing was used extensively in the ScummVM version, so I guess 
> you're talking about current git Munt

Sure. For our "old" munt, we changed the code to make use of our DumpFile class (which is write-only, while our File class is read-only).
Writing to arbitrary files is an issue on certain platforms, and the waveform cache is a hassle for users on all platforms, so getting rid of that is a big improvement in my eyes :).


Cheers,
Max



More information about the Scummvm-devel mailing list