Giter Site home page Giter Site logo

nagyd / pr Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 4.0 254 KB

Princed Resources is a tool to export and import graphics and other data from and to DAT files of Prince of Persia 1 and 2.

License: GNU General Public License v2.0

Makefile 2.40% C++ 3.39% C 91.85% FreeBasic 1.74% Visual Basic 6.0 0.62%
prince-of-persia

pr's People

Contributors

berikv avatar nagyd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pr's Issues

PoP2: incorrect palette handling

This is a known issue. The details are here: http://forum.princed.org/viewtopic.php?f=70&t=4062

I wanted to export backgrounds from caverns and final, and the images came with garbled palette. I managed to fix this manually, so now I'm sharing my findings.
(I used PR-1.3.1-prerelease2)

My MO was as follows:

  1. find a palette file responsible for garbling (I think you just have to look for files which are too large compared to the average, or maybe this is always pals03500.pal file)
  2. Split this file into several smaller files, according to my best judgement. The files contain smaller set of colors.
  3. Reload the incorrect pictures, trying different palette files until the colors are correct. (I used GIMP for this: import new palette, then set colormap).

Information about palette files:

CAVERNS/pals03500.pal
Consists of 320 colors (larger than 256)
The first 160 colors are related to the shap03501-shap04059 (they export correctly).
The last 160 colors are about the bridge scenery: shap04225 - shap04235.

FINAL/pals03500.pal
Consists of 576 colors (larger than 256)
First 192 colors = shap03501-shap04027 (tower)
Next 96 = shap04050-shap04105 (chessboard and spider)
Next 96 - unused (and empty)
Next 192 - shap04125-shap04189 (crystal room and Escher rooms)

Observations:

  • Palette resources for these images contain multiple concatenated palettes. The end of palette is padded with "124 124 124" (the gray #7c7c7c), sometimes the palettes begin or end with "0 0 0" (not always; but two "0 0 0" lines in a row seem to be a strong indicator of a concatenation point).
  • How to find out which images are related to this palette part? Look for gaps in numeration and transitions between screens. The relative order is preserved: if shap04059 comes before shap04225, then the palette for shap04059 will come before shap04225 in the palette file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.