Hacking the SNES ROM

Discuss PoP1 for SNES here.
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 »

4DPlayer wrote: July 19th, 2019, 2:18 amThe byte at 0x18018 is 0x6B
The byte at 0x1806C is 0x0E
Your 0x6B instructs the game to go to the demo level, and the 0x0E byte specifies what is the demo level.
This is the modification that apoplexy uses to allow modders to quickly playtest specific levels.
To 'fix' your ROM file, change 0x18018 to 0x75, and 0x1806C to 0x15.
4DPlayer

Re: Hacking the SNES ROM

Post by 4DPlayer »

Norbert wrote: July 19th, 2019, 3:07 pm
Your 0x6B instructs the game to go to the demo level, and the 0x0E byte specifies what is the demo level.
This is the modification that apoplexy uses to allow modders to quickly playtest specific levels.
To 'fix' your ROM file, change 0x18018 to 0x75, and 0x1806C to 0x15.
Will do. I guess it’s one of those other things that happen when you’re new at SNES modding. :P
I’ll use PR1SNESLevEd from now on.
Last edited by 4DPlayer on July 20th, 2019, 2:58 am, edited 1 time in total.
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 »

4DPlayer wrote: July 19th, 2019, 3:14 pmWill do. I guess it’s one of those other things that happen when modding with Apoplexy. :P
The program (apoplexy) temporarily modifies the ROM to allow modders to quickly playtest specific levels. It modifies the ROM before launching the game, and then after the modder quits the game modifies the ROM back to what it was originally. In other words, say you want to test level 12, then when you initiate playtesting from apoplexy while level 12 is active in the editor, the game launches straight into level 12. This makes the editor user-friendly.

What you ran into, that the ROM wasn't changed back, should not normally happen. Perhaps you quit the application before you quit the game. Although even that user action is something apoplexy takes into account, so then it should've changed the ROM back anyway. Maybe you had the ROM open in two editors at the same time, which could cause various unexpected things to happen. Regardless, what you ran into is something that should not normally happen, and I wouldn't personally describe it as "one of those things that happen when modding with Apoplexy"... :P
4DPlayer

Re: Hacking the SNES ROM

Post by 4DPlayer »

If you notice the blue faced guards in this mod/level, they are actually blue-faced torture guards beating up the prince.
Plus, the sword appears on the row below the row the guard is on. Strange...
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 »

4DPlayer wrote: September 8th, 2019, 12:57 amIf you notice the blue faced guards in this mod/level, they are actually blue-faced torture guards beating up the prince.
Plus, the sword appears on the row below the row the guard is on. Strange...
In Pr1SnesLevEd, if you right click and pick "Guard type...", you can choose "[BAD] torture".
It won't show up in the editor, but it will in the game.
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

I have a question. Is it possible to change which door/gate closes at the start of Level 1? Normally, it will always be the one in the room in which the Prince starts, but if the door is located on the column 9 of the room to the left (in this case), it won't close.
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: September 16th, 2019, 12:48 am I have a question. Is it possible to change which door/gate closes at the start of Level 1? Normally, it will always be the one in the room in which the Prince starts, but if the door is located on the column 9 of the room to the left (in this case), it won't close.
At 0xEEB2 write: 20 F0 FF
At 0xEECD write: 20 F0 FF
At 0xFFF0 write: AD 79 05 F0 04 AD 72 04 60 A9 nn 60
Where nn is the room in which the gate is.
The game will check that room in the same way as it usually checks the starting room.

(BTW, is this for the remake of DOS levels on SNES which you mentioned earlier?)
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: September 21st, 2019, 12:31 pm
At 0xEEB2 write: 20 F0 FF
At 0xEECD write: 20 F0 FF
At 0xFFF0 write: AD 79 05 F0 04 AD 72 04 60 A9 nn 60
Where nn is the room in which the gate is.
The game will check that room in the same way as it usually checks the starting room.
Thank you, David!
David wrote: September 21st, 2019, 12:31 pm (BTW, is this for the remake of DOS levels on SNES which you mentioned earlier?)
Spoiler: show

Hopefully, v1.0. Around 25% has been completed. No sprite changes at the moment but levels will play the same as the DOS version.
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 »

Another one. On the shadow's steal potion sequence, the hacks tab only has the prince row position but no prince column position. Is it possible to specify on which column the Prince has to be in order to trigger the shadow steal?
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: September 28th, 2019, 10:30 pm Another one. On the shadow's steal potion sequence, the hacks tab only has the prince row position but no prince column position. Is it possible to specify on which column the Prince has to be in order to trigger the shadow steal?
At 0x8C4C write: 20 E0 FF EA EA
At 0xFFE0 write: AD 6C 04 C9 rw D0 05 AD 6B 04 C9 co 60
Where rw is the row and co is the column 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: September 29th, 2019, 11:15 am At 0x8C4C write: 20 E0 FF EA EA
At 0xFFE0 write: AD 6C 04 C9 rw D0 05 AD 6B 04 C9 co 60
Where rw is the row and co is the column number.
Good, thanks.

I have had other occupations, so I haven't worked on it as much as I wished, so I couldn't finish it for today's anniversary. I could however, release a beta that runs up to level 7. (EDITED THRICE: Now up to level 10).

I have another request. Can the mouse sequence occur without any Jaffar sequence/animation and music? I tried all possibilities on the hacks tab, but the closest I could get was to make Jaffar not appear, but he's still there as the health meter still appears, so his animations still play, thus the Prince still stays motionless until Jaffar ''goes away'' and the level music restarts as I tried to mute the Jaffar's apparition music.
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 »

I think I figured the above using Kaslghnoon hacking/hex values from page 1 so that only the mouse appears, though the values for the palette of the mouse were meant for level 13, so I had to check the disassemble document in order to know which of the values represented the level in which the mouse palette is applied to revert that number to what I had as I did move the sequences to Level 8. It seems to be stable and no other side-effects have occurred so far.

I don't dare to do this stuff by my own as I don't know nothing about what each hex-number does, I can only follow instructions and play within them.

Spoiler: show
(Now, I couldn't figure out about the special ''floating'' tiles at the end of Level 15 that appear after merging the Shadow. Are they called ''shadow floor'' on the disassembly? Still, I don't know what values do what or which I have to change them in order to still make them appear after merging with the Shadow, but on Level 12, on row 0 across two rooms, just like the DOS version. Hopefully, this is the last hack I need to do for this anniversary port.
I already did the hack of the Shadow appearing without needing Jaffar to appear first, as I already had the instructions when I asked this for ''The Queen Of Light'' mod.)
EDIT: Found how to make work the special tiles on the level editor without needing to hack them.

There are three things I need to fix/add:
1. On the Shadow fight sequence, if the Prince has not merged with the Shadow and he goes to the next room and back again, the Shadow's intro and animation play again, but he's invisible* and if I try to merge with him or go to the next room, the Prince dies instantly; only either attacking him or going to the previous room and back restore things to normal. What I want is that the Shadow intro sequence only plays once so that even if I go to another room, he'll stay there instead of re-appearing again.
EDIT: Found why he's ''invisible''. His intro animation height (y) is 0, so when I go to the next room and go back, he stays at the 0 position, thus he's actually above, not invisible.

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. Also, I added the flash when he's killed and turned off the stun, but the level music didn't play again.

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.
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 3rd, 2019, 9:01 pm I have another request. Can the mouse sequence occur without any Jaffar sequence/animation and music?
Sorry for the late reply.
I tried to figure this out last weekend, but with the best hack I found then, the mouse got stuck in the bottom left corner instead of disappearing.
Anyway, here is a better solution I found today.

Important: I wrote this before I saw that you already figured it out by yourself. I post it anyway in case someone needs it.

First of all, you should undo everything you did to hide Jaffar, and use only the following hacks instead.

At 0xD1ED write: FF
This makes the mouse appear immediately after the appropriate time elapses, instead of waiting for Jaffar to finish.
By the way, this also fixes the button getting stuck after the mouse presses it.
The gate will still stay open forever, anyway, unless you disable that as well.

At 0xF901 write: D4
This disables Jaffar (on the mouse level).

At 0xD1F5 write: 00
This hides the hit point of the mouse.

Optional hacks to make the special event more similar to the DOS version:

Disable the gate staying open forever:
At 0xD397 write: CC
(This one is in the hacks window, by the way.)

Change how much time should elapse before the mouse appears:
At 0xF8FB write the number of ticks (in hex).

The game also checks if the kid is to the right from the leftmost tile column, and if he's turned right.
This might make sense for the original scene with Jaffar, but you can disable it:
At 0xF8F1 write: EA EA EA EA
At 0xF8F8 write: EA EA
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 12th, 2019, 10:10 am
Spoiler: show
Shauing wrote: October 3rd, 2019, 9:01 pm I have another request. Can the mouse sequence occur without any Jaffar sequence/animation and music?
Sorry for the late reply.
I tried to figure this out last weekend, but with the best hack I found then, the mouse got stuck in the bottom left corner instead of disappearing.
Anyway, here is a better solution I found today.

Important: I wrote this before I saw that you already figured it out by yourself. I post it anyway in case someone needs it.

First of all, you should undo everything you did to hide Jaffar, and use only the following hacks instead.

At 0xD1ED write: FF
This makes the mouse appear immediately after the appropriate time elapses, instead of waiting for Jaffar to finish.
By the way, this also fixes the button getting stuck after the mouse presses it.
The gate will still stay open forever, anyway, unless you disable that as well.

At 0xF901 write: D4
This disables Jaffar (on the mouse level).

At 0xD1F5 write: 00
This hides the hit point of the mouse.

Optional hacks to make the special event more similar to the DOS version:

Disable the gate staying open forever:
At 0xD397 write: CC
(This one is in the hacks window, by the way.)

Change how much time should elapse before the mouse appears:
At 0xF8FB write the number of ticks (in hex).

The game also checks if the kid is to the right from the leftmost tile column, and if he's turned right.
This might make sense for the original scene with Jaffar, but you can disable it:
At 0xF8F1 write: EA EA EA EA
At 0xF8F8 write: EA EA
Thank you, David. I followed most of the new instructions except for the disabling the gate staying forever one, as I want to avoid as many softlocks that could happen in the original.

I'll wait for the solution of the other fixes I mentioned above, and just add a minor one. The Shadow's intro on Level 12 starts as soon as the Prince enters instead of after he starts crossing the loose tiles like on DOS. Can the Shadow's intro start at that point?
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 »

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?
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