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 »

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: 2879
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...
User avatar
Iso
Sheikh
Sheikh
Posts: 48
Joined: January 15th, 2010, 11:34 pm

Re: Hacking the SNES ROM

Post by Iso »

Kaslghnoon wrote:As of right now, your ROM is more than 1,048,576 bytes because byte(s) have been added between x8000-x1ffff.
Is this caused by hex editing exclusively or could it be a result of adding tiles with the graphics editor? Could over-writing pre-existing tiles instead of making brand new ones help?
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:
Kaslghnoon wrote:As of right now, your ROM is more than 1,048,576 bytes because byte(s) have been added between x8000-x1ffff.
Is this caused by hex editing exclusively or could it be a result of adding tiles with the graphics editor? Could over-writing pre-existing tiles instead of making brand new ones help?
First, x20000.smc was corrupted, the rest were good. No extra byte was inserted by mistake. Bytes can be inserted in Translhextion when you accidently hit the 'Insert' key on the keyboard toggling between 'Override' and 'Insert' mode. This information can be viewed at the status bar of Translhextion (at the bottom bar it's the second status from the right showing either "ANSI/OVR/L" or "ANSI/INS/L"). But I confirm that this corruption was not hex-editing related. It was Pr1SnesLevEd related. The corruption covered all offsets between xADF3C-xAE6AE, far away from the range covered in this topic.

Second, major data truncation had occurred to the first resource table. But this was not an internal fault of Pr1SnesLevEd, but rather the usage of its current version. I will address the proper usage of Pr1SnesLevEd's graphic editor in its topic so proper compression can be achieved without data loss.
User avatar
spartacus735
Wise Scribe
Wise Scribe
Posts: 221
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 »

Hey , I have some questions

1 - How to change the passwords of the game ? (such as "quiet level")

2 - How to remove the drive / video from the beginning (and the end) just to get the text from the beginning and change just to get "princed.org," myname "" name of mod "(as" quiet level ")

Thx
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod
David
The Prince of Persia
The Prince of Persia
Posts: 2879
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

spartacus735 wrote:1 - How to change the passwords of the game ? (such as "quiet level")
x15698 to x1569D: cheat password
x1571C to x1576E: letters on the password screen, with spaces between them, as they will appear on the screen
x15783 to x157A6: letters on the password screen, without any spaces
x15E38 to x15E57: letters used for making passwords
x15FF2 to x15FF8: default password
spartacus735 wrote:2 - How to remove the drive / video from the beginning (and the end) just to get the text from the beginning and change just to get "princed.org," myname "" name of mod "(as" quiet level ")
x18458 to x184BB: the first intro text
x184B6 to x18525: the second intro text

EDIT: All offsets in this post are for the headered rom.
Last edited by David on July 19th, 2013, 11:25 am, edited 1 time in total.
User avatar
spartacus735
Wise Scribe
Wise Scribe
Posts: 221
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Hacking the SNES ROM

Post by spartacus735 »

thx David !

I have another question, the shadow of the game is transparent. I wonder if it is possible to recover this effect and add a guard or prince

Image
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod
David
The Prince of Persia
The Prince of Persia
Posts: 2879
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Hacking the SNES ROM

Post by David »

I'm not sure what do you mean by "recover".
Do you want to make the shadow non-transparent?
Or do you want to make someone else transparent?
Post Reply