10 August, 2009

Kyrandia 1 Amiga

This time a really long time passed since the last post. I decided to make a new entry now, since there has been finally some progress on Kyrandia 1 Amiga. Some of you might know that we have an GSoC student working on support for various AMIGA sound formats (to be precise: TFMX for Monkey Island 1 Amiga and MaxTrax for Kyrandia 1 Amiga). You can find his blog over here. He already finished MaxTrax support. This gave me enough motivation to look into Kyrandia 1 Amiga again.

First of all I finally managed to implement a font renderer. That was a major PITA at first, but with help from nolange (the GSoC student) I was able to get a bit into how the library code on Amiga works. This helped to RE the font format, since it used blitting of the "graphics.library". With this information I was able to decode all the important information and write an implementation for rendering the fonts in ScummVM.

Here is some screen of a font use in the intro:


As you can see it works fine, even the colors seem correct. I do not have any Amiga to check that though.

Next I implemented some differences in the Amiga palette code. Kyrandia 1 Amiga uses two 32 color palettes. It splits the screen into two areas: the main game screen and the inventory. The first one uses a palette supplied by the scene files, the latter uses a fixed palette, which also includes all colors used by the items. Now the in-game parts looks nice too.

There was a major other palette difference I implemented too: Since the Amiga has not too many free colors, the game overwrites color index 16 with the correct font color every time a text is displayed. The original used some kind of switch statement to determine from the color index passed from the scripts, which color to set up in the palette. I did implement that too, I chose to cleanup the way it is done though. Here comes a funny side note: the Amiga version still uses the 256 color indexes from the DOS version for text processing. It uses fixed colors for the font: 16 and 19. Color 16 is the font color, while color 19 is the outline color, which is usually black. Now the Amiga text palette color setup code takes the DOS color index compares it to certain values and then sets up color 16 accordingly. The font drawing code on the other hand ignores the passed color indices and just uses the aforementioned colors.

Here are two in-game screens of Kyrandia 1 Amiga:



and here is how it looked before:



As you can see the interface changed the colors back then, since the whole screen used the scene palette.

Of course there is still plenty of work to do. For example the in-game GUI is still horribly broken color wise (and text wise). Just take a look at this screenshot:


I will also try to make some more blog updates now in the future. So long. See you in the next blog entry.

3 comments:

Vicent Marti said...

Wow, it only took you one year to update the blog. Haha.

Nice job, though... That in-game GUI looks like a lot of hassle though. Gl with it.

Fingolfin said...

Excellent work! And nice to hear how hard individual work combined with good teamwork helped in this :).

dakael said...

That is something!