Hacking the SNES ROM

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

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: September 1st, 2018, 9:22 am I think I will either need two more of exiting a room up, or one more each for exiting a room up or down.
At x81DE write: 4C 00 FE
At x81E5 write: 4C 10 FE
At xFE00 write: A0 08 A2 00 20 20 FE 4C A5 82
At xFE10 write: A0 08 A2 10 20 20 FE 4C AF 82
At xFE20 write: AD 79 05 DD 40 FE D0 0B BD 48 FE CD 62 04 D0 03 20 BD 83 E8 88 D0 E9 60

At xFE40 write: The levels(-1) for exiting up.
At xFE48 write: The rooms for exiting up.
At xFE50 write: The levels(-1) for exiting down.
At xFE58 write: The rooms for exiting down.
You can use 8 different locations for each. I think that's more than enough.
You should fill the unused entries in each table with some invalid level/room number, like FF.
User avatar
Shauing
Calif
Calif
Posts: 432
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: September 1st, 2018, 5:06 pm
Shauing wrote: September 1st, 2018, 9:22 am I think I will either need two more of exiting a room up, or one more each for exiting a room up or down.
At x81DE write: 4C 00 FE
At x81E5 write: 4C 10 FE
At xFE00 write: A0 08 A2 00 20 20 FE 4C A5 82
At xFE10 write: A0 08 A2 10 20 20 FE 4C AF 82
At xFE20 write: AD 79 05 DD 40 FE D0 0B BD 48 FE CD 62 04 D0 03 20 BD 83 E8 88 D0 E9 60

At xFE40 write: The levels(-1) for exiting up.
At xFE48 write: The rooms for exiting up.
At xFE50 write: The levels(-1) for exiting down.
At xFE58 write: The rooms for exiting down.
You can use 8 different locations for each. I think that's more than enough.
You should fill the unused entries in each table with some invalid level/room number, like FF.
What do you mean with "8 different locations for each"?
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: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: September 2nd, 2018, 5:23 pm What do you mean with "8 different locations for each"?
You can use 8 level+room combinations for setting a checkpoint by exiting a room up, and another 8 level+room combinations for setting a checkpoint by exiting a room down.
User avatar
Shauing
Calif
Calif
Posts: 432
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: September 2nd, 2018, 7:08 pm
Shauing wrote: September 2nd, 2018, 5:23 pm What do you mean with "8 different locations for each"?
You can use 8 level+room combinations for setting a checkpoint by exiting a room up, and another 8 level+room combinations for setting a checkpoint by exiting a room down.

Oh wow. I am curious if this could also be possible for more left and right exits? Though I would not exactly use them all in this mod, it gives me a potential idea for another mod.
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: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: September 2nd, 2018, 7:17 pm Oh wow. I am curious if this could also be possible for more left and right exits? Though I would not exactly use them all in this mod, it gives me a potential idea for another mod.
If you're adding this to some new mod, then you need the xFE20 part from the previous hack.

At x828E write: 20 E0 FD
At x829B write: 20 F0 FD
At xFDE0 write: A0 08 A2 20 20 20 FE 4C 6D 83
At xFDF0 write: A0 08 A2 30 20 20 FE 4C AD 83

At xFE60 write: The levels(-1) for exiting left.
At xFE68 write: The rooms for exiting left.
At xFE70 write: The levels(-1) for exiting right.
At xFE78 write: The rooms for exiting right.
Again, you get to use 8 bytes for each.

I know xFE70 was already used, but it was for the old "exiting up" code that was replaced in the hack I posted yesterday.
salvadorc17
Calif
Calif
Posts: 553
Joined: August 27th, 2011, 2:04 am

Re: Hacking the SNES ROM

Post by salvadorc17 »

Shauing wrote: September 2nd, 2018, 7:17 pm Oh wow. I am curious if this could also be possible for more left and right exits? Though I would not exactly use them all in this mod, it gives me a potential idea for another mod.
Can you show some images to know what you doing, or which mod will have this hacks..
User avatar
Shauing
Calif
Calif
Posts: 432
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: September 2nd, 2018, 8:07 pm
Shauing wrote: September 2nd, 2018, 7:17 pm Oh wow. I am curious if this could also be possible for more left and right exits? Though I would not exactly use them all in this mod, it gives me a potential idea for another mod.
If you're adding this to some new mod, then you need the xFE20 part from the previous hack.

At x828E write: 20 E0 FD
At x829B write: 20 F0 FD
At xFDE0 write: A0 08 A2 20 20 20 FE 4C 6D 83
At xFDF0 write: A0 08 A2 30 20 20 FE 4C AD 83

At xFE60 write: The levels(-1) for exiting left.
At xFE68 write: The rooms for exiting left.
At xFE70 write: The levels(-1) for exiting right.
At xFE78 write: The rooms for exiting right.
Again, you get to use 8 bytes for each.

I know xFE70 was already used, but it was for the old "exiting up" code that was replaced in the hack I posted yesterday.
I am testing these but don't seem to work; I think it is because there is no restart room and tile specified? Do I still have to use the ''Hacks...'' window to do this? If so, the checkpoints will still be limited to 6 levels only.
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: 432
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

salvadorc17 wrote: September 3rd, 2018, 12:03 am
Shauing wrote: September 2nd, 2018, 7:17 pm Oh wow. I am curious if this could also be possible for more left and right exits? Though I would not exactly use them all in this mod, it gives me a potential idea for another mod.
Can you show some images to know what you doing, or which mod will have this hacks..
Not yet; I'm close to finish the mod, though. I will see if I can do another one if this first one is good enough.
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: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: September 3rd, 2018, 12:40 am I am testing these but don't seem to work; I think it is because there is no restart room and tile specified? Do I still have to use the ''Hacks...'' window to do this? If so, the checkpoints will still be limited to 6 levels only.
Yes, you still need to specify where to restart.

Here is how to break the 6 levels limit:

At xDF18 write: AD 27 06 F0 1B AE 79 05 BD 80 FD 8F 12 F1 7F BD A0 FD 8F 10 F1 7F BD C0 FD 8F 11 F1 7F 4C 1B E0 AD 79 05 EA

Then you need to fill in these tables:
From xFD80: restart direction ($FF=left, $00=right)
From xFDA0: restart room
From xFDC0: restart tilepos
Each table has one byte for each level, from level 1 to training 5, in the same order as in the level selection list of Pr1SnesLevEd.
User avatar
Shauing
Calif
Calif
Posts: 432
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: September 8th, 2018, 10:00 pm
Yes, you still need to specify where to restart.

Here is how to break the 6 levels limit:

At xDF18 write: AD 27 06 F0 1B AE 79 05 BD 80 FD 8F 12 F1 7F BD A0 FD 8F 10 F1 7F BD C0 FD 8F 11 F1 7F 4C 1B E0 AD 79 05 EA

Then you need to fill in these tables:
From xFD80: restart direction ($FF=left, $00=right)
From xFDA0: restart room
From xFDC0: restart tilepos
Each table has one byte for each level, from level 1 to training 5, in the same order as in the level selection list of Pr1SnesLevEd.
Cool; I tried to see if it could detect more than one checkpoint per level but it only goes back to the first. While doing this, I had a crazy idea that had to do with multiple checkpoints per level and where it would restart for the another mod I mentioned previously, but I will ask this if I do get to do that one.

Another question: Is it possible to activate a checkpoint via teleport or reaching a specific tile?
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: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: September 9th, 2018, 6:16 pm Another question: Is it possible to activate a checkpoint via teleport or reaching a specific tile?
To activate a checkpoint via teleport:
At x853B write: 20 70 FD EA.
At xFD70 write: 48 C9 xx D0 03 20 BD 83 68 22 57 EE 00 60.
Where xx is the modifier of the teleport that should activate the checkpoint.
There is no level check, so you could use this on multiple levels.
Just be careful not to use this modifier for teleports on levels where you don't want this kind of checkpoint.
User avatar
Shauing
Calif
Calif
Posts: 432
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: September 15th, 2018, 7:04 pm
To activate a checkpoint via teleport:
At x853B write: 20 70 FD EA.
At xFD70 write: 48 C9 xx D0 03 20 BD 83 68 22 57 EE 00 60.
Where xx is the modifier of the teleport that should activate the checkpoint.
There is no level check, so you could use this on multiple levels.
Just be careful not to use this modifier for teleports on levels where you don't want this kind of checkpoint.
Works as intended, thanks.

I have one more question (hopefully the last for this mod, really sorry to bother you with like 50+ hacks for just one mod). Is it possible to fight Jaffar in his magic phase in one level and his sword phase on another? Or at least just fight only the magic phase of Jaffar?
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: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: September 16th, 2018, 9:28 am Is it possible to fight Jaffar in his magic phase in one level and his sword phase on another? Or at least just fight only the magic phase of Jaffar?
But then what should happen when you beat Jaffar in the magic phase?

This is what I came up with:
To make it possible to kill Jaffar during the magic fight:
At x1414F write: C9 00.
At x1410E write: C9 00.
Then, to make Jaffar show a normal dying animation:
At xCE7E write: 20 60 FD.
At xFD60 write: AD 64 04 C9 08 D0 05 A9 02 8D 64 04 60.
User avatar
Shauing
Calif
Calif
Posts: 432
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: September 16th, 2018, 12:56 pm But then what should happen when you beat Jaffar in the magic phase?

This is what I came up with:
To make it possible to kill Jaffar during the magic fight:
At x1414F write: C9 00.
At x1410E write: C9 00.
Then, to make Jaffar show a normal dying animation:
At xCE7E write: 20 60 FD.
At xFD60 write: AD 64 04 C9 08 D0 05 A9 02 8D 64 04 60.
Yeah, I wanted to be able to kill Jaffar in the magic phase, so that in another level, you will face the sword phase. Probably should have wrote the question as "Be able to Kill Jaffar in his magic phase in one level then fight him and be able to kill him again in his sword phase?" But I think you got it.
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: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: September 16th, 2018, 1:45 pm Yeah, I wanted to be able to kill Jaffar in the magic phase, so that in another level, you will face the sword phase. Probably should have wrote the question as "Be able to Kill Jaffar in his magic phase in one level then fight him and be able to kill him again in his sword phase?" But I think you got it.
But then (story-wise) how can Jaffar be alive if I killed him earlier?...
Post Reply