don't click here

How to add Dynamic Palettes in Sonic 2 SMS

Discussion in 'Engineering & Reverse Engineering' started by Mikel, Feb 23, 2009.

Thread Status:
Not open for further replies.
  1. Mikel

    Mikel

    Member
    I would like to thank Glitch for both, the Sonic 2 SMS disassembly, and the program Aspect Edit.

    Ok, if you have been playing Sonic 2 SMS in the past, you may notice that four zones in the game lack the use of Dynamic Palettes, as only three of the zones in the original game use them. The four zones that lacked Dynamic Palettes were:

    Underground Zone, Green Hills Zone, Gimmick Mountain Zone and Scrambled Egg Zone.

    So, if you want to add Dynamic Palettes for those four zones in Sonic 2 SMS, follow these instrcutions below:

    First, go to LevelPaletteValues in the Sonic 2 SMS disassembly, located in src/s2.asm, and you will get something like this:
    Code (ASM):
    1. LevelPaletteValues:
    2. .db $0E, $09
    3. .db $0E, $09
    4. .db $0E, $09
    5. ;shz
    6. .db $0F, $05
    7. .db $10, $06
    8. .db $0F, $05
    9. ;alz
    10. .db $11, $07
    11. .db $12, $08
    12. .db $11, $07
    13. ;ghz
    14. .db $13, $04
    15. .db $13, $04
    16. .db $13, $04
    17.  
    18. .db $14, $0A
    19. .db $14, $0A
    20. .db $14, $0A
    21.  
    22. .db $15, $0B
    23. .db $15, $0B
    24. .db $15, $0B
    25.  
    26. .db $16, $0C
    27. .db $16, $0C
    28. .db $17, $0D
    Take a look at Underground Zone for example:
    Code (ASM):
    1. .db $0E, $09
    2. .db $0E, $09
    3. .db $0E, $09
    As you can see, $0E is the zone palette for Underground Zone, and $09 is the palette for Sonic in Underground Zone.

    Then, Open up Aspect Edit, and click on the Open Palette button:
    [​IMG]

    Right now, we are going to edit Underground Zone's palette, so click on "palette_ugz.bin" (Which is located in the palettes folder) in the file browser:
    [​IMG]

    Then, you can edit the colors in the palette, after you're done, click the Save Palette as button:
    [​IMG]
    When it asks for a new filename, save it as "palette_ugz2.bin" for Act 2, and "palette_ugz3.bin" for Act 3.

    For GHZ, do the same method, but open "palette_ghz.bin", and save it as "palette_ghz2.bin" for Act 2, and "palette_ghz3.bin" for Act 3.

    Same goes for SEZ, and GMZ. open "palette_sez.bin" for SEZ, and "palette_gmz.bin" for GMZ, for SEZ, save it as "palette_sez2.bin" for Act 2, and "palette_sez3.bin" for Act 3. And for GMZ, save it as "palette_gmz2.bin" for Act 2, and "palette_gmz3.bin" for Act 3.

    Then, If you want Underground to go through a Day-to-Night, do this:
    Code (ASM):
    1. ;ugz
    2. .db $0E, $09
    3. .db $2F, $09
    4. .db $30, $09
    And for Green Hills Zone to Scrambled Egg, do this:
    Code (ASM):
    1. ;ghz
    2. .db $13, $04
    3. .db $31, $04
    4. .db $32, $04
    5. ;gmz
    6. .db $14, $0A
    7. .db $33, $0A
    8. .db $34, $0A
    9. ;sez
    10. .db $15, $0B
    11. .db $35, $0B
    12. .db $36, $0B
    And lastly, add these lines at the end of src/includes/palettes.asm:
    Code (ASM):
    1. Palette_UGZ_2:    ;$2F
    2. .incbin "palettes\palette_ugz2.bin"
    3.  
    4. Palette_UGZ_3:    ;$30
    5. .incbin "palettes\palette_ugz3.bin"
    6.  
    7. Palette_GHZ_2:    ;$31
    8. .incbin "palettes\palette_ghz2.bin"
    9.  
    10. Palette_GHZ_3:    ;$32
    11. .incbin "palettes\palette_ghz3.bin"
    12.  
    13. Palette_GMZ_2:    ;$33
    14. .incbin "palettes\palette_gmz2.bin"
    15.  
    16. Palette_GMZ_3:    ;$34
    17. .incbin "palettes\palette_gmz3.bin"
    18.  
    19. Palette_SEZ_2:    ;$35
    20. .incbin "palettes\palette_sez2.bin"
    21.  
    22. Palette_SEZ_3:    ;$36
    23. .incbin "palettes\palette_sez3.bin"
    Then, build the rom, and check out your new Dynamic palettes for UGZ, GHZ, GMZ, and SEZ.

    That's all, if you have any questions, PM me, and give credit where credit is due.

    And if you want to see my dynamic palettes for UGZ, here they are (The palette for Act 1 is the Same palette as the original game):

    UGZ Act 1 (Same palette as the original game)

    UGZ Act 2

    UGZ Act 3
     
  2. Spanner

    Spanner

    The Tool Member
    Very nice, even though it's pretty much set out for you it's good to see somebody doing something with the disassembly.
    Keep it up! :words:
     
  3. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,641
    57
    28
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    Wow, Mikel, you didn't waste any time did you? Great Work!
     
  4. Mikel

    Mikel

    Member
    Thanks, I felt very impressed on how I made a guide for an 8-bit Sonic game.

    Well, Shadow Fire's original guide for Sonic 1 inspired me to make this guide, but Thanks anyway.
     
Thread Status:
Not open for further replies.