Different Swords For Guards And Prince

Discuss PoP1 for DOS here.
Post Reply
Slasher_101
Scholar Scribe
Scholar Scribe
Posts: 3
Joined: January 25th, 2016, 11:07 pm

Different Swords For Guards And Prince

Post by Slasher_101 »

Hi, Ive been trying to change the colour of the guard's sword with PR but some of the sprites are shared meaning that if I recolour it then the prince's sword will change as well. Does anyone know of a workaround for this? I want the prince to have a different sword to the guard.
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Different Swords For Guards And Prince

Post by David »

(Sorry for the late reply.)

Versions v1.3/v1.4 have something that could be changed.
Namely, the skeleton's sword is drawn all white, but it's hard to notice.
Details: viewtopic.php?p=17708#p17708

A limitation is that the non-default sword can use only a single colour.
(So it won't work well with the PoP2-style sword for example.)

I will try to find a hex-edit for this.
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Different Swords For Guards And Prince

Post by David »

This is what I came up with:

In the disassembly:

Code: Select all

seg000:C2D3                      objid_3_sword:
seg000:C2D3 C7 46 FE 10 00                       mov     [bp+blit], blitters_10h_transp
seg000:C2D8 8B 1E B0 10                          mov     bx, current_level
seg000:C2DC D1 E3                                shl     bx, 1
seg000:C2DE 83 BF 92 03 02                       cmp     tbl_guard_type[bx], 2 ; skeleton
seg000:C2E3 75 15                                jnz     loc_C2FA
seg000:C2E5 A0 A8 4E                             mov     al, obj_direction
seg000:C2E8 38 06 59 45                          cmp     kid.direction, al
seg000:C2EC 74 0C                                jz      loc_C2FA
seg000:C2EE 80 3E 35 31 03                       cmp     graphics_mode, gmEga
seg000:C2F3 74 05                                jz      loc_C2FA
seg000:C2F5 C7 46 FE 4F 00                       mov     [bp+blit], 4Fh
seg000:C2FA                      loc_C2FA:
What to change:

Code: Select all

For v1.3:
Search: C7 46 FE 10 00 8B 1E B0 10 D1 E3 83 BF 92 03 02 75 15 A0 A8 4E 38 06 59 45 74 0C 80 3E 35 31 03 74 05 C7 46 FE 4F 00
Change: -- -- -- PP -- 90 90 90 90 90 90 90 90 90 90 90 90 90 -- -- -- -- -- D9 44 75 -- -- -- -- -- -- -- -- -- -- -- GG --
Where PP/GG = how to draw the sword of the Prince/Guard.
You can use 0x10 for the default palette, or 0x40 + color number to use a single color.

Color numbers:
* 0x00..0x0F are the hard-coded palette, see here: http://www.popot.org/other_useful_tools.php?tool=CusPop
* 0x20..0x2F are the colors from the sword's palette.
Post Reply