VOGONS


First post, by chjmartin2

User metadata
Rank Newbie
Rank
Newbie

Hi,

Does anybody know of a tool that would extract CGA/EGA graphics data from Prince of Persia and a way to send them back? For some reason that I am not sure I understand I would like to see how involved it would be to edit the graphics and enabled a Composite CGA mode Prince of Persia. The only tools I can find extract the VGA data and it is very clear that the CGA and EGA versions do not appear to be interpreted from the VGA version, they appear to be completely independent graphics. The other thing to figure out would be how to get colorburst enabled and get it into 640x200 mode although you could just use the 4 color mode we have but that palette isn't as ideal as the 640x200 mode. Any ideas on where to start?

Chris

Reply 1 of 2, by VileR

User metadata
Rank l33t
Rank
l33t

Interesting question... I guess I'd start with Princed Graphics Extractor which includes C sources. Looks like it can extract all the graphical .DATs, CGA/EGA included. I didn't look too closely, but at least the created .raw chunks appear to be correct. The CGA .bmp results have the wrong palette (all black), but that can probably be fixed in the source. More importantly, you get a .txt description of each .DAT you extract - and since you have the decompression code in the source, that could help recreate them with the modified graphics.

FWIW, I think the EGA data won't help you much; it has the wrong bit-depth, and the colors don't map 1:1 to any composite CGA palette anyway.

Changing the CGA mode-setting code (to set up mode 6 and disable the BW bit) is probably easier, but likely requires a few more bytes of code than whatever it currently does. So you'd have to look into the various versions of the .EXE and find somewhere to add it, then patch the original code to call/jump to your new code instead.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 2 of 2, by chjmartin2

User metadata
Rank Newbie
Rank
Newbie
VileR wrote on 2022-12-09, 19:02:

Interesting question... I guess I'd start with Princed Graphics Extractor which includes C sources. Looks like it can extract all the graphical .DATs, CGA/EGA included. I didn't look too closely, but at least the created .raw chunks appear to be correct. The CGA .bmp results have the wrong palette (all black), but that can probably be fixed in the source. More importantly, you get a .txt description of each .DAT you extract - and since you have the decompression code in the source, that could help recreate them with the modified graphics.

FWIW, I think the EGA data won't help you much; it has the wrong bit-depth, and the colors don't map 1:1 to any composite CGA palette anyway.

Changing the CGA mode-setting code (to set up mode 6 and disable the BW bit) is probably easier, but likely requires a few more bytes of code than whatever it currently does. So you'd have to look into the various versions of the .EXE and find somewhere to add it, then patch the original code to call/jump to your new code instead.

Thank you for the tool - it will be useful. I'm not ever sure where to start on the CGA mode-setting - funny that you say it is easier as I think the easiest part would be editing/creating the composite graphics. I searched the PRINCE.EXE that I have and looked for the mode control register (03D8) and found several instances of it, but I have NEVER created a patch, so it is completely new to me for sure. Any insight you could provide on a better hex editor or disassembler that may yield help me along the way?

Lastly and this is for anybody that reads the thread. What would be the best version to patch for CGA? Would it be the 1.4 version or a much older one?