PoP1 for DOS Chomper Delay

Discussions about all other tools (CusPop, SAV/HOF editors) and hex editing.
Post Reply
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

PoP1 for DOS Chomper Delay

Post by Norbert »

My leapop editor of PoP1 for Apple II can change the chomper delay (via F2).
I decided to figure out how to change the PoP1 for DOS chomper delay.
I used SDLPoP, David's disassembly and an x86 opcode and instruction reference.

Here's how to change the chomper delay in PoP1 1.0:
At offset 0xA26D, change 0x0F.
For example to 0x06, to make the chompers faster.
(You can also use the next 0x00 byte, to make chompers slower.)

Here's roughly how I know.

I started with SDLPoP's:

Code: Select all

[...]
frame = (curr_modifier & 0x7F) + 1;
if (frame > 15) {
	frame = 1;
}
[...]
Then I found in the disassembly:

Code: Select all

[...]
and ax, 7Fh
inc ax
mov [bp+frame], ax
cmp ax, 15
jle loc_89C6
mov [bp+frame], 1
[...]
I more or less recognized this in the hex editor:

Code: Select all

[...]
[25] AND (logical AND)
[7F 00] 7Fh
[40] INC (increment by one)
[89] MOV
[46 FC] bp+frame
[3D] CMP
[0F 00] 15
[7E] JLE (jump if less or equal, not greater)
[05] to (*)
[C7] MOV
[46 FC] bp+frame
[01 00] 01
(*)
[...]
Which means I could then modify:
25 80 00 89 46 FE 8B C6 25 7F 00 40 89 46 FC 3D [0F 00] 7E 05 C7 46 FC 01 00 8A 46 FE 0A
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: PoP1 for DOS Chomper Delay

Post by Falcury »

Nice find! Quite terrifying actually. You could make some ludicrously hard mods with this.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PoP1 for DOS Chomper Delay

Post by David »

Falcury wrote: February 28th, 2018, 2:54 pm Nice find! Quite terrifying actually. You could make some ludicrously hard mods with this.
I'm wondering if slow chompers might also make the game harder.
You know, because the player doesn't know when they will finally chomp.


Here are some interesting effects:

10 (0x0A) or less: Pause + step won't work. Pause + (standing) jump won't work either.
8 or less: Pause + run won't work.
5 or less: The chomper won't stop even if you leave the room! (The resulting sound might drive some players mad...)
3 or less: Impossible to pass, even with a running jump. (Well, at least I couldn't.)
1 or less: The chomper won't even move, you can safely pass it.

128 (0x80) or more: The chomper will become bloody by itself when it finally chomps.

An explanation for the "pause+step" above:
A foolproof way to pass chompers in the original game is to pause the game and single step until the chomper is fully closed.
Then you can run or step through the chomper, because the prince will be far away when the chomper closes the next time.
However, this hack can make this impossible, as I wrote above.


There is another part related to chompers' animation:

Code: Select all

// seg007:0F9A
int __pascal far next_chomper_timing(byte timing) {
	// 15,12,9,6,13,10,7,14,11,8,repeat
	timing -= 3;
	if (timing < 6) {
		timing += 10;
	}
	return timing;
}

Code: Select all

seg007:0F9D 80 6E 06 03                          sub     [bp+timing], 3
seg007:0FA1 80 7E 06 06                          cmp     [bp+timing], 6
seg007:0FA5 73 04                                jnb     loc_94FB
seg007:0FA7 80 46 06 0A                          add     [bp+timing], 10
This function makes the phase difference between different chompers that work at the same time.
For example, if you change that 3 to 0 then all chompers will chomp at the same time.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: PoP1 for DOS Chomper Delay

Post by atrueprincefanfrom18 »

How do I get started using or trying this?
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: PoP1 for DOS Chomper Delay

Post by Norbert »

atrueprincefanfrom18 wrote: March 18th, 2020, 3:24 pmHow do I get started using or trying this?
On the lower right of the EXE screen (F2) of apoplexy.
The recently released mod Hurry up Prince by Aram modified this.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: PoP1 for DOS Chomper Delay

Post by atrueprincefanfrom18 »

Norbert wrote: March 18th, 2020, 3:46 pm On the lower right of the EXE screen (F2) of apoplexy.
The recently released mod Hurry up Prince by Aram modified this.
:shock: :shock: :shock:

Nice!!! It's very difficult to master... And changing the values, is like almost playing a new game! It's very difficult because you are used to some timing and then your actions fail a lot...

It also can be used to prevent certain tricks, for example climbing a ledge with a chomper beneath it...

Is it possible to change the values for each level? For example, I just want to make the Level 8 very difficult by changing the values, so can I do that?

Maybe David can help! :P :)
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
Post Reply