PR 1.3.1 pre-release 2

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

Moderator: English Moderator Team

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

PR 1.3.1 pre-release 2

Post by David » December 7th, 2014, 8:12 pm

Here is the new version.
The changes are:

Code: Select all

-------------------------------------------------
PR v1.3.1 pre-release 2 (released 2014-12-07)
-------------------------------------------------
- PR now won't round up palette colors from 254 and 255 to 256.
+ Added support for PoP2 waves.
- In a partial import, no conversion was done.
- In a partial import, no checksum bytes were written.
- PR now won't crash if I give a directory name without a trailing backslash.
- PR will remove a trailing backslash from the DAT path.
+ Added TXT4 decoding/encoding.
Attachments
PR-1.3.1-prerelease2.ZIP
(359.21 KiB) Downloaded 139 times

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

Re: PR 1.3.1 pre-release 2

Post by Norbert » December 7th, 2014, 10:03 pm

Thanks David.
You've put a lot of hours into creating and improving PoP related software. :)

I've moved your post into a new thread, its own thread about pre-release 2.

In August 2013, after you published pre-release 1, I wrote: "[...] and will wait with 'announcing it' (Facebook/Twitter/front pages) until it's no longer pre-release." I think maybe I should ignore that it's called a pre-release and just announce pre-release 2, because a lot has changed since 1.3. ;) Agreed?

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

Re: PR 1.3.1 pre-release 2

Post by David » December 8th, 2014, 4:43 pm

Norbert wrote:I think maybe I should ignore that it's called a pre-release and just announce pre-release 2, because a lot has changed since 1.3. ;) Agreed?
Agreed! :)

lvcabral
Vizier
Vizier
Posts: 89
Joined: March 11th, 2016, 10:34 pm

Re: PR 1.3.1 pre-release 2

Post by lvcabral » August 12th, 2016, 8:40 am

When extracting the graphics from SNES VPALACE.DAT (that uses WDA) I always get only the first 5 resources in color, the rest are converted as B&W and with the patterns scrambled (see image). Any clue about this issue?

EDIT: Just noticed that the VPALACE from mod 47 (Pirates of Persia) also has the same issue.

Image

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

Re: PR 1.3.1 pre-release 2

Post by David » August 13th, 2016, 10:07 am

lvcabral wrote:When extracting the graphics from SNES VPALACE.DAT (that uses WDA)
For such VPALACE.DAT files, you need to make a new resources.xml this way:
* Make a copy of the original resources.xml with a different name.
* In that, copy the "walls" section from "vdungeon" to "vpalace", overwriting the original.

Also, PR has a command-line option to use this custom xml instead of "resources.xml".

lvcabral
Vizier
Vizier
Posts: 89
Joined: March 11th, 2016, 10:34 pm

Re: PR 1.3.1 pre-release 2

Post by lvcabral » August 14th, 2016, 5:14 am

David wrote:
lvcabral wrote:When extracting the graphics from SNES VPALACE.DAT (that uses WDA)
For such VPALACE.DAT files, you need to make a new resources.xml this way:
* Make a copy of the original resources.xml with a different name.
* In that, copy the "walls" section from "vdungeon" to "vpalace", overwriting the original.

Also, PR has a command-line option to use this custom xml instead of "resources.xml".
Thanks David,

It worked perfectly, I already updated my conversion tools to support wda mode for palace.
https://github.com/lvcabral/PoPSpritesConverter

Image

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

Re: PR 1.3.1 pre-release 2

Post by Norbert » September 10th, 2017, 11:56 am

I ran into an issue when exporting PoP2.

For 'debugging' purposes I added this to the start of pop2decompress():

Code: Select all

printf ("pop2decompress: %i, %i\n", inputSize, verify);
./pr -f --resource=pop2.xml --export=/home/norbert/test/resources PoP2/ROOFTOPS.DAT
Running this gets stuck:
Spoiler: show
[...]
pop2decompress: 679, 22
pop2decompress: 580, 21
pop2decompress: 674, 22
pop2decompress: 655, 21
pop2decompress: 4016, 232
pop2decompress: 1786, 45
pop2decompress: 688, 26
pop2decompress: -4, 30007
[It now hangs here and does not continue.]
Running this finishes successfully:
./pr -f --resource=pop2.xml --export=resources PoP2/ROOFTOPS.DAT
Spoiler: show
[...]
pop2decompress: 679, 22
pop2decompress: 580, 21
pop2decompress: 674, 22
pop2decompress: 655, 21
pop2decompress: 4016, 232
pop2decompress: 1786, 45
pop2decompress: 688, 26
pop2decompress: -4, 0
pop2decompress: 9037, 122
pop2decompress: 2557, 32
pop2decompress: 1003, 34
pop2decompress: 325, 54
pop2decompress: 366, 54
pop2decompress: 364, 54
pop2decompress: 355, 54
pop2decompress: 11767, 320
pop2decompress: 13667, 320
pop2decompress: 16957, 298
Result: 131 files successfully exported (131)
The former appears to get stuck at either shap04167.bmp or shap04168.bin.
The -4 value looks suspicious.
(All of this might be related to this?)

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

Re: PR 1.3.1 pre-release 2

Post by David » September 17th, 2017, 11:01 am

Norbert wrote: ./pr -f --resource=pop2.xml --export=/home/norbert/test/resources PoP2/ROOFTOPS.DAT
Running this gets stuck:
[...]
Running this finishes successfully:
./pr -f --resource=pop2.xml --export=resources PoP2/ROOFTOPS.DAT
So, the only difference is the export path?
That's odd.

This is what PR does for me on Windows: (with the --verbose option)
Spoiler: show
[...]
pop2decompress: 679, 22
pop2decompress: 580, 21
pop2decompress: 674, 22
pop2decompress: 655, 21
pop2decompress: 4016, 232
pop2decompress: 1786, 45
pop2decompress: 688, 26
Error in file shap04166.bmp (code -26)
Error in file shap04167.bmp (code -26)
pop2decompress: 9037, 122
pop2decompress: 2557, 32
pop2decompress: 1003, 34
pop2decompress: 325, 54
pop2decompress: 366, 54
pop2decompress: 364, 54
pop2decompress: 355, 54
pop2decompress: 11767, 320
pop2decompress: 13667, 320
pop2decompress: 16957, 298
Result: 131 files successfully exported (131)
The problem is that those two resources are almost empty in PoP2 v1.0, they contain only two bytes: 00 00.
The game interprets this as a zero-height image (the first two bytes store the height), and does not try to process it further.
PR, however, does not skip these.

I added them as bitmaps to pop2.xml because PoP2 IR *does* have actual images with these resource IDs.

What should PR do when it finds a zero-height bitmap?
Should it export them as a 0×0 BMP? (Is that even valid?)
Or just don't export them at all?

Either way, most PoP2 (and PoP1) DAT files have plenty of such resources.
Would it be a good idea to mark them as bitmaps instead of binary in the XMLs?
Norbert wrote:The -4 value looks suspicious.
That is the "remaining" size of the 2-byte resource after subtracting the 6 bytes of the header.
Norbert wrote:(All of this might be related to this?)
The palettes? I don't think so.

EDIT: For now, I chose not to export them at all:
https://github.com/NagyD/PR/commit/010c ... 25b8f582ed
Please try if it works for you.

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

Re: PR 1.3.1 pre-release 2

Post by Norbert » September 17th, 2017, 7:22 pm

David wrote:EDIT: For now, I chose not to export them at all:
https://github.com/NagyD/PR/commit/010c ... 25b8f582ed
Please try if it works for you.
The Makefile appears to only copy resources.xml to bin/.
If I knew how to fix this, I'd say how, but I've tried fixing this and didn't succeed.

Anyway, yeah, both commands now work. Neither hangs the program.
The program reports 131 exported files.
I count 130 files (26 .bin, 101 .bmp, 2 .pal, 1 .pal.more).

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

Re: PR 1.3.1 pre-release 2

Post by David » September 23rd, 2017, 12:25 pm

Norbert wrote:
September 17th, 2017, 7:22 pm
The program reports 131 exported files.
I count 130 files (26 .bin, 101 .bmp, 2 .pal, 1 .pal.more).
It seems that the empty images are also counted, even though no files are exported for them.
And actually, *resources* are counted, to the .pal.more and its related .pal is counted as one.

So, of the 131 resources, only 129 are exported into 130 files.

How important is to fix this?
I have a fix that counts successfully exported *resources* (not files), and it says 129 at the end.

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

Re: PR 1.3.1 pre-release 2

Post by Norbert » September 23rd, 2017, 4:13 pm

David wrote:
September 23rd, 2017, 12:25 pm
How important is to fix this?
Not important.
The Makefile probably is though.

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

Re: PR 1.3.1 pre-release 2

Post by David » September 24th, 2017, 1:28 pm

Norbert wrote:
September 17th, 2017, 7:22 pm
The Makefile appears to only copy resources.xml to bin/.
If I knew how to fix this, I'd say how, but I've tried fixing this and didn't succeed.
Done: https://github.com/NagyD/PR/commit/e90b ... 2dc5ce2d9a
This works for me under Linux.

(I wonder what you were doing wrong.)

Post Reply