Palace wall patterns

About PR usage and development, and about the POP format.
Post Reply
jeminacek
Scholar Scribe
Scholar Scribe
Posts: 4
Joined: August 17th, 2013, 5:35 pm

Palace wall patterns

Post by jeminacek »

Hello,
I am sorry if this is trivial but I can't seem to figure it out. I have designed a completely new graphics for VPALACE.DAT and everything went fine except for one thing: I can't change the colour of marks on the wall. There are some 1-BPP images (black & white) in the "vpalace\walls\patterns\" folder and that's all there is. Any ideas?
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Palace wall patterns

Post by David »

palace_wall_marks_color.png
palace_wall_marks_color.png (3.76 KiB) Viewed 7618 times
You need to hex-edit prince.exe for this one.

Code: Select all

seg000:0293 B8 06 00                             mov     ax, colors_6_palace_wall
seg000:0296 50                                   push    ax              ; index
seg000:0297 B8 30 00                             mov     ax, 30h ; '0'
seg000:029A 50                                   push    ax              ; red
seg000:029B B8 26 00                             mov     ax, 26h ; '&'
seg000:029E 50                                   push    ax              ; green
seg000:029F B8 14 00                             mov     ax, 14h
seg000:02A2 50                                   push    ax              ; blue
seg000:02A3 2B C0                                sub     ax, ax          ; RGB(30h,26h,14h) = #C09850 = light brown
seg000:02A5 50                                   push    ax              ; vsync
seg000:02A6 9A DF 92 79 0C                       call    set_pal
Search for: B8 06 00 50 B8 30 00 50 B8 26 00 50 B8 14 00 50
Change: 30, 26, 14 to the RGB values of the new color.
Note that most programs display RGB in the range 00h..FFh (0..255), but PoP uses 00h..3Fh (0..63), so you need to divide the values by 4.
jeminacek
Scholar Scribe
Scholar Scribe
Posts: 4
Joined: August 17th, 2013, 5:35 pm

Re: Palace wall patterns

Post by jeminacek »

Thank you!

I have just tried it and it worked!

Maybe another question: How did you know? Is there a documentation I should know about?
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Palace wall patterns

Post by David »

There is a disassembly of PoP1 here: viewtopic.php?f=68&t=3423
It's a bit old, I have a newer version. I will upload that when I can.
The old version does not have the hex codes on the left side that I copied after "search for".

I know enough about the disassembly (*) so I could find the part where this color is stored.
(*) After all, I converted the disassembly to C...
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Palace wall patterns

Post by Norbert »

If we hex edit to change palace wall marks, then what are the res* files in "vpalace/walls"?
[Edit: Never mind, I get it. Obviously, the shapes are in the images, the color in the EXE.]
Post Reply