Sonic sprite pallete query

Discussion in 'Engineering & Reverse Engineering' started by Rabid, Mar 25, 2008.

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

    Rabid

    *Proclaimed by Nemesis* The Pallete Master Oldbie
    63
    0
    6
    Cumbria, northwest UK
    Project Pending...
    Ok, I asked this question a while back on area 51 before we had the assemblies and it wasn't possible then with our level of understanding so here I go again.

    What im after is to change the pallete of sonic and tails by refering those two sprites to entirely seperate pallete each without effecting everything else that shares sonics pallete in sonic 2.

    The theory being that if possible I could severly increase the graphical quality of those sprites because they would no longer need the shared colours of other sprites such as tails colours in the pallete for sonic and completly redraw their framed to accomodate.

    I really need and answer for this as its one essential ideas for my annual sonic hacking comp entry.

    Thanks!
     
  2. Mr. Fox

    Mr. Fox

    Member
    556
    9
    18
    Megadrive allows only for 64 colors on the screen simultaneously. That's 4 palettes.
     
  3. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,582
    3
    18
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    Theoretically, yes, it is possible, but you would be losing a palette line for your level art, which will add many more limitations, so I personally wouldn't recommend it.
    But, If you're willing to overhaul the level art to fit the new palette system, then go for it, no reason not to try =P
     
  4. JoseTB

    JoseTB

    Tech Member
    700
    44
    28
    Without completely redrawing most of the level related art in order not to use two lines but one, it's simply not possible.
     
  5. Tweaker

    Tweaker

    Misfit
    12,389
    1
    0
    You could always pull a NES trick and do flickering—changing the palette every frame and displaying Sonic and Tails only on the frame where the relevant palette colors are loaded. It would look horribly ugly, but I guess it would work. =P
     
  6. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    18,105
    300
    63
    Berkshire, England
    Learning Cymraeg
    I was about to say, wouldn't that be utterly AWFUL to look at?
     
  7. ICEknight

    ICEknight

    Researcher Researcher
    I'm thinking that perhaps he just wants either Sonic or Tails on screen, and not both. So the game would load a different first palette, depending on the character you choose.
     
  8. Hitaxas

    Hitaxas

    Retro 80's themed Twich streamer Member
    I don't think that's what he means. From what I understand, he wants to be able to have both Sonic and Tails on the screen, but both using different palette lines. If a plain "separate Palette" deal is all they want:

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm">Level_LoadPal:
    [color= #00bfff;]move[/color].[color= #00bfff;]b[/color] <span style="">(</span>Level<span style="">)</span>.[color= #00bfff;]w[/color],<span style="font-weight:bold;">d0</span>
    [color= #00bfff;]cmpi[/color].[color= #00bfff;]w[/color] [color= #ff0000;]#[/color][color= #ff0000;]1[/color],<span style="">(</span>Player_mode<span style="">)</span>.[color= #00bfff;]w[/color] [color= #adadad; font-style: italic;]; is character sonic?[/color]
    [color= #00bfff;]bne[/color] TailsPalLoad [color= #adadad; font-style: italic;]; If not, load Tails pallet[/color]
    [color= #00bfff;]cmpi[/color].[color= #00bfff;]w[/color] [color= #ff0000;]#[/color][color= #ff0000;]0[/color],<span style="">(</span>Player_mode<span style="">)</span>.[color= #00bfff;]w[/color] [color= #adadad; font-style: italic;]; is character sonic and Tails?[/color]
    [color= #00bfff;]bne[/color] both_pal
    [color= #00bfff;]move[/color].[color= #00bfff;]b[/color] [color= #ff0000;]#[/color][color= #ff0000;]2[/color],<span style="">(</span>player_mode<span style="">)</span>.[color= #00bfff;]w[/color]
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]3[/color],<span style="font-weight:bold;">d0</span>
    [color= #00bfff;]bsr[/color].[color= #00bfff;]w[/color] PalLoad2 [color= #adadad; font-style: italic;]; load Sonic's pallet line[/color]
    [color= #00bfff;]tst[/color].[color= #00bfff;]b[/color] <span style="">(</span>Water_flag<span style="">)</span>.[color= #00bfff;]w[/color] [color= #adadad; font-style: italic;]; does level have water?[/color]
    [color= #00bfff;]beq[/color].[color= #00bfff;]s[/color] Level_GetBgm [color= #adadad; font-style: italic;]; if not, branch[/color]
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]15[/color][/color],<span style="font-weight:bold;">d0</span> [color= #adadad; font-style: italic;]; palette number $15[/color]
    [color= #00bfff;]cmpi[/color].[color= #00bfff;]b[/color] [color= #ff0000;]#[/color][color= #ff0000;]8[/color],<span style="">(</span>Current_Zone<span style="">)</span>.[color= #00bfff;]w[/color]
    [color= #00bfff;]beq[/color].[color= #00bfff;]s[/color] Level_WaterPal [color= #adadad; font-style: italic;]; branch if level is HPZ[/color]
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]16[/color][/color],<span style="font-weight:bold;">d0</span> [color= #adadad; font-style: italic;]; palette number $16[/color]
    [color= #00bfff;]cmpi[/color].[color= #00bfff;]b[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;]D[/color],<span style="">(</span>Current_Zone<span style="">)</span>.[color= #00bfff;]w[/color]
    [color= #00bfff;]beq[/color].[color= #00bfff;]s[/color] Level_WaterPal [color= #adadad; font-style: italic;]; branch if level is CPZ[/color]
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]17[/color][/color],<span style="font-weight:bold;">d0</span> [color= #adadad; font-style: italic;]; palette number $17[/color]
    &nbsp;
    &nbsp;
    TailsPalLoad:
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]28[/color][/color],<span style="font-weight:bold;">d0</span>
    [color= #00bfff;]bsr[/color].[color= #00bfff;]w[/color] PalLoad2 [color= #adadad; font-style: italic;]; load Tails pallet line[/color]
    [color= #00bfff;]tst[/color].[color= #00bfff;]b[/color] <span style="">(</span>Water_flag<span style="">)</span>.[color= #00bfff;]w[/color] [color= #adadad; font-style: italic;]; does level have water?[/color]
    [color= #00bfff;]beq[/color].[color= #00bfff;]s[/color] Level_GetBgm [color= #adadad; font-style: italic;]; if not, branch[/color]
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]15[/color][/color],<span style="font-weight:bold;">d0</span> [color= #adadad; font-style: italic;]; palette number $15[/color]
    [color= #00bfff;]cmpi[/color].[color= #00bfff;]b[/color] [color= #ff0000;]#[/color][color= #ff0000;]8[/color],<span style="">(</span>Current_Zone<span style="">)</span>.[color= #00bfff;]w[/color]
    [color= #00bfff;]beq[/color].[color= #00bfff;]s[/color] Level_WaterPal [color= #adadad; font-style: italic;]; branch if level is HPZ[/color]
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]16[/color][/color],<span style="font-weight:bold;">d0</span> [color= #adadad; font-style: italic;]; palette number $16[/color]
    [color= #00bfff;]cmpi[/color].[color= #00bfff;]b[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;]D[/color],<span style="">(</span>Current_Zone<span style="">)</span>.[color= #00bfff;]w[/color]
    [color= #00bfff;]beq[/color].[color= #00bfff;]s[/color] Level_WaterPal [color= #adadad; font-style: italic;]; branch if level is CPZ[/color]
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]17[/color][/color],<span style="font-weight:bold;">d0</span> [color= #adadad; font-style: italic;]; palette number $17[/color]
    &nbsp;
    both_pal:
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]3[/color],<span style="font-weight:bold;">d0</span>
    [color= #00bfff;]bsr[/color].[color= #00bfff;]w[/color] PalLoad2 [color= #adadad; font-style: italic;]; load Sonic's pallet line[/color]
    [color= #00bfff;]tst[/color].[color= #00bfff;]b[/color] <span style="">(</span>Water_flag<span style="">)</span>.[color= #00bfff;]w[/color] [color= #adadad; font-style: italic;]; does level have water?[/color]
    [color= #00bfff;]beq[/color].[color= #00bfff;]s[/color] Level_GetBgm [color= #adadad; font-style: italic;]; if not, branch[/color]
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]15[/color][/color],<span style="font-weight:bold;">d0</span> [color= #adadad; font-style: italic;]; palette number $15[/color]
    [color= #00bfff;]cmpi[/color].[color= #00bfff;]b[/color] [color= #ff0000;]#[/color][color= #ff0000;]8[/color],<span style="">(</span>Current_Zone<span style="">)</span>.[color= #00bfff;]w[/color]
    [color= #00bfff;]beq[/color].[color= #00bfff;]s[/color] Level_WaterPal [color= #adadad; font-style: italic;]; branch if level is HPZ[/color]
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]16[/color][/color],<span style="font-weight:bold;">d0</span> [color= #adadad; font-style: italic;]; palette number $16[/color]
    [color= #00bfff;]cmpi[/color].[color= #00bfff;]b[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;]D[/color],<span style="">(</span>Current_Zone<span style="">)</span>.[color= #00bfff;]w[/color]
    [color= #00bfff;]beq[/color].[color= #00bfff;]s[/color] Level_WaterPal [color= #adadad; font-style: italic;]; branch if level is CPZ[/color]
    [color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]17[/color][/color],<span style="font-weight:bold;">d0</span> [color= #adadad; font-style: italic;]; palette number $17[/color]</pre><!--gc2--><!--TGV2ZWxfTG9hZFBhbDoKCW1vdmUuYgkoTGV2ZWwpLncsZDAKCWNtcGkudwkjMSwoUGxheWVyX21vZGUp
    LncgOyBpcyBjaGFyYWN0ZXIgc29uaWM/CglibmUJVGFpbHNQYWxMb2FkCQk7IElmIG5vdCwgbG9hZCBUYWlscyBwYWxsZXQKCWNtcGkudwkjMCwo
    UGxheWVyX21vZGUpLncgOyBpcyBjaGFyYWN0ZXIgc29uaWMgYW5kIFRhaWxzPwoJYm5lICAgICBib3RoX
    3BhbAoJbW92ZS5iICAjMiwocGxheWVyX21vZGUpLncKCW1v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ICYjMDM2OzE2CgljbXBpLmIJIyYjMDM2O0QsKEN1cnJlbnRfWm9uZSkudwoJYmV
    xLnMJTGV2ZWxfV2F0ZXJQYWwgOyBicmFuY2ggaWYgbGV2ZWwgaXMgQ1BaCgltb3ZlcQkjJiMwMzY7MTcs
    ZDAJOyBwYWxldHRlIG51bWJlciAmIzAzNjsxNwoKYm90aF9wYWw6CiAgICAgICAgICAgICAgICBtb3Zlc
    QkjMyxkMAogICAgICAgICAgICAgICAgYnNyLncJUGFsTG9hZDIJOyBsb2FkIFNvbmljJiMzOTtzIHBhbG
    xldCBsaW5lCiAgICAgICAgICAgICAgICB0c3QuYgkoV2F0ZXJfZmxhZykudwk7IGRvZXMgbGV2ZWwgaGF
    2ZSB3YXRlcj8KCWJlcS5zCUxldmVsX0dldEJnbQk7IGlmIG5vdCwgYnJhbmNoCgltb3ZlcQkjJiMwMzY7
    MTUsZDAJOyBwYWxldHRlIG51bWJlciAmIzAzNjsxNQoJY21waS5iCSM4LChDdXJyZW50X1pvbmUpLncKC
    WJlcS5zCUxldmVsX1dhdGVyUGFsIDsgYnJhbmNoIGlmIGxldmVsIGlzIEhQWgoJbW92ZXEJIyYjMDM2Oz
    E2LGQwCTsgcGFsZXR0ZSBudW1iZXIgJiMwMzY7MTYKCWNtcGkuYgkjJiMwMzY7RCwoQ3VycmVudF9ab25
    lKS53CgliZXEucwlMZXZlbF9XYXRlclBhbCA7IGJyYW5jaCBpZiBsZXZlbCBpcyBDUFoKCW1vdmVxCSMm
    IzAzNjsxNyxkMAk7IHBhbGV0dGUgbnVtYmVyICYjMDM2OzE3--><!--egc2--><!--g2--></div><!--eg2-->

    Just add the new palette to the end of PalPointers , and your all set.

    Otherwise, flickering is the only logical answer, which would look like shit.
     
  9. ICEknight

    ICEknight

    Researcher Researcher
    Well... doesn't it show more colors when there's some water on screen? But I guess the water effect just divides the screen and can't apply other colors to specific sprites...
     
  10. Bibin

    Bibin

    DON'T LET THE SUN LAUGH AT YOU. Member
    882
    0
    0
    New York City
    Ghost in the Machine
    It can show 64 simultaniously if you do not count the fact that you can change the palettes at a defined scanline(s). Theoretically, you could have 64*(vertheight) colors, but as this is hard to pull off without being inefficient and inaccurate, resulting in some color wierdness (look at the top of the water in CPZ in Sonic 2 after disabling the watertops; you can see it at the edges. That's the purpose of the top-o-water sprites)

    Now, if you look at the sonic in my signature, you'll see that I merged his tan and reds into a red-orange-tan 5-color gradient, and merged his blues and greys into one long blue line, making what would be greys slightly greyed-blues. Other than the fact that I made his tans too dark, it looks generally good and allows for quite complex shading.
     
Thread Status:
Not open for further replies.