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

DIRECTOR: fix Japanese continuation marker while preprocessing #3558

Merged
merged 1 commit into from Nov 22, 2021

Conversation

@mistydemeo
Copy link
Contributor

@mistydemeo mistydemeo commented Nov 22, 2021

The continuation marker is at the same codepoint in MacRoman as the half-width katakana tsu (ツ) in MacJapanese. Since parsing happens after Lingo source has been converted from its original encoding to Unicode, the continuation marker is being translated into the wrong character and treated as a syntax error. This patch works around it by checking for ツ and translating it back into the continuation character. While this could eventually be fixed by having the parser work on the raw bytes of the Lingo source instead of decoded strings, this is good enough for now to fix the affected games. I've tested several games with the issue - Difficult Book Game (henachoco03), The Seven Colors (the7colors), and Oz (erikotamuraoz).

Here's what the source code with the wrong continuation marker looks like:

on startMovie
    global theObjects,retdata1,retdata2,ladytime,selif,daiido,Xzahyo,Yzahyo,StageNum, ツ

This is the third fix needed to promote Difficult Book Game to fully-working status.

At least one of the three affected games has Japanese text on the same line as as a continuation marker, so it might just be that is the continuation marker in Japanese.

@sev-
Copy link
Member

@sev- sev- commented Nov 22, 2021

Yes, this is a good thing, I was mentioning it in the past.

However, I would like to ask you to add a sanity check: do the transformation only if that character is followed by \r or the end of the string.

Loading

@mistydemeo mistydemeo force-pushed the director_patch_continuation_marker branch from 950b5a0 to cf273ea Nov 22, 2021
@mistydemeo
Copy link
Contributor Author

@mistydemeo mistydemeo commented Nov 22, 2021

Good call. Done.

Loading

@sev-
Copy link
Member

@sev- sev- commented Nov 22, 2021

Thanks!

Loading

@sev- sev- merged commit 61ff576 into scummvm:master Nov 22, 2021
8 checks passed
Loading
@mistydemeo mistydemeo deleted the director_patch_continuation_marker branch Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants