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

Stop using file extensions to determine GameInfo.System #3435

Open
YoshiRulz opened this issue Oct 31, 2022 · 2 comments
Open

Stop using file extensions to determine GameInfo.System #3435

YoshiRulz opened this issue Oct 31, 2022 · 2 comments
Labels
App: EmuHawk Relating to EmuHawk frontend Enhancement For feature requests or possible improvements

Comments

@YoshiRulz
Copy link
Member

YoshiRulz commented Oct 31, 2022

see also #969, #2889

Detection can be a list of IFileTypeDetectors (something like Func<byte[], VSystemID>) run on the rom in order (for small roms, can run in parallel with one copy of the rom per thread). We have a bit of this already for disc images and ZX Spectrum / Apple II. edit: DiscIdentifier uses file extensions too -_-
The ones which fail faster (e.g. magic bytes) should be run first.
Not sure what should happen if multiple match, maybe we'll need to manually deprioritise an implementor that's prone to false positives. I don't think the current system has anything like this as it uses file extensions—obviously mutually-exclusive.
We could allow the implementators to return a list of multiple file types (something like Func<byte[], VSystemID[]>) for polyglots.
Rather than system ID, we could use MIME types. On my Manjaro machine, I'm seeing most given unique types by file/mimetype: application/x-atari-2600-rom, application/x-fds-disk, application/x-gba-rom, application/x-n64-rom, application/x-pc-engine-rom, etc., notably home PCs seem to be a problem. I'm not suggesting we delegate file type detection to file (libmagic) though, especially because it will be a pain to bundle it on Windows. IANA is the authority for MIME types.

also need to make MAMEMachineDB.IsMAMEMachine override opt-in

@YoshiRulz YoshiRulz added Enhancement For feature requests or possible improvements App: EmuHawk Relating to EmuHawk frontend labels Oct 31, 2022
@CasualPokePlayer
Copy link
Member

Note that these issues only apply if a match isn't found in the gamedb anyways (so bad dumps, hacks, homebrew, or systems where the gamedb is not available).

@YoshiRulz
Copy link
Member Author

YoshiRulz commented Nov 10, 2022

gamedb should be optional (#2939) and that still leaves polyglots unaccounted for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App: EmuHawk Relating to EmuHawk frontend Enhancement For feature requests or possible improvements
Projects
None yet
Development

No branches or pull requests

2 participants