Sunday, January 5, 2014

FMod - Denounment

Even though I didn't write very much new code at all today, I did make a lot of progress on FMod! First, I adjusted my bit twiddling in the EGAHEAD writer, repairing the overflow issue and allowing Keen to read my graphics. When I did run Keen with those graphics, I found that everything was blue; only the third and fourth planes had been used.

It took quite a while of scratching my head, stepping through the code, and running tests to determine that I was running a for loop backwards. I was using my "check if value minus two to the n is not less than zero" trick to split the bits, but I was running it with n starting at zero and getting bigger, which would obviously put the bit in the wrong plane. Making it a "step -1" fixed it, and it only took me a little while to find the places where I forgot to reverse the loop bound constants, which resulted in all-black tiles.

Then, I checked the ModdingWiki and found that my question about Huffman tree reading had been answered. Keen apparently likes to reverse the bit order of the character data in the EGADICT, which was the cause of the problem. I will be able to fully reintegrate Huffman compression tomorrow.

The last little issue I had was with the large scrolling texts at Keen startup. In my reader, I had used the wrong variable inside a loop, causing the loop to have no effect. With that corrected, all that remains is to stop Keen from wigging out at the edge of those texts.

No comments:

Post a Comment