Opened 17 years ago

Closed 16 years ago

Last modified 8 months ago

#8148 closed patch

Handling Y/N questions (bug #647860)

Reported by: eriktorbjorn Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game: Monkey Island 1


This patch enables the MI1/MI2 "instant win" cheats
(see bug #647860). I know Fingolfin said we should
close that bug as WONTFIX, but since these cheats are
part of the game scripts, and I believe that we will
eventually have to support other "Are you sure you want
to...?" style questions, I think we should fix it after

There are a few things I'm uncertain about:

With this patch, unkMessage2() will always write to the
VAR_KEYPRESS variable, which is a new variable that
I've added. I'm almost certain this is the correct
behaviour for MI1 and MI2, but for all other games it's
just a guess.

To handle Ctrl-Alt-<key>, I'm adding 250 to the value
_keyPressed would normally get. I don't know if this is
correct, but it works well enough to handle Ctrl-Alt-W
for me under Linux. It'll have to be tested with other
backends and operating systems though.

Ticket imported from: #655594. Ticket imported from: patches/253.

Attachments (1)

mi-cheat.diff (3.3 KB) - added by eriktorbjorn 17 years ago.
Patch against a December 17 CVS snapshot

Download all attachments as: .zip

Change History (11)

Changed 17 years ago by eriktorbjorn

Attachment: mi-cheat.diff added

Patch against a December 17 CVS snapshot

comment:1 Changed 17 years ago by fingolfin

Hm, I thought the shortcut was Alt-W ? Various game hint
sites seem to agree with me.

comment:2 Changed 17 years ago by fingolfin

I checked this in minus the key detection code in
scummvm.cpp - first we need to resolve if it should be Alt-W
or Ctrl-Alt-W

comment:3 Changed 17 years ago by fingolfin

Owner: set to fingolfin

comment:4 Changed 17 years ago by SF/sir_kill_a_lot

I just tried it again with the original MI2 and it seems I was
wrong, the cheat code for MI2 is ALT-W.

comment:5 Changed 17 years ago by eriktorbjorn

When playing the original with DosBox, both Alt-W and
Alt-Ctrl-W work. But you're probably right that Alt-W is the
correct one. That Alt-Ctrl-W works may just be an accident.

At least under Linux, the SDL backend generates keycode 119
for Alt-W, while ASCII is either 87 or 119 depending on if I
press Shift (or if Caps Lock is active).

comment:6 Changed 17 years ago by SF/andrej4000

Well: it is Alt+W
I checked it with my game and on this site:

comment:7 Changed 17 years ago by eriktorbjorn

Travan has confirmed that SDL generates the same
keycode/ascii for him under Windows as it does for me under
Linux. Something like this would match the original
behaviour pretty closely then:

} else if (event.kbd.flags & OSystem::KBD_ALT) {
// The result must be 273 for Alt-W
// because that's what MI2 looks for in
// its "instant win" cheat.
_keyPressed = event.kbd.keycode + 154;
} else

Of course, we may very well want to check for
event.kbd.flags == OSystem::KBD_ALT and use event.kbd.ascii
instead. I'm a bit fuzzy on the difference between keycode
and ascii...

comment:8 Changed 16 years ago by fingolfin

keycodes correspond to keys. E.g. the "A" key has one particular keycode. When you press "A" or Shift-A or Ctrl-A, you get the same keycode each time. OTOH, the ascii code differs; pressing "A" gives a different ascii code than Shift-A (upper vs. lower case), etc.

comment:9 Changed 16 years ago by fingolfin

Status: newclosed

comment:10 Changed 8 months ago by digitall

Component: Engine: SCUMM
Game: Monkey Island 1
Note: See TracTickets for help on using tickets.