Palace wall patterns

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

Moderator: English Moderator Team

Post Reply
jeminacek
Scholar Scribe
Scholar Scribe
Posts: 4
Joined: August 17th, 2013, 5:35 pm

Palace wall patterns

Post by jeminacek » August 11th, 2014, 1:03 am

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: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Palace wall patterns

Post by David » August 11th, 2014, 12:00 pm

palace_wall_marks_color.png
palace_wall_marks_color.png (3.76 KiB) Viewed 575 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 » August 11th, 2014, 5:24 pm

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: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Palace wall patterns

Post by David » August 12th, 2014, 7:08 pm

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: 3165
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: Palace wall patterns

Post by Norbert » September 9th, 2017, 5:58 pm

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