Hacking the SNES ROM

Discuss PoP1 for SNES here.

Moderator: English Moderator Team

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3115
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: Hacking the SNES ROM

Post by Norbert » August 21st, 2015, 12:12 am

David, feel free to edit Kaslghnoon's post, for example to add a link to your post above after his lines that mention x77CE, or to fix things.
You have the necessary privileges. If you do so, please indicate somewhere that you've edited his post. Thanks.

(To prevent misunderstandings: I wrote the above text only as an idea/suggestion; just to make sure you feel free to edit. Not with the idea that you'd need my permission or anything. :))

User avatar
spartacus735
Sultan
Sultan
Posts: 164
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 » August 21st, 2015, 4:16 pm

To do list:

1) Figure out how to increase time limit.
2) Find out details on hacking checkpoints and two-part levels.
3) Edit what occurs during shadow steal.
4) Edit what occurs during the original level 15 Jaffar and shadow appearances.
5) Find out more information about level 17 and the monster.
6) Find out details on room 7 in level 19.
7) Figure out how to break level barriers to have a total of 27 levels.
Apparently, he planned to change and study the code for "shadow". So I think all that is mentioned in this list was not necessarily safe or without bugs.

Yesterday I tried to change the level of "shadow steal" for the level 1

Code: Select all

x872B = 00 [LIST 1]
x8C44 = 10
x75D3 = 00
x75DB = 10 
= No works , I don't know why. I tried to put this hexahack into a clearrom, same problem...
I just see the hitpoints of shadow , no apparition , no steal , nothing

Also with the exportation of level 7 into level 1 the problem is always here.

I think the hexa have some problems.
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod

User avatar
Kaslghnoon
Sultan
Sultan
Posts: 138
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: Hacking the SNES ROM

Post by Kaslghnoon » August 22nd, 2015, 2:24 am

spartacus735 wrote:
Yesterday I tried to change the level of "shadow steal" for the level 1

Code: Select all

x872B = 00 [LIST 1]
x8C44 = 10
x75D3 = 00
x75DB = 10 
= No works , I don't know why. I tried to put this hexahack into a clearrom, same problem...
I just see the hitpoints of shadow , no apparition , no steal , nothing

Also with the exportation of level 7 into level 1 the problem is always here.

I think the hexa have some problems.
You are correct, one offset is missing:

x75D3
  • x872B
    • x8BF5
      • Thank you spartacus735 for the catch, and also thanks to David for correcting x77CE which is headered and also incorrect. Like Norbert said, please feel free to correct my errors in the first post.

User avatar
spartacus735
Sultan
Sultan
Posts: 164
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 » August 22nd, 2015, 1:20 pm

Image

Work !

But I notice something , Shadow need a life potion for the tile 6 to appear.

For exemple , if a place a "kill potion" instead of the life potion = no shadow.

It is possible to change the stealing object with hexadecimal ? Like " Shadow need to steal a "kill potion " for appear.


( Sorry again if my english is bad )
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod

User avatar
Kaslghnoon
Sultan
Sultan
Posts: 138
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: Hacking the SNES ROM

Post by Kaslghnoon » August 22nd, 2015, 9:37 pm

spartacus735 wrote:It is possible to change the stealing object with hexadecimal ? Like " Shadow need to steal a "kill potion " for appear.
Almost everything is possible if you are willing to spend time on it and figure it out. At this time, I don't know how to change the life potion stipulation of Shadow steal, but if you have the time/interest feel free to disassemble at the two main offsets for Shadow steal (x872B and x8BF5). You will be looking at
  • and searching for value $13 which is life potion. Don't forget to make backups of your ROM before attempting trial and error for finding offsets.

    Some key values to search: $E013, $C913, $A913, $8013, and $9013.

    Learning 6502 assembly and hex editing is quite enjoyable but unfortunately it takes up a considerable amount of time which I don't have right now.

User avatar
spartacus735
Sultan
Sultan
Posts: 164
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 » August 23rd, 2015, 2:41 am

6502 assembly ? Prince of Persia SNES was created with a commodore 64 ?

What is the tool for disassemble a SNES rom ? Sometime David show some code of the game like :

Code: Select all

main menu (palette?):
00:F7CE: a9 04       LDA #$04
00:F7D0: 20 61 f5    JSR $f561 ; set palette slot index =A + find palette $45=69
00:F7D3: a2 0c 00    LDX #$000c ; row 12 in the palette editor
00:F7D6: 20 73 f5    JSR $f573 ; seek row X in palette resource
00:F7D9: 4c 8c f5    JMP $f58c ; write palette (A rows)
What sort of software is it ?
$E013, $C913, $A913, $8013, and $9013
it's like "$CC or $00" value in hexadecimal ?
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod

User avatar
Kaslghnoon
Sultan
Sultan
Posts: 138
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: Hacking the SNES ROM

Post by Kaslghnoon » August 23rd, 2015, 4:16 am

spartacus735 wrote:6502 assembly ? Prince of Persia SNES was created with a commodore 64 ?
To be precise, SNES uses 65816 assembly. From my experience, learning 6502 assembly will also suffice.
spartacus735 wrote:What is the tool for disassemble a SNES rom ? Sometime David show some code of the game like :

Code: Select all

main menu (palette?):
00:F7CE: a9 04       LDA #$04
00:F7D0: 20 61 f5    JSR $f561 ; set palette slot index =A + find palette $45=69
00:F7D3: a2 0c 00    LDX #$000c ; row 12 in the palette editor
00:F7D6: 20 73 f5    JSR $f573 ; seek row X in palette resource
00:F7D9: 4c 8c f5    JMP $f58c ; write palette (A rows)
What sort of software is it ?
If you are interested in learning the disassembly of the original PoP1 ROM, the first thing to do is download David's disassembly package: viewtopic.php?f=122&t=3652

Study the "Prince_disasm.txt" file within the package. Skip through the header and start reading from line 383, that is offset x0000 in a headerless mod. Do a search for "shadow steal" and you will also see that my missing offset (x8BF5) is addressed at lines 15789 and 15790:

Code: Select all

01:8BF4: c9 06       CMP #$06
01:8BF6: f0 48       BEQ $8c40 ; level 7 room 16 shadow steal
00:8000 = x0000
00:9000 = x1000
00:A000 = x2000
00:B000 = x3000
00:C000 = x4000
00:D000 = x5000
00:E000 = x6000
00:F000 = x7000

01:8000 = x8000
01:9000 = x9000
01:A000 = xA000
01:B000 = xB000
01:C000 = xC000
01:D000 = xD000
01:E000 = xE000
01:F000 = xF000

02:8000 = x10000
02:9000 = x11000
02:A000 = x12000
02:B000 = x13000
02:C000 = x14000
02:D000 = x15000
02:E000 = x16000
02:F000 = x17000

By that conversion, 01:8C40 = x8C40
spartacus735 wrote:
$E013, $C913, $A913, $8013, and $9013
it's like "$CC or $00" value in hexadecimal ?
Yes, those are values. If you are using Translhextion, then to search for $E013, you Ctrl+F, then find <bh:e0><bh:13> and for $C913 you do a Ctrl+F then find <bh:c9><bh:13> and so on...

I put $ in front of values to avoid confusing values with offsets. When doing a search in Translhextion, do not enter the $ sign. To be safe just search using the <bh:00><bh:00> format and replace the zeroes with the offsets you want to search for. If you are using a hex editor other than Translhextion, then the <bh:00><bh:00> most likely does not apply.

After David has successfully disassembled the ROM, the information needed for hex editing is all there. It is all a matter of taking the time to find it...

User avatar
spartacus735
Sultan
Sultan
Posts: 164
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 » August 23rd, 2015, 12:00 pm

Code: Select all

level 7 room 16 shadow steal:
01:8727: ad 79 05    LDA $0579 ; current level
01:872A: c9 06       CMP #$06
01:872C: d0 1e       BNE $874c ; level 20 room 4 Jaffar
01:872E: ad 06 05    LDA $0506 ; shown room ; VisScrn
01:8731: 8d 62 04    STA $0462 ; Char.room ; CharScrn
01:8734: c9 10       CMP #$10
01:8736: d0 42       BNE $877a
01:8738: a2 06       LDX #$06
01:873A: a0 00       LDY #$00
01:873C: 20 f5 ae    JSR $aef5 ; find tile (A=room, X=tile, Y=row?) ; RDBLOCK
01:873F: eb          XBA
[code]01:8740: c9 13       CMP #$13
01:8742: d0 07 BNE $874b
01:8744: a9 c2 LDA #$c2
01:8746: a2 80 LDX #$80
01:8748: 4c 04 81 JMP $8104

01:874B: 60 RTS

[/code]

Code: Select all

01:8740: c9 13       CMP #$13
As you can see number 13 is object stipulation of Shadow steal , I tried with a "Kill potion" ( = 1C ) Work ! But I think we need to change the effect of potion, because when shadow drink the "kill potion" he don't die ! Interresting thing !

First Version : x8740 to $E0 $[LIST3] ( from $E0 $13 )

Exemple : Shadow need to steal a "kill potion" : x8740 to $E0 $1C
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod

User avatar
Kaslghnoon
Sultan
Sultan
Posts: 138
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: Hacking the SNES ROM

Post by Kaslghnoon » August 23rd, 2015, 9:01 pm

Well done man. No need to modify x8740. All you need is:

x8741 to $
  • I just gave $E013 as an example of what can precede the $13. In this case you found $C913 and there was no $E013. Therefore, the $C9 must remain intact while you modify the object from $13 to $
    • .

      Please revert x8740 back to $C9 to avoid glitches. Like I said, have fun with ROM hacking, it can be quite enjoyable and rewarding.

User avatar
spartacus735
Sultan
Sultan
Posts: 164
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 » August 23rd, 2015, 10:04 pm

Yep ! Don't panic I never changed "$EO" I think I wasn't clear in my previous post :p

Actually create glitch is pretty funny, look my video :

>>>>>>>>>>>>>>>>>>>> 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: 3115
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: Hacking the SNES ROM

Post by Norbert » August 23rd, 2015, 10:54 pm

That video is funny. :P

User avatar
spartacus735
Sultan
Sultan
Posts: 164
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 » August 24th, 2015, 12:08 am

Now, my true hexa work with shadow !

- No transparence
- New Palette
- Alternative object

My video is also a little preview of my mod ( with some new character )

>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod

salvadorc17
Calif
Calif
Posts: 521
Joined: August 27th, 2011, 2:04 am

Re: Hacking the SNES ROM

Post by salvadorc17 » August 24th, 2015, 9:47 pm

My video is also a little preview of my mod ( with some new character )
New character??, do you have used shadow?? this will not change affect shadow in all levels?

User avatar
spartacus735
Sultan
Sultan
Posts: 164
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 » August 24th, 2015, 11:47 pm

Yep I used Shadow and Jaffar, and yes I changed the Shadow trigger and Jaffar , and they will not be the same anymore. I create a new story that why.
But no spoil , it's a secret ;)
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod

salvadorc17
Calif
Calif
Posts: 521
Joined: August 27th, 2011, 2:04 am

Re: Hacking the SNES ROM

Post by salvadorc17 » August 27th, 2015, 9:26 pm

Yep I used Shadow and Jaffar, and yes I changed the Shadow trigger and Jaffar , and they will not be the same anymore. I create a new story that why.
Hope there should be a way to create new without using existing ones, to do more interesting stuff..

Post Reply