Building database

Well, I figured if I was going to get every bit of this game working, I’d need to know which part is where, etc. So I’m unpacking everything. That may not sounds very exciting (and it’s not), but I was quite impressed to find that just INTRO.GJD, which starts off at about 30MB decompressed to about 900MB. So the whole game (about 650MB) will probably take up 20GB. And then I just have all the decompression data to put into some sort of usable form…

/me trundles off to investigate MySQL

And I’m spent

I managed it in the end. I figured out not only what the problem was, but why I had a problem with that frame in particular. The frame uses a particular opcode, 0x60, a lot, when others don’t (at all? Not sure). That opcode gives very precise control over the image: where the previous frames have been slightly “rushed” as it were, to save space, this one is done very precisely. If you remember the intro to 7th guest, you’ll know why: all the action for the next few scenes takes place on the pages of that book: it basically doesn’t change for a minute or more.
But that’s not important. The important thing is that it works. Now I’ve just got to try it on all the others and find the ones it doesn’t work on…

Noooooooooooo!

It was all going so well! I’d finally got the palette completely sorted (how could it be so difficult?), the first 30 frames were perfect, then this! Where do I start trying to figure out what’s wrong with this? I just don’t know…

Still bad, but getting better

As you can see, I’m getting there…

My sticking point

In case anyone is trying to do the same (unlikely, I know), the thing that was confusing me was that the 0x61 opcode, which skips to the end of the line, is also required at the end of each line (like a new line character). As such, you don’t need to keep track of the number of tiles in the x direction that have been processed.

Woo hoo!

Though barely recognizable, this is a breakthrough. This is the house, after we’ve pulled out to see it in the book (remember that bit?). It may seem like small comfort, but it pretty much just the palette that’s screwed. Hopefully.

End of night post

This is to aid my memory when I come back to this tomorrow. Too late now.

Program segfaults. This is because it goes beyond the end of the image array. This is because it goes beyond the correct number of blocks in y. I do not know why this is, I must have interpreted the file wrong… right?

Progressing

Next stage. Still not really recognizable (I think it’s just gonna be the mansion again, btw).

Not quite there yet

Was getting bored of writing, so thought I’d post some images. This could be an interesting transformation… I think I’ve screwed up the palette on this image. I’m gonna be putting it together a few pieces at a time, so we’ll see!

Valgrind is teh Magic

It seems that when your code is shonky (and you have an inkling that it might be), valgrind is where to look. It’ll point to things, even when your program appears to be working, and say “err, are you sure that’s right? it looks like you’re being a bit of a muppet there”. And you can ignore it (I did, mostly cos it took me a while to figure out what its error messages meant), but eventually they’ll come up and bite you in the seg fault.

In short, I feel it is going to be invaluable. Even more so than it has been tonight.