How can I edit special gates in snes POP 1?

Post Reply
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

How can I edit special gates in snes POP 1?

Post by robert »

Hi everyone, as I can't post this topic in other forum (I don't know why :? ) I post it here.
It's about Snes Prince Of Persia 1:

As you saw in level 6, 9, 12, etc. when you beat the final guard, like the fat guy, it opens a gate and stays open for ever. In my mod I want to edit the trigger that opens the gate when you beat the guard. The original prince has in a specific room and tile the gate that is triggered.
So my question is if there is a way to edit the trigger, and how can I do it?
Image
This will be my face if you can't win any of my mods
Kaslghnoon
Sultan
Sultan
Posts: 153
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: How can I edit special gates in snes POP 1?

Post by Kaslghnoon »

For this you will need a hex editor. The one I use is Translhextion, you can download it at:
http://www.zophar.net/download_file/2779

Open the ROM file with a hex editor, remove the header by highlighting the first 512 bytes (hex offsets x0000-x01FF) and delete. There are 6 events built into the game. Prince defeats the boss and usually a gate permanently opens, or the exit opens in level 12. By hex-editing any of these events you can have the sword fighting defeat of any guard type trigger any object (gate, exit, loose tile, stuck chomper, ...etc) in a particular level. You can have multiple trigger events in one level. This feature is not restricted to bosses only. These events will not be triggered if the target guard is killed by chomper, guillotine, crusher, falling down or onto spikes, or falling below the screen. One event can only target one tile.

Hex editor notes:
-Hex numbers preceded with 'x' are offsets, preceded with '$' are values.
-To quickly jump to an offset, press Ctrl+g then enter the number. If you are using Translhextion you must enter the 'x' before an offset number like I've shown.

Below are all the offsets to the 6 events:

1)
xADB9 = Level (level where event happens)
xADC0 = Guard (guard type whose defeat triggers event)
xADC4 = Room (room where a tile is triggered after guard defeat)
xADC6 = Action (whether a gate opens or closes)
xADC8 = Tile (tile that is being triggered)

2)
xADCC = Level
xADD3 = Guard
xADD7 = Room
xADD9 = Action
xADDB = Tile

3)
xADDF = Level
xADE6 = Guard
xADEA = Room
xADEC = Action
xADEE = Tile

4)
xADF2 = Level
xADF9 = Guard
xADFD = Room
xADFF = Action
xAE01 = Tile

5)
xAE05 = Level
xAE0C = Guard
xAE10 = Room
xAE12 = Action
xAE14 = Tile

6)
xAE18 = Level
xAE1F = Guard
xAE23 = Room
xAE25 = Action
xAE27 = Tile

----------------------------------------------------------------

Level hex values:
Level 1 = $00
Level 2 = $01
Level 3 = $02
Level 4 = $03
Level 5 = $04
Level 6 = $05
Level 7 = $06
Level 8 = $07
Level 9 = $08
Level 10 = $09
Level 11 = $0A
Level 12 = $0B
Level 13 = $0C
Level 14 = $0D
Level 15 = $0E
Level 16 = $0F
Level 17 = $10
Level 18 = $11
Level 19 = $12
Level 20 = $13
Jaffar level = $14
Demo level = $15
Training 1 = $16
Training 2 = $17
Training 3 = $18
Training 4 = $19
Training 5 = $1A

Guard hex values: (the guard names are taken from David's editor)
Skel = $01
Brown skel = $02
Golden skel = $03
Girl = $04
Fat = $05
Shadow = $06
Green = $07
Greenish blue = $08
Blue = $09
Red = $0A
Purple = $0B
Blueface = $0C
Red knight = $0D
Blue knight = $0E
Monster = $0F
Jaffar = $10

Room hex values: Convert the room number to hexadecimal.

Action hex values:
$00 = Instant silent open (Triggered gate will permanently open quickly without making the normal sound)
$01 = Regular temporary open (choose $01 for triggering exits or any other objects that aren't regular gates)
$02 = Permanent open
$03 = Close

Tile hex values: Convert the tile number to hexadecimal.
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

Re: How can I edit special gates in snes POP 1?

Post by robert »

Thanks, but I can't understand how to do it. :oops: I tell you one of the things I want to do:

In level 6 I put the girl guard in room 23 tile 9 seeing to the left. I put the gate it supposedly opens is in room 20 tile 20, and closed. I want the gate opens when I beat the girl, and stays open.

Well I tell you the other is level 9, the fat is in room 15 tile 16 seeing to the left. The gate is in room 15 tile 19. When I beat the fat the gate opens and stays open.

Just these things, I'm sorry but I don't know how to change the values. Can you help me please? :D
Image
This will be my face if you can't win any of my mods
Kaslghnoon
Sultan
Sultan
Posts: 153
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: How can I edit special gates in snes POP 1?

Post by Kaslghnoon »

You will be making a few changes to events 1 and 2.

1)
xADB9 = Level (no change)
xADC0 = Guard (no change)
xADC4 = Room (change to $14)
xADC6 = Action (no change)
xADC8 = Tile (no change)

2)
xADCC = Level (no change)
xADD3 = Guard (no change)
xADD7 = Room (change to $0F)
xADD9 = Action (no change)
xADDB = Tile (change to $13)

IMPORTANT NOTE: Backup your mod before hex-editing.

I made a video showing how to edit the ROM to accomplish what you described.
http://www.youtube.com/watch?v=o7IecrVqy1c

In the first 8 seconds I am deleting the header, for the rest of the video I am applying the above changes. Download and extract Translhextion, open the .smc file with it and simply do what is shown. Test the mod after saving to verify the results.
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

Re: How can I edit special gates in snes POP 1?

Post by robert »

I made the changes succesfully, thank you. Just one last question, is there any way to have another guard trigger in another level? I put a guard in level 7, specifically a dead purple guard (I don't know why it is in level editor) room 0 tile 13, and the gate is in room 20. With this I'm asking if the game can has 7 events?
Image
This will be my face if you can't win any of my mods
Kaslghnoon
Sultan
Sultan
Posts: 153
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: How can I edit special gates in snes POP 1?

Post by Kaslghnoon »

Yes, you can insert more trigger events. The more events you add, the more offsets you will have to edit. Let me know how many more events you think you will need and I will get back to you when I'm done coding. It takes a little work to avoid having glitches when adding bytes.
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

Re: How can I edit special gates in snes POP 1?

Post by robert »

Ok, right now the only trigger I want to add is the one that I told you in the last post. With this one I will complete all my mod.

Hope mk1995 see this: Happy Birthday :!:
Image
This will be my face if you can't win any of my mods
Kaslghnoon
Sultan
Sultan
Posts: 153
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: How can I edit special gates in snes POP 1?

Post by Kaslghnoon »

Make these changes to add a 7th event:
xADB5 to $4C
xADB6 to $5E
xADB7 to $FA
xFA5E to $AD
xFA5F to $79
xFA60 to $05
xFA61 to $C9
xFA62 to $06
xFA63 to $F0
xFA64 to $05
xFA65 to $4C
xFA66 to $B8
xFA67 to $AD
xFA68 to $D0
xFA69 to $0F
xFA6A to $AD
xFA6B to $2B
xFA6C to $06
xFA6D to $C9
xFA6E to $00
xFA6F to $F0
xFA70 to $08
xFA71 to $AD
xFA72 to $79
xFA73 to $05
xFA74 to $4C
xFA75 to $B8
xFA76 to $AD
xFA77 to $D0
xFA78 to $54
xFA79 to $A9
xFA7A to $14
xFA7B to $A2
xFA7C to $02
xFA7D to $A0
xFA7E to $13
xFA7F to $4C
xFA80 to $C9
xFA81 to $AD

----------------

Event 7 offsets:
xFA62 = Level
xFA6E = Guard
xFA7A = Room
xFA7C = Action
xFA7E = Tile

----------------

You didn't mention a tile number for the gate being opened in room 20; you can use the conversion below to modify xFA76.

Tile 0 = $00
Tile 1 = $01
Tile 2 = $02
Tile 3 = $03
Tile 4 = $04
Tile 5 = $05
Tile 6 = $06
Tile 7 = $07
Tile 8 = $08
Tile 9 = $09
Tile 10 = $0A
Tile 11 = $0B
Tile 12 = $0C
Tile 13 = $0D
Tile 14 = $0E
Tile 15 = $0F
Tile 16 = $10
Tile 17 = $11
Tile 18 = $12
Tile 19 = $13
Tile 20 = $14
Tile 21 = $15
Tile 22 = $16
Tile 23 = $17
Tile 24 = $18
Tile 25 = $19
Tile 26 = $1A
Tile 27 = $1B
Tile 28 = $1C
Tile 29 = $1D

Note: The guard's location (room/tile) does not effect the trigger event. The event will trigger the gate no matter where the guard is defeated. It's the location of the tile being triggered (room and tile of the gate being opened) that we need to assign. To summarize an event, such as event 7 that you just added:

At level (xFA62), after guard type (xFA6E) is defeated, apply action (xFA74) to the object at room (xFA72), tile (xFA76).
Guard location is not a part of the stipulation.

**Edit: I corrected the offset changes.
Last edited by Kaslghnoon on October 30th, 2011, 8:13 pm, edited 1 time in total.
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

Re: How can I edit special gates in snes POP 1?

Post by robert »

Really great! You must be a programmer or something about that ;) . Thanks a lot, now my mod is totally finnished! I will post it soon, are you going to try it? :D
Image
This will be my face if you can't win any of my mods
Kaslghnoon
Sultan
Sultan
Posts: 153
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: How can I edit special gates in snes POP 1?

Post by Kaslghnoon »

robert wrote:are you going to try it?
Of course I will! :)
Post Reply