Hacking the SNES ROM

Discuss PoP1 for SNES here.
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: November 3rd, 2019, 3:59 am I'm toying with removing the graphical effects but not the music on the rest of the levels just to match the DOS even more, but I'm debating between how much I should match the DOS and how much of the SNES changes I should leave.
To remove fade and mosaic at the end of every level:
At 0x9F09 write: A9 00 8D 16 02

Shauing wrote: November 3rd, 2019, 3:59 am I think it's actually the ''time up'' cutscene that appears when you still continue the game but there is no time left. This might explain why it uses the music from the other cutscenes and no game over appears.
I've just verified this, and indeed, this cutscene appears before levels (instead of the usual cutscenes) if the time has expired.
I haven't seen this before, but it makes sense.
(But if the princess is gone by the time you reach level 13 then who sends the mouse?)

Shauing wrote: November 3rd, 2019, 3:59 am Related to the good and bad ending cutscene; can the pixelated & fade-in intro be removed for this specific cutscene only? As the final level has the pixelating and fade-out effect removed, it looks odd that the cutscene starts with this effect.
The good ending and the bad ending are two separate cutscenes. Do you want to remove the effects from both?

At 0x14D0C write: 22 30 FF 01
At 0xFF30 write: 22 5A B4 02 AD 84 0A C9 06 F0 05 C9 07 F0 01 6B A9 0F 8D 16 02 8D 1A 02 6B

Shauing wrote: November 3rd, 2019, 3:59 am Interesting that was left unused, but what if the guards follow you to another room? Their skill will not revert to their default one?
I tried it with a green guard set to the fat guard's skill, and his skill remains when he follows me.
His skill also remains when I leave the room (without the guard following me) and reenter.

Shauing wrote: November 3rd, 2019, 3:59 am Why was this removed from the latest version of Pr1SnesLevEd?
I removed it because it doesn't do anything in the original game, and I didn't foresee that I will make a hack that will change this.
Here is the discussion: viewtopic.php?p=17507#p17507

Shauing wrote: November 3rd, 2019, 3:59 am I assume this separates the guards skills from the type.
Yes, exactly.
Shauing wrote: November 3rd, 2019, 3:59 am In the 2015 editor I see that guards have skill 0 regardless of their type.
You mean on your edited levels, right?
In the original levels the skill of each guard matches their type.
For example, green guards have skill=7, green-blue guards have skill=8, the fat guard has skill=5, etc.

Shauing wrote: November 3rd, 2019, 3:59 am On SNES, if guards are at a certain tile closer to the next room, they also appear on said next room, something that on DOS does not occur. [...] Can this be changed closer to what the DOS does?
At 0x8785 write: 60
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: November 9th, 2019, 1:12 pm
Spoiler: show
Shauing wrote: November 3rd, 2019, 3:59 am I'm toying with removing the graphical effects but not the music on the rest of the levels just to match the DOS even more, but I'm debating between how much I should match the DOS and how much of the SNES changes I should leave.
To remove fade and mosaic at the end of every level:
At 0x9F09 write: A9 00 8D 16 02
Good. As the SNES does save the best time of each level, I'll probably leave in the best time/password display at the end of each level (except on 6, 12 and 13).
David wrote: November 9th, 2019, 1:12 pm
Spoiler: show
Shauing wrote: November 3rd, 2019, 3:59 am I think it's actually the ''time up'' cutscene that appears when you still continue the game but there is no time left. This might explain why it uses the music from the other cutscenes and no game over appears.
I've just verified this, and indeed, this cutscene appears before levels (instead of the usual cutscenes) if the time has expired.
I haven't seen this before, but it makes sense.
(But if the princess is gone by the time you reach level 13 then who sends the mouse?)
It's a interesting oversight. They did a good job nonetheless as there aren't that many oversights in this port, but those few do have something interesting to show.
David wrote: November 9th, 2019, 1:12 pm
Spoiler: show
Shauing wrote: November 3rd, 2019, 3:59 am Related to the good and bad ending cutscene; can the pixelated & fade-in intro be removed for this specific cutscene only? As the final level has the pixelating and fade-out effect removed, it looks odd that the cutscene starts with this effect.
The good ending and the bad ending are two separate cutscenes. Do you want to remove the effects from both?
At 0x14D0C write: 22 30 FF 01
At 0xFF30 write: 22 5A B4 02 AD 84 0A C9 06 F0 05 C9 07 F0 01 6B A9 0F 8D 16 02 8D 1A 02 6B
On both. Related to the other cutscenes: can the pixelated effect be removed but the fade-in stay, just like the DOS version?

David wrote: November 9th, 2019, 1:12 pm
Spoiler: show
Shauing wrote: November 3rd, 2019, 3:59 am Interesting that was left unused, but what if the guards follow you to another room? Their skill will not revert to their default one?
I tried it with a green guard set to the fat guard's skill, and his skill remains when he follows me.
His skill also remains when I leave the room (without the guard following me) and reenter..
Good to know their skill remains unchanged, no matter what room he is in. I wonder why the SNES developers had all guards and skills linked, instead of the diversity the DOS had.
David wrote: November 9th, 2019, 1:12 pm
Shauing wrote: November 3rd, 2019, 3:59 am Why was this removed from the latest version of Pr1SnesLevEd?
I removed it because it doesn't do anything in the original game, and I didn't foresee that I will make a hack that will change this.
Here is the discussion: viewtopic.php?p=17507#p17507
I'm surprised no one did a mod that included this feature.

David wrote: November 9th, 2019, 1:12 pm
Spoiler: show
Shauing wrote: November 3rd, 2019, 3:59 am In the 2015 editor I see that guards have skill 0 regardless of their type.
You mean on your edited levels, right?
In the original levels the skill of each guard matches their type.
For example, green guards have skill=7, green-blue guards have skill=8, the fat guard has skill=5, etc.
Yes, on most of my edited levels occurred that as I created them from scratch (except on the levels that closely matched the DOS; curiously, the other guard on Level 1 had a 255 skill).
David wrote: November 9th, 2019, 1:12 pm
Spoiler: show
Shauing wrote: November 3rd, 2019, 3:59 am On SNES, if guards are at a certain tile closer to the next room, they also appear on said next room, something that on DOS does not occur. [...] Can this be changed closer to what the DOS does?
At 0x8785 write: 60
Great! This also fixed a guard on Level 9 that changed skill, as he was closer to the end of a room and on another row different from the Prince, so when the Prince got to the next room, his skill changed permanently.

This is a minor thing as well, but on DOS the Shadow falling intro occurs when the Prince starts to cross the first loose tile, but on SNES the intro plays as soon as the Prince enters the room. Can his intro play like the DOS?

Got any update regarding the music changes/additions and the level 7 intro?

EDIT: Adding a small bug that it's a bit hard to pull off, but still worth noting. On Level 8, the room where the Mouse sequence occurs, if the guard of the previous room gets close enough to this room and the Prince goes back to said previous room, now that guard has transformed into Jaffar!
And if then the Prince goes to open the final door and come back, Jaffar dies when the mouse enters!
Oddly, if the Prince goes to the row below on the mouse room and enters the previous room, the guard disappears, and he doesn't re-appear until the Prince arrives the mouse room again but on the top row. It is a pretty curious bug.
Someone speedrunning this mod might find this bug, so if there's solution to it, good; if not, it is not that huge of a deal.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: November 9th, 2019, 8:17 pm On both. Related to the other cutscenes: can the pixelated effect be removed but the fade-in stay, just like the DOS version?
At 0x1346C write: A9 0F

Shauing wrote: November 9th, 2019, 8:17 pm This is a minor thing as well, but on DOS the Shadow falling intro occurs when the Prince starts to cross the first loose tile, but on SNES the intro plays as soon as the Prince enters the room. Can his intro play like the DOS?
At 0x8C76 write: 4C 10 FF
At 0xFF10 write: AD 88 04 C9 96 B0 08 A9 01 8D 2C 06 4C 7E 8C A9 CA A2 80 4C 04 81

Shauing wrote: November 9th, 2019, 8:17 pm Got any update regarding the music changes/additions and the level 7 intro?
Level 7:
With a few hours of debugging the SNES and the Apple II versions, I finally found a workaround...
At 0xE0C3 write: 4C F0 FE
At 0xFEF0 write: AD 79 05 C9 LL D0 0A A9 03 20 72 84 A9 00 8D 5C 04 4C 71 B5
Where LL is the level number.
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: November 10th, 2019, 3:06 pm
Spoiler: show
Shauing wrote: November 9th, 2019, 8:17 pm On both. Related to the other cutscenes: can the pixelated effect be removed but the fade-in stay, just like the DOS version?
At 0x1346C write: A9 0F
Good, thanks.
David wrote: November 10th, 2019, 3:06 pm
Spoiler: show
Shauing wrote: November 9th, 2019, 8:17 pm This is a minor thing as well, but on DOS the Shadow falling intro occurs when the Prince starts to cross the first loose tile, but on SNES the intro plays as soon as the Prince enters the room. Can his intro play like the DOS?
At 0x8C76 write: 4C 10 FF
At 0xFF10 write: AD 88 04 C9 96 B0 08 A9 01 8D 2C 06 4C 7E 8C A9 CA A2 80 4C 04 81
This didn't change a thing. Perhaps the level, column and row indications are missing?
David wrote: November 10th, 2019, 3:06 pm
Spoiler: show
Shauing wrote: November 9th, 2019, 8:17 pm Got any update regarding the music changes/additions and the level 7 intro?
Level 7:
With a few hours of debugging the SNES and the Apple II versions, I finally found a workaround...
At 0xE0C3 write: 4C F0 FE
At 0xFEF0 write: AD 79 05 C9 LL D0 0A A9 03 20 72 84 A9 00 8D 5C 04 4C 71 B5
Where LL is the level number.
Niiice. It was awesome to finally see this work.

Adding just two more small things.
1. Can the Prince not fade-out and vanish when killed?
2. Can the timer be stopped when Jaffar is killed on Level 12b(13 here on my mod)?
Though I'm almost sure that with the bug I mentioned on Level 8, the timer will stop if the Jaffar of this level is killed.
EDIT:
3. Can the Mirror and Shadow stuns be turned off but that the short jingle still play on Levels 4 and 6 respectively?
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: November 10th, 2019, 6:25 pm This didn't change a thing. Perhaps the level, column and row indications are missing?
Yes, I forgot something...
At 0x8C6E write the number of the shadow's room (in hex).

I changed that byte in my test-ROM back in October to test something, that's why I forgot to mention it now. Sorry!
Shauing wrote: November 10th, 2019, 6:25 pm 1. Can the Prince not fade-out and vanish when killed?
At 0xF4B3 write: 80
At 0xF381 write: 04
Shauing wrote: November 10th, 2019, 6:25 pm 2. Can the timer be stopped when Jaffar is killed on Level 12b(13 here on my mod)?
At 0xF001 write: 0C (This is the number of Jaffar's level minus 1 in hex.)
At 0xF004 write: 4C E0 FE
At 0xFEE0 write: D0 08 AD C1 04 D0 03 4C 09 F0 4C 0C F0
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: November 16th, 2019, 7:43 pm
Spoiler: show
Shauing wrote: November 10th, 2019, 6:25 pm This didn't change a thing. Perhaps the level, column and row indications are missing?
Yes, I forgot something...
At 0x8C6E write the number of the shadow's room (in hex).
I changed that byte in my test-ROM back in October to test something, that's why I forgot to mention it now. Sorry!
EDIT: Sorry, misread your post. I read shadow's level instead of room. It worked. Thank you.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: November 16th, 2019, 7:43 pm
Spoiler: show
Shauing wrote: November 10th, 2019, 6:25 pm 1. Can the Prince not fade-out and vanish when killed?
At 0xF4B3 write: 80
At 0xF381 write: 04
David wrote: November 16th, 2019, 7:43 pm
Spoiler: show
Shauing wrote: November 10th, 2019, 6:25 pm 2. Can the timer be stopped when Jaffar is killed on Level 12b(13 here on my mod)?
At 0xF001 write: 0C (This is the number of Jaffar's level minus 1 in hex.)
At 0xF004 write: 4C E0 FE
At 0xFEE0 write: D0 08 AD C1 04 D0 03 4C 09 F0 4C 0C F0
Both worked, thanks.

There's a small bug on Level 6 when the Prince falls to finish the level. If he manages to jump and fall avoiding the stun animation, he will keep falling in the same room until the jingle is over, and then the level ends. Is there any solution to this?

Well, I think except for the stuns to be removed on Levels 4 and 6, the bug fixes on Levels 6 and 8, and the music cues additions/changes to the specified levels/cutscenes, I can start to implement the new character graphics, so that the mod can finally be finished.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: November 10th, 2019, 6:25 pm 3. Can the Mirror and Shadow stuns be turned off but that the short jingle still play on Levels 4 and 6 respectively?
At 0x846D write: 01 (disables stun for mirror)
At 0x8721 write: 01 (disables stun for shadow)
Shauing wrote: November 16th, 2019, 8:42 pm There's a small bug on Level 6 when the Prince falls to finish the level.
If he manages to jump and fall avoiding the stun animation, he will keep falling in the same room until the jingle is over, and then the level ends. Is there any solution to this?
At 0xEF9D write: 20 D0 FE EA EA
At 0xFED0 write: AD 79 05 C9 LL F0 02 C9 80 60
Where LL is level number - 1 (05 in your case).
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: November 16th, 2019, 10:46 pm
Spoiler: show
Shauing wrote: November 10th, 2019, 6:25 pm 3. Can the Mirror and Shadow stuns be turned off but that the short jingle still play on Levels 4 and 6 respectively?
At 0x846D write: 01 (disables stun for mirror)
At 0x8721 write: 01 (disables stun for shadow)
David wrote: November 16th, 2019, 10:46 pm
Spoiler: show
Shauing wrote: November 16th, 2019, 8:42 pm There's a small bug on Level 6 when the Prince falls to finish the level.
If he manages to jump and fall avoiding the stun animation, he will keep falling in the same room until the jingle is over, and then the level ends. Is there any solution to this?
At 0xEF9D write: 20 D0 FE EA EA
At 0xFED0 write: AD 79 05 C9 LL F0 02 C9 80 60
Where LL is level number - 1 (05 in your case).
Good, and a fade-out of the jingle instead of abruptly cutting like the original. Nice.
I had to move this one to 0xFEB0, as I have on 0xFED0 three bytes of the 60 minutes time hack.

Well, now the Level 8 bug and the music cues are left. We're finally reaching the end!

EDIT: Forgot about the Level 12 Shadow bug, which now it's slightly worse with the new Shadow delayed intro hack.
Spoiler: show
EDIT 2: By the way, can passwords be changed? More specifically, that the passwords give a maximum of 60 minutes of time limit and a max of 9 health points. The old passwords still work, so they will still give up to 120 minutes and up to 15 health points.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: November 17th, 2019, 12:13 am I had to move this one to 0xFEB0, as I have on 0xFED0 three bytes of the 60 minutes time hack.
You also changed the first part to 20 B0 FE, right?

Shauing wrote: November 17th, 2019, 12:13 am Well, now the Level 8 bug and the music cues are left.
Here is one of the music cues:
Shauing wrote: October 22nd, 2019, 11:00 am - The different ending of the ''level completed'' jingle after finishing Level 4
This hack changes a part of the earlier "disable the ending music on certain levels" hack!
At 0xFF9C write: 20 90 FE
At 0xFE90 write: AD 79 05 C9 03 D0 04 A9 MS 80 02 A9 MD A2 05 20 4D EA 60
Where MS is the music for level 4, and MD is the default music.
0x1C is the number of the original ending music.

Shauing wrote: November 17th, 2019, 12:13 am EDIT: Forgot about the Level 12 Shadow bug, which now it's slightly worse with the new Shadow delayed intro hack.
I don't know exactly how did you configure the shadow, so I copied the settings from the DOS version to test it.
I could solve the problem by changing the row from 0 to 255 (interpreted as -1) in Pr1SnesLevEd.
If this doesn't solve it for you then you should post your edited ROM somewhere so I can look into it.

Shauing wrote: November 17th, 2019, 12:13 am EDIT 2: By the way, can passwords be changed? More specifically, that the passwords give a maximum of 60 minutes of time limit and a max of 9 health points. The old passwords still work, so they will still give up to 120 minutes and up to 15 health points.
As a workaround, you could change the password alphabet at 0x15C38-0x15C57.
That makes passwords from the original game (and other SNES mods) invalid in your mod.
The Quiet Levels does this.
(And it does more: it crashes the game if the number of HPs is incorrect, even if they were added by a cheat and not from a password.)

But if this is not enough then I also figured out how to limit the values allowed in entered passwords:

(By the way, the max HP is 10 in the DOS version: The prince starts with 3 HP, there are 6 obtainable big potions (levels 2,3,4,7,9,11), and he gets one more HP when he merges the shadow.)

Limit the HP to 10:
At 0x15A7C write: 4C F0 FF
At 0x17FF0 write: 20 5F DB C9 0B B0 03 4C 7F DA 4C 9D DA
(The 0x0B there is the max allowed HP +1.)

Limit the remaining minutes to 60:
At 0x15A79 write: 4C D0 FF
At 0x17FD0 write: 20 14 DB C2 20 AD 60 0E C9 9C 63 E2 20 90 03 4C 7C DA 4C 9D DA
(9C 63 is $639C = 25500 = (120-60)*425, calculated as here.)
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: November 23rd, 2019, 9:49 pm
Spoiler: show
Shauing wrote: November 17th, 2019, 12:13 am I had to move this one to 0xFEB0, as I have on 0xFED0 three bytes of the 60 minutes time hack.
You also changed the first part to 20 B0 FE, right?
Yes, I did. Figured out by reading carefully where the new hacking data was being located, thus I assumed the first part is to indicate where the new hack data is.
David wrote: November 23rd, 2019, 9:49 pm
Spoiler: show
Shauing wrote: November 17th, 2019, 12:13 am Well, now the Level 8 bug and the music cues are left.
Here is one of the music cues:
Spoiler: show
Shauing wrote: October 22nd, 2019, 11:00 am - The different ending of the ''level completed'' jingle after finishing Level 4
This hack changes a part of the earlier "disable the ending music on certain levels" hack!
At 0xFF9C write: 20 90 FE
At 0xFE90 write: AD 79 05 C9 03 D0 04 A9 MS 80 02 A9 MD A2 05 20 4D EA 60
Where MS is the music for level 4, and MD is the default music.
0x1C is the number of the original ending music.
Awesome. Hopefully the rest will be possible too.
David wrote: November 23rd, 2019, 9:49 pm
Shauing wrote: November 17th, 2019, 12:13 am EDIT: Forgot about the Level 12 Shadow bug, which now it's slightly worse with the new Shadow delayed intro hack.
I don't know exactly how did you configure the shadow, so I copied the settings from the DOS version to test it.
I could solve the problem by changing the row from 0 to 255 (interpreted as -1) in Pr1SnesLevEd.
If this doesn't solve it for you then you should post your edited ROM somewhere so I can look into it.
Didn't solve it; the Shadow falls through the floor and walls, and once outside the room, he dies, thus the Prince dies.
On the hacks window, at the Level 15 tab, the shadow start position reads like this:
frame 15 | x 82 | y 0 | direction right | col 6 | row 255 | action 0 | sequence 7

I'll send you a PM containing a video of the Level 8 bug I mentioned and on the description of that video, there will be a download link of the ROM so you can check what's wrong. I already placed the Prince on the room before the Shadow room so that you don't have to do all the level. The SPCCMD! password still works.
David wrote: November 23rd, 2019, 9:49 pm
Spoiler: show
Shauing wrote: November 17th, 2019, 12:13 am EDIT 2: By the way, can passwords be changed? More specifically, that the passwords give a maximum of 60 minutes of time limit and a max of 9 health points. The old passwords still work, so they will still give up to 120 minutes and up to 15 health points.
As a workaround, you could change the password alphabet at 0x15C38-0x15C57.
That makes passwords from the original game (and other SNES mods) invalid in your mod.
The Quiet Levels does this.
(And it does more: it crashes the game if the number of HPs is incorrect, even if they were added by a cheat and not from a password.)
Changing the password alphabet is a good idea, but still the limits are needed to avoid players using passwords that exceed the 60 minute time limit. I'll probably restore the original Japanese alphabet (which utilized A to Z), though not sure if I want to crash the game if HPs are higher than what normally you would have at specific levels.
I compared the original ROM and The Quiet Levels one at around that area, and saw that besides the alphabet changes, a value was changed from 06 to 07 (exactly at 0x15BD4, 0x15DD4 on The Quiet Levels). On the disassembly, it documents it as part of ''calculate checksum->B and CRC->A''. What does this value change do exactly?
David wrote: November 23rd, 2019, 9:49 pm But if this is not enough then I also figured out how to limit the values allowed in entered passwords:

(By the way, the max HP is 10 in the DOS version: The prince starts with 3 HP, there are 6 obtainable big potions (levels 2,3,4,7,9,11), and he gets one more HP when he merges the shadow.)

Limit the HP to 10:
At 0x15A7C write: 4C F0 FF
At 0x17FF0 write: 20 5F DB C9 0B B0 03 4C 7F DA 4C 9D DA
(The 0x0B there is the max allowed HP +1.)

Limit the remaining minutes to 60:
At 0x15A79 write: 4C D0 FF
At 0x17FD0 write: 20 14 DB C2 20 AD 60 0E C9 9C 63 E2 20 90 03 4C 7C DA 4C 9D DA
(9C 63 is $639C = 25500 = (120-60)*425, calculated as here.)
Works as intended; the default password on Level 1 does not work as it exceeds the 60 minute limit, and if somehow the Prince has more than 10 HP, the passwords that are given are invalid. Great!
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: November 24th, 2019, 12:06 am Didn't solve it; the Shadow falls through the floor and walls, and once outside the room, he dies, thus the Prince dies.
On the hacks window, at the Level 15 tab, the shadow start position reads like this:
frame 15 | x 82 | y 0 | direction right | col 6 | row 255 | action 0 | sequence 7

I'll send you a PM containing a video of the Level 8 bug I mentioned and on the description of that video, there will be a download link of the ROM so you can check what's wrong. I already placed the Prince on the room before the Shadow room so that you don't have to do all the level. The SPCCMD! password still works.
I think I found the solution: Set row to 0, and at the bottom of the level 15 page, change the "?" to level 12.

I'm not sure what exactly the "?" setting does, but it changes the number after the CMP at 01:8161 in the disassembly, and that area does something with guards.

Shauing wrote: November 24th, 2019, 12:06 am I compared the original ROM and The Quiet Levels one at around that area, and saw that besides the alphabet changes, a value was changed from 06 to 07 (exactly at 0x15BD4, 0x15DD4 on The Quiet Levels). On the disassembly, it documents it as part of ''calculate checksum->B and CRC->A''. What does this value change do exactly?
It changes how the check bits in the password are calculated.
This means that even if you changed the password alphabet of The Quiet Levels back to the original, you still couldn't use the passwords from the original game.
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: November 30th, 2019, 6:52 pm
Spoiler: show
Shauing wrote: November 24th, 2019, 12:06 am Didn't solve it; the Shadow falls through the floor and walls, and once outside the room, he dies, thus the Prince dies.
On the hacks window, at the Level 15 tab, the shadow start position reads like this:
frame 15 | x 82 | y 0 | direction right | col 6 | row 255 | action 0 | sequence 7

I'll send you a PM containing a video of the Level 8 bug I mentioned and on the description of that video, there will be a download link of the ROM so you can check what's wrong. I already placed the Prince on the room before the Shadow room so that you don't have to do all the level. The SPCCMD! password still works.
I think I found the solution: Set row to 0, and at the bottom of the level 15 page, change the "?" to level 12.

I'm not sure what exactly the "?" setting does, but it changes the number after the CMP at 01:8161 in the disassembly, and that area does something with guards.
It works, if the Prince does not put his sword down on the next room. If he does and goes back, the shadow remains above.
David wrote: November 30th, 2019, 6:52 pm
Spoiler: show
quote=Shauing post_id=27113 time=1574546812 user_id=2693]
I compared the original ROM and The Quiet Levels one at around that area, and saw that besides the alphabet changes, a value was changed from 06 to 07 (exactly at 0x15BD4, 0x15DD4 on The Quiet Levels). On the disassembly, it documents it as part of ''calculate checksum->B and CRC->A''. What does this value change do exactly?
It changes how the check bits in the password are calculated.
This means that even if you changed the password alphabet of The Quiet Levels back to the original, you still couldn't use the passwords from the original game.
Interesting; indeed it explains why the original game passwords didn't work there.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: November 24th, 2019, 12:06 am I'll send you a PM containing a video of the Level 8 bug I mentioned and on the description of that video, there will be a download link of the ROM so you can check what's wrong. I already placed the Prince on the room before the Shadow room so that you don't have to do all the level. The SPCCMD! password still works.
I figured out how to fix the Level 8 bug:

Problem: Guard becomes Jaffar.
Solution: At 0x75F6 write: EA EA EA EA

Problem: Jaffar/guard dies when the mouse appears.
Solution: At 0xD1F6 write: EA EA EA

New problem: Now the guard dies when the mouse disappears.
Solution: At 0x8BE9 write: 4C 35 F3
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: November 30th, 2019, 7:37 pm It works, if the Prince does not put his sword down on the next room. If he does and goes back, the shadow remains above.
Another way to trigger the same bug: put the sword down in the shadow's room, go left, then go back right.

To fix it: Change the shadow's action to 4 (freefall).
Post Reply