Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ROM files loading algorithm in the SMF2WAV conversion command-line tool #52

Closed
sergm opened this issue Mar 28, 2021 · 0 comments

Comments

@sergm
Copy link
Member

sergm commented Mar 28, 2021

Current behaviour

Currently, the tool is only capable of searching two sets of ROM files in a specified directory. These two sets have hard-coded names ["CM32L_CONTROL.ROM", "CM32L_PCM.ROM"] and ["MT32_CONTROL.ROM", "MT32_PCM.ROM"], yet the CM32L files take priority over the MT32 ones. There is no check implemented wrt. correspondence these filenames to the actual machine model. Also, the priorities are hard-coded, it is not possible to make the tool load the MT32 files in case the CM32L files are present in the same directory.

Desired behaviour

The tool should feature a ROM scanning function. It should be capable of searching in a specified directory and loading ROM files for a particular machine model regardless of filenames. A new command-line option (e.g. -i / --machine-id) should be introduced for specifying either the exact desired machine model or a pattern. The backend for this feature becomes available in libmt32emu with #47.

  • When the exact machine model is specified, the corresponding ROM files of all known types (including full and/or partial ROM images) should be searched for and loaded into the emulation engine. All other irrelevant files in the directory should be ignored.
  • When a pattern is specified (or, by default, any available ROM set is searched for), the CM-32L ROMs should still have higher priority that MT-32 ROMs, yet higher control ROM version should always win if multiple are available.

Upon successful startup, the tool should indicate the machine model, for which the ROM files have been loaded and are being used.

sergm added a commit that referenced this issue Mar 28, 2021
- Nuked the hard-coded filenames previously attempted to get loaded at
  startup
- Added a new option -i / --machine-id that provides a way to specify a
  machine model to search and load ROM files for; three patterns are also
  available: any (the default), any version of MT-32 and any version of
  CM-32L / LAPC-I
- The ROM directory (specified with the option "rom-dir") no longer needs
  to be terminated with the path separator
- Along the way, fixed a minor memory leak and muted a MSVC warning in main
sergm added a commit that referenced this issue Mar 29, 2021
  where the configured system locale isn't UTF-8
- Suppressed redundant output about detected machine configuration (#52)
@sergm sergm added this to the mt32emu_smf2wav_1_7 milestone Mar 30, 2021
@sergm sergm closed this as completed May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant