MEGAHIT

Questions like: "I can't find the sword" should go here.
Post Reply
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

MEGAHIT

Post by Norbert »

So, why is the default PoP1 1.0 cheat code "MEGAHIT"?
Maybe it was their prediction that the game would become extremely successful.
Or perhaps hit is referring to a sword hit.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: MEGAHIT

Post by David »

Norbert wrote: May 29th, 2018, 1:03 am So, why is the default PoP1 1.0 cheat code "MEGAHIT"?
Maybe it was their prediction that the game would become extremely successful.
Or perhaps hit is referring to a sword hit.
I remember that long ago there was a discussion about this and other PoP 1&2 cheat parameters, but I can't find it.
Maybe it was on the PoPUW forum.

What I remember from it:
* "megahit" might refer to success ("mega hit"), as you wrote.
* "improved" means that PoP 1.3 is an improved version of PoP 1.0.
* "makinit" is "making it".
* I don't remember what they wrote about "yippeeyahoo".

Or maybe there was no such discussion and I am just remembering the PoP2 walkthrough:
http://www.popuw.com/texts/dos-prince_of_persia_ii_a.txt wrote: Q: Why are all the cheat codes so strange? Makinit, Megahit...
A: Perhaps Mechner wanted POP1 to be a mega hit (which it was), and POP2 to simply "make it". In other words, I think it means success for the game.
(I think it says something that the *definitive* PoP2 walkthrough mentions the cheat code of only the leaked version...)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: MEGAHIT

Post by Norbert »

David wrote: June 2nd, 2018, 11:52 am
http://www.popuw.com/texts/dos-prince_of_persia_ii_a.txt wrote: Q: Why are all the cheat codes so strange? Makinit, Megahit...
A: Perhaps Mechner wanted POP1 to be a mega hit (which it was), and POP2 to simply "make it". In other words, I think it means success for the game.
(I think it says something that the *definitive* PoP2 walkthrough mentions the cheat code of only the leaked version...)
It leaked while they were still makinit.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: MEGAHIT

Post by David »

Norbert wrote: June 2nd, 2018, 4:37 pm It leaked while they were still makinit.
Haha, yes! :lol:
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: MEGAHIT

Post by David »

Norbert wrote: May 29th, 2018, 1:03 am So, why is the default PoP1 1.0 cheat code "MEGAHIT"?
A similarly mysterious phrase appears when you activate the cheats in PoP1 Amiga:
David wrote: June 5th, 2014, 5:57 pm The status bar will show "MEGA DRIVE ENGAGED" if you did it right. (Is this a reference to SEGA Mega Drive? Or MEGAhit?)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: MEGAHIT

Post by Norbert »

Both French versions here have "megahit" at 0x1AE48, but both don't enable cheats with 'PRINCE.EXE megahit'. Is this a known thing, that the French version has no cheats? Their executables also have unusual sizes, namely 122304 bytes (cracked) and 122295 bytes (uncracked). It's also unusual for cracked and uncracked sizes not to match. Could the French version be PoP 1.2, or is this too far-fetched?

[Edit:]
Hm, actually the German version also has its own size (122263).
The Polish community version does too, but that's because they added "Wejdz na www.princeofpersia.prv.pl." at the very end of their p0 file.
The cracked French version has hex "1D DD 1D DE 1D DF 1D E0 1D" at the end, for some reason. And it changed some other things unknown to me.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: MEGAHIT

Post by David »

The cracked French version crashes soon after the prince enters swordfight.
That's because someone overwrote some bytes at offsets 0x043D1..0x043D5 with 0x90.
That might have a more meaningful effect in some other version, but I couldn't find out which.
(I've mentioned this here.)

Norbert wrote: January 14th, 2020, 1:43 am Is this a known thing, that the French version has no cheats?
I wanted to say that I don't remember this, but a quick search shows that I posted about it before: viewtopic.php?p=17848#p17848
Basically, the French version has a new variable whose value must be 1, or else the cheats are not enabled by megahit.
This variable has the initial value 2 and nothing writes to it.
I guess the developers changed it to 1 in the source whenever they wanted to test something using cheats, and changed it back to 2 afterwards.

Code: Select all

seg000:0179 B8 7D 00                             mov     ax, offset aMegahit ; "megahit"
seg000:017C 50                                   push    ax
seg000:017D 9A 5A 0E 84 1C                       call    check_param
seg000:0182 0B C0                                or      ax, ax
seg000:0184 74 0C                                jz      loc_10192
seg000:0186 83 3E 2A 08 01                       cmp     cheats_allowed?, 1
seg000:018B 75 05                                jnz     loc_10192
seg000:018D B8 01 00                             mov     ax, 1
seg000:0190 EB 02                                jmp     short loc_10194
seg000:0192                      ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
seg000:0192
seg000:0192                      loc_10192:
seg000:0192
seg000:0192 2B C0                                sub     ax, ax
seg000:0194
seg000:0194                      loc_10194:
seg000:0194 A3 9C 00                             mov     cheats_enabled, ax
Norbert wrote: January 14th, 2020, 1:43 am The cracked French version has hex "1D DD 1D DE 1D DF 1D E0 1D" at the end, for some reason. And it changed some other things unknown to me.
Here are all the changes I could find:
offsets 0x00002..0x00003: A size-related field in the MZ header. It was changed to reflect the new size of the EXE.
offsets 0x00012..0x00013: Checksum field in the MZ header. It's 0 in all official PRINCE.EXEs.
I wonder why did someone bother to change the these fields. Maybe they used a hex-editor which automatically recalculates MZ header fields?
offsets 0x04D31..0x043D5: See the beginning of my post.
offsets 0x1AE69..0x1AE6A: Level where the potions level should appear.
offsets 0x1B587..0x1B678: Copy protection codes (page-line-word). The codes in the cracked version don't match the only French manual I could find. (I've mentioned this here.)
offsets 0x1DDB7..0x1DDBF (new bytes): No idea why were they added. They probably don't have any effect on the game.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: MEGAHIT

Post by Norbert »

Thanks once again for your insightful comments, David.
Is there any chance you could use the non-cracked version to create a working cracked version that also accepts megahit?
The cracked version currently at PoPUW is clearly pointless...
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: MEGAHIT

Post by David »

Norbert wrote: January 18th, 2020, 9:14 pm Thanks once again for your insightful comments, David.
Is there any chance you could use the non-cracked version to create a working cracked version that also accepts megahit?
The cracked version currently at PoPUW is clearly pointless...
Start from the non-cracked PRINCE.EXE and do these hex-edits:
At 0x1AE69 write FF FF. This disables the potions level.
At 0x1B587 write 01. This enables megahit.
Post Reply