KEMBAR78
MTROPOLIS: Implement the Return Modifier and tentative opint handling by Willem3141 · Pull Request #4651 · scummvm/scummvm · GitHub
Skip to content

Conversation

@Willem3141
Copy link
Contributor

When SPQR opens a dialog box it wants to return from, it sets worldmanager.opint to 7 before switching worldmanager.currentscene to the dialog box scene. (Other values encountered in SPQR are 2 and 4, which seem to be used for scene transitions that do not go to dialogs.) It therefore seems logical that 7 is used to indicate that the add-to-return-list flag should be set. This PR tentatively assumes that the least significant bit of opint is the add-to-return-list flag and sets this flag accordingly when handling writes to currentscene.

Together with a (very simple) implementation of the Return Modifier, this PR makes SPQR's dialog handling work (i.e., dialogs can be closed with the exit button now).

Please note that I have not reverse-engineered anything here (as I have no real idea how to achieve that). This PR is based simply on observing SPQR's behavior, so what's implemented here may not match what mTropolis does. For games that do not use opint, this change should not break anything, as the add-to-return-list flag was already set to false anyway.

When SPQR opens a dialog box it wants to return from, it sets
worldmanager.opint to 7 before switching worldmanager.currentscene to
the dialog box scene. (Other values encountered in SPQR are 2 and 4,
which seem to be used for scene transitions that do not go to dialogs.)
It therefore seems logical that 7 is used to indicate that the
add-to-return-list flag should be set. This commit tentatively assumes
that the least significant bit of opint is the add-to-return-list flag
and sets this flag accordingly when handling writes to
worldmanager.currentscene.
@sev-
Copy link
Member

sev- commented Feb 7, 2023

Thank you!

@sev- sev- merged commit 8c570d2 into scummvm:master Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants