Opened 16 years ago

Closed 16 years ago

Last modified 5 years ago

#8782 closed patch

KYRA: HoF startup patch for towns and floppy

Reported by: athrxx Owned by: lordhoto
Priority: normal Component: Engine: Kyra
Version: Keywords:
Cc: Game: Kyrandia 2

Description

This patch fixes startup for the towns and floppy versions. Starting a new game will no longer cause an immediate crash.

Ticket imported from: #1869752. Ticket imported from: patches/887.

Attachments (2)

hofStartupFix.patch (3.9 KB ) - added by athrxx 16 years ago.
hofStartupFix_V2 plus ingame sfx.patch (7.6 KB ) - added by athrxx 16 years ago.

Download all attachments as: .zip

Change History (9)

by athrxx, 16 years ago

Attachment: hofStartupFix.patch added

comment:1 by lordhoto, 16 years ago

This sounds interessting, but I wonder about some things: - _lang is set to 3 for JAP is that what the original did? If not I would love to know what value the original used I suppose 1? Since there's an opcode which returns _lang (at least for the CD version), so it would be good to know the real value if it also exists in the FM-Towns version.

- That check for _flags.useHiResOverlay is unneeded, I fixed checkInput a few seconds ago, after I saw it in your patch.

- That if check in KyraEngine_v2::loadNPCScript looks too complicated I suppose it should check for "if (_flags.platform != Common::kPlatformPC || _flags.isTalkie)"

- showMessageFromCCode doesn't work with Floppy or FM-Towns if I get it right? I saw you were able to put most occurences to talkie specific code, but there's one in items_v2.cpp left, also updateCommandLine is using _cCodeBuffer, so I guess this will still crash for DOS and FM-Towns versions? Don't they have any C_CODE file, or what's the problem with it? I wonder at least how the Towns version is able to support two languages without any translation file, which is what C_CODE seems to be for.

comment:2 by lordhoto, 16 years ago

Owner: set to lordhoto

comment:3 by athrxx, 16 years ago

Now this starts to sound _really_ interesting ;-)

The original towns code has a bool value for language where 0 is English and 1 is Japanese. There are 167 opcode functions which means that we don't have anything like o2_getGameLanguage() here. We _should_ be safe with a _lang value of 3 (if not we will notice soon enough :-) ).

Regarding the cCode stuff: We probably will have to load the _cCodeBuffer for all versions (my patch is wrong here). The original code does this, too. I am starting to believe that showMessageFromCCode() might fail only in this particular case which would make sense (the message is "Reading CD-ROM data..." or something like that). The original code does not call it here either. I will look into this some more and then upload a new patch file.

comment:4 by athrxx, 16 years ago

Now here is a new version of the patch. I also fixed updateCommandLineEx() for Japanese according to the original code and I added support for ingame voc/pcm sound effects (the corresponding patch for the kyradat tool is the next tracker item).

Zanthia still doesn't talk much. The CD-ROM version often makes Zanthia talk via o2_zanthiaChat(). This opcode is beyond the range of the floppy and towns opcode tables (which hopefully will be the same at least). I haven't explored this for now. The last opcode is 167 which is o2_getVocHigh for CD-ROM and a nullsub for Towns and Floppy. File Added: hofStartupFix_V2 plus ingame sfx.patch

comment:5 by lordhoto, 16 years ago

Thanks for the patch, next time I would really like to have the create_kyradat patch in the same tracker item though.

comment:6 by lordhoto, 16 years ago

Status: newclosed

comment:7 by digitall, 5 years ago

Component: Engine: Kyra
Game: Kyrandia 2
Note: See TracTickets for help on using tickets.