Page 1 of 1

Prince of Persia Retro (iOS) background

Posted: February 18th, 2016, 3:14 pm
by Norbert
For a while (May 2010-Dec 2011), Apple allowed iOS users to use the free "Prince of Persia Retro" (old link, no longer a page there), until it was eventually replaced with the "Prince of Persia Classic" remaster.

This free Retro game featured a hand-drawn title screen background that I'm looking to obtain, just because it's nice to have. Some web pages, such as this one have images of the background, but always with text on it. (On that page, someone else commented "Do you also have a screenshot of the title-screen without the title text?".) Here's the background with the palace fully visible. I've been able to find various images that almost allowed me to assemble the full 1024x768 image without text - but not fully.

Therefore I looked into the actual game itself. The game package (Prince.of.Persia.Retro.1.0.2.ipa) is essentially a ZIP file. It includes Payload/pop1.app/mainMenuBackground_iPad.png, which is an Xcode CgBI file; Apple's proprietary extension to PNG. I've tried to uncrush/defry the PNG file, but so far without success. I found six programs that could potentially make the PNG file readable on non-iOS platforms. I've been able to test 4 out of 6 programs, and could use help with the last two.

[1] Tested
iPhone PNG Image Normalizer, ipin.py
Download: http://www.axelbrz.com.ar/ipin1.0.zip
Mirror: http://www.mexlinux.com/wp-content/uplo ... pin1.0.zip
Result: This program works for most PNG files, but not for the PNG file in question.

[2] Tested
pngdefry
Download: http://www.jongware.com/binaries/pngdefry.zip
Result: It does not work, it says it has seen the file, but not processed it.

[3] Tested
Download: https://web.archive.org/web/20110821204 ... fixpng.tgz
Mirror: http://www.ush.it/team/ascii/iphone-fixpng.tgz
Result: It does something, but the end result only includes the top portion of the image, and the image is bluish.

[4] Tested
Download ("Download ZIP"): https://github.com/hadess/fixpng-thumbnailer
Result: It does something, but the end result only includes the top portion of the image. The colors are correct though. It gives three ZLib errors.

[5] Not Tested Yet
Download ("Download ZIP"): https://github.com/MikeWeller/PNGDecrush
This is a .NET/C# program that I cannot test. The README.markdown says "Existing implementations are broken", so perhaps this is a good candidate to do the job.

[6] Not Tested Yet
It should be possible to run "xcrun -sdk iphoneos pngcrush -revert-iphone-optimizations". This requires XCode from the App Store, and requires the modified pngcruch binary that has been created by Apple and is provided with the iOS SDK.

Could anyone here test options [5] and/or [6]?

Even though the game is abandonware, I don't think I should provide a download link to the IPA file.
The links below are mirrors for just the 'crushed' PNG image.
http://www.filedropper.com/image_26
http://s000.tinyupload.com/index.php?fi ... 2313441746
http://www.speedyshare.com/vpPZQ/image.png

Re: Prince of Persia Retro (iOS) background

Posted: February 18th, 2016, 3:47 pm
by Norbert
By the way, here's a comparison of the DOS and iOS Retro versions of the palace.
Both are cool. :)

Image
(image mirror)

Re: Prince of Persia Retro (iOS) background

Posted: May 16th, 2016, 3:54 am
by lvcabral
Does anybody managed to correct the colors of the png ? I can open it on Paint.Net but it's "blueish

Re: Prince of Persia Retro (iOS) background

Posted: May 16th, 2016, 4:08 am
by lvcabral
I managed to uncrush using this:
[5] Not Tested Yet
Download ("Download ZIP"): https://github.com/MikeWeller/PNGDecrush
This is a .NET/C# program that I cannot test. The README.markdown says "Existing implementations are broken", so perhaps this is a good candidate to do the job
The file is here:

Image

Re: Prince of Persia Retro (iOS) background

Posted: May 16th, 2016, 7:26 pm
by Norbert
Nice.

Re: Prince of Persia Retro (iOS) background

Posted: April 9th, 2017, 5:16 am
by Norbert
The (iOS/Android) Prince of Persia Classic background is also kinda nice.
POP_menu.jpg

Re: Prince of Persia Retro (iOS) background

Posted: January 28th, 2018, 10:37 pm
by salvadorc17
This game on android plays very good. I like the 3d graphics in 2d platformer camera.


Re: Prince of Persia Retro (iOS) background

Posted: January 28th, 2018, 11:40 pm
by Norbert
On a related note...
Norbert wrote: February 18th, 2016, 3:14 pmFor a while (May 2010-Dec 2011), Apple allowed iOS users to use the free "Prince of Persia Retro" (old link, no longer a page there), until it was eventually replaced with the "Prince of Persia Classic" remaster.
And "Prince of Persia Classic" is now also no longer available on Apple's App Store.
Still listed here, but not available for download.
I wonder why not. Maybe it was a 32-bit application, which Apple is dropping.

Re: Prince of Persia Retro (iOS) background

Posted: February 3rd, 2018, 12:41 pm
by David
Norbert wrote: February 18th, 2016, 3:14 pm It includes Payload/pop1.app/mainMenuBackground_iPad.png, which is an Xcode CgBI file; Apple's proprietary extension to PNG. I've tried to uncrush/defry the PNG file, but so far without success.
I'm somewhat late with this, but for example the STB_image library can also load CgBI images.
It's mentioned here: https://github.com/nothings/stb/blob/ma ... age.h#L255

Here is some example C source code for doing the conversion:
Spoiler: show
main.c

Code: Select all

#include <stdio.h>
#include <stdlib.h>

#include "stb_image.h"
#include "stb_image_write.h"

int main(int argc, char *argv[]) {
	if (argc<2) return 1;
	int w, h, comp;
	stbi_convert_iphone_png_to_rgb(1);
	stbi_set_unpremultiply_on_load(1);
	void* data = stbi_load(argv[1], &w, &h, &comp, 0);
	int stride = w * comp;
	stbi_write_png("out.png", w, h, comp, data, stride);
	free(data);

	return 0;
}
stb_image.c

Code: Select all

#define STBI_ONLY_PNG

#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"

#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"

(You can find an example CgBI image here: http://www.jongware.com/pngdefry.html , search for "(b)" )

On another note, it seems that IrfanView can also open CgBI images, although it's not documented in its help, or anywhere.

Re: Prince of Persia Retro (iOS) background

Posted: March 2nd, 2018, 6:30 pm
by YURA
Question? Prompt who has these 2 games ("Prince of Persia Retro","Prince of Persia Classic" ) already ready to use together with the emulator? It is possible them where that to find and to download?