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: October 22nd, 2019, 11:00 am - A different jingle on the Princess cutscenes before and after Level 8, and
- A different jingle when time is about to run out
I chose to do these together because both are about the music of cutscenes.

At 0x14D17 write: 4C A0 FF EA
At 0x17FA0 write: C9 04 F0 04 C9 08 D0 05 A9 mm 4C 1D CD C9 05 D0 0C 20 AD CE E0 07 90 05 A9 tt 4C 1D CD A9 xx 4C 1D CD
Where:
* mm is the music ID for the mouse cutscenes before level 8 and 9.
* tt is the music ID to use when little time is left before level 12.
* xx is the music ID for the other cutscenes (except the bad ending). It's 0x11 in the original game.

In your ROM, "use cutscene of level 9 for" is set to level 12, but that's wrong, please set it to disabled.
Instead set "use cutscene of level 16 for" to level 12, because this is the cutscene that shows a different animation if there is little time left.

The definition of "little time" is: the remaining minutes are fewer than the first number in the hourglass hack here: viewtopic.php?p=26713#p26713
There I wrote that you should use the half of the original numbers; but another option is to use the numbers from the DOS version, which are 6, 17, 33, 65.
It's strange that the last number is more than the starting time.
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 »

And here is the last missing music cue:
Shauing wrote: October 22nd, 2019, 11:00 am - The brief one at the start of Level 1
At 0xEE62 write: AD 79 05 D0 03 EE 5B 05 EA
At 0xA1DA write: 4C 60 FE
At 0xFE60 write: AD 5B 05 F0 20 AD 79 05 D0 1B AD 41 05 D0 11 AD 5B 05 C9 01 D0 0B A9 mm A2 01 20 4D EA EE 5B 05 60 9C 5B 05 60 9C 5B 05 4C 7C A4
Where mm is the ID of the music you want to play.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5787
Joined: April 9th, 2009, 10:58 pm

Re: Hacking the SNES ROM

Post by Norbert »

I have to say that, after reading about all these ROM hacks that are being used, I'm looking forward to eventually - no hurry - play the mod.
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, 8:41 pm
Spoiler: show
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
Great, it works; only a very minor issue remains, I'll explain with screenshots:
Spoiler: show
Regardless of the mouse appearing or disappearing, if the guard gets close to the mouse room...
PoP1_US - 30th Anniversary Port003.png
PoP1_US - 30th Anniversary Port003.png (16.5 KiB) Viewed 30401 times
When the Prince goes to the bottom row and enters the previous room, he won't appear even though technically he's there (On the mouse room, he's technically on the first or second tile of the previous room - row 0 column 0 or 1):
PoP1_US - 30th Anniversary Port004.png
PoP1_US - 30th Anniversary Port004.png (17.45 KiB) Viewed 30401 times
PoP1_US - 30th Anniversary Port005.png
PoP1_US - 30th Anniversary Port005.png (15.52 KiB) Viewed 30401 times
If the Prince returns to this previous room at the top row and enters the mouse room, the guard will appear on the mouse room:
PoP1_US - 30th Anniversary Port006.png
PoP1_US - 30th Anniversary Port006.png (15.47 KiB) Viewed 30401 times
PoP1_US - 30th Anniversary Port009.png
PoP1_US - 30th Anniversary Port009.png (18.08 KiB) Viewed 30401 times
David wrote: November 30th, 2019, 9:56 pm
Spoiler: show
Shauing wrote: October 22nd, 2019, 11:00 am - A different jingle on the Princess cutscenes before and after Level 8, and
- A different jingle when time is about to run out
I chose to do these together because both are about the music of cutscenes.

At 0x14D17 write: 4C A0 FF EA
At 0x17FA0 write: C9 04 F0 04 C9 08 D0 05 A9 mm 4C 1D CD C9 05 D0 0C 20 AD CE E0 07 90 05 A9 tt 4C 1D CD A9 xx 4C 1D CD
Where:
* mm is the music ID for the mouse cutscenes before level 8 and 9.
* tt is the music ID to use when little time is left before level 12.
* xx is the music ID for the other cutscenes (except the bad ending). It's 0x11 in the original game.

In your ROM, "use cutscene of level 9 for" is set to level 12, but that's wrong, please set it to disabled.
Instead set "use cutscene of level 16 for" to level 12, because this is the cutscene that shows a different animation if there is little time left.

The definition of "little time" is: the remaining minutes are fewer than the first number in the hourglass hack here: viewtopic.php?p=26713#p26713
There I wrote that you should use the half of the original numbers; but another option is to use the numbers from the DOS version, which are 6, 17, 33, 65.
It's strange that the last number is more than the starting time.
David wrote: November 30th, 2019, 11:14 pm And here is the last missing music cue:
Spoiler: show
Shauing wrote: October 22nd, 2019, 11:00 am - The brief one at the start of Level 1
At 0xEE62 write: AD 79 05 D0 03 EE 5B 05 EA
At 0xA1DA write: 4C 60 FE
At 0xFE60 write: AD 5B 05 F0 20 AD 79 05 D0 1B AD 41 05 D0 11 AD 5B 05 C9 01 D0 0B A9 mm A2 01 20 4D EA EE 5B 05 60 9C 5B 05 60 9C 5B 05 4C 7C A4
Where mm is the ID of the music you want to play.
Awesome! All worked just as planned! But I forgot two cues. The good ending cutscene, and merging with Shadow. Both have different music too, and though the latter on DOS actually uses the level end music, on SNES it uses the victory fight music; thus, it is not an independent cue.
And just adding two more things (I'm really checking back and forth to make sure I'm not missing anything else).
1. On Level 10, there's a door top in combination with a floor on the starting room, but the Prince can cross it when on DOS he can't. My solution was to put a wall, but looks a bit off aesthetically. Can this be fixed?
Spoiler: show
PoP1_US - 30th Anniversary Port011.png
PoP1_US - 30th Anniversary Port011.png (16.71 KiB) Viewed 30401 times
PoP1_US - 30th Anniversary Port012.png
PoP1_US - 30th Anniversary Port012.png (16.72 KiB) Viewed 30401 times
PoP1_US - 30th Anniversary Port010.png
PoP1_US - 30th Anniversary Port010.png (17.57 KiB) Viewed 30401 times
2. Can the Prince sitting with Princess, Prince being dragged away, and the Jaffar walk scrolling scenes be skipped, in order to only have the same scenes as the original prologue on DOS?
Spoiler: show
Remove These Two Scenes.png
Remove These Two Scenes And This Scene.png
Remove These Two Scenes And This Scene.png (7.23 KiB) Viewed 30400 times
EDIT: I think I found where these are and how to deactivate them; from x18033 to x1803B, writing EA over those nine bytes. Hope I am deactivating them correctly.
This makes me wonder, the torture scene data was removed from the US ROM or is it still there? The character sprites for the scene are still there.
If it isn't there, can it be added back, taking the data from the JP rom? It won't be for this port, but probably for the next one; I would love to have this scene restored along with the text.
Norbert wrote: December 1st, 2019, 1:45 am I have to say that, after reading about all these ROM hacks that are being used, I'm looking forward to eventually - no hurry - play the mod.
I really hope you and everybody that plays it will like it. I'm really pushing to get it as close to the DOS as possible, adapting every visual/audio/gameplay aspect of the DOS into the SNES, though with some limitations that do not let me fully adapt it as I intend, but I hope all of this effort will be enough.
And maybe later at some point, I'll do a ''B version'' that utilizes the SNES environment/look and music, but with the DOS gameplay and level design, just for more variety look-wise. Who knows; for now, let's see how this one goes.
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 »

An update for one of the two forgotten cues (as I cannot edit my post above anymore - unless Falcury or another administrator can put what I wrote here at the bottom of the the post above).
I discovered that the Shadow merging music is actually independent from the victory fight music via the hacks window in the music tracks tab.
I tested a few cue changes, and discovered that some of them are labeled wrong.
The first ''Guard Defeated'' is actually the ''Shadow Merging'' music.
The ''Jaffar Defeated?'' is actually the ''Guards Defeated'' music.
The (second) ''Guard Defeated?'' is actually the ''Jaffar Defeated'' music.

And I had forgotten that Jaffar actually has a more ''grandious sounding'' victory music when he's killed, but fortunately as I mentioned above, it can be changed without needing of a hack.
So, only the good ending music is missing.
Adding a third thing I forgot I changed. On Level 11, there are loose tiles that fall on the starting room that lead to the life potion to the left of the same room, and one of those tiles falls in the start door, and erases the door sprite. Temporarily, I just made that tile a floor one but, can this be fixed somehow?
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: December 1st, 2019, 4:39 am But I forgot two cues. The good ending cutscene, and merging with Shadow.
[...]
So, only the good ending music is missing.
This hack builds on (overwrites part of) the previous hack related to cutscene music.

At 0x17FBD write:
C9 07 D0 05 A9 gg 4C 1D CD A9 xx 4C 1D CD
* gg is the music for the good ending.
* xx is the music ID for the other cutscenes. It's 0x11 in the original game.

Shauing wrote: December 4th, 2019, 9:34 pm I discovered that the Shadow merging music is actually independent from the victory fight music via the hacks window in the music tracks tab.
I tested a few cue changes, and discovered that some of them are labeled wrong.
You're right.

While I was looking at them, I found another music cue you might want to change:
When the prince (and the shadow) dies in the shadow fight, the DOS version uses the same music as when you finish level 4.
However, the SNES version uses the "death outside battle" music.
You can change this music at 0xF440.

And another one which you probably don't want to change, but I post it for the record:
The regular "death in battle" music is at 0xF43C.
Both this and the previous hack are missing from Pr1SnesLevEd.

Shauing wrote: December 1st, 2019, 4:39 am 1. On Level 10, there's a door top in combination with a floor on the starting room, but the Prince can cross it when on DOS he can't. My solution was to put a wall, but looks a bit off aesthetically. Can this be fixed?
The code in CMPBARR (01:AEA3-01:AEE0) checks for doortops (CMP #$18) only if there is no floor in the tile. This is a bug.
I'm assuming you're not using those traps which were not in the DOS version, right? (guillotine, fire, crusher, stars)
If it's so then we can change the collision checks for one of those traps into a check for door tops.

At 0xAECB write: C9 18 F0 03

Shauing wrote: December 1st, 2019, 4:39 am 2. Can the Prince sitting with Princess, Prince being dragged away, and the Jaffar walk scrolling scenes be skipped, in order to only have the same scenes as the original prologue on DOS?
[...]
EDIT: I think I found where these are and how to deactivate them; from x18033 to x1803B, writing EA over those nine bytes. Hope I am deactivating them correctly.
Yes, that's correct.
You found this from the disassembly, right?

Shauing wrote: December 1st, 2019, 4:39 am This makes me wonder, the torture scene data was removed from the US ROM or is it still there? The character sprites for the scene are still there.
If it isn't there, can it be added back, taking the data from the JP rom? It won't be for this port, but probably for the next one; I would love to have this scene restored along with the text.
There is a patch which restores the torture scene (and other removed elements) from the Japanese ROM into the US/EU ROM:
The patch on RomHacking: https://www.romhacking.net/hacks/3603/
The patched ROMs on Princed: viewtopic.php?p=23366#p23366

Shauing wrote: December 4th, 2019, 9:34 pm On Level 11, there are loose tiles that fall on the starting room that lead to the life potion to the left of the same room, and one of those tiles falls in the start door, and erases the door sprite. Temporarily, I just made that tile a floor one but, can this be fixed somehow?
At 0xDC0E write: C9 24 F0 23
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: December 7th, 2019, 1:22 pm
Spoiler: show
Shauing wrote: December 1st, 2019, 4:39 am But I forgot two cues. The good ending cutscene, and merging with Shadow.
[...]
So, only the good ending music is missing.
This hack builds on (overwrites part of) the previous hack related to cutscene music.

At 0x17FBD write:
C9 07 D0 05 A9 gg 4C 1D CD A9 xx 4C 1D CD
* gg is the music for the good ending.
* xx is the music ID for the other cutscenes. It's 0x11 in the original game.
Great! Only a minor goof I realized when comparing back to back the cutscenes. The bad ending cutscene has a fade-in, the good ending does not. We removed the effects on both with one hack:
Spoiler: show
(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)
Only we need to restore only the fade-in for the bad ending cutscene only.

An oddity related to music cues appeared while testing with the SPCCMD! password, the Level 1 short intro cue does not play if selected from the Level Select screen.

Talking about that Level Select screen also, can the Levels 15-20 be erased and/or deactivated from this screen?
David wrote: December 7th, 2019, 1:22 pm
Spoiler: show
Shauing wrote: December 4th, 2019, 9:34 pm I discovered that the Shadow merging music is actually independent from the victory fight music via the hacks window in the music tracks tab.
I tested a few cue changes, and discovered that some of them are labeled wrong.
You're right.

While I was looking at them, I found another music cue you might want to change:
When the prince (and the shadow) dies in the shadow fight, the DOS version uses the same music as when you finish level 4.
However, the SNES version uses the "death outside battle" music.
You can change this music at 0xF440.
True! Forgot that cue as well. Good thing that it is also an independent cue on SNES.
David wrote: December 7th, 2019, 1:22 pm And another one which you probably don't want to change, but I post it for the record:
The regular "death in battle" music is at 0xF43C.
Both this and the previous hack are missing from Pr1SnesLevEd.
I swore that both death music cues were on the Hacks window, but you're right, only ''Death (2)'' is there.
David wrote: December 7th, 2019, 1:22 pm
Shauing wrote: December 1st, 2019, 4:39 am 1. On Level 10, there's a door top in combination with a floor on the starting room, but the Prince can cross it when on DOS he can't. My solution was to put a wall, but looks a bit off aesthetically. Can this be fixed?
The code in CMPBARR (01:AEA3-01:AEE0) checks for doortops (CMP #$18) only if there is no floor in the tile. This is a bug.
I'm assuming you're not using those traps which were not in the DOS version, right? (guillotine, fire, crusher, stars)
If it's so then we can change the collision checks for one of those traps into a check for door tops.


At 0xAECB write: C9 18 F0 03
Yes, none of those traps are being used. Niiice. A curiosity, if all traps available were to be used on another mod and want to apply this hack, how could it be done?
David wrote: December 7th, 2019, 1:22 pm
Spoiler: show
Shauing wrote: December 1st, 2019, 4:39 am 2. Can the Prince sitting with Princess, Prince being dragged away, and the Jaffar walk scrolling scenes be skipped, in order to only have the same scenes as the original prologue on DOS?
[...]
EDIT: I think I found where these are and how to deactivate them; from x18033 to x1803B, writing EA over those nine bytes. Hope I am deactivating them correctly.
Yes, that's correct.
You found this from the disassembly, right?
Correct. At the first search, I found sprite pointers for those cutscenes, but later I did found the actual cutscene pointers.
David wrote: December 7th, 2019, 1:22 pm
Spoiler: show
Shauing wrote: December 1st, 2019, 4:39 am This makes me wonder, the torture scene data was removed from the US ROM or is it still there? The character sprites for the scene are still there.
If it isn't there, can it be added back, taking the data from the JP rom? It won't be for this port, but probably for the next one; I would love to have this scene restored along with the text.
There is a patch which restores the torture scene (and other removed elements) from the Japanese ROM into the US/EU ROM:
The patch on RomHacking: https://www.romhacking.net/hacks/3603/
The patched ROMs on Princed: viewtopic.php?p=23366#p23366
I had seen that one some time ago, but misremembered that the cutscenes were off-sync with the music versus the Japanese version. I re-compared it back to back and it is actually in sync with the Japanese one. The only very very minor thing is that the text is no longer centered. Can this be fixed?
David wrote: December 7th, 2019, 1:22 pm
Spoiler: show
Shauing wrote: December 4th, 2019, 9:34 pm On Level 11, there are loose tiles that fall on the starting room that lead to the life potion to the left of the same room, and one of those tiles falls in the start door, and erases the door sprite. Temporarily, I just made that tile a floor one but, can this be fixed somehow?
At 0xDC0E write: C9 24 F0 23
Cool, though the tile that falls disappears instead of converting to debris.
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: December 7th, 2019, 6:50 pm Great! Only a minor goof I realized when comparing back to back the cutscenes. The bad ending cutscene has a fade-in, the good ending does not. We removed the effects on both with one hack:

(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)

Only we need to restore only the fade-in for the bad ending cutscene only.
At 0xFF30 write: 22 5A B4 02 AD 84 0A C9 07 D0 08 A9 0F 8D 16 02 8D 1A 02 6B

Shauing wrote: December 7th, 2019, 6:50 pm An oddity related to music cues appeared while testing with the SPCCMD! password, the Level 1 short intro cue does not play if selected from the Level Select screen.
I copied the logic from the DOS version.
The same happens in the DOS version if you use Shift+L to go from level 14 to level 1.
Maybe I'll look into it.

Shauing wrote: December 7th, 2019, 6:50 pm Talking about that Level Select screen also, can the Levels 15-20 be erased and/or deactivated from this screen?
At 0x16724 write: 05
At 0x16747 write: 05
At 0x16753 write: 04
At 0x16754 write: F0 1C
At 0x16772 write: A9 0A 80 E2

Shauing wrote: December 7th, 2019, 6:50 pm (door top fix)
A curiosity, if all traps available were to be used on another mod and want to apply this hack, how could it be done?
At 0xAEA3 write: C9 02 F0 31
At 0xAEAC write: EA EA EA EA EA EA EA

Shauing wrote: December 7th, 2019, 6:50 pm (uncensored version)
The only very very minor thing is that the text is no longer centered. Can this be fixed?
The vertical position of each text is given by a byte before the text.
The offsets of the bytes are: 0x18257, 0x182B5, 0x18658, 0x189C8, 0x194AB, 0x19510, 0x1958D, 0x1FF00, 0x1FF7F.

A bigger number will move the text up, a smaller number will move the text down.
In the original game, the number is always the number of lines in the text, including the blank lines as well.

So you should use these numbers:
0x18257: 05
0x182B5: 07
0x18658: 05
0x189C8: 05
0x194AB: 05
0x19510: 07
0x1958D: 05
0x1FF00: 07
0x1FF7F: 05

Some texts were also moved horizontally by changing the number of spaces at the beginning of the lines:
In the original game, the "On Jaffar's orders" and "Little does she know" texts use two spaces for the left margin, while all the other texts use only one space.
In the uncensored version, all the texts uniformly use one space.

Another thing about spaces: The original game has spaces at the end of every line (except the last line of each text), but the uncensored version removed these.

While at it, the uncensored version changes "the Princess's heart" to "the Princess' heart".
I don't think the new version is correct.

It also changes "daughter..." (3 dots) into "daughter....." (5 dots).
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: December 8th, 2019, 2:39 pm
Spoiler: show
Shauing wrote: December 7th, 2019, 6:50 pm Great! Only a minor goof I realized when comparing back to back the cutscenes. The bad ending cutscene has a fade-in, the good ending does not. We removed the effects on both with one hack:

(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)

Only we need to restore only the fade-in for the bad ending cutscene only.
At 0xFF30 write: 22 5A B4 02 AD 84 0A C9 07 D0 08 A9 0F 8D 16 02 8D 1A 02 6B
Great. Thanks.
David wrote: December 8th, 2019, 2:39 pm
Spoiler: show
Shauing wrote: December 7th, 2019, 6:50 pm An oddity related to music cues appeared while testing with the SPCCMD! password, the Level 1 short intro cue does not play if selected from the Level Select screen.
I copied the logic from the DOS version.
The same happens in the DOS version if you use Shift+L to go from level 14 to level 1.
Maybe I'll look into it.
Didn't know you could go from Level 14 to Level 1 using Shift+L, Interesting. If there's a possible solution, I will appreciate it.
David wrote: December 8th, 2019, 2:39 pm
Spoiler: show
Shauing wrote: December 7th, 2019, 6:50 pm Talking about that Level Select screen also, can the Levels 15-20 be erased and/or deactivated from this screen?
At 0x16724 write: 05
At 0x16747 write: 05
At 0x16753 write: 04
At 0x16754 write: F0 1C
At 0x16772 write: A9 0A 80 E2
Thank you! I did some experimentation to see if I could remove the Levels from said screen up to Level 10, and managed to do it. This is for the Queen Of Light mod, if I ever finish the v3.0. I'm preparing a walkthrough of it as it has been almost a year since its original release.
David wrote: December 8th, 2019, 2:39 pm
Spoiler: show
Shauing wrote: December 7th, 2019, 6:50 pm (door top fix)
A curiosity, if all traps available were to be used on another mod and want to apply this hack, how could it be done?
At 0xAEA3 write: C9 02 F0 31
At 0xAEAC write: EA EA EA EA EA EA EA
Awesome. A graphical bug exists on both cases though if the Prince climbs from the right to the floor tile above: the Prince will be ''inside'' the door top sprite. I might have to remove the falling tile if I want to preserve this door top hack. Also, the Layer 2 sprite that's used to display the door top lacks the top corners, so if the loose tile falls, it reveals that the door top sprite is incomplete, and as Layer 2 tiles can't be flipped, the only other solution was to put a Layer 2 wall sprite, but the Prince inside the door top sprite bug is still there.
David wrote: December 8th, 2019, 2:39 pm
Spoiler: show
Shauing wrote: December 7th, 2019, 6:50 pm (uncensored version)
The only very very minor thing is that the text is no longer centered. Can this be fixed?
The vertical position of each text is given by a byte before the text.
The offsets of the bytes are: 0x18257, 0x182B5, 0x18658, 0x189C8, 0x194AB, 0x19510, 0x1958D, 0x1FF00, 0x1FF7F.

A bigger number will move the text up, a smaller number will move the text down.
In the original game, the number is always the number of lines in the text, including the blank lines as well.

So you should use these numbers:
0x18257: 05
0x182B5: 07
0x18658: 05
0x189C8: 05
0x194AB: 05
0x19510: 07
0x1958D: 05
0x1FF00: 07
0x1FF7F: 05
Awesome. I wonder how many lines can it fit, given that there is limited space to write as well.
As an aside note, I noticed that at 0x18092 is changed to a new pointer (02 20 6C FF) where the missing lines are located. This addition is enough to reactivate the censored cutscenes, as I copied this on an unedited US copy, and it worked. So, it is seems that the scenes were just deactivated though I'm not sure where the data of the original pointer is and what it does (00 20 A6 80).
David wrote: December 8th, 2019, 2:39 pm Some texts were also moved horizontally by changing the number of spaces at the beginning of the lines:
In the original game, the "On Jaffar's orders" and "Little does she know" texts use two spaces for the left margin, while all the other texts use only one space.
In the uncensored version, all the texts uniformly use one space.

Another thing about spaces: The original game has spaces at the end of every line (except the last line of each text), but the uncensored version removed these.

While at it, the uncensored version changes "the Princess's heart" to "the Princess' heart".
I don't think the new version is correct.

It also changes "daughter..." (3 dots) into "daughter....." (5 dots).
Noticed that, wonder why they did all of that.
''The Princess' heart'' seems to be a pointless change unless they ran out of space.


I need to solve an issue with the title screen cutscene.

As I am now implementing the music, I realized that the "Prince of Persia" title appears as soon as the cutscene starts, instead of a few seconds later like the DOS version. Is there a way to delay said title apparition? This will help with syncing the music correctly by the time the Princess meets Jaffar cutscene plays, instead of making the music faster than the original in order to reach sync with the Princess cutscene.

Also, when the demo plays the ''60 minutes left'' text prompt appears. Can it be removed?
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 »

Shauing wrote: December 8th, 2019, 5:59 pm I need to solve an issue with the title screen cutscene.

As I am now implementing the music, I realized that the "Prince of Persia" title appears as soon as the cutscene starts, instead of a few seconds later like the DOS version. Is there a way to delay said title apparition? This will help with syncing the music correctly by the time the Princess meets Jaffar cutscene plays, instead of making the music faster than the original in order to reach sync with the Princess cutscene.
I should also ask if it's possible to manipulate the length of each scene and text, and perhaps as well sprite animations. I'm noticing that SNES goes fast, and unless the music is sped up, it won't go in sync to the DOS version. Ironically, both prologues music last exactly 1:48 (without looping back to the beginning for the SNES)
Spoiler: show
(Implementing the music is HARD...Good thing only the prologue and ending music are the longest ones, otherwise it would be a nightmare to fit them all in the limited space of each SNES song)
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: December 8th, 2019, 5:59 pm (level 1 music cue)
Didn't know you could go from Level 14 to Level 1 using Shift+L, Interesting. If there's a possible solution, I will appreciate it.
At 0xEE62 write back what was there: 8D 7D 05 8D 5A 05 8D 1A 05
At 0xED77 write: 20 50 FE
At 0xFE50 write: 8D 5B 05 2C 79 05 D0 03 EE 5B 05 60

The remaining parts are the same as for the older hack:
At 0xA1DA write: 4C 60 FE
At 0xFE60 write: AD 5B 05 F0 20 AD 79 05 D0 1B AD 41 05 D0 11 AD 5B 05 C9 01 D0 0B A9 mm A2 01 20 4D EA EE 5B 05 60 9C 5B 05 60 9C 5B 05 4C 7C A4
Where mm is the ID of the music you want to play.

Shauing wrote: December 8th, 2019, 5:59 pm (uncensored version)
As an aside note, I noticed that at 0x18092 is changed to a new pointer (02 20 6C FF) where the missing lines are located. This addition is enough to reactivate the censored cutscenes, as I copied this on an unedited US copy, and it worked. So, it is seems that the scenes were just deactivated though I'm not sure where the data of the original pointer is and what it does (00 20 A6 80).
Not exactly.
What restores the torture scenes is at 0x18039: 20 96 90 is changed to 20 75 FF.
And of course you need the extra code at 0x1FF00-0x1FFDF.

Then there are these changes:
0x180ED: A2 27 83 -> A2 00 FF
0x19028: A2 43 90 -> A2 7F FF
These give the location of the newly added texts.
The original locations (0x18327 and 0x19043) have just some zero bytes, i.e. empty texts.

There are two more changes:
0x186AD: 78 -> A7
0x18A2A: 96 -> A2
I don't know what these do.

Shauing wrote: December 8th, 2019, 5:59 pm Also, when the demo plays the ''60 minutes left'' text prompt appears. Can it be removed?
When? I don't see that in the ROM you sent me in PM.
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: December 14th, 2019, 2:13 pm
Shauing wrote: December 8th, 2019, 5:59 pm (level 1 music cue)
Didn't know you could go from Level 14 to Level 1 using Shift+L, Interesting. If there's a possible solution, I will appreciate it.
At 0xEE62 write back what was there: 8D 7D 05 8D 5A 05 8D 1A 05
At 0xED77 write: 20 50 FE
At 0xFE50 write: 8D 5B 05 2C 79 05 D0 03 EE 5B 05 60

The remaining parts are the same as for the older hack:
At 0xA1DA write: 4C 60 FE
At 0xFE60 write: AD 5B 05 F0 20 AD 79 05 D0 1B AD 41 05 D0 11 AD 5B 05 C9 01 D0 0B A9 mm A2 01 20 4D EA EE 5B 05 60 9C 5B 05 60 9C 5B 05 4C 7C A4
Where mm is the ID of the music you want to play.
David wrote: December 14th, 2019, 2:13 pm
Shauing wrote: December 8th, 2019, 5:59 pm Also, when the demo plays the ''60 minutes left'' text prompt appears. Can it be removed?
When? I don't see that in the ROM you sent me in PM.
60minutesdemo.png
60minutesdemo.png (9.27 KiB) Viewed 30230 times
The original hack for Level 1 music cue triggered the ''60 minutes left'' prompt at the very beginning of the demo, but this new addition fixed it.

This reminds me, can the ''minutes left'' prompt be removed from Level 14? It does not appear on DOS.
David wrote: December 14th, 2019, 2:13 pm
Spoiler: show
Shauing wrote: December 8th, 2019, 5:59 pm (uncensored version)
As an aside note, I noticed that at 0x18092 is changed to a new pointer (02 20 6C FF) where the missing lines are located. This addition is enough to reactivate the censored cutscenes, as I copied this on an unedited US copy, and it worked. So, it is seems that the scenes were just deactivated though I'm not sure where the data of the original pointer is and what it does (00 20 A6 80).
Not exactly.
What restores the torture scenes is at 0x18039: 20 96 90 is changed to 20 75 FF.
And of course you need the extra code at 0x1FF00-0x1FFDF.
When I put the 20 75 FF on its own it didn't do nothing, but adding the extra code did activate the cutscene.
David wrote: December 14th, 2019, 2:13 pm Then there are these changes:
0x180ED: A2 27 83 -> A2 00 FF
0x19028: A2 43 90 -> A2 7F FF
These give the location of the newly added texts.
The original locations (0x18327 and 0x19043) have just some zero bytes, i.e. empty texts.

There are two more changes:
0x186AD: 78 -> A7
0x18A2A: 96 -> A2
I don't know what these do.
I see that its just two zero bytes, I expected a bigger wall of zeros. Curious, how many new texts can be added?
So what the original 00 20 A6 80 pointer leads to? Nothing?

Talking about the texts, I had to expand slightly the ''Jaffar gives her a choice...'' text to four lines. But the next text does not appear ''Locked in her room...'' and a few seconds later the ''Little does she know...'' text appears. I think I'm missing a pointer to indicate where the ''Locked...'' text starts; also I need to remove the last text, as only two are needed instead of three, thus the cutscene should fade out and end after the second text.
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: December 8th, 2019, 5:59 pm As I am now implementing the music, I realized that the "Prince of Persia" title appears as soon as the cutscene starts, instead of a few seconds later like the DOS version. Is there a way to delay said title apparition?
a) Delay specified in one byte.
At 0x19657 write: 20 F0 FF
At 0x1FFF0 write: A9 ww 20 63 AA 4C 66 97
Where ww is the number of frames to wait, in hex.

One frame is 1/60 of a second, so the maximum possible delay with this hack is 255 frames / 60 fps = 4.25 seconds.
If that's not enough then use hack b) instead.

b) Delay specified in two bytes.
At 0x19657 write: 20 E0 FF
At 0x1FFE0 write: C2 20 A9 ww ww 48 E2 20 A9 01 20 63 AA C2 20 68 3A D0 F2 E2 20 4C 66 97
Where ww ww is the number of frames to wait, in hex, with the two bytes swapped as usual.

This time, the maximum possible delay is 65535 frames / 60 fps = 1092,25 seconds ~ 18 minutes.

Shauing wrote: December 14th, 2019, 5:21 am I should also ask if it's possible to manipulate the length of each scene and text, and perhaps as well sprite animations.
The wait time for the texts on the sky+moon background is at 0x180BD.
The wait time for the texts after the princess scene is at 0x19400.
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: December 14th, 2019, 5:56 pm This reminds me, can the ''minutes left'' prompt be removed from Level 14? It does not appear on DOS.
In the ROM you sent me, it does not appear automatically when I start level 14.
It appears only I ask for it by pressing button Y.

The byte at 0xE9C2 specifies the first level which should not show the minutes left when you start it.
It's 0x0D in the ROM you sent me. (0x0D = 13 means level 14.)

Shauing wrote: December 14th, 2019, 5:56 pm Talking about the texts, I had to expand slightly the ''Jaffar gives her a choice...'' text to four lines.
But the next text does not appear ''Locked in her room...'' and a few seconds later the ''Little does she know...'' text appears.
I think I'm missing a pointer to indicate where the ''Locked...'' text starts;
also I need to remove the last text, as only two are needed instead of three, thus the cutscene should fade out and end after the second text.
The offset to the "Locked in her room" text is at 0x19429-0x1942A.
(The default is 10 95 i.e. 0x9510 which means 0x19510.)
Note that text pointers must point to the byte telling the number of lines, just before the text.

To remove text 3:
At 0x193D4 write EA EA EA EA EA A9 01.
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: December 20th, 2019, 2:14 pm
Shauing wrote: December 14th, 2019, 5:56 pm This reminds me, can the ''minutes left'' prompt be removed from Level 14? It does not appear on DOS.
In the ROM you sent me, it does not appear automatically when I start level 14.
It appears only I ask for it by pressing button Y.

The byte at 0xE9C2 specifies the first level which should not show the minutes left when you start it.
It's 0x0D in the ROM you sent me. (0x0D = 13 means level 14.)
For me in the ROM I sent to you and the current one, it is still appearing even when the byte at 0xE9C2 is 0x0D; I even wrote 0C or 0B and it still appears on Levels 12 and 13; perhaps something in the hacks tab is wrong? There's a new link with the latest ROM on the description of the same Level 8 bug video I sent to you on PM on Nov. 23rd (it has all the latest hacks implemented, except the text and title delay ones, those are yet to be implemented as I haven't finished the writing of the title music on all channels - I have written four channels at the time of this writing).
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
Post Reply