Page 1 of 1

Palace wall patterns

Posted: August 11th, 2014, 1:03 am
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?

Re: Palace wall patterns

Posted: August 11th, 2014, 12:00 pm
by David
palace_wall_marks_color.png
palace_wall_marks_color.png (3.76 KiB) Viewed 8747 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.

Re: Palace wall patterns

Posted: August 11th, 2014, 5:24 pm
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?

Re: Palace wall patterns

Posted: August 12th, 2014, 7:08 pm
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...

Re: Palace wall patterns

Posted: September 9th, 2017, 5:58 pm
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.]