I am currently working on an old classic PC game. The programming face a lot of issues as I go along, mostly because I am not educated as a programmer nor designer. Although my passion for this particular game makes it wort it.
I am currently trying to open the images for the game. The images are made using Paint Deluxe 2. From what I have found out they are all PCX-format when you open them to add changes. Then they are saved into the game in a external achieve beside the executable file as .bmp-files (from what I can understand). The palette used is actually a bit weird with 6-bits channels (not 8-bits as you would expect).
I face a issue with the developers way of doing it. Before adding the images to the file, the header was stripped off, and the palette stored in an external file. As Paint Deluxe 2 save the length of the pixels for a 190x107 to 20544 bytes (189x107-190x107-191x107 and 192x107 are all stored as 20544 bytes of pixels excluding the header and palette). While is should actually be 20330 bytes. This brings some headache for me. As well as it seems like the images used for the game is somehow the other way around. Looks like the images is stored going in the opposite direction somehow.
To clear things up: FILE34 which is 20330 byte is the ORGINAL file loaded by the game onto the screen. FILE34 which is 20544 byte is what I end up with when I stripp the file after changing it back to pcx-format and then to bmp-format. The pcx-file is also included and can be opened with GIMP for example. BIN_PALETTE.PAL is the palette used for the images.
Are anyone familiar with this issue, and can give me some advice? enter link description here
BMP files are usually stored bottom-up (the last scanline is stored first, all the up, until the first scanline). More recent BMP files can also be stored top-down like other formats, but this is less common. If the game's files are stored top-down, they will appear as upside down, compared to a normal BMP file.
Also, the BMP format pads each scanline to a 32 bit (long word) boundary, which is why the file size is the same for widths 189-192 (they all need 192 bytes per scanline). If game's files are stored without this padding, this is the reason for the difference.
For more info, see BMP file format on Wikipedia.
It is quite easy to rewrite your headerless BMPs to the format used in the game (given those are the two only differences). I'll outline the process/use pseudo code, as there's no language tag in your question:
(I can write the above in Java if it helps you).