Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#2716 closed defect (fixed)

INDY3 (FM-TOWNS): Black screen upon start (Amiga)

Reported by: (none) Owned by: Kirben
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Indiana Jones 3

Description

ScummVM 0.9.0 (Jun 25 2006 22:47:47) Features compiled in: Vorbis MP3 zLib

Already mentioned on the forums(?) and on IRC, also in private mail to some of the devs, reproduceable on AmigaOS4 builds dated back to v0.8.1.

Games is recognized in Launcher, can be added, can be started, but shows a black screen (window) afterwards.

No errors from ScummVM given. Since v9.0 there has little changed in the behaviour after startup, but debug output was added (i think).

Debug.log is attached, it seems there is an ongoing infinite loop which slows down the system and eats up all the memory (maybe) which (again, maybe) could cause the black screen and though the game not to start up properly.

These two lines are performed infinitive... Locking mutex IMuseInternal::on_timer() Unlocking mutex IMuseInternal::on_timer()

English version

AmigaOS4 build gcc version 4.0.2 (AmigaOS build 20051012)

Ticket imported from: #1515345. Ticket imported from: bugs/2716.

Attachments (2)

ScummVM_Indy3_Debug.log (85.0 KB ) - added by SF/*anonymous 18 years ago.
ScummVM_Indy3_Debug.log
indy3towns.diff (1.5 KB ) - added by Kirben 18 years ago.
Patch to fix problem

Download all attachments as: .zip

Change History (10)

by SF/*anonymous, 18 years ago

Attachment: ScummVM_Indy3_Debug.log added

ScummVM_Indy3_Debug.log

comment:1 by fingolfin, 18 years ago

Summary: Black Screen after starting Indy3 (FMTowns)INDY3 (FM-TOWNS): Black screen upon start (Amiga)

comment:2 by Kirben, 18 years ago

Comparing the attached debug log, to my own, it looks like the problem is in void ScummEngine_v4::readIndexFile() of engines/scumm/resource_v4.cpp. Between openRoom(0) (Last debug output in log) and allocateArrays() (Where next debug output would be).

Would be worth adding some debug printfs to that section of ScummVM source code, to narrow down the cause.

comment:3 by (none), 18 years ago

So, here's the new log (shortened, with debug output added: Look further down for altered source...

readIndexFile() openRoom(0) openResourceFile(00.LFL) Opening hashed: Games:ScummVM/Games/IndianaJones3/00.LFL before fileHandle->eof filehandle - itemsize filehandle - blocktype before filehandle->ioFailed before blocktype before filehandle->seek(itemsize) filehandle - itemsize filehandle - blocktype before filehandle->ioFailed before blocktype before filehandle->seek(itemsize) filehandle - itemsize filehandle - blocktype before filehandle->ioFailed before blocktype before filehandle->seek(itemsize) filehandle - itemsize filehandle - blocktype before filehandle->ioFailed

a bunch of

Locking mutex IMuseInternal::on_timer() Unlocking mutex IMuseInternal::on_timer()

then

before blocktype MuseInternal::on_timer() before blocktype

bunch of

Locking mutex IMuseInternal::on_timer() Unlocking mutex IMuseInternal::on_timer()

then

before filehandle->seek(itemsize) mer() ; seems it eats some of the output before filehandle->seek(itemsize)

bunch of

Locking mutex IMuseInternal::on_timer() Unlocking mutex IMuseInternal::on_timer()

then

filehandle - blocktype before filehandle->ioFailed before blocktype before filehandle->seek(itemsize)

bunch of

Locking mutex IMuseInternal::on_timer() Unlocking mutex IMuseInternal::on_timer()

then

filehandle - blocktype rnal::on_timer() filehandle - blocktype

bunch of

Locking mutex IMuseInternal::on_timer() Unlocking mutex IMuseInternal::on_timer()

then

before filehandle->ioFailed :on_timer() before filehandle->ioFailed

bunch of

Locking mutex IMuseInternal::on_timer() Unlocking mutex IMuseInternal::on_timer()

then

before blocktype MuseInternal::on_timer() before blocktype

bunch of

Locking mutex IMuseInternal::on_timer() Unlocking mutex IMuseInternal::on_timer()

then

before filehandle->seek(itemsize) timer() before filehandle->seek(itemsize)

and repeat

I'm doing this the second time in my life, really trying to, so please, don't beat me, if i have done something stupid

following the altered parts of resource_v4.cpp

debug(9, "readIndexFile()");

closeRoom(); openRoom(0);

debug(9, "before fileHandle->eof"); //__amigaos4__ while (!_fileHandle->eof()) { // Figure out the sizes of various resources debug(9, "filehandle - itemsize"); //__amigaos4__ itemsize = _fileHandle->readUint32LE(); debug(9, "filehandle - blocktype"); //__amigaos4__ blocktype = _fileHandle->readUint16LE(); debug(9, "before filehandle->ioFailed"); //__amigaos4__ if (_fileHandle->ioFailed()) break;

debug(9, "before blocktype"); //__amigaos4__ switch (blocktype) { debug(9, "blocktype 0X4E52"); //__amigaos4__ case 0x4E52: // 'NR' _fileHandle->readUint16LE(); break; debug(9, "blocktype 0X5230"); //__amigaos4__ case 0x5230: // 'R0' _numRooms = _fileHandle->readUint16LE(); break; debug(9, "blocktype 0X5330"); //__amigaos4__ case 0x5330: // 'S0' _numScripts = _fileHandle->readUint16LE(); break; debug(9, "blocktype 0X4E30"); //__amigaos4__ case 0x4E30: // 'N0' _numSounds = _fileHandle->readUint16LE(); break; debug(9, "blocktype 0X4330"); //__amigaos4__ case 0x4330: // 'C0' _numCostumes = _fileHandle->readUint16LE(); break; debug(9, "blocktype 0X4F30"); //__amigaos4__ case 0x4F30: // 'O0' _numGlobalObjects = _fileHandle->readUint16LE(); break; } debug(9, "before filehandle->seek(itemsize)"); //__amigaos4__ _fileHandle->seek(itemsize - 8, SEEK_CUR); }

debug(9, "before file handle->clearIOFailed"); //__amigaos4__ _fileHandle->clearIOFailed(); debug(9, "before filehandle->seek(0, SEEK_SET)"); //__amigaos4__ _fileHandle->seek(0, SEEK_SET);

debug(9, "before readMAXS(0)"); //__amigaos4__ readMAXS(0); debug(9, "before allocateArrays"); //__amigaos4__ allocateArrays();

Sorry for the long post, and please don't tell me "This isn't of any use!" or something :-)

by Kirben, 18 years ago

Attachment: indy3towns.diff added

Patch to fix problem

comment:4 by Kirben, 18 years ago

Owner: set to Kirben

comment:5 by Kirben, 18 years ago

The index file (00.LFL) of the FM-TOWNS version of indy3 includes 32 extra bytes at the end of file, which are currently ignored.

There is no item size, for the last 32 bytes of the index file. So this file read loop jumps around the file, until it reachs the end. Which seems to fail on an Amiga systems.

Please try the attached patch, which skips the extra 32 bytes when required.

comment:6 by (none), 18 years ago

Looking for indy3 Trying to start game 'Indiana Jones and the Last Crusade' WARNING: Couldn't open drive: Invalid CD-ROM drive index! File pos 6 ID 0R File pos 509 ID 0S File pos 1512 ID 0N File pos 2515 ID 0C File pos 3518 ID 0O

OMG, you DID it!

:-D

All i can say is: "YES!"...GREAT work, kirben, ever since i bought this FMTowns game i wanted to play it and now it's possible at last on my system :clap :clap

Many, many thanks for fixing, hussah, and back into the game... :-)

btw: Did the error output i sent help something? I really do hope, had many drawbacks lately.

btw2: I read in the sources that those 32bytes are unknown, do you lately found out what they were used for? Initialization of the FMTowns hardware (or sound system), maybe?

Thanks a lot again /me grinning from ear to ear

comment:7 by Kirben, 18 years ago

Yes, the debug output helped, it became clear the last 32 bytes were not been skipped correctly.

No, we still doesn't know what the extra 32 bytes are for.

comment:8 by Kirben, 18 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.