Opened 20 years ago

Closed 20 years ago

Last modified 6 years ago

#8359 closed patch

Some basics for the Kyra Engine

Reported by: lordhoto Owned by: SF/ender
Priority: normal Component: Engine: Kyra
Version: Keywords:
Cc: Game:

Description

Currently I reimplementated form the FreeKyra code. I did some improvments to the fontloader/-renderer and to the CPS loader. The WSA Loader is still buggy, but the WSA renderer works a bit better than in FreeKyra.

At next i'm looking at the Scriptfiles (.EMC).

Currently i know of these fileformats: .CPS - Image files (only supported without own palettes) .WSA - Movies (only version 1 is supported) .COL - Palette files (uncompressed an compressed are supported) .FNT - Font files (all versions should be supported) .PAK - Package files (I know only of uncompressed) .MSC - Room Mask Files (same format as .CPS)

now not supported files: .EMC - Script files .SND - Some kind of Soundformat .XMI - Should be a format from Miles .ADL - Should be a format for AdLib .DAT - don't know for what this files are used. They should have always a string for a room mask file but don't know of the rest.

.VRM - used by Kyrandia 1 CD version should be a package file format ( maybe the same as .PAK? )

CREDITS.TXT - should have some extra information about text color

currently the 'engine' will only show the ITEMS.CPS and draws a text string with 8FAT.FNT.

Supported games: Legend of Kyrandia - floopy disk version

Not supported: Legend of Kyrandia - CD version Legend of Kyrandia 2 and newer

TODO: - improve game detection - fix bugs with WSA movies - maybe some code cleanups - better documentation of the code - and add many other things

BUGS: - WSA loader doesn't work well

I hope you can understand my english =)

Ticket imported from: #1046538. Ticket imported from: patches/464.

Attachments (4)

kyra.tar.gz (17.9 KB ) - added by lordhoto 20 years ago.
newest code
kyra.cpp (5.7 KB ) - added by lordhoto 20 years ago.
new file patched some 'bugs'
kyra_cpp.tar (10.0 KB ) - added by lordhoto 20 years ago.
real working files, some error on unix systems have been corrected
kyra_16102004.tar.gz (8.0 KB ) - added by lordhoto 20 years ago.
Lastest bugfixes from 16.10.2004

Download all attachments as: .zip

Change History (20)

comment:1 by lordhoto, 20 years ago

You have to add --enable-kyra to ./configure and then it will work.

comment:2 by sev-, 20 years ago

Couple notes.

o strcmpi -> scumm_stricmp. First is not portable o max() -> MAX(). Same thing

Preferably use Unix line endings for you files if you can.

Also some fonts use FontHeader_Magic4 = 0x1010. particularly my localized version. When I change it, font shows up correctly.

Another thing is to modify your loop as following:

while(true) { OSystem::Event event;

updateScreen(); while (g_system->pollEvent(event)) { switch (event.event_code) { case OSystem::EVENT_QUIT: g_system->quit(); break; } } _system->delayMillis(10); }

So it will not be a CPU hog and quitting will be possible.

comment:3 by eriktorbjorn, 20 years ago

Owner: set to SF/ender

comment:4 by lordhoto, 20 years ago

what version have you got? I have a german version and in it it's 0x0x1011.

comment:5 by sev-, 20 years ago

Russian, both Floppy and CD versions which obviously are dervied from English.

comment:6 by SF/ender, 20 years ago

The VRM files only contain .VOC voices and as such are not yet important. If you just patch in the right resource names for the Cd version (intro1.pak and startup.pak I believe) then your test code runs fine.

I'm replacing some of the code in my current tree with some of this, and it'll be in my next commit. Great work. Sorry, it's 2:30am and I'm tired so I'm being a bit abrupt :)

comment:7 by lordhoto, 20 years ago

i don't know if you know it but the decode40 function is buggy. and now i got out that XMI files are XMIDI files but we won't work with the XMIDI parser from scummvm so well. (i got this warning: "Can only handle 32 tracks but was handed 40"). And i implemented a script interpreter for the EMC files. It loades all files but when the command is 14 (execute) in _STARTUP.EMC the argument is 0x69 and in FreeKyra this 'opcode' isn't implemented so it will shutdown :)

by lordhoto, 20 years ago

Attachment: kyra.tar.gz added

newest code

comment:8 by lordhoto, 20 years ago

ups in the newest code i forgot to comment delete movie; in file kyra/kyra.cpp line: 180

by lordhoto, 20 years ago

Attachment: kyra.cpp added

new file patched some 'bugs'

by lordhoto, 20 years ago

Attachment: kyra_cpp.tar added

real working files, some error on unix systems have been corrected

comment:9 by sev-, 20 years ago

_error is unitialized in VMContext class, which prevents any scripts from running.

comment:10 by SF/ender, 20 years ago

I've just committed some of this code to CVS, with a splattering of changes.

I have various other work of my own that I still need to merge in and commit (I've just decided to use your base classes as the framework, since mine are messier atm :)

As far as the language flag goes, I'm calling it version at the moment since it seems to be related to the engine version more than the language.

Right now I'm trying to work out why loadScript segfaults kyracd loading the _NPC script from startup.pak.. Once I get that fixed, I'll poke around the opcodes.

Hopefully we'll meet up on IRC sometime this weekend and be able to discuss this more.

comment:11 by lordhoto, 20 years ago

I did some bugfixes in the cps blitter and in the decompression. Here is my newest code.

by lordhoto, 20 years ago

Attachment: kyra_16102004.tar.gz added

Lastest bugfixes from 16.10.2004

comment:12 by fingolfin, 20 years ago

I think it's usually better to open a new tracker item for a new patch, lordhoto.

comment:13 by fingolfin, 20 years ago

Furthermore, this isn't a proper patch (generated via "cvs diff -u"), rather it's a set of "modified" files. That makes reviewing the patches somewhat more difficult, so please submit patches as patches from now on, thanks :-)

comment:14 by fingolfin, 20 years ago

The patch has some obvious mistakes in it (easily revealed by turning on more compiler warnings), like mixing up "=" and "==" in at least two places. And since I recently changed code formatting in the kyra/ dir, this set of changed files isn't any longer acceptable either (another reason why real patches are to be prefered -- they don't decay as quickly).

So, please submit a new tracker item. Thanks!

comment:15 by fingolfin, 20 years ago

Status: newclosed

comment:16 by digitall, 6 years ago

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