Opened 15 years ago

Closed 15 years ago

Last modified 12 months ago

#8356 closed patch

Descumm misdecompilation fix

Reported by: SF/madm00se Owned by: fingolfin
Priority: normal Component: Tools
Keywords: Cc:


This patch does a few things all-in-one. I can split it
up if anybody wants me to.

Most importantly, it fixes the misdecompilation of the
case from sam&max script 52 mentioned in the comment at
the top of descumm.cpp (The "while" and "else"
detection code interference.)

Other than that it:

* Makes us output "arrayXXX[...]" instead of
"array-XXX[...]" because that's what we do with all
other types of variables and it's easier to compile.

* Makes us output "else if" in places we didn't before.

* Makes us output "var++" and "var--" instead of "var
+= 1" and "var += -1", since SCUMM doesn't support
values other than +/- 1.

* Makes us output "unless (condition)" instead of "if
(!(condition))" and "until (condition)" instead of
"while (!(condition))" because it's prettier.

* And finally (and most controversially), makes us
output the "break" keyword where needed (with it's
usual c meaning for breaking out of loops) and turns
the current "break()" into "breakHere()" to avoid
conflicts with the keyword. It's already called
breakHere() in v8, which is why I chose it, but maybe
we should change it to "yield()" or something to make
the keyword and the function more distinct?

I've got testcases if anybody wants to them.

Ticket imported from: #1037397. Ticket imported from: patches/461.

Attachments (1)

diff_v1_0_1.txt (11.9 KB ) - added by SF/madm00se 15 years ago.
Descumm multipatch v1.0.1

Download all attachments as: .zip

Change History (5)

comment:1 by SF/madm00se, 15 years ago

I forgot to remove a line which caused the ++ and -- not to
work. Updated patch attached.

by SF/madm00se, 15 years ago

Attachment: diff_v1_0_1.txt added

Descumm multipatch v1.0.1

comment:2 by fingolfin, 15 years ago

Owner: set to fingolfin
Status: newclosed

comment:3 by fingolfin, 15 years ago

Looks fine, thanks.

comment:4 by digitall, 12 months ago

Component: Tools
Note: See TracTickets for help on using tickets.