Hacking the SNES ROM

Discuss PoP1 for SNES here.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Hacking the SNES ROM

Post by Norbert »

What exactly are you trying to do?

For The Lost Bottle (Chapter 1), I see:
0x10F5 "TRAINING MODE !!" -> " TRICKS MODE "
0x1278 "CONTINUE" -> "PASSWORD"
0x1284 "TRAINING" -> "TRICKS "
0xCA2F "TRAINING !!" -> " TRICKS ! "
0xCAEF "TRAINING" -> " TRICKS "

Do you want to change the level numbers?
User avatar
NITM-T
Sultan
Sultan
Posts: 182
Joined: July 29th, 2017, 12:10 am

Re: Hacking the SNES ROM

Post by NITM-T »

Sorry, I saw again and there is Tricks 1. But I want to take off the number:

Image

See? I just want (Tricks!!) not that number (5)
May the Moon light your path.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

NITM-T wrote:Sorry, I saw again and there is Tricks 1. But I want to take off the number:
See? I just want (Tricks!!) not that number (5)
To hide the level number of training levels:
At offset xCAA8 (headerless ROM) or xCCA8 (headered ROM) change 20 F9 CA to 4C 36 CB.
User avatar
NITM-T
Sultan
Sultan
Posts: 182
Joined: July 29th, 2017, 12:10 am

Re: Hacking the SNES ROM

Post by NITM-T »

It worked! Thanks, both of you!
May the Moon light your path.
User avatar
spartacus735
Wise Scribe
Wise Scribe
Posts: 217
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 »

NITM-T wrote:Sorry, I saw again and there is Tricks 1. But I want to take off the number:

Image

See? I just want (Tricks!!) not that number (5)
I'm glad to see you appreciate my ideas of "tricks training" !
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Hacking the SNES ROM

Post by Norbert »

spartacus735 wrote:I'm glad to see you appreciate my ideas of "tricks training" !
Yesterday I trained some tricks with your mod. ;)
User avatar
spartacus735
Wise Scribe
Wise Scribe
Posts: 217
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 »

Sound good to me , I will improve this idea of "tricks mode" for the "lost bottle" V2 coming soon.
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod
salvadorc17
Calif
Calif
Posts: 553
Joined: August 27th, 2011, 2:04 am

Re: Hacking the SNES ROM

Post by salvadorc17 »

David wrote: To hide the level number of training levels:
At offset xCAA8 (headerless ROM) or xCCA8 (headered ROM) change 20 F9 CA to 4C 36 CB.
Is possible to expand training level after 5, and to reduce the normal levels below 20, or change level orders i mean..
User avatar
NITM-T
Sultan
Sultan
Posts: 182
Joined: July 29th, 2017, 12:10 am

Re: Hacking the SNES ROM

Post by NITM-T »

spartacus735 wrote:I'm glad to see you appreciate my ideas of "tricks training" !
Yep ^_^! That was a cool ideia of yours and I made one too. it's just the level 5, but is for more fun for the mod.
May the Moon light your path.
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

I have a question here.

Is it possible to delete/skip levels in the SNES version? Maybe via hex editing?

This first mod I am doing I am planning to have only 10 levels, as I want to do something relatively quick for this one and don't want to take too much time by doing 20 levels.
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: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Hacking the SNES ROM

Post by Norbert »

Shauing wrote: April 20th, 2018, 4:39 amIs it possible to delete/skip levels in the SNES version? Maybe via hex editing?
I'd say at the very least it should be possible to change the level and room where the prince wins.

Actually, Pr1SnesLevEd has File -> Hacks..., with "Starting level" on the starting tab.
This means you could have the player start in level 11, and either keep the first 10 levels as the default or clear them.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Norbert wrote: April 20th, 2018, 7:57 am I'd say at the very least it should be possible to change the level and room where the prince wins.
On the "Jaffar's level" tab, there is a hack titled "show ending when next level would be: [Jaffar's level]".
But it doesn't seem to do work. For example if I set it to level 2 then the game should end after I complete level 1. But it doesn't.

As for the room, it's on the "special exits" tab. But it works together with the previous hack, which doesn't work.

Update: It seems that you have to disable a check.

Code: Select all

01:EF76: ad 44 05    LDA $0544 ; next level
01:EF79: c9 14       CMP #$14 ; <-- the above mentioned hack changes this
01:EF7B: d0 13       BNE $ef90 ; show cutscene for level
01:EF7D: 20 3b e9    JSR $e93b ; calc remaining min/sec?
01:EF80: ad 27 05    LDA $0527 ; remaining min
01:EF83: 0d 29 05    ORA $0529 ; remaining sec
01:EF86: f0 05       BEQ $ef8d
01:EF88: ad b5 04    LDA $04b5 ; teleport back? (Jaffar)
01:EF8B: f0 03       BEQ $ef90 ; show cutscene for level
01:EF8D: 4c d3 f3    JMP $f3d3 ; show ending?
search: AD B5 04 F0 03
change: 03 to 00
Then you can change the level number in the above mentioned hack.
I have tested this, it worked for me.
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

Hello again! I have a question which I will try to explain as clear as I can, with the help of a video.

I want to have loose tiles that you can stand and run, until a switch is pressed and the tiles fall (0:00 - 0:16).



But I want the floor also to look just like normal floor, but if I try to do that, you cannot stand on those loose tiles. (0:18-0:27)


Is there a way to fix this?
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: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

Shauing wrote: May 23rd, 2018, 10:10 am I want to have loose tiles that you can stand and run, until a switch is pressed and the tiles fall (0:00 - 0:16).
But I want the floor also to look just like normal floor, but if I try to do that, you cannot stand on those loose tiles. (0:18-0:27)
You need to hex-edit the rom for this.
Search: B9 80 E0 F0 06 4A
Replace: B9 80 E0 4A F0 05
Then any loose floor with modifier=1 will look like a regular floor.

Technical details:
Spoiler: show
Here is the relevant part of the disassembly:

Code: Select all

is loose:
00:E4D1: b9 80 e0    LDA $e080,Y ; current room modifiers (w=16,h=5)
00:E4D4: f0 06       BEQ $e4dc
00:E4D6: 4a          LSR
00:E4D7: 29 01       AND #$01
00:E4D9: 18          CLC
00:E4DA: 69 03       ADC #$03
00:E4DC: 4c 0d e6    JMP $e60d ; end of object
In the original code, BEQ jumps if the modifier is 0 (i.e. a regular loose floor that is not shaking).
My hack moves the LSR (bit-shift right) before BEQ, and thus BEQ will jump if (modifier>>1)==0, that is, the modifier is 0 or 1.
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Hacking the SNES ROM

Post by Shauing »

David wrote: May 26th, 2018, 9:20 pm
You need to hex-edit the rom for this.
Search: B9 80 E0 F0 06 4A
Replace: B9 80 E0 4A F0 05
Then any loose floor with modifier=1 will look like a regular floor.

Technical details:
Spoiler: show
Here is the relevant part of the disassembly:

Code: Select all

is loose:
00:E4D1: b9 80 e0    LDA $e080,Y ; current room modifiers (w=16,h=5)
00:E4D4: f0 06       BEQ $e4dc
00:E4D6: 4a          LSR
00:E4D7: 29 01       AND #$01
00:E4D9: 18          CLC
00:E4DA: 69 03       ADC #$03
00:E4DC: 4c 0d e6    JMP $e60d ; end of object
In the original code, BEQ jumps if the modifier is 0 (i.e. a regular loose floor that is not shaking).
My hack moves the LSR (bit-shift right) before BEQ, and thus BEQ will jump if (modifier>>1)==0, that is, the modifier is 0 or 1.
I found two matches on the hex-editor, one in between offsets 0025781 and 0025810, and the other on offset 0026100. ¿Both have to be modified or just 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
Post Reply