This prevents us from loading a file as both a driver and a game file,
preventing double-loading .chd files when `meta.emulator_ext` is `chd`.
In these cases, it appears that the files aren't needed as driver files,
so we can safely just load them as game files and ignore the duplicates
we'd get by loading all .chd files as drivers.
Emularity had been storing downloaded game files into the IndexedDB,
but if the file was already present then it would download it again
and overwrite it. Now it will skip the download if the file exists.
At present this only applies to files downloaded using the “saveFile”
method, not the “mountZip” method. The “mountZip” method doesn’t save
the zip file anywhere, so no caching is currently done.
Potentially this could cause you problems if a file gets corrupted or
edited, and reloading the page won’t fix it. Emularity doesn‘t provide
a UI for diagnosing or fixing such problems at present, so you may
want to implement some way to flush the IndexedDB containing the
filesystem.
Some arguments that you might put in extraArgs will add or remove
peripherals, and attempting to use those newly added peripherals
silently fails if we try to use them before they've been added.
Fixes MAMERunner's mute/unmute functions, and starts MAME with the
volume turned down instead of with no sound emulation at all when the
mute cookie is set.
Turns out that a program that uses emscripten's SDL port to create a
"window" (by calling SDL_CreateWindow) gets exactly the canvas size
that they requested, and emscripten actually resets the canvas back to
this size on certain events (such as window resize).
This means that the application must request the scaled size, or
explictly resize the canvas using a different API. Since MAME accepts a
-resolution command-line argument, I can at least make it request a
window of the scaled size. It's not as efficient as letting the
browser scale the window, but it works.
Move fliplist file creation into VICELoader, and processing of IA metadata into IALoader.
Not actually tested on indepenent VICELoader. Tested and works on IA, with the caveat that empty metadata_fliplist.vfl gets created.