Old DOS / Amiga CD32 image formats
Posted: Sat Feb 02, 2013 3:02 pm
Hey
Purely for educational purposes, I'm studying the images of an older DOS-game (which originated from the Amiga CD32) and am trying to display the images in an OpenGL-based application. The image I'm trying to load is 64768 bytes long and I'm fairly sure it's a 320x200 image. After examining the file with a hex editor, I found out that the first 768 bytes define the palette of the images (256 times 3 bytes for RGB colors, making a 24-bit color per index) and the remaining bytes are the image data (320 * 200 = 64000 with each byte being an index into the palette, there is no header). It took me a couple of days to figure most of this out but when I finally got the image on-screen, I noticed it was duplicated several times as smaller versions (i.e. I got the same image 4 times vertically as 320x50 images instead of one large 320x200 image). I did some research and found out that some older image formats use things like striping, tiling as well as bit planes. I wanted if someone is familiar with this kind of format and could tell me how one goes about combining these images into one larger image? I have the final 320x200 image as reference and have tried several ways of merging the smaller versions together (using specific bits of each part, linearly adding them together, etc.), but it seems I'm shooting in the dark and just not finding the right combination.
PS: A "strange" observation I've made is that if I just display the palette colors as indicated in the file, each of the four replica's is too dark. But if I add these four colors together, the brightness is correct, but the positions of the pixels never are and this only gives me 1 pixel rather than 4 of course.
Anything you guys might know about these kind of image formats may be helpful, as I said I'm not very familiar with older consoles and their programming practises.
Thanks in advance,
Creature
Purely for educational purposes, I'm studying the images of an older DOS-game (which originated from the Amiga CD32) and am trying to display the images in an OpenGL-based application. The image I'm trying to load is 64768 bytes long and I'm fairly sure it's a 320x200 image. After examining the file with a hex editor, I found out that the first 768 bytes define the palette of the images (256 times 3 bytes for RGB colors, making a 24-bit color per index) and the remaining bytes are the image data (320 * 200 = 64000 with each byte being an index into the palette, there is no header). It took me a couple of days to figure most of this out but when I finally got the image on-screen, I noticed it was duplicated several times as smaller versions (i.e. I got the same image 4 times vertically as 320x50 images instead of one large 320x200 image). I did some research and found out that some older image formats use things like striping, tiling as well as bit planes. I wanted if someone is familiar with this kind of format and could tell me how one goes about combining these images into one larger image? I have the final 320x200 image as reference and have tried several ways of merging the smaller versions together (using specific bits of each part, linearly adding them together, etc.), but it seems I'm shooting in the dark and just not finding the right combination.
PS: A "strange" observation I've made is that if I just display the palette colors as indicated in the file, each of the four replica's is too dark. But if I add these four colors together, the brightness is correct, but the positions of the pixels never are and this only gives me 1 pixel rather than 4 of course.
Anything you guys might know about these kind of image formats may be helpful, as I said I'm not very familiar with older consoles and their programming practises.
Thanks in advance,
Creature