don't click here

alternate Supersonic pallettes

Discussion in 'General Sonic Discussion' started by re-inferno, Jul 14, 2005.

Thread Status:
Not open for further replies.
  1. re-inferno

    re-inferno

    Member
    49
    0
    6
    ok, since I got my old ARP Codes to work here we go.
    Either you try this on the real hardware or use Kega Fusion as Iceknight mentioned in the linked thread, Gens does not work!


    facts:
    Activating the code FFF65F:00XX will switch sonics pallette where XX determines the pallette itself.

    FF= normal Supersonic pallette (works with S2 and S2B but that is already known)
    01= weird looking (probably glitched) pallette that also works with S2B, but I wouldn't count this as valid pallette

    47 (even some other values) = makes sonic flash from yellow to a bright pink to it's original blue. (only works with S2F)
    This pallette seems very clean.

    theory:
    My belief is that the last pallete is an alternate one for Supersonic which was scrapped in the last minute in favour of the yellow one. Reason is that I don't know of any object in the game that uses such a rotating pallette (so it could be incidently(sp?) switched.
    And if you think of S3&K's Hypersonic, the idea was recycled (with a bit more tweaking of course)

    The attached gif shows the three pallettes, I didn't make them animated because it would be to big then.
     

    Attached Files:

    • rp.gif
      rp.gif
      File size:
      8.6 KB
      Views:
      1
  2. Aurochs

    Aurochs

    Единый, могучий Советский Союз! Tech Member
    2,343
    0
    0
    Whatever catches my fancy
    Hmm. I thought that was just a flag controlled by the LSB. Shows just how much I know about the engine. :P

    Note that inserting $02 in there yields the normal pallette.
     
  3. LocalH

    LocalH

    roxoring your soxors Tech Member
    I don't know about the pink part of that, but I'm almost wondering if the yellow-to-blue fade isn't used, when you revert from Super Sonic to regular Sonic.

    Matter of fact, I just did something that makes me think even more that it's just that, with other stuff in front of it that I don't recognize. While the game is running, enable the code, and as soon as Sonic turns pink disable the code. When it gets through the yellow-to-blue part, it stops, just like when you lose your last ring as Super Sonic.

    Edit: Also, I'm not so sure with this, but I know that you turn pink for just a few frames when switching to Super Sonic, perhaps this is somethig to do with that? If not the same pallet rotation, maybe an alternate one that they decided to change?
     
  4. re-inferno

    re-inferno

    Member
    49
    0
    6
    I checked, sonic turns a bit violet when becoming Supersonic, but there's none of the pink frames in the alternate rotating pallette

    - which ist the same with the "FF" Supersonic palette
    - also note, while being pink, sonic doesn't become blue before he gets yellow, (pink -> violet -> yellow -> blue) so the yellow -> blue fade is the only part where the palette rotation can be "cleanly" interrupted.
    That behavior would be even more proof thet they came up with another Supersonic palette
     

    Attached Files:

    • rp1.GIF
      rp1.GIF
      File size:
      4.8 KB
      Views:
      3
  5. LocalH

    LocalH

    roxoring your soxors Tech Member
    I don't know if you left out an 'n' there, but I just turned on the FF code, let it start rotating the pallet, then disabled the code. So far, Sonic is still flashing yellow (it's been about a minute and a half).

    Yeah, I see about him turning pink, it's only for like one frame or so. Still, I think that the yellow-blue fade is the same one used when Super Sonic loses his last ring. Either the pink-blue part is unused, or it's some other rotating pallet that this PAR code happens to reference. I noticed that the pink-blue fade doesn't stop itself like the yellow-blue part does. That probably means that it wasn't meant to be used by itself, or it would have data to cause it to stop like the yellow-blue part.

    Perhaps they were originally going to have Super Sonic pulsate between the pink and yellow, and so they had two different versions of the fade to blue, depending on what color SS actually has when he runs out of rings.

    Edit: Something else odd - turn into SS, then enable the 01 code. As soon as you see SS turn pink, turn it back off. Instead of cycling through that whole set of weird-ass colors, Sonic will just fade back to yellow and then pulsate like normal. Also, if you let the 01 code run for a while and get into the weird colors, and then disable it, Sonic will still snap back to the SS palette. The same thing happens if you do the first part above with regular Sonic - he goes into the SS pallet. Perhaps that's the pink part you get when going Super? *goes off to Kega*

    Okay, I think that is what it is, I don't know what the weird-ass stuff is after it. I put the game in pause and then enabled the code. I frame-stepped with C (four times) until I got the first frame where Sonic turned pink. Then I disabled the code, and frame-stepped four more times. Sonic turned back to blue and then faded to the yellow SS palette, where it stayed like normal SS.
     
  6. Aurochs

    Aurochs

    Единый, могучий Советский Союз! Tech Member
    2,343
    0
    0
    Whatever catches my fancy
    This should be moved to E&RE.

    When Sonic transforms, the object code moves $01 into $F65F. This sets the normal Super Sonic rotating pallette. When he falls out of his Super form for whatever reason, code in the next routine moves $02 into the same location. I have not seen $47 anywhere in this code, but I'll look.

    EDIT: I just checked the transformation frame-by-frame, and I didn't see any colors that looked anything like that shade of purple.
     
  7. LOst

    LOst

    Tech Member
    4,891
    8
    18
    It gets purple when you change the direction flag and the timer is invalid I guess.

    Anyway, when Sonic turns super, $F65F will become $01, when super it will be $FF, and when going back to normal it will be $02.

    The timer is the byte value at $F65E. It is critical to make the fade from blue to yellow, and yellow to white work.
     
  8. Aurochs

    Aurochs

    Единый, могучий Советский Союз! Tech Member
    2,343
    0
    0
    Whatever catches my fancy
    Ahah! So THAT's what that is! Thank you. :P
     
  9. LOst

    LOst

    Tech Member
    4,891
    8
    18
    It's a frame timer that counts down to zero, and then goes back to the original value... whereever the original value is located is another mystery.

    E.g:

    3... 2... 1... 0... 3... 2... 1... 0... 3... etc when going super.

    7... 6... 5... 4... 3... 2... 1... 0... 7... etc when being super.
     
  10. Aurochs

    Aurochs

    Единый, могучий Советский Союз! Tech Member
    2,343
    0
    0
    Whatever catches my fancy
    From the disassembly:
    Code (Text):
    1. move.b     #$F,($FFFFF65E).w
    Now that I think of it, I believe that it does take 16 frames to complete the transformation.
     
  11. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Remember that $0F means 15 frames till next palette fade. That's what it takes for Sonic to get into position and the right frame.. You know when he still is blue but looks like Super Sonic standing in the air. When it has reached $00 it is set to $03 so that it will take 4 frames between the palette fades until he reaches yellow. I guess. I still haven't spent much time on this so I can be wrong.
     
  12. Aurochs

    Aurochs

    Единый, могучий Советский Союз! Tech Member
    2,343
    0
    0
    Whatever catches my fancy
    Well, you do know a lot more about the engine than I do. It took me two weeks to figure out that the controller is scanned every VINT, and that I didn't have to call the scan procedures myself. :P

    So, yeah, I'd take your word over mine on this.
     
  13. Cinossu

    Cinossu

    Administrator
    2,832
    44
    28
    London, UK
    Sonic the Hedgehog Extended Edition
    The purple-pink palettes looks like the Super Sonic palette used when in Chemical Plant's "water".
     
  14. re-inferno

    re-inferno

    Member
    49
    0
    6
    It looks like, but isn't
    again, the alternate Supersonic palette has it's own underwater pallette although I'm not sure if that's only done with color shifting.

    Lost, Aurochs;

    I tried to follow your explanations as well as I could (I don't know M68k assembly code, only 6510 lol)

    - ram adress $F65F is a counter/flag?

    - the color transition looks very clean for an invalid input, doesn't it? (at least the blue - pink - violet - yellow - blue pallette.
    - now the question is: how is the rotating palette set?
    a) is it stored somewhere in the rom?
    b) is it genereted by bitshifting a generic palette?

    in case of a) it would be an alternate pallette for SS (face it, the pink - violet transition is nowhere used, though some frames of the normal SS transformation might use one or another corresponding color)
    in case of b) it would just be random crap that looks "nice"

    there is no pink -> blue, it's from pink -> violet and that's why it can't be interrupted in the pink phase (which makes it look even more like a cycle)

    The yellow->blue part corresponds with normal SS losing his last ring, that's true, but it could've been the other way round; the pink - yellow - blue SS was the first one and they later decided to use a simplified pallette (maybe because the monitor Items and Flickies become too flashy?) that and recycle as much as possible form the #47 one (note that it also includes the normal SS flashing!)
     
  15. LOst

    LOst

    Tech Member
    4,891
    8
    18
    From what I have seen, $F65E is the animation frame counter for the palette, and $F65F is the direction flag, or the palette animation pointer. Both bytes of course.

    If you really want me to look into the code for it, I can. If you want to know what happens at all time.
     
  16. re-inferno

    re-inferno

    Member
    49
    0
    6
    I'd only like to know if the alternate pallette could really be (=was intended as) an alternate for supersonic (with the linkage to hypersonic as proposed in my first posting)

    that would require it's

    - not a pallette used anywhere else in the game (I think it's not)
    - not the result of generic bit-shifting resulting in color distortion (alternate #01 - the weird colors would propose that, though it should result in something completly different than Sonic flashing in any color according to your notes?)

    So, if you'd like to look into the code, I think it's best to locate the color table where the counter refers to and see if there are colors available other than any blue-yellow and yellow flashing transitions to proove a possible alternate SS.

    (Though I must admit I think the ram adress is more a flag than a counter, reason is:

    - #$00 freezes sonic's color, no matter what that should be at the time it's set to zero
    - #$01 results in a strange looking rotating pallette, applied to Sonic as soon as the transition to blue starts (or sonic is blue anyways) - the regular SS palette is an exception here since it's instantly interrupted as soon as #$01 is set
    - #$02 results in the pink-yellow-blue pallette that works similar to #$01 (instant interruption during SS pallette, otherwise fade to blue and then start)
    - #$03 and higher = same as #$02
    - as soon as the higher numbers (e.g. #$D0) are reached, regular SS pallette is applied

    I'm aware that ARP Codes work like an IRQ effectively disabling any type of counters. But from the behavior of these different values, it seems obvious that the adress is used as some kind of pallette pointer.

    The situation gets more complicated because of the interaction of other things ... mainly the different behavior of the regular SS palette that LocalH pointed out - which can be explaind since SS was finally programmed around this palette

    That part is a bit complicated since SS can't be triggered at once, it needs

    $FE19 set to #$01 to trigger the transformation, including the the beginning of the color change, Sonic will also jump as high as SS bit isn't any faster than Sonic nor invincable
    $FF65 set to #$FF to trigger the rotating palette, it does nothing else
    $F760 set to #$xx to adjust SS's speed
    $F763 to determine the acceleration
    $F764 for deceleration
    and finally the flags for the music/SFX and invincibility
     
  17. LOst

    LOst

    Tech Member
    4,891
    8
    18
    $213E (ROM location) is where the Super Sonic palette code is at.

    Okay, here is the code and my comments (only for $F65F $FF):
    Code (Text):
    1.  ? ?move.b ? ?$F65F.w,d0 ? ? ? ?; Get Super Sonic state
    2.  ? ?beq ? ? ? *removed* ? ? ? ?; Is state zero? Then jump (not disassembled)
    3.  ? ?bmi ? ? ? normal_flash ? ? ?; Is state minus ($FF)? Then jump
    4.  
    5.  ? ?... ? ? ? ? ? ? ? ? ? ? ? ?; Skipping any other states for now
    6.  
    7. normal_flash:
    8.  ? ?subq.b ? ?#1,$F65E.w ? ? ? ?; Subtrack frame counter
    9.  ? ?bpl ? ? ? ret_loc ? ? ? ? ?; Skip animation if counter > 0
    10.  
    11.  ? ?move.b ? ?#$07,$F65E.w ? ? ?; Set counter back to 7 when it reached 0
    12.  
    13.  ? ?lea ? ? ? $2246.l,a0 ? ? ? ?; Load ROM address $2246 (Super Sonic palette) into A0 ? ?
    14.  ? ?move.w ? ?$F65C.w,d0 ? ? ? ?; Load relative palette offset from $2246 into D0
    15.  
    16.  ? ?addq.w ? ?#8,$F65C.w ? ? ? ?; And increase 4 palettes (the flashing) for next frame
    17.  ? ?cmpi.w ? ?#$78,$F65C.w ? ? ?; ($78 - $30) / 4 is $12. So there are $12 flashing animations ? ?
    18.  ? ?bcs ? ? ? no_reset ? ? ? ? ?; Was the relative palette offset < #$78? If so jump
    19.  
    20.  ? ?move.w ? ?#$30,$F65C.w ? ? ?; Set relative offset to $30 as a start value
    21.  
    22. no_reset:
    23.  ? ?lea ? ? ? $FB04.w,a1 ? ? ? ?; Load palette line 0 index 2 into A1 (Sonic's blue shade)
    24.  ? ?move.l ? ?(a0,d0.w),(a1)+ ?; Move the first two palettes at a0 + d0 into $FB04
    25.  ? ?move.l ? ?(a0,d0.w),(a1)+ ?; Move the first two palettes at a0 + d0 into $FB04
    26.  ? ?move ? ? ?(4,a0,d0.w),(a0) ?; Move the second two palettes at 4 + a0 + d0 into $FB06
    27.  
    28.  ? ?lea ? ? ? $22C6.l,a0 ? ? ? ?; Load ROM address $22C6 (Super Sonic Chemical Plant underwater palette) into A0
    29.  ? ?
    30.  ? ?cmpi.b ? ?#$0D,$FE10.w ? ? ?; Is zone number Chemical Plant?
    31.  ? ?beq ? ? ? chemical_super ? ?; Yes, then jump
    32.  
    33.  ? ?cmpi.b ? ?#$0F,$FE10.w ? ? ?; Is zone number Aquatic Ruin?
    34.  ? ?beq ? ? ? aquatic_super ? ?; Yes, then jump
    35.  
    36. ret_loc:
    37.  ? ?rts ? ? ? ? ? ? ? ? ? ? ? ?; Bye bye! See you next frame! ? ?
    38.  
    39.  
    40.  
    41. aquatic_super:
    42.  ? ?lea ? ? ? $2346.l,a0 ? ? ? ?; Load ROM address $2346 (Super Sonic Aquatic Ruin underwater palette) into A0
    43.  
    44. chemical_super:
    45.  ? ?lea ? ? ? $F084.w,a1 ? ? ? ?; Load underwater palette line 0 index 2 into A1 (Sonic's blue shade)
    46.  ? ?move.l ? ?(a0,d0.w),(a1)+ ?; Move the first two palettes at a0 + d0 into $F084
    47.  ? ?move ? ? ?(4,a0,d0.w),(a0) ?; Move the second two palettes at 4 + a0 + d0 into $F086
    48.  ? ?rts ? ? ? ? ? ? ? ? ? ? ? ?; Bye bye! See you next frame!
    49. * Disassembled and commented by LOst

    So my guess is you found the flashing palette for Chemical Plant's underwater.

    And remember that $F65C is a word and not a byte and needs to be between $30 and $78 with 8 steps inbetween for the flashing to work in state $FF. Else you will get wierd colors. If you wonder what index $00 to $2F is, it is probably the palette for becomming Super.

    Also, you can see how Super Sonic was programmed after the removal of Hidden Palace.
     
  18. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Lovely, no one replied after all that work. Well, that's life!

    postcount++
     
  19. re-inferno

    re-inferno

    Member
    49
    0
    6
    Well I'm not always online ;) gotta have some sleep some time :D

    Few question still bother me:

    - made a frame per frame comparison, some colors correspond with SS's CPZ underwater palette, but not all (brighter pink shades do) - these palettes are not identical!

    - In your code, there's only one reference to $F65F ($F65F must be the high-byte of $F65E, right? Damn thinking only in the 8-Bit registers)

    - both $F65F and $F65E seem to carry changing values otherwise the different branches wouldn't be necessary and the rotating palette wouldn't work, did I get that right?

    - now there's my problem:
    The values are modified by the program itself, but the ARP rewrites the set value, so the rotating palette would be possible then.

    And note, your code states that an underwater palette must be loaded from a certain adress - that's important, since our pink-yellow-blue sonic has it's own underwater pallette in both CPZ and AQZ! (AQZ's underwater uses part of the #$01 glitched palette that itself doesn't have an underwater palette, it's just Sonic's normal underwater color or SS brighter underwater color.

    #$01 palette has some other strange behavior: whereas becoming SS with #$47 (or equal) palette, SS is walking in the air (not controlable any more) just like becoming "normal" SS with a "normal" Sonic after completing an act (with the necessary codes enabled of course) the #$01 (or equal) palette doesn't glitch up the transformation, but makes the game unplayable, e.g. Sonic can't follow the tubes in CPZ (and possibly OOZ), is sent across the screen and eventually dies.

    So $F65F seems to have more importance than described in your disassembly.
     
  20. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Yea of course. I cut it off by purpose. You see the "..." in my disassembly? It's code I haven't checked out yet. There is the code for becomming Super Sonic, and going back to normal.
     
Thread Status:
Not open for further replies.