PoP1 SEGA Genesis cheat codes

Discuss other PoP1 related things here.

Moderator: English Moderator Team

Post Reply
David
The Prince of Persia
The Prince of Persia
Posts: 1435
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

PoP1 SEGA Genesis cheat codes

Post by David » July 16th, 2017, 5:33 pm

I found some cheats for the SEGA Genesis / Mega Drive version of PoP1: https://www.gamefaqs.com/genesis/586397 ... sia/cheats
During game play just pause the game and press the following codes:
Code -- Effect
ABACCACB -- Kill the enemy
AABACAAC -- Open doors
(They also have a third code but it's a password.)

I tried these, they work in the European (Mega Drive) version only.

I found some more here: http://www.sega-mag.com/astuces-Prince+ ... 1784-3.htm (French)
CACBBACC -- Get one more HP, like a small potion.
BAABCBBB -- Shake the level, like that special potion.
Plus the two codes from gamefaqs.

Another list: https://archive.org/stream/Game-Power-3 ... 1_djvu.txt (Italian)
This lists all four codes above.

Um... If I scroll down on the aforementioned gamefaqs page, there are more codes there:
BBAABCCB -- Adds a life bar
BAABCBBB -- Create earthquake
CBAACCBA -- Halts time
BACCACB -- Kill enemies
BACAAC -- Open doors
CBAACBAB -- Skip level
CABBBB -- Slow motion falling

This lists almost everything I found before, except the code for one more HP. Plus of course it has new codes.
They all work in the European version.
Note how many of these are potion effects, including those potion effects that are limited to the European version.

Interestingly, slow-fall seems to protect the prince from spikes.
Although this is also true for the slow-fall caused by potions.

Looks like the leading A's are not needed?
Let me guess: In the key-buffer, A is stored as zero, and the buffer is initialized to zeroes?
The leading A's are required, though, if I pressed B or C before entering the code.

Now, I wonder if there are more codes, or any codes for the USA version...

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3078
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: PoP1 SEGA Genesis cheat codes

Post by Norbert » July 16th, 2017, 5:58 pm

David wrote:Now, I wonder if there are more codes, or any codes for the USA version...
In case the ROM hides these, I could manually try combinations.
If it's the same as the EU version, there are only (3^8=) 6561 combinations possible, right? :)

David
The Prince of Persia
The Prince of Persia
Posts: 1435
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PoP1 SEGA Genesis cheat codes

Post by David » July 22nd, 2017, 3:16 pm

David wrote: In case the ROM hides these, I could manually try combinations.
If it's the same as the EU version, there are only (3^8=) 6561 combinations possible, right? :)
"only" eh?
You could, but it would be quite long and boring... :)

Instead I looked into the disassembly. (Europe version)

I found the checks in the Europe version by searching for code that calls potion effects, since I knew that some codes do that.

This is the code that collects the pressed buttons:

Code: Select all

000563DE   3400                             MOVE.W    D0,D2
000563E0   e84a                             LSR.W     #4,D2
000563E2   0242 0007                        AND.W     #0x7,D2
000563E6   4a42                             TST.W     D2
000563E8   6600 000c                        BNE.L     B_563f6
000563EC   33fc 0000 00ff 1f98              MOVE.W    #0x0000,A_00ff1f98 ; is_pressed
000563F4   4e75                             RTS

000563F6   4a79 00ff 1f98                   TST.W     A_00ff1f98 ; is_pressed
000563FC   6700 0004                        BEQ.L     B_56402
00056400   4e75                             RTS

00056402   33fc ffff 00ff 1f98              MOVE.W    #0xffff,A_00ff1f98 ; is_pressed
0005640A   0c42 0004                        CMP.W     #0x4,D2 ; (A) button?
0005640E   6600 0006                        BNE.L     B_56416
00056412   343c 0000                        MOVE.W    #0x0000,D2
00056416   7200                             MOVEQ     #0x0,D1
00056418   3239 00ff 1f94                   MOVE.W    A_00ff1f94,D1 ; buffer?
0005641E   c3fc 0003                        MULS.W    #0x0003,D1
00056422   d242                             ADD.W     D2,D1
00056424   83fc 19a1                        DIVS.W    #0x19A1,D1 ; = 3**8
00056428   4841                             SWAP      D1 ; mod
0005642A   33c1 00ff 1f94                   MOVE.W    D1,A_00ff1f94 ; buffer?
00056430   c3fc 0515                        MULS.W    #0x0515,D1
00056434   83fc 19a1                        DIVS.W    #0x19A1,D1 ; = 3**8
00056438   4841                             SWAP      D1 ; mod
C equivalent:

Code: Select all

short buffer; /*A_00ff1f94*/
short is_pressed; /*A_00ff1f98*/

void process(short input /*D0*/) {
	short button /*D2*/ = (input >> 4) & 7;

	if (button == 0) { is_pressed = 0; return; }
	// Ignore pressed buttons until all buttons are released:
	if (is_pressed != 0) return;
	is_pressed = -1;

	if (button == 4) button = 0; // (A) button?
	// A=0, B=1, C=2

	buffer = (buffer * 3 + button) % 0x19A1;

	switch ((buffer * 0x0515) % 0x19A1) {
		// ... see recognized codes below ...
	}
}
BASH script to convert ABC strings into numbers:

Code: Select all

#! /bin/bash
x=$(echo "$1" | tr ABC 012)
((x = 3#$x))
((x = (x * 0x515) % (3 ** 8) ))
printf "%#x" $x
And here are the recognized codes:

Code: Select all

0005643A   0c41 1216                        CMP.W     #0x1216,D1 ; CACBBACC
0005643E   6700 003c                        BEQ.L     B_5647c ; heal
00056442   0c41 0dac                        CMP.W     #0xdac,D1 ; BBAABCCB
00056446   6700 0046                        BEQ.L     B_5648e ; life
0005644A   0c41 0edb                        CMP.W     #0xedb,D1 ; CBAACBAB
0005644E   6700 0050                        BEQ.L     B_564a0 ; skip level
00056452   0c41 076c                        CMP.W     #0x76c,D1 ; AABACAAC
00056456   6700 0090                        BEQ.L     B_564e8 ; open gates
0005645A   0c41 07be                        CMP.W     #0x7be,D1 ; AACABBBB
0005645E   6700 00dc                        BEQ.L     B_5653c ; slow-fall
00056462   0c41 13dc                        CMP.W     #0x13dc,D1 ; ABACCACB
00056466   6700 00fc                        BEQ.L     B_56564 ; kill guard
0005646A   0c41 005c                        CMP.W     #0x5c,D1 ; BAABCBBB
0005646E   6700 013a                        BEQ.L     B_565aa ; shake
00056472   0c41 1380                        CMP.W     #0x1380,D1 ; CBAACCBA
00056476   6700 0142                        BEQ.L     B_565ba ; stop time
0005647A   4e75                             RTS
So the codes are:

Code: Select all

CACBBACC = heal
BBAABCCB = life
CBAACBAB = skip level
AABACAAC = open gates (but not the exit door)
AACABBBB = slow-fall
ABACCACB = kill guard
BAABCBBB = shake/earthquake
CBAACCBA = stop time
All of these were included in at least one of the lists that I linked from my first post, so it looks like I didn't find any new codes.

Notes:
"kill guard" will not close the paused menu if there is no guard to kill.

"skip level" does not work on level 16 (tower/Jaffar), but on level 17 (princess) it will go to the ending.
Also, it takes time away!
It takes away somewhat less than 5 minutes, unless this would make the remaining time less than 6 minutes.

Code: Select all

000564A0   0c79 000f 00ff 0fe0              CMP.W     #0xf,A_00ff0fe0 ; level number - 1
000564A8   67d0                             BEQ       B_5647a ; return without accepting

000564AA   2039 00ff 0d5c                   MOVE      A_00ff0d5c,D0 ; Time
000564B0   04b9 0000 3840 00ff 0d5c         SUB       #0x3840,A_00ff0d5c ; 0x3840 = 14400 = 4,8 * 60 * 50 (4:48)
000564BA   0cb9 0000 4650 00ff 0d5c         CMP       #0x4650,A_00ff0d5c ; 0x4650 = 18000 = 6 * 60 * 50 (6:00)
000564C4   6e00 0008                        BGT.L     B_564ce
000564C8   23c0 00ff 0d5c                   MOVE      D0,A_00ff0d5c ; Time
As for the USA version:
* I didn't find any code that would call any of the potion effects (except when drinking a potion, obviously).
* Neither did I find any place in RAM (savestates) that stores collected button presses.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3078
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: PoP1 SEGA Genesis cheat codes

Post by Norbert » July 22nd, 2017, 7:22 pm

David wrote:[...], so it looks like I didn't find any new codes.
Too bad. It would've been nice if your efforts would've paid off with an extra code. ;)
David wrote:
David wrote: In case the ROM hides these, I could manually try combinations.
If it's the same as the EU version, there are only (3^8=) 6561 combinations possible, right? :)
"only" eh?
You could, but it would be quite long and boring... :)

[...]

As for the USA version:
* I didn't find any code that would call any of the potion effects (except when drinking a potion, obviously).
* Neither did I find any place in RAM (savestates) that stores collected button presses.
I've used a script to check the US version for all combinations.
It doesn't react to any of them.

The code:
Spoiler: show

Code: Select all

# This public domain script checks if PoP1 for the Sega Genesis has cheats
# similar to those available with PoP1 for the Mega Drive. Spoiler: it doesn't.
# 1. Rebind Mednafen keys (via Alt+Shift+1) to set a=a,b=b,c=c.
# 2. Run this script, which will launch PoP1 for the Sega Genesis.
# 3. The PoP window should already have focus. If not, give it focus.
# 4. Press Enter until level 1 is active and paused.
# 5. Wait.

mednafen PoP1_US.md &
sleep 7
for ((e = 0; e <= 6560; e++))
do
	result_a=`echo "obase=3;ibase=10;$e"|bc`
	result_b=$(printf "%08d" $result_a)
	result_c=${result_b//0/a}
	result_d=${result_c//1/b}
	result_e=${result_d//2/c}
	percent_a=`echo "(($e + 1) / 6561) * 100"|bc -l`
	percent_b=`echo "scale=2; ($percent_a * 100) / 100"|bc`
	echo [ INFO ] Testing: $result_e \($percent_b% done\)
	for ((loop = 0; loop < ${#result_e}; loop++)); do
		xdotool key "${result_e:$loop:1}"
	done
done
That GNU/Linux allows me to put together and use such a script more or less out-of-the-box is one of the reasons I'm not on Windows.
(I'm aware Microsoft provides basic Bash as part of their Windows 10 "developer mode".)

David
The Prince of Persia
The Prince of Persia
Posts: 1435
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PoP1 SEGA Genesis cheat codes

Post by David » July 23rd, 2017, 10:53 am

Norbert wrote: I've used a script to check the US version for all combinations.
It doesn't react to any of them.
Oh, yes, xdotool.
I remember you already used it here: viewtopic.php?p=12072#p12072
(Just to be sure, did you also check that the Europe version does react?)

Again we see how differently we approach the same problem. That's good. :)

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3078
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: PoP1 SEGA Genesis cheat codes

Post by Norbert » July 23rd, 2017, 2:03 pm

David wrote:(Just to be sure, did you also check that the Europe version does react?)
Yep.
It unpauses the game with (certain?) hits though, so it's primarily useful to do a general check whether it reacts to anything.
David wrote:Again we see how differently we approach the same problem.
Heh, yeah. Although occasionally the primary reason I pick a different approach is because I lack certain skills. ;) I don't remember details, but there have been occasions where my limitations forced me to look for creative solutions that, when found, I thought turned out to be preferable solutions over what I initially aimed for.

David
The Prince of Persia
The Prince of Persia
Posts: 1435
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PoP1 SEGA Genesis cheat codes

Post by David » July 27th, 2017, 8:08 pm

Norbert wrote: It unpauses the game with (certain?) hits though, so it's primarily useful to do a general check whether it reacts to anything.
When the game recognizes a valid code, it unpauses itself.
Except in two cases:
* "kill guard" will not close the paused menu if there is no guard to kill.
* "skip level" does not work on level 16, and won't close the paused menu there.
Norbert wrote: Heh, yeah. Although occasionally the primary reason I pick a different approach is because I lack certain skills. ;)
This reminds me of the Amiga cheats thread.
You searched the web, and even contacted the author of the emulator, while I "just" disassembled the game. :)
Norbert wrote: I don't remember details, but there have been occasions where my limitations forced me to look for creative solutions that, when found, I thought turned out to be preferable solutions over what I initially aimed for.
That sounds interesting...

Too bad you don't remember concrete examples. (Are they related to PoP at least? Something about your level editors for example? Or PoPOT?)

Post Reply