Opened 18 years ago

Closed 18 years ago

Last modified 20 months ago

#8001 closed patch (outdated)

SIMON2: Lockup workaround

Reported by: eriktorbjorn Owned by: SF/ender
Priority: normal Component: Engine: AGOS
Keywords: Cc:
Game: Simon the Sorcerer 2

Description

I've been trying to play simon2win, but it would always lock up on the city overhead view.I think I've found a workaround for that now.

First, here's how to trigger the lockup:

Go to the city overhead view. (Since this can be reached from the very beginning of the game I'm not including a saved game.) Move the mouse cursor over a recognized building, e.g. the Town Square. The name of the building will be displayed. Before this text is removed, move the mouse cursor to over another recognized building.

The game no longer responds to any mouse events. In effect, it has locked up.

The problem appears to be that although timer_proc1() is getting called (i.e. ScummVM itself has not hung), _lock_word is 0x0040 so it never gets past the first lock test which means, among other things, that handle_mouse_moved() is never called.

As far as I can see, there's only one place where this can happen, and that is in start_vga_code(). However, if has_vga_struct_with_id() returns true, the function will return without clearing the lock.

The patch switches places between setting the lock and calling has_vga_struct_with_id(). I can't promise this won't break anything else, but it looks promising to me. (Anyway it's much easier to test for bugs if the game is playable in the first place. :-)

Ticket imported from: #591172. Ticket imported from: patches/106.

Attachments (1)

simon2.diff (502 bytes ) - added by eriktorbjorn 18 years ago.
experimental patch

Download all attachments as: .zip

Change History (9)

by eriktorbjorn, 18 years ago

Attachment: simon2.diff added

experimental patch

comment:1 by wjp, 18 years ago

The current start_vga_code does look like it has a problem, since it is the only place where this lock is cleared.

The remaining question is whether the lock should be set when calling has_vgastruct_with_id(). has_vgastruct_with_id() is also called from vga opcode 3, and the lock isn't set there, which would indicate it can be called without a lock.

However, timer_proc1, which checks this lock, does quite a lot with the _vga_sprites list, which would indicate it might need the lock after all.

I would probably stay on the safe side and obtain the lock before calling has_vgastruct_with_id(), and clearing it again before returning.

comment:2 by eriktorbjorn, 18 years ago

Sounds good to me. If I understand you right, that's how I first did it. Then I tried to be clever. :-)

(I don't have to upload a new patch, do I?)

comment:3 by SF/ender, 18 years ago

So is this patch sutible to apply, or will you upload a new one with wjp's comments taken into account?

comment:4 by SF/ender, 18 years ago

Owner: set to SF/ender

comment:5 by eriktorbjorn, 18 years ago

Sorry for the delay. I was away, visiting a few friends. (And, of course, Introducing them to the wonders of ScummVM in the process. ;-)

Since wjpalenstijn has uploaded a new patch (#593444) in my absence, could you please use that one instead?

comment:6 by SF/ender, 18 years ago

Resolution: outdated
Status: newclosed

comment:7 by SF/ender, 18 years ago

Replaced by 593444 :)

comment:8 by digitall, 20 months ago

Component: Engine: AGOS
Game: Simon the Sorcerer 2
Note: See TracTickets for help on using tickets.