there is a way to extract pop2 resource??

About PR usage and development, and about the POP format.

Moderator: English Moderator Team

Post Reply
Kumatetsu
Scholar Scribe
Scholar Scribe
Posts: 1
Joined: July 6th, 2017, 5:54 am

there is a way to extract pop2 resource??

Post by Kumatetsu » July 6th, 2017, 6:08 am

hi
i tried to extract resource from pop2
but image is not good
Image
Image

i used pr 1.3 version
and comand line
pr --resource=pop2.xml --export=resources *.dat

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3168
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: there is a way to extract pop2 resource??

Post by Norbert » July 6th, 2017, 7:23 pm

Kumatetsu wrote:i used pr 1.3 version
Latest version is 1.3.1 pre-release 2, but it also has the problem.
These files, ROOFTOPS/shap04171.bmp and ROOFTOPS/shap04350.bmp (in fact, all from shap04150.bmp - shap04352.bmp) seem to use an incorrect palette.
I don't know if this bug is easy to fix.
David may know more.

David
The Prince of Persia
The Prince of Persia
Posts: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: there is a way to extract pop2 resource??

Post by David » July 8th, 2017, 8:41 am

Norbert wrote: These files, ROOFTOPS/shap04171.bmp and ROOFTOPS/shap04350.bmp (in fact, all from shap04150.bmp - shap04352.bmp) seem to use an incorrect palette.
I don't know if this bug is easy to fix.
David may know more.
The problem is that the palette resources for these images contain multiple concatenated palettes, and the bugged images would use the second or third palette.
But there is currently no way to tell PR that it should use a later part of the palette, so it uses the first.
To solve this, I should add a new attribute to the resources.xml parser. Maybe "paletteoffset".

Also, I guess it would be a good idea to upload the PR source to GitHub...

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3168
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: there is a way to extract pop2 resource??

Post by Norbert » July 8th, 2017, 12:19 pm

David wrote:Also, I guess it would be a good idea to upload the PR source to GitHub...
An ancient version already is. ;)
Better somewhere else though, since that one is part of the whole (outdated) Princed branch.

David
The Prince of Persia
The Prince of Persia
Posts: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: there is a way to extract pop2 resource??

Post by David » July 9th, 2017, 1:26 pm

Here is today's fixed version.

I fixed multiple palette-related problems:
1. The palettes that need offsets. This is what Kumatetsu reported and I elaborated.
2. PR can now use SHPL palettes. Needed for the regular guards (GUARD.DAT) and the copy protection symbols in PRINCE.DAT.
3. The default palettes for 8-bit images are now greyscale instead of all-black. PR uses these when I couldn't find any usable palette. (end sequence in TRANS.DAT, horses in PRINCE.DAT)

Some palettes are *still* wrong, namely the flame behind the prince, the thrown flame and the aforementioned images in point 3.
These images would use palettes from a DAT file different from where the image is.
Attachments
PR_2017-07-09.ZIP
Princed Resources, 2017 July 09, binary+source
(385.79 KiB) Downloaded 3 times

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3168
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: there is a way to extract pop2 resource??

Post by Norbert » July 9th, 2017, 5:08 pm

Thanks for improving this.
In the Makefile, Linux requires some \ to be /, namely for .bitfield.o 5x and for .text.o 6x.
After that I get an "XML parsing error (-14)", but maybe this is also related to paths (didn't look into it yet)?

David
The Prince of Persia
The Prince of Persia
Posts: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: there is a way to extract pop2 resource??

Post by David » July 16th, 2017, 9:36 am

Norbert wrote:In the Makefile, Linux requires some \ to be /, namely for .bitfield.o 5x and for .text.o 6x.
Thanks, I fixed it now (in my copy).
Norbert wrote:After that I get an "XML parsing error (-14)", but maybe this is also related to paths (didn't look into it yet)?
I'll look into that.

About uploading to GitHub:
Norbert wrote: An ancient version already is. ;)
Better somewhere else though, since that one is part of the whole (outdated) Princed branch.
Should I just upload the latest source as first commit, into a new repo in my account?

David
The Prince of Persia
The Prince of Persia
Posts: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: there is a way to extract pop2 resource??

Post by David » July 16th, 2017, 10:36 am

Moved topic to PR forum.
Norbert wrote:After that I get an "XML parsing error (-14)", but maybe this is also related to paths (didn't look into it yet)?
That's because the XML parser of PR can't parse opening tags without attributes.
In pop2.xml there is a <folder> tag. If I put a space before the ">" then it works.
Another thing to fix...

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3168
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: there is a way to extract pop2 resource??

Post by Norbert » July 16th, 2017, 10:42 am

David wrote:Should I just upload the latest source as first commit, into a new repo in my account?
Makes sense, yes.

Post Reply