Code: Select all
seg009:99F1 and ax, 7000h
seg009:99F4 cmp ax, 3000h
and later...
seg009:9AEC and ax, 7000h
seg009:9AEF cmp ax, 7000h
Both of these check the bitdepth of the current image, from the ImageMask field. (See the specifications.)
The first comparison matches when the top 4 bits of the ImageMask are x011, that is, when the image is 4 bpp. (16 colors)
The second comparison matches when the top 4 bits are x111. In PoP2 this means that the image is 8 bpp. (256 colors)
(See the additions.)
I didn't know that PoP1 supported 256-color images, so I tested it:
Open title.dat in a hex editor, and change these:
0x2e98: 0xD4 -> 0x94 (checksum)
0x2e9e: 0xB3 -> 0xF3 (upper byte of ImageMask)
Now we changed the main title image from 4bpp to 8bpp.
This is what happens if you start the game: So what happened? The image data is the same, but it is interpreted differently. One byte means one pixel (8bpp) instead of two (4bpp).
So each row is now pressed into a half row, and the image data ends at the half of the screen.
Of course, to use this for modding, certain problems have to be solved, like the palettes, adding PR support, etc.