Question: hex edit to make chomper -1hp instead of kill?
Question: hex edit to make chomper -1hp instead of kill?
Can an easy hex edit of PRINCE.EXE be made to make the chomper remove 1 hit point instead of killing the prince?
Re: Question: hex edit to make chomper -1hp instead of kill?
The relevant part of the disassembly:Norbert wrote: Can an easy hex edit of PRINCE.EXE be made to make the chomper remove 1 hit point instead of killing the prince?
Code: Select all
seg004:0811 B8 64 00 mov ax, 100
seg004:0814 50 push ax ; count
seg004:0815 9A BD 06 CB 06 call take_hp
seg004:081A B8 2E 00 mov ax, sound_46_something_chopped
seg004:081D 50 push ax ; sound_id
seg004:081E 9A C5 12 00 00 call play_sound
seg004:0823 B8 36 00 mov ax, 54 ; chomped
seg004:0826 50 push ax ; seq_index
seg004:0827 9A 0A 00 DE 05 call seqtbl_offset_char
Change:
* 0x64 -> 0x01 (how many HP to take)
* 0x36 -> what do you want instead of being chomped:
0x11 = seq_17_soft_land
0x1A = seq_26_crouch_while_running
0x32 = seq_50_crouch
0x4F = seq_79_crouch_hop
See types.h of SDLPoP for other numbers.
Now, if the prince had only 1 HP then there might be a problem...
You might also want to remove blood:
Code: Select all
seg004:07C0 8A 1E ED 42 mov bl, curr_tile_pos
seg004:07C4 2A FF sub bh, bh
seg004:07C6 8B 36 88 5F mov si, curr_room_modif
seg004:07CA 80 08 80 or byte ptr [bx+si], 80h ; put blood
seg004:07CD 80 3E 22 3D B2 cmp char_frame, 178 ; chopped
What is your goal, by the way?
Maybe you are making some new mod where the chomper (graphics) is replaced with something different?
Re: Question: hex edit to make chomper -1hp instead of kill?
Neat.
To be honest I was merely curious to see the modified chomper in action. I just have and it's quite fun to see the chomper just take one hitpoint. I hope it didn't take too much effort on your part to find the hex modifications necessary for it. I tried to make sure you wouldn't put in a lot of effort finding them - if that would've been necessary - by including "an easy hex edit" in my question, but now that I'm thinking about it, that phrase is multi-interpretable. It could also refer to how easy the edit(s) is (are) to apply after being found.David wrote:What is your goal, by the way?
Yes, it causes a problem, because the game basically hangs. If there was a way to fix this, maybe the modifications could be used for the easiest setting of King of Persia. But it's probably better if you focus your energy on other things.David wrote:Now, if the prince had only 1 HP then there might be a problem...