Opened 12 years ago

Closed 6 years ago

#6145 closed defect (fixed)

TINSEL: DW1 PSX Assertion on Savegame Load

Reported by: raziel- Owned by: dreammaster
Priority: normal Component: Engine: Tinsel
Version: Keywords:
Cc: Game: Discworld

Description

ScummVM 1.6.0git (Sep 22 2012 10:37:02) Features compiled in: Vorbis FLAC MP3 RGB zLib Theora AAC FreeType2

On loading the attached save i get a black screen and an assertion assertion "g_McurObj" failed: file "engines/tinsel/cursor.cpp", line 225

I got this before when i had more problems with the PS version of this game, but it was fixed in the process. Now this assertion is back again.

Happens everytime i try to load the game. I can go back to an earlier save state but this assertion comes crawling back everytime

Discworld (CD/Sony PlayStation/English)

gcc (GCC) 4.2.4 (adtools build 20090118) AmigaOS4 - PPC - SDL - BE

Ticket imported from: #3570680. Ticket imported from: bugs/6145.

Attachments (1)

dw-cd-psx.005 (2.9 KB ) - added by raziel- 12 years ago.
Assertion on loading

Download all attachments as: .zip

Change History (9)

by raziel-, 12 years ago

Attachment: dw-cd-psx.005 added

Assertion on loading

comment:1 by digitall, 12 years ago

Summary: DW1: PS version gets an assertion on loading a saveTINSEL: DW1 PSX Assertion on Savegame Load

comment:2 by digitall, 12 years ago

Owner: set to dreammaster

comment:3 by digitall, 12 years ago

raziel_: This is due to the non-const global variable usage in the Tinsel Cursor functions. If you use RTL (Return To Launcher) or load via the Launcher Load, it is likely to error. The relevant lines are even marked with " // FIXME: Avoid non-const global vars".

dreammaster: Any ideas on how easy it would be to refactor this part of the Tinsel engine to move these variables to engine member variables?

comment:4 by dreammaster, 12 years ago

Well, on the bright side, the major work of identifying global variables has already be done, so that's a plus. Given the state of the engine, I think we'd need to go with a compromise solution, having a single 'Globals' class and 'g_globals' pointer. The Globals constructor could then do all the initialisation to NULL of all the fields, allowing the engine to be properly re-enterable.

That way, each source file would include a 'globals.h', and we end up with code like 'g_globals->objectList' or 'g_globals->gCurrentCD'.

This refactoring could be done anyone with some time on their hands. If there's no volenteer's, I'll try to tackle it in the near future.

comment:5 by wjp, 11 years ago

Interestingly the function in which this assert is located does not do what its comments claim in the case g_McurObj == 0. It has been like that since the original commit of the Tinsel engine, though.

comment:6 by raziel-, 11 years ago

This can be closed

I can't pinpoint the revision but it definitely does'nt come up anymore.

The attached save file though will still produce the error mentioned, so i'm tempted to say it has erroneous flags set or something like that

At least i played through the whole game without a crash or anything on saving, loading or playing

Thanks for the ongoing great work

comment:7 by raziel-, 11 years ago

Yeah, well, talked too early

The assertion is still there, as tdhs pointed out, when loading from the launcher.

Loading ingame through "F1" strangely works though, so i can at least replay the game without too much hassle

comment:8 by dreammaster, 6 years ago

Resolution: fixed
Status: newclosed

Closing this; it turned out to be a problem only when loading savegames from the launcher that were saved whilst an item was being held. I've fixed the problem when loading savegames in such a case.

Note: See TracTickets for help on using tickets.