Opened 8 months ago
Closed 3 months ago
#16211 closed defect (fixed)
ALL: The new platform options seems to break the parsing of other options
| Reported by: | eriktorbjorn | Owned by: | sev- |
|---|---|---|---|
| Priority: | normal | Component: | Common |
| Version: | Keywords: | ||
| Cc: | Game: |
Description (last modified by )
This appears to be a regression from https://github.com/scummvm/scummvm/pull/6773
As I understand it, GUI options are stored in two ways. There is the human readable one in scummvm.ini, and the binary one produced by parseGameGUIOptions(), which produces a string which we then usually calls contains() in to see if it has a particular option.
The options are defined in gui_options.h, with values from GUIO_NONE ("\x00") through GUIO_NOLANG ("\x33") for global options, and the game options GUIO_GAMEOPTIONS1 ("\xe0") through GUIO_GAMEOPTIONS32 ("\xff").
And then there is GUIO_PLATFORM_PREFIX ("\x40"), followed by a platform code from kPlatformApple2GS_VAL ("\x01") through kPlatformNintendoSwitch_VAL ("\x27"). So now a single byte can mean more than one thing?
At the very least, this breaks the music device setting when adding a new SCI game. E.g. if I add Space Quest III, it only offers me "<default>", "No music", and "AdLib emulator". That's because it does this to determine if the game explicitly specifies MIDI options:
const Common::String allFlags = MidiDriver::musicType2GUIO((uint32)-1); bool hasMidiDefined = (strpbrk(_guioptions.c_str(), allFlags.c_str()) != nullptr);
But I could easily see it break any code that calls parseGameGUIOptions() and then uses contains() on it. I just haven't tried to verify it.
Change History (12)
comment:2 by , 8 months ago
The options dialog checks for single flags:
GUIO_NOASPECT("\x13"), possible clash withkPlatformNES_VALGUIO_LINKMUSICTOSFX("\x31")GUIO_LINKSPEECHTOSFX("\x30")GUIO_MIDIADLIB("\x0a"), possible clash withkPlatformDOS_VALGUIO_NOMIDI("\x05"), possible clash withkPlatformAmiga_VALGUIO_NOMUSIC("\x02"), possible clash withkPlatformApple2_VALGUIO_NOSFX("\x04"), possible clash withkPlatformAcorn_VALGUIO_NOSPEECH("\x03"), possible clash withkPlatform3DO_VALGUIO_NOSPEECHVOLUME("\x32")GUIO_NOSUBTITLES("\x01"), possible clash withkPlatformApple2GS_VAL
It also checks for groups of flags:
All MIDI flags:
GUIO_MIDIPCSPK("\x07"), possible clash withkPlatformAtariST_VALGUIO_MIDICMS("\x08"), possible clash withkPlatformC64_VALGUIO_MIDIPCJR("\x09"), possible clash withkPlatformAmstradCPC_VALGUIO_MIDIADLIB("\x0a"), possible clash withkPlatformDOS_VAL(possibly the source of the bug I initially saw)GUIO_MIDIC64("\x0b"), possible clash withkPlatformPC98_VALGUIO_MIDIAMIGA("\x0c"), possible clash withkPlatformWii_VALGUIO_MIDIAPPLEIIGS("\x0d"), possible clash withkPlatformCoCo_VALGUIO_MIDITOWNS("\x0e"), possible clash withkPlatformCoCo3_VALGUIO_MIDIPC98("\x0f"), possible clash withkPlatformFMTowns_VALGUIO_MIDISEGACD("\x10"), possible clash withkPlatformLinux_VALGUIO_MIDIGM("\x12"), possible clash withkPlatformPCEngine_VALGUIO_MIDIMT32´ ("\x11"), possible clash withkPlatformMacintosh_VAL`GUIO_MIDIMAC("\x17"), possible clash withkPlatformPS2_VAL
Aside note: I would have thought that this would mean that a Macintosh SCI game would only offer MT-32 music, but that's not the case.
All render modes:
GUIO_RENDERHERCGREEN("\x18"), possible clash withkPlatformPS3_VALGUIO_RENDERHERCAMBER("\x19"), possible clash withkPlatformXbox_VALGUIO_RENDERCGA("\x1a"), possible clash withkPlatformCDi_VALGUIO_RENDEREGA("\x1b"), possible clash withkPlatformIOS_VALGUIO_RENDERVGA("\x1c"), possible clash withkPlatformAndroid_VALGUIO_RENDERAMIGA("\x1d"), possible clash withkPlatformOS2_VALGUIO_RENDERFMTOWNS("\x1e"), possible clash withkPlatformBeOS_VALGUIO_RENDERPC98_256C("\x1f"), possible clash withkPlatformPocketPC_VALGUIO_RENDERPC98_16C("\x20"), possible clash withkPlatformMegaDrive_VALGUIO_RENDERAPPLE2GS("\x21"), possible clash withkPlatformSaturn_VALGUIO_RENDERATARIST("\x22"), possible clash withkPlatformPippin_VALGUIO_RENDERMACINTOSH("\x23"), possible clash withkPlatformMacintoshII_VALGUIO_RENDERMACINTOSHBW("\x24"), possible clash withkPlatformShockwave_VALGUIO_RENDERCGACOMP("\x25"), possible clash withkPlatformZX_VALGUIO_RENDERCGABW("\x26"), possible clash withkPlatformTI994_VALGUIO_RENDERPC("\x27"), possible clash withkPlatformNintendoSwitch_VALGUIO_RENDERZX("\x28")GUIO_RENDERC64("\x29")GUIO_RENDERVGAGREY("\x2A")GUIO_RENDERPC98_8C("\x2B")GUIO_RENDERWIN_16C("\x2D")GUIO_RENDERWIN_256C("\x2C")
Aside note: The kRenderWin256c and kRenderWin16c entries seem wrong in s_renderGUIOMapping[]?
I do have one game for OS/2. I guess I should check if it incorrectly offers me Amiga rendering. Can't do it at the moment, though.
comment:3 by , 8 months ago
It's a bit more complicated than I first thought for Macintosh games. The Mac version of Castle of Dr. Brain offers me the following music drivers:
- <default>
- No music
- Sndio
- FluidSynth
- MT-32 Emulator
- Embedded Audio Synthesis
- TiMidity
In 2.9.1 it offered the full (?) list, probably because the SCI engine doesn't specify which ones it wants. That, at least, is probably caused by it mistaking the Macintosh platform flag for the MT-32 Emulator music flag.
comment:4 by , 8 months ago
In some cases, we use Common::checkGameGUIOption() or Common::checkGameGUIOptionLanguage(). Haven't checked if they cause any problem.
comment:5 by , 8 months ago
I incorrectly stated that the platform options aren't automatically updated when a game was launched. I was wrong. I just started a SCI game, and the platform options were updated alongside others.
It still keeps the old music_driver setting in scummvm.ini, so it doesn't break your sound. But it may very well be one that you're no longer allowed to set.
comment:6 by , 8 months ago
| Description: | modified (diff) |
|---|
comment:7 by , 8 months ago
| Summary: | ALL: Platform options seems to break GUI option parsing → ALL: The new platform options seems to break the parsing of other options |
|---|
comment:8 by , 8 months ago
| Description: | modified (diff) |
|---|
comment:9 by , 8 months ago
| Description: | modified (diff) |
|---|
comment:10 by , 8 months ago
Hi eriktorbjorn, thank you for this detailed report. This issue should be fixed with https://github.com/scummvm/scummvm/pull/6944
comment:11 by , 6 months ago
| Owner: | set to |
|---|---|
| Resolution: | → fixed |
| Status: | new → pending |
comment:12 by , 3 months ago
| Owner: | changed from to |
|---|---|
| Status: | pending → closed |

Some more notes along the way.
There is only one place where
parseGameGUIOptionsPlatforms()is called, and that's fromparseGameGUIOptions(). So we only need to worry about the latter, and fortunately that's not called in that many places either.Beneath a Steel Sky uses it to test for
GUIO_NOSPEECH("\x03"). This would potentially clash withkPlatform3DO_VAL, but by pure luck I don't think that's an issue.The SCUMM engine uses it to test for several things:
GAMEOPTION_ORIGINALGUI(GUIO_GAMEOPTIONS4)GAMEOPTION_COPY_PROTECTION(GUIO_GAMEOPTIONS7)GAMEOPTION_ENHANCEMENTS(GUIO_GAMEOPTIONS2)GAMEOPTION_LOWLATENCYAUDIO(GUIO_GAMEOPTIONS5)GAMEOPTION_AUDIO_OVERRIDE(GUIO_GAMEOPTIONS3)GAMEOPTION_REMASTERED_AUDIO(GUIO_GAMEOPTIONS8)GAMEOPTION_TTS(GUIO_GAMEOPTIONS9)GAMEOPTION_TRIM_FMTOWNS_TO_200_PIXELS(GUIO_GAMEOPTIONS1)None of these can clash with the platform options.
The SCI engine does something with it, but only to append the language settings?
So the main use is probably the options dialog, and I'll put that in a separate comment.