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 13th, 2019, 3:56 pm I've changed and tested all guards skills to match the DOS one, and it mostly worked.
I found an issue with the guards I had to change sprites with the brown and golden skeleton respectively; as they still behave like skeletons, they display some wrong sprites, and in the case of the brown skeleton, it doesn't have a hitpoints despite adding them, and cannot die but only knock it out for a few seconds before rising up again.
Can those two skeletons, plus the monster be changed to have guards behavior? Or can more guard types be added?
Here is how to disable special behavior for specific guard types:
At 0x8A24 write: CC (skeleton)
At 0x8A28 write: CC (brown skeleton)
At 0x8A32 write: CC (golden skeleton)
At 0x8A3C write: CC (amazon)
At 0x8A46 write: CC (shadow)
At 0x8A50 write: CC (monster)
At 0x8A5A write: CC (fat)
At 0x8A5E write: CC (red knight)
At 0x8A62 write: CC (blue knight)
Shauing wrote: October 7th, 2019, 6:07 am 3. On Level 7, is it possible that the Prince falling intro starts off-screen like on the DOS version? I can only put him fall either from row 0 of the same room where he has to grab the ledge, or on the second row of the room above, but in this case you can see him in said above room for a small glimpse.
I wonder why the developers of the SNES PoP didn't include this effect.

Yesterday I tried to make a hack for this.
But with the hack I found, the prince can't grab ledges and falls through floors!
So I still need to work on this one...
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 7th, 2019, 6:07 am 2. Jaffar being killed on the final level should open the final door, and he does but only when killed by the sword. If he falls, it doesn't open the final door.
Yes, the game does not open boss gates if the boss dies from anything other than the sword. (For example, falling out of the room or traps.)
This was mentioned before: viewtopic.php?p=22820#p22820

To trigger gates/doors by any kind of death:
At 0xE199 write: 20 C0 FF
At 0xFFC0 write: 20 B0 AD AD 79 05 60
At 0xADB0 write: AD 84 04
Shauing wrote: October 7th, 2019, 6:07 am Also, I added the flash when he's killed and turned off the stun, but the level music didn't play again.
At 0xE1B7 write: 01

I can't try this one directly, however I believe this to be the solution, because:
There are two calls to cuesong for playing the guard death music.
One is for Jaffar, the other is for other guards.
LDX is followed by 01 for regular guards and 02 for Jaffar.
If I change the byte at 0xE1AF (LDX for other guards) from 01 to 02 then level music stops after regular guard deaths as well.
So probably the number after LDX decides whether to resume level music after playing the specified music.
So we need to change that number from 02 to 01 at 0xE1B7 (LDX for Jaffar).

The relevant part of the disassembly:

Code: Select all

01:E1AC: a9 1d       LDA #$1d
01:E1AE: a2 01       LDX #$01
01:E1B0: 20 4d ea    JSR $ea4d ; play music A ; cuesong
01:E1B3: 60          RTS

Jaffar died:
01:E1B4: a9 1d       LDA #$1d
01:E1B6: a2 02       LDX #$02
01:E1B8: 20 4d ea    JSR $ea4d ; play music A ; cuesong
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: October 13th, 2019, 5:28 pm
Spoiler: show
Shauing wrote: October 13th, 2019, 3:56 pm I've changed and tested all guards skills to match the DOS one, and it mostly worked.
I found an issue with the guards I had to change sprites with the brown and golden skeleton respectively; as they still behave like skeletons, they display some wrong sprites, and in the case of the brown skeleton, it doesn't have a hitpoints despite adding them, and cannot die but only knock it out for a few seconds before rising up again.
Can those two skeletons, plus the monster be changed to have guards behavior? Or can more guard types be added?
Here is how to disable special behavior for specific guard types:
At 0x8A24 write: CC (skeleton)
At 0x8A28 write: CC (brown skeleton)
At 0x8A32 write: CC (golden skeleton)
At 0x8A3C write: CC (amazon)
At 0x8A46 write: CC (shadow)
At 0x8A50 write: CC (monster)
At 0x8A5A write: CC (fat)
At 0x8A5E write: CC (red knight)
At 0x8A62 write: CC (blue knight)
Good! Thanks. I really needed the monster, because there are two different palettes for one of the guard types on the DOS version, and I have already used all the other guards.
David wrote: October 13th, 2019, 5:28 pm
Spoiler: show
Shauing wrote: October 7th, 2019, 6:07 am 3. On Level 7, is it possible that the Prince falling intro starts off-screen like on the DOS version? I can only put him fall either from row 0 of the same room where he has to grab the ledge, or on the second row of the room above, but in this case you can see him in said above room for a small glimpse.
I wonder why the developers of the SNES PoP didn't include this effect.

Yesterday I tried to make a hack for this.
But with the hack I found, the prince can't grab ledges and falls through floors!
So I still need to work on this one...
The closest I got was the second option I mentioned, but you can see a glimpse of the Prince in the above room. Perhaps some way to not display the above room if no hack applied to the Prince can be done?
David wrote: October 13th, 2019, 6:12 pm
Spoiler: show
Shauing wrote: October 7th, 2019, 6:07 am 2. Jaffar being killed on the final level should open the final door, and he does but only when killed by the sword. If he falls, it doesn't open the final door.
Yes, the game does not open boss gates if the boss dies from anything other than the sword. (For example, falling out of the room or traps.)
This was mentioned before: viewtopic.php?p=22820#p22820

To trigger gates/doors by any kind of death:
At 0xE199 write: 20 C0 FF
At 0xFFC0 write: 20 B0 AD AD 79 05 60
At 0xADB0 write: AD 84 04
David wrote: October 13th, 2019, 6:12 pm
Spoiler: show
Shauing wrote: October 7th, 2019, 6:07 am Also, I added the flash when he's killed and turned off the stun, but the level music didn't play again.
At 0xE1B7 write: 01

I can't try this one directly, however I believe this to be the solution, because:
There are two calls to cuesong for playing the guard death music.
One is for Jaffar, the other is for other guards.
LDX is followed by 01 for regular guards and 02 for Jaffar.
If I change the byte at 0xE1AF (LDX for other guards) from 01 to 02 then level music stops after regular guard deaths as well.
So probably the number after LDX decides whether to resume level music after playing the specified music.
So we need to change that number from 02 to 01 at 0xE1B7 (LDX for Jaffar).

The relevant part of the disassembly:

Code: Select all

01:E1AC: a9 1d       LDA #$1d
01:E1AE: a2 01       LDX #$01
01:E1B0: 20 4d ea    JSR $ea4d ; play music A ; cuesong
01:E1B3: 60          RTS

Jaffar died:
01:E1B4: a9 1d       LDA #$1d
01:E1B6: a2 02       LDX #$02
01:E1B8: 20 4d ea    JSR $ea4d ; play music A ; cuesong
I'll test these and inform you back in a moment.
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: October 13th, 2019, 6:12 pm
Spoiler: show
Shauing wrote: October 7th, 2019, 6:07 am 2. Jaffar being killed on the final level should open the final door, and he does but only when killed by the sword. If he falls, it doesn't open the final door.
Yes, the game does not open boss gates if the boss dies from anything other than the sword. (For example, falling out of the room or traps.)
This was mentioned before: viewtopic.php?p=22820#p22820

To trigger gates/doors by any kind of death:
At 0xE199 write: 20 C0 FF
At 0xFFC0 write: 20 B0 AD AD 79 05 60
At 0xADB0 write: AD 84 04
Shauing wrote: October 7th, 2019, 6:07 am Also, I added the flash when he's killed and turned off the stun, but the level music didn't play again.
At 0xE1B7 write: 01

I can't try this one directly, however I believe this to be the solution, because:
There are two calls to cuesong for playing the guard death music.
One is for Jaffar, the other is for other guards.
LDX is followed by 01 for regular guards and 02 for Jaffar.
If I change the byte at 0xE1AF (LDX for other guards) from 01 to 02 then level music stops after regular guard deaths as well.
So probably the number after LDX decides whether to resume level music after playing the specified music.
So we need to change that number from 02 to 01 at 0xE1B7 (LDX for Jaffar).

The relevant part of the disassembly:

Code: Select all

01:E1AC: a9 1d       LDA #$1d
01:E1AE: a2 01       LDX #$01
01:E1B0: 20 4d ea    JSR $ea4d ; play music A ; cuesong
01:E1B3: 60          RTS

Jaffar died:
01:E1B4: a9 1d       LDA #$1d
01:E1B6: a2 02       LDX #$02
01:E1B8: 20 4d ea    JSR $ea4d ; play music A ; cuesong

Both worked. But perhaps because the first hack opens any kind of gate/door, it doesn't play the ''level door end open'' jingle. It's a minor thing.

Another minor thing: when going to Level 14 from Level 13, it starts with the teleport effect. Perhaps it's due to the flash trigger?:

Code: Select all

flash: Jaffar died:
01:E1BB: a9 7f       LDA #$7f
01:E1BD: 8d c4 04    STA $04c4 ; flash color ; lightcolor
01:E1C0: a9 0a       LDA #$0a
01:E1C2: 8d c3 04    STA $04c3 ; flash count ; lightning
01:E1C5: a9 01       LDA #$01
01:E1C7: 8d c1 04    STA $04c1 ; exit open / special event flag
01:E1CA: a9 04       LDA #$04
01:E1CC: 8d 47 05    STA $0547 ; is show time
01:E1CF: a9 ff       LDA #$ff
01:E1D1: 8d b5 04    STA $04b5 ; teleport back? (Jaffar)
01:E1D4: 4c 04 d2    JMP $d204 ; stun? on
As I said, I rarely venture myself to do this stuff, so I'm not sure if what I did is correct (I play tested it and worked fine plus it didn't seem to break anything else):
I wrote EA EA EA on offset 0xE1D1, and incidentally, my hack to put the stun off was by writing 4C 0A D2 on offset 0xE1D4.
At least 4C 0A D2 appears on a couple of places on the disassembly where it's used as ''stun? off''
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 »

Adding a small issue I found while playtesting again. As I'm using all type guards, I changed the palette of the 'dead' guard as well. (EDIT: I Changed it on the Guards tab, settings option.) But in doing so, it also modified the mouse's palette appearance on Level 8! On the cutscenes it does appear with its correct palette.
Last edited by Shauing on October 17th, 2019, 9:33 pm, edited 1 time in total.
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
4DPlayer

Re: Hacking the SNES ROM

Post by 4DPlayer »

Shauing wrote: October 17th, 2019, 8:26 am Adding a small issue I found while playtesting again. As I'm using all type guards, I changed the palette of the 'dead' guard as well. But in doing so, it also modified the mouse's palette appearance on Level 8! On the cutscenes it does appear with its correct palette.
Maybe this post can help.
Kaslghnoon wrote: June 21st, 2013, 9:18 am Well done Robert, just replace "red prince" with "dead purple" and your info is completely accurate.

Palette $00 is dead purple by default. If you made any guard palette changes using Pr1SnesLevEd it will also be applied here.

Normal Prince and blue prince ($5C) are available. Red Prince is not available to be used in Uniform Guards unless:
A) Using Pr1SnesLevEd, you change a guard's palette to 1
B) You carefully add a $01 somewhere in the x75A0-x769F region

--

Mouse palette:

x760E decides which palette is used for the mouse. If you happen to find a suitable palette for the mouse among the values $13-$FF and set x760E to that value, then the guard "dead" and the mouse will no longer share a palette.
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

4DPlayer wrote: October 17th, 2019, 3:40 pm
Maybe this post can help.
Spoiler: show
Kaslghnoon wrote: June 21st, 2013, 9:18 am Well done Robert, just replace "red prince" with "dead purple" and your info is completely accurate.

Palette $00 is dead purple by default. If you made any guard palette changes using Pr1SnesLevEd it will also be applied here.

Normal Prince and blue prince ($5C) are available. Red Prince is not available to be used in Uniform Guards unless:
A) Using Pr1SnesLevEd, you change a guard's palette to 1
B) You carefully add a $01 somewhere in the x75A0-x769F region

--

Mouse palette:

x760E decides which palette is used for the mouse. If you happen to find a suitable palette for the mouse among the values $13-$FF and set x760E to that value, then the guard "dead" and the mouse will no longer share a palette.

There must be a better solution, the mouse palette cannot be used if I change the 'dead' guard one.
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
4DPlayer

Re: Hacking the SNES ROM

Post by 4DPlayer »

Shauing wrote: October 17th, 2019, 10:23 pm
4DPlayer wrote: October 17th, 2019, 3:40 pm
Maybe this post can help.
Spoiler: show
Kaslghnoon wrote: June 21st, 2013, 9:18 am Well done Robert, just replace "red prince" with "dead purple" and your info is completely accurate.

Palette $00 is dead purple by default. If you made any guard palette changes using Pr1SnesLevEd it will also be applied here.

Normal Prince and blue prince ($5C) are available. Red Prince is not available to be used in Uniform Guards unless:
A) Using Pr1SnesLevEd, you change a guard's palette to 1
B) You carefully add a $01 somewhere in the x75A0-x769F region

--

Mouse palette:

x760E decides which palette is used for the mouse. If you happen to find a suitable palette for the mouse among the values $13-$FF and set x760E to that value, then the guard "dead" and the mouse will no longer share a palette.

There must be a better solution, the mouse palette cannot be used if I change the 'dead' guard one.
Oh, ok.
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

Well, I followed what 4DPlayer quoted of Kaslghnoon and used a different palette for the mouse that for this mod it went unused as I changed every guard type and palette to the normal guard.

I have changed the palettes of all enemy sprites now, though there are a few guards that use a different palette but have the same skill, and I don't have more guards to use.

I'm still unsure if to mute the levels music like the DOS version. If I do so, I'll try to adapt the original DOS jingles/music, but this might take quite some time.

I'm still playtesting, and there's still some few fixes I need to do before considering the mod as ''complete and ready for release'':
1. It seems that literally, the ''open any gate/door by any kind of death'' hack also includes the Prince as, if he's killed by Jaffar, his death also opens the final door.

2. If I do adapt the DOS music, there are a few pieces that normally don't play on the SNES version, such as:
- The brief one at the start of Level 1
- The different ending of the ''level completed'' jingle after finishing Level 4
- A different jingle on the Princess cutscenes before and after Level 8, and
- A different jingle when time is about to run out
If I'm not wrong, each music in the game has some trigger decides which music will play and when. If I do mute the music during levels, I could perhaps replace all that data with these new pieces and I'll just need a hack to indicate when and what tune will play.
2.1. Is it possible to jump to the bad ending when time runs out? The SNES version lets you continue, but the DOS doesn't.
2.2 Can some exits have the jingle muted/off such as Level 6, 12 and 13, and have the pixelating (mosaic I think it's called in the disassembly) and fade-out effects removed on those levels as well?

3. Perhaps optional, but as the timer is changed to 60 minutes, the hourglass during the Princess's cutscenes does not display the right amount of sand left; it starts at the halfway point instead of full. Only on the prologue and ending it displays both the full and empty hourglasses correctly.

4. Maybe optional as well; as mentioned above, although I changed all the guard skills and palettes to match the DOS version, there are some guards that use other guards palettes on different levels. I know there's a hack back on page 1 but I think it's only for the hacked rom Kaslghnoon did.

5. The minor one about the falling entry for Level 7.
Last edited by Shauing on October 23rd, 2019, 1:25 am, edited 1 time in total.
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
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5786
Joined: April 9th, 2009, 10:58 pm

Re: Hacking the SNES ROM

Post by Norbert »

Shauing wrote: October 22nd, 2019, 11:00 amI'm still unsure if to mute the levels music like the DOS version.
Personally, I would, because it'd be more similar to the DOS port.
You could replace the level 1 music with a shorter 'sound effect', such as death by sword (21) or sword pickup (23).
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

Norbert wrote: October 22nd, 2019, 2:38 pm Personally, I would, because it'd be more similar to the DOS port.
You could replace the level 1 music with a shorter 'sound effect', such as death by sword (21) or sword pickup (23).
But that short ''sound effect'' should only play once when starting on the first room; if I put is as a level music, later when I pick up the sword and the short jingle of it finishes, it will play the level music again.
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: October 22nd, 2019, 11:00 am 1. It seems that literally, the ''open any gate/door by any kind of death'' hack also includes the Prince as, if he's killed by Jaffar, his death also opens the final door.
Whoops, I forgot to test what happens if the prince dies!

Here is the fix:
At 0xADB0 write back the original bytes: AD 64 04
At 0xFFC0 write: AD 84 04 20 B3 AD AD 79 05 60
At 0xE199 write: 20 C0 FF (same as in the previous hack)

Shauing wrote: October 22nd, 2019, 11:00 am 2.1. Is it possible to jump to the bad ending when time runs out? The SNES version lets you continue, but the DOS doesn't.
I tried this, but with the hack I found, when the bad ending ends, it will play again repeatedly.
(At 0xF017 write: 4C D3 F3)
So I still need to work on this one...

Shauing wrote: October 22nd, 2019, 11:00 am 2.2 Can some exits have the jingle muted/off such as Level 6, 12 and 13, and have the pixelating (mosaic I think it's called in the disassembly) and fade-out effects removed on those levels as well?
To disable the ending music on certain levels:
At 0x9EFE write: 20 90 FF
At 0xFF90 write: AE 79 05 BD A0 FF D0 07 A9 1C A2 05 20 4D EA 60

To disable pixelating (mosaic) and fading on certain levels:
At 0x9F0B write: 20 70 FF
At 0xFF70 write: 8D 16 02 AE 79 05 BD A0 FF F0 07 A9 00 8D 16 02 60

To specify the levels for both:
The table starting at 0xFFA0 tells which levels should have no ending music, pixelating and fading.
Each byte corresponds to a level, in the order they are listed in the editor.
For example, to disable these on level 6, at 0xFFA5 write 01.

Do you want to remove the displaying of the time and password as well, or will you keep it?

Shauing wrote: October 22nd, 2019, 11:00 am 3. Perhaps optional, but as the timer is changed to 60 minutes, the hourglass during the Princess's cutscenes does not display the right amount of sand left; it starts at the halfway point instead of full. Only on the prologue and ending it displays both the full and empty hourglasses correctly.
At 0x14EB6 you find this: C9 06 90 10 CA C9 16 90 0B CA C9 36 90 06 CA C9 76 90 01 CA 60
The bytes after the C9 bytes tell at how many minutes remaining will the hourglass switch to the next state.
You need to change these.
Important: The remaining minutes are in BCD, which means you need to interpret the hexadecimal form of the byte as if it was a decimal number.
So for example the last bold byte, 0x76, means 76 minutes, not 118.
Since you halved the time given, you need to halve these numbers as well. So the new numbers should be 03, 08, 18, 38.

Shauing wrote: October 22nd, 2019, 11:00 am 4. Maybe optional as well; as mentioned above, although I changed all the guard skills and palettes to match the DOS version, there are some guards that use other guards palettes on different levels. I know there's a hack back on page 1 but I think it's only for the hacked rom Kaslghnoon did.
Do you mean the skeleton palette swap on level 10?
Or do you mean the palette shared by the mouse and the dead guard?
Or maybe something else?
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: October 27th, 2019, 11:57 am
Spoiler: show
Shauing wrote: October 22nd, 2019, 11:00 am 2.2 Can some exits have the jingle muted/off such as Level 6, 12 and 13, and have the pixelating (mosaic I think it's called in the disassembly) and fade-out effects removed on those levels as well?
Do you want to remove the displaying of the time and password as well, or will you keep it?
I think those should be removed on those levels as well in order to not interrupt the flow. I might do it for all levels as well just to make it closer to the DOS, but for now those three levels should not display the password and time.

Related to "2." Forgot that the ending princess cutscene when making it on time and late have different music as well. I think all these specific moments just need a hack that specifies what music will play, and only on the case of level 1, the short music intro should only play once on that first room. I'll later modify each song's data via HEX-editing.
David wrote: October 27th, 2019, 11:57 am
Spoiler: show
Shauing wrote: October 22nd, 2019, 11:00 am 2.1. Is it possible to jump to the bad ending when time runs out? The SNES version lets you continue, but the DOS doesn't.
I tried this, but with the hack I found, when the bad ending ends, it will play again repeatedly.
(At 0xF017 write: 4C D3 F3)
So I still need to work on this one...
Perhaps adding some sort of instruction that returns to the Konami screen or to title logo?
David wrote: October 27th, 2019, 11:57 am
Spoiler: show
Shauing wrote: October 22nd, 2019, 11:00 am 4. Maybe optional as well; as mentioned above, although I changed all the guard skills and palettes to match the DOS version, there are some guards that use other guards palettes on different levels. I know there's a hack back on page 1 but I think it's only for the hacked rom Kaslghnoon did.
Do you mean the skeleton palette swap on level 10?
Or do you mean the palette shared by the mouse and the dead guard?
Or maybe something else?
It's for the guards that have same skills but different palettes or same palette with different skills; for example, on Level 4 of the DOS version there are two guards with guard skill 3 (based on the document "POP1 Guard Types) but one is a yellow-orange guard and the other a white-purple one. Maybe on some situations it will be better to change the palette, and on others change the skill. That's what I want.

The palette shared by the dead guard and mouse also needs a fix. I temporarly fixed it using 4Dplayer's quoting Kaslghnoon hack of changing the mouse palette to another one (in this case, the golden skeleton one which is unused for this mod), but for other mods, this temporary fix won't work if all guards sprites, palettes and skills are used.
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: October 27th, 2019, 6:34 pm
David wrote: October 27th, 2019, 11:57 am Do you want to remove the displaying of the time and password as well, or will you keep it?
I think those should be removed on those levels as well in order to not interrupt the flow.
I might do it for all levels as well just to make it closer to the DOS, but for now those three levels should not display the password and time.
Disable time and password on certain levels:
At 0xFA51 write: 20 60 FF EA
At 0xFF60 write: AE 79 05 BD 9F FF D0 04 22 58 DC 02 60
This uses the same table at 0xFFA0, like the other two hacks related to level ending.

If you later decide to disable time and password on all levels:
At 0xFA51 write: EA EA EA EA

Shauing wrote: October 22nd, 2019, 11:00 am 2.1. Is it possible to jump to the bad ending when time runs out? The SNES version lets you continue, but the DOS doesn't.
Here is a fixed version:
At 0xF017 write: 4C 50 FF
At 0xFF50 write: A9 FE 8D 79 05 4C D3 F3
The game will return to the main menu after the bad ending.

Problem: The prince will enter the princess's room even though he's not there yet.

Solution A: It seems the game contains the cutscene from the original version, without the prince. So use it!
At 0xF3EB write: 09
Problem: This will use the music from the other cutscenes instead of the bad ending, and "GAME OVER" won't appear either.

Solution B: Remove the prince from the GAME OVER cutscene.
At 0x14B5F write: EA EA EA

Shauing wrote: October 27th, 2019, 6:34 pm It's for the guards that have same skills but different palettes or same palette with different skills;
for example, on Level 4 of the DOS version there are two guards with guard skill 3 (based on the document "POP1 Guard Types) but one is a yellow-orange guard and the other a white-purple one.
Maybe on some situations it will be better to change the palette, and on others change the skill. That's what I want.
I was thinking of a different approach: To make skill and appearance independent of each other.
There is an unused area in the level data which, it seems, was intended to store the guards' skill.
The game even stores the current guard's skill there when the player leaves a guard's room.
And in fact, older versions of Pr1SnesLevEd had a menu item in the right-click menu, called "Guard skill..." for editing this.

To use this area for guard skill:
At 0x87EC write: BF 44 F1 7F 80 09

The 2015-06-03 version of Pr1SnesLevEd was the last which can edit the guard skill.
You can get it here: https://www.popot.org/level_editors.php ... 1SnesLevEd

One difficulty is that after the hack, Pr1SnesLevEd will still think that the guard settings are bound to type, not skill.
Namely, you can edit skill 0 under the settings of dead purple, skill 1 under the settings of skel, and so on.
This might be inconvenient.
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 2nd, 2019, 9:41 pm
Spoiler: show
Shauing wrote: October 27th, 2019, 6:34 pm
David wrote: October 27th, 2019, 11:57 am Do you want to remove the displaying of the time and password as well, or will you keep it?
I think those should be removed on those levels as well in order to not interrupt the flow.
I might do it for all levels as well just to make it closer to the DOS, but for now those three levels should not display the password and time.
Disable time and password on certain levels:
At 0xFA51 write: 20 60 FF EA
At 0xFF60 write: AE 79 05 BD 9F FF D0 04 22 58 DC 02 60
This uses the same table at 0xFFA0, like the other two hacks related to level ending.

If you later decide to disable time and password on all levels:
At 0xFA51 write: EA EA EA EA
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.
David wrote: November 2nd, 2019, 9:41 pm
Spoiler: show
Shauing wrote: October 22nd, 2019, 11:00 am 2.1. Is it possible to jump to the bad ending when time runs out? The SNES version lets you continue, but the DOS doesn't.
Here is a fixed version:
At 0xF017 write: 4C 50 FF
At 0xFF50 write: A9 FE 8D 79 05 4C D3 F3
The game will return to the main menu after the bad ending.

Problem: The prince will enter the princess's room even though he's not there yet.

Solution A: It seems the game contains the cutscene from the original version, without the prince. So use it!
At 0xF3EB write: 09
Problem: This will use the music from the other cutscenes instead of the bad ending, and "GAME OVER" won't appear either.
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.
David wrote: November 2nd, 2019, 9:41 pm Solution B: Remove the prince from the GAME OVER cutscene.
At 0x14B5F write: EA EA EA
This is the better solution. Thanks.

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.
David wrote: November 2nd, 2019, 9:41 pm
Spoiler: show
Shauing wrote: October 27th, 2019, 6:34 pm It's for the guards that have same skills but different palettes or same palette with different skills;
for example, on Level 4 of the DOS version there are two guards with guard skill 3 (based on the document "POP1 Guard Types) but one is a yellow-orange guard and the other a white-purple one.
Maybe on some situations it will be better to change the palette, and on others change the skill. That's what I want.
I was thinking of a different approach: To make skill and appearance independent of each other.
There is an unused area in the level data which, it seems, was intended to store the guards' skill.
The game even stores the current guard's skill there when the player leaves a guard's room.
Interesting that was left unused, but what if the guards follow you to another room? Their skill will not revert to their default one?
David wrote: November 2nd, 2019, 9:41 pm And in fact, older versions of Pr1SnesLevEd had a menu item in the right-click menu, called "Guard skill..." for editing this.
[...]
The 2015-06-03 version of Pr1SnesLevEd was the last which can edit the guard skill.
You can get it here: https://www.popot.org/level_editors.php ... 1SnesLevEd
Why was this removed from the latest version of Pr1SnesLevEd?
David wrote: November 2nd, 2019, 9:41 pm To use this area for guard skill:
At 0x87EC write: BF 44 F1 7F 80 09
I assume this separates the guards skills from the type. In the 2015 editor I see that guards have skill 0 regardless of their type.
David wrote: November 2nd, 2019, 9:41 pm One difficulty is that after the hack, Pr1SnesLevEd will still think that the guard settings are bound to type, not skill.
Namely, you can edit skill 0 under the settings of dead purple, skill 1 under the settings of skel, and so on.
This might be inconvenient.
I'm not sure if I follow this correctly but, if I apply the above hack all guards have skill 0, so now I have to change every single guard skill number in the game. It's okay, as long as the guard skill doesn't change between rooms if they follow and then the Prince exits and enters this new room again.

This reminded me of something related to the guards. 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. For example, on Level 8 the green-yellow guard at the far right side of the level; on DOS you go to the next room, climb to the top row and carefully enter back to the previous room as, if you enter that room and are still running you'll probably be killed by him; but on SNES, he appears on the next room as well, so when you reach the row in which he is at, he will come to you. Can this be changed closer to what the DOS does?

Hope you also find solution to the remaining points to see if its worthy to change music data in order to insert the DOS tunes.
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