Hacking the SNES ROM

Discuss PoP1 for SNES here.
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

Re: Hacking the SNES ROM

Post by robert »

Kaslghnoon wrote:Problem: Konami screen does not load after editing level graphics using Pr1SnesLevEd

Temporary solution:

Option (A) Skip the Konami screen: x1802B to $A8
Option (B) Follow these steps:

1) Make a backup copy of your mod
2) Open your mod with Translhextion
3) Ctrl+f on the keyboard
4) Enter: <bh:01><bh:ff><bh:c0><bh:00><bh:0c><bh:00><bh:fe>
5) With values being highlighted, press these keys on the keyboard in the correct order:
Right arrow, Tab, Right arrow, Right Arrow, Right Arrow, 0
6) Save and test

If you had previously skipped the Konami and Title screens using the "x1801C to $01" hack, you may not even have realized that you've had this problem. Set x1801C back to $00 to check for a possible Konami screen corruption.
Many thanks for your help! One thing, step 4: when I enter the values it sends me "String not found", and this happens with the "migrated" rom (the 0.smc where I migrated the stuff from my rom). But don't worry, I skipped the Konami screen TEMPORAIRLY. I'll wait for David's response.
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: Hacking the SNES ROM

Post by Kaslghnoon »

robert wrote:One thing, step 4: when I enter the values it sends me "String not found", and this happens with the "migrated" rom (the 0.smc where I migrated the stuff from my rom).
I'm hoping you made a typo entering <bh:01><bh:ff><bh:c0><bh:00><bh:0c><bh:00><bh:fe> ... Otherwise, the Konami screen's resource data have disappeared into oblivion. At this point the more tile-editing you do the more damage may be done to the data of your mod's first resource table. Now of course I do not suggest that you stop working on your mod but make as many backups as possible.
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

Re: Hacking the SNES ROM

Post by robert »

Kaslghnoon wrote:
robert wrote:One thing, step 4: when I enter the values it sends me "String not found", and this happens with the "migrated" rom (the 0.smc where I migrated the stuff from my rom).
I'm hoping you made a typo entering <bh:01><bh:ff><bh:c0><bh:00><bh:0c><bh:00><bh:fe> ... Otherwise, the Konami screen's resource data have disappeared into oblivion. At this point the more tile-editing you do the more damage may be done to the data of your mod's first resource table. Now of course I do not suggest that you stop working on your mod but make as many backups as possible.
Sure... I'm scared now :shock: Yes I copied/pasted that text, no typing errors. I'm going to stop using the graphic editor, until David analyzes my rom (I sent him a copy by PM) and finds the solution. By now, I'll take a little break from my snes mod and focus on my still-not finnished new PC mod that I'm going to release very soon beside other 2 already done mods.
Image
This will be my face if you can't win any of my mods
User avatar
Iso
Sheikh
Sheikh
Posts: 48
Joined: January 15th, 2010, 11:34 pm

Re: Hacking the SNES ROM

Post by Iso »

Not sure if this intended or not but it seems you can only have one trigger potion per level. Not really an issue but it's worth noting.
Kaslghnoon
Sultan
Sultan
Posts: 153
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: Hacking the SNES ROM

Post by Kaslghnoon »

Iso wrote:Not sure if this intended or not but it seems you can only have one trigger potion per level. Not really an issue but it's worth noting.
If this can potentially limit level design ideas/creativity then it is an issue.
Kaslghnoon
Sultan
Sultan
Posts: 153
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: Hacking the SNES ROM

Post by Kaslghnoon »

Allow multiple trigger potions in a level:

The 0.smc code only allows one trigger potion per level. Use the hack below to break the barriers between trigger events.

Between 1 and 2: xFDA8 to $B8
Between 2 and 3: xFDBD to $CD
Between 3 and 4: xFDD2 to $E2
Between 4 and 5: xFDE7 to $F7
Between 5 and 6: xFDFC to $0C and xFDFD to $FE
Between 6 and 7: xFE11 to $21 and xFE12 to $FE
Between 7 and 8: xFE26 to $36 and xFE27 to $FE
Between 8 and 9: xFE3B to $4B and xFE3C to $FE
Between 9 and 10: xFE50 to $60 and xFE51 to $FE
Between 10 and 11: xFE65 to $75 and xFE66 to $FE
Between 11 and 12: xFE7A to $8A and xFE7B to $FE
Between 12 and 13: xFE8F to $9F and xFE90 to $FE
Between 13 and 14: xFEA4 to $B4 and xFEA5 to $FE

--

Example 1:

I'd like to reserve trigger potion events 7-10 to be used in level 8.

-First I refer to the "Trigger potion" section under "Advanced hacking" to locate my events:

7) In level xFD33
  • , drinking hurt potion in room xFE22
    • applies action xFE2D
      • to object located at room xFE2B
        • , tile xFE2F
          • .
            8) In level xFD37
            • , drinking hurt potion in room xFE37
              • applies action xFE42
                • to object located at room xFE40
                  • , tile xFE44
                    • .
                      9) In level xFD3B [LIST 1], drinking hurt potion in room xFE4C [LIST 4] applies action xFE57 [LIST 7] to object located at room xFE55 [LIST 4], tile xFE59 [LIST 5].
                      10) In level xFD3F [LIST 1], drinking hurt potion in room xFE61 [LIST 4] applies action xFE6C [LIST 7] to object located at room xFE6A [LIST 4], tile xFE6E [LIST 5].

                      -Next, I set xFD33, xFD37, xFD3B, and xFD3F all to $07, then set my rooms, actions, triggered rooms/tiles accordingly.

                      -Finally, I break the barriers:
                      Between 7 and 8: xFE26 to $36 and xFE27 to $FE
                      Between 8 and 9: xFE3B to $4B and xFE3C to $FE
                      Between 9 and 10: xFE50 to $60 and xFE51 to $FE


                      Example 2:

                      I'd like to reserve trigger potion events 1-3 to be used in level 4, while events 1 and 2 are both triggered by drinking the same potion.

                      -First I refer to the "Trigger potion" section under "Advanced hacking" to locate my events:

                      1) In level xFD1B [LIST 1], drinking hurt potion in room xFDA4 [LIST 4] applies action xFDAF [LIST 7] to object located at room xFDAD [LIST 4], tile xFDB1 [LIST 5].
                      2) In level xFD1F [LIST 1], drinking hurt potion in room xFDB9 [LIST 4] applies action xFDC4 [LIST 7] to object located at room xFDC2 [LIST 4], tile xFDC6 [LIST 5].
                      3) In level xFD23 [LIST 1], drinking hurt potion in room xFDCE [LIST 4] applies action xFDD9 [LIST 7] to object located at room xFDD7 [LIST 4], tile xFDDB [LIST 5].

                      -Next, I set xFD1B, xFD1F, and xFD23 all to $03, then set my rooms, actions, triggered rooms/tiles accordingly, making sure I set xFDA4 and xFDB9 to the same value of the room number where the trigger potion is located

                      -Next, I break the barriers:
                      Between 1 and 2: xFDA8 to $B8
                      Between 2 and 3: xFDBD to $CD

                      -Finally, I link 1 to 2: xFDB2 to $20

                      Yes, it sure isn't the simplest thing to do, but from what I have tested, it works.
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

Re: Hacking the SNES ROM

Post by robert »

Testing the "Uniform Guards" I've found out which value corresponds to each guard's palette, and more palettes that I don't know where they are used.

These are some of the values that represent a palette guard or prince:

$00: edit: it's dead puprle
$01: skel
$02: brown skel
$03: yellow skel
$04: girl
$05: fat
$06: shadow
$07: yellow-green normal guard
$08: green-blue normal guard
$09: yellow-blue normal guard
$0A: red normal guard
$0B: green-violet normal guard
$0C: blueface guard
$0D: red knight
$0E: blue knight
$0F: monster
$10: jaffar
$11: dead guard (mouse palettes)
$12: red skel (lvl10)
$13: girl (again)
$1B: normal prince

Some values represent a palette of different colours that not correspond to a guard.
For example: $28 is green, pink, red, orange, etc.

Some palettes are repeated in other values.
For example: $1E skel, $1F red guard, $25 green-violet guard, $23 normal prince, etc.

Some values represent a nice combination of colours.
For example: $28 is an all-shades-of-dark-brown guard. Nice if you want an "afro american" guard :lol:

Curiously, I couldn't find the value of dead purple guard, which is also the princess's palettes.
In pr1snesleved, if you open the "edit sprites palettes" you'll see in the third row a combination of greenish palettes. I couldn't find its value too :|
Last edited by robert on June 21st, 2013, 6:34 pm, edited 1 time in total.
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: Hacking the SNES ROM

Post by Kaslghnoon »

Well done Robert, just replace "red prince" with "dead purple" and your info is completely accurate.

Palette $00 is dead purple by default. If you made any guard palette changes using Pr1SnesLevEd it will also be applied here.

Normal Prince and blue prince ($5C) are available. Red Prince is not available to be used in Uniform Guards unless:
A) Using Pr1SnesLevEd, you change a guard's palette to 1
B) You carefully add a $01 somewhere in the x75A0-x769F region

--

Mouse palette:

x760E decides which palette is used for the mouse. If you happen to find a suitable palette for the mouse among the values $13-$FF and set x760E to that value, then the guard "dead" and the mouse will no longer share a palette.
User avatar
robert
Sultan
Sultan
Posts: 194
Joined: August 27th, 2011, 7:16 pm
Location: Argentina

Re: Hacking the SNES ROM

Post by robert »

Kaslghnoon wrote:Well done Robert, just replace "red prince" with "dead purple" and your info is completely accurate.

Palette $00 is dead purple by default. If you made any guard palette changes using Pr1SnesLevEd it will also be applied here.
Edited :D
Kaslghnoon wrote:Red Prince is not available to be used in Uniform Guards unless:
A) Using Pr1SnesLevEd, you change a guard's palette to 1
You're right, I had changed the dead purple guard palette to 1, that's why he looked like red prince.
Kaslghnoon wrote: Mouse palette:

x760E decides which palette is used for the mouse. If you happen to find a suitable palette for the mouse among the values $13-$FF and set x760E to that value, then the guard "dead" and the mouse will no longer share a palette.
Good!, now we can have 7 normal guards (like PC PoP1!): the common guards and the "dead" and dead purple

Thank you Kasl :D
Image
This will be my face if you can't win any of my mods
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 »

robert wrote:Testing the "Uniform Guards" I've found out which value corresponds to each guard's palette, and more palettes that I don't know where they are used.

[...]
I think I found where are the meanings of these palette numbers stored.
At x75A0 there is a table that begins with:
x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF
03 04 05 06 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 | 0x
14 15 07 08 C2 10 E2 20 AF 79 05 00 C9 04 D0 0E | 1x
AF 06 05 00 C9 0F D0 06 A9 06 8F 2B 06 00 AF 79 | 2x

You can see that, for example, entries $0A and $1F both contain $0E (red guard), $04 and $13 both contain $08 (girl), $0B and $25 both contain $0F (green-violet guard). Actually, the part from 08 C2 10 is not data, but machine code!

Ok, I just realized that this table is the guard's palette table, the same that you can edit with Guards/Palettes or Guards/Settings.
However, these guard IDs (which match those in
  • in the first post) differ by 2 from those used in the levels. (So the editor uses offset 0x759E.)
    So the line "Palette = This palette will be applied." should say that it's from
    • .
      Kaslghnoon wrote:B) You carefully add a $01 somewhere in the x75A0-x769F region
      Yes, it's exactly this table.
User avatar
Iso
Sheikh
Sheikh
Posts: 48
Joined: January 15th, 2010, 11:34 pm

Re: Hacking the SNES ROM

Post by Iso »

Kaslghnoon wrote: 4) Enter: <bh:01><bh:ff><bh:c0><bh:00><bh:0c><bh:00><bh:fe>
5) With values being highlighted, press these keys on the keyboard in the correct order:
Right arrow, Tab, Right arrow, Right Arrow, Right Arrow, 0
My game has begun freezing or going black when a guard tries to counter-attack, so I went to try this fix but when I enter those values it says string not found. Are you supposed to do each value individually?
Kaslghnoon
Sultan
Sultan
Posts: 153
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: Hacking the SNES ROM

Post by Kaslghnoon »

Thanks David and Robert for your addition to "Uniform Guards." I plan on expanding "Uniform Guards" to allow multiple guard palette-swaps in one level. This along with "Level-specific guard skills" and "Guard Skill Modifier" will allow for the possibility of having 40+ unique guards in a SNES mod.
robert via PM wrote:Is there also a way to make the skeleton boss in level 12 have battle intro without quitting other boss intro?
Certainly. Follow the directions below:

1) Make a backup copy of your mod
2) Open your mod with Translhextion and make these offset changes:
x8A59 to $4C
x8A5A to $D3
x8A5B to $FE
x8AC2 to $4C
x8AC3 to $FC
x8AC4 to $FE
3) Ctrl+g on the keyboard
4) Enter xFED3
5) Minimize Translhextion while focus is still on xFED3
6) Download http://www.freewebs.com/kaslghnoon/xFED3.zip
7) Open xFED3.txt with Notepad
8) Ctrl+a, then Ctrl+c on the keyboard
9) Switch back to the Translhextion session of your mod
10) Ctrl+v on the keyboard, click 'OK'
11) Save and close Translhextion, close xFED3.txt

The outcome:

Guards with boss introductions:

1) Golden Skeleton
2) xFED4 (Default: Fat)
  • 3) xFED8 (Default: Red Knight)
    • 4) xFEDC (Default: Blue Knight)
      • 5) xFEE0 (Default: Blueface)
        • 6) xFEE4 (Default: Jaffar)
          • 7) xFEE8 (Default: $CC)
            • 8) xFEEC (Default: $CC)
              • 9) xFEF0 (Default: $CC)
                • ----------------------------------------------------------
                  Disable Golden Skeleton boss intro: xFEFD to $CC
                  ----------------------------------------------------------
Kaslghnoon
Sultan
Sultan
Posts: 153
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: Hacking the SNES ROM

Post by Kaslghnoon »

Iso wrote:My game has begun freezing or going black when a guard tries to counter-attack
Iso, please take the time to read and follow the "ROM Troubleshooting" section I'm about to add to this topic.

ROM Troubleshooting:

Data corruption can occur. Take the following steps to narrow down the corruption of your SNES Prince of Persia mod:

1) Download http://www.popot.org/get_the_games/software/PoP1_US.smc
2) Make 4 copies of PoP1_US.smc, rename to x0000.smc, x8000.smc, x10000.smc and x20000.smc
3) Open the corrupted mod with Translhextion
4) Ctrl+Home on the keyboard
5) Ctrl+e on the keyboard
6) Modify the value of "Select up to and including offset:" from x0 to x7fff, click 'OK'
7) Ctrl+c on the keyboard, click 'OK', minimize the Translhextion session of the corrupted mod
8) Open x0000.smc with Translhextion
9) Ctrl+Home on the keyboard
10) Ctrl+v on the keyboard, click 'OK'
11) Save and close the Translhextion session of x0000.smc
12) Restore the Translhextion session of the corrupted mod
13) Ctrl+g on the keyboard
14) Enter x8000
15) Ctrl+e on the keyboard
16) Modify the value of "Select up to and including offset:" from x0 to xffff, click 'OK'
17) Ctrl+c on the keyboard, click 'OK', minimize the Translhextion session of the corrupted mod
18) Open x8000.smc with Translhextion
19) Ctrl+g on the keyboard
20) Type x8000 then Enter (Do not copy/paste the x8000)
21) Ctrl+v on the keyboard, click 'OK'
22) Save and close the Translhextion session of x8000.smc
23) Restore the Translhextion session of the corrupted mod
24) Ctrl+g on the keyboard
25) Enter x10000
26) Ctrl+e on the keyboard
27) Modify the value of "Select up to and including offset:" from x0 to x1ffff, click 'OK'
28) Ctrl+c on the keyboard, click 'OK', minimize minimize the Translhextion session of the corrupted mod
29) Open x10000.smc with Translhextion
30) Ctrl+g on the keyboard
31) Type x10000 then Enter (Do not copy/paste the x10000)
32) Ctrl+v on the keyboard, click 'OK'
33) Save and close the Translhextion session of x10000.smc
34) Restore the Translhextion session of the corrupted mod
35) Ctrl+g on the keyboard
36) Enter x20000
37) Ctrl+Shift+End on the keyboard
38) Ctrl+c on the keyboard, click 'OK', close the Translhextion session of the corrupted mod
39) Open x20000.smc with Translhextion
40) Ctrl+g on the keyboard
41) Type x20000 then Enter (Do not copy/paste the x20000)
42) Ctrl+v on the keyboard, click 'OK'
43) Save and close the Translhextion session of x20000.smc
44) Test x0000.smc, x8000.smc, x10000.smc and x20000.smc one by one for corruption. Record the results by adding (Pass) or (Fail) to their file names. Example: x0000(Pass).smc, x8000(Fail).smc
45) If x0000.smc, x8000.smc, or x10000.smc are corrupted, this indicates an error made while hex-editing. For example if x8000.smc is corrupted, you have now narrowed the corruption down to x8000-xFFFF. Try to correct the problem yourself. If you still require assistance, report the problem in this topic.
46) If x20000.smc is the corrupted one, report the problem in the Pr1SnesLevEd topic.

--

Important Note:
If your mod is not the US version, at step 1 you go to http://www.popot.org/get_the_games.php?game=1_SNES to download the correct version of the ROM. Then step 2 will instruct you to make 4 copies of either PoP1_EU.smc or PoP1_JP.smc. All else stays the same.
User avatar
Iso
Sheikh
Sheikh
Posts: 48
Joined: January 15th, 2010, 11:34 pm

Re: Hacking the SNES ROM

Post by Iso »

Is the 0.smc you provided in the first post the US version? I tried the above steps but at step 42 it said there was not enough space. x0000.smc did not have the problem. x8000 and x10000 wouldn't load.
Kaslghnoon
Sultan
Sultan
Posts: 153
Joined: February 27th, 2010, 8:35 pm
Location: United States

Re: Hacking the SNES ROM

Post by Kaslghnoon »

Iso wrote:Is the 0.smc you provided in the first post the US version? I tried the above steps but at step 42 it said there was not enough space. x0000.smc did not have the problem. x8000 and x10000 wouldn't load.
Yes. Both 0.smc and PoP1_US.smc are 1,048,576 bytes. As of right now, your ROM is more than 1,048,576 bytes because byte(s) have been added between x8000-x1ffff. If this sounds like something you can correct, by all means go for it. If not, I need to see the x0-x1ffff portion of the ROM for me to be able to do anything about it.

Ctrl+Home, then use Ctrl+e to highlight offsets x0-x1ffff. Use Ctrl+Shift+o to export the selection to a .hex file, attach that hex file to this topic. It will not spoil your mod because x0-x1ffff gives no information about level design or edited graphics/palettes...
Post Reply