Basic Questions & Answers thread

Discussion in 'Engineering & Reverse Engineering' started by Tweaker, May 29, 2008.

  1. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,582
    3
    18
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    They stay the same. I need them to drain, which just won't seem to happen. =P
     
  2. Selbi

    Selbi

    The Euphonic Mess Member
    1,485
    10
    18
    Northern Germany
    Sonic ERaZor
    @Psi: The actual limit is 32, if I haven't counted something wrong. I'll talk to you on PM, if that's ok.

    @Psy: You shouldn't use $FFFFF614 as RAM adress. I did it with $FFFFFFA2. 614 is an overall system timer, being used by many different things.
     
  3. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,582
    3
    18
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    Yeah, tried different RAM addresses too. I was aware it's used as a system timer, thought trying to take advantage of that might help =P
     
  4. Selbi

    Selbi

    The Euphonic Mess Member
    1,485
    10
    18
    Northern Germany
    Sonic ERaZor
    Then lemme ask something different: Are you 120% sure, you are actually going to that code? What I always do to find out, if my code is actually being activated is to remove various things. In this case, I would try to remove the superflag thingy, then the check if one second is over. If it suddenly works after removing one of these, they are wrong.
     
  5. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,582
    3
    18
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    Yeah, I've checked just about everything.
    That superflag definately works as it should, I have it too many times to number elsewhere in the code. =P
     
  6. Selbi

    Selbi

    The Euphonic Mess Member
    1,485
    10
    18
    Northern Germany
    Sonic ERaZor
    So you made the code look like this:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm" style="font-family:monospace;">Obj01_Super:
    <span style="color: #adadad; font-style: italic;">; tst.b (superflag).w</span>
    <span style="color: #adadad; font-style: italic;">; beq.s countend</span>
    &nbsp;
    Obj01SuperLoop:
    <span style="color: #adadad; font-style: italic;">; subq.w #1,($FFFFF614).w</span>
    <span style="color: #adadad; font-style: italic;">; bne.w countend</span>
    <span style="color: #adadad; font-style: italic;">; move.w #60,($FFFFF614).w</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="">(</span>update_HUD_rings<span style="">)</span>.<span style="color: #00bfff;">w</span>
    <span style="color: #00bfff;">subq</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE20</span><span style="">)</span>.<span style="color: #00bfff;">w</span>
    <span style="color: #adadad; font-style: italic;">; beq.w makenotsuper ; if rings=0, branch.</span>
    &nbsp;
    countend:
    <span style="color: #00bfff;">rts</span></pre><!--gc2--><!--T2JqMDFfU3VwZXI6Cgk7CXRzdC5iCShzdXBlcmZsYWcpLncKCTsJYmVxLnMJY291bnRlbmQKIApPYmow
    MVN1cGVyTG9vcDoKCTsJc3VicS53CSMxLCgmIzAzNjtGRkZGRjYxNCkudwoJOwlibmUudwljb3VudGVuZ
    AoJOyAgICAgICBtb3ZlLncJIzYwLCgmIzAzNjtGRkZGRjYxNCkudwoJCW1vdmUuYgkjMSwodXBkYXRlX0
    hVRF9yaW5ncykudwoJCXN1YnEudwkjMSwoJiMwMzY7RkZGRkZFMjApLncKCTsJYmVxLncJbWFrZW5vdHN
    1cGVyCQk7IGlmIHJpbmdzPTAsIGJyYW5jaC4KIApjb3VudGVuZDoKCQlydHM=--><!--egc2--><!--g2--></div><!--eg2-->
    But there is still absoluteley nothing happening to your rings counter? The only possibility then is, that you aren't even branching to that code. (Or at least not at the right spot. You should do it at a point like Obj01_Control, because that is a point, where the code always goes to.)
     
  7. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,582
    3
    18
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    Okay, I've check everything, it was definately branching to the code. I took the time to rethink the code logically, and got it working.
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm" style="font-family:monospace;">&nbsp;
    Obj01_Super:
    <span style="color: #00bfff;">cmpi</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="">(</span>superflag<span style="">)</span>.<span style="color: #00bfff;">w</span>
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">s</span> countend
    &nbsp;
    LoopReset:
    <span style="color: #00bfff;">clr</span>.<span style="color: #00bfff;">b</span> <span style="">(</span>update_HUD_rings<span style="">)</span>.<span style="color: #00bfff;">w</span><span style="color: #adadad; font-style: italic;">;</span>
    <span style="color: #00bfff;">cmpi</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="">(</span>super_sonic_frame_count<span style="">)</span>.<span style="color: #00bfff;">w</span>
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">s</span> obj01superloop
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">60</span>,<span style="">(</span>super_sonic_frame_count<span style="">)</span>.<span style="color: #00bfff;">w</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="">(</span>update_HUD_rings<span style="">)</span>.<span style="color: #00bfff;">w</span><span style="color: #adadad; font-style: italic;">;</span>
    <span style="color: #00bfff;">subq</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE20</span><span style="">)</span>.<span style="color: #00bfff;">w</span>
    &nbsp;
    Obj01SuperLoop:
    <span style="color: #00bfff;">subq</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="">(</span>super_sonic_frame_count<span style="">)</span>.<span style="color: #00bfff;">w</span>
    <span style="color: #00bfff;">tst</span>.<span style="color: #00bfff;">w</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE20</span><span style="">)</span>.<span style="color: #00bfff;">w</span>
    <span style="color: #00bfff;">beq</span>.<span style="color: #00bfff;">w</span> makenotsuper <span style="color: #adadad; font-style: italic;">;if rings=0, branch.</span>
    &nbsp;
    countend:
    <span style="color: #00bfff;">rts</span>
    &nbsp;</pre><!--gc2--><!--Ck9iajAxX1N1cGVyOgogICAgICAgICAgICAgICAgY21waS5iICAjMSwoc3VwZXJmbGFnKS53CiAgICAg
    ICAgICAgICAgICBibmUucyAgIGNvdW50ZW5kCgpMb29wUmVzZXQ6CiAgICAgICAgICAgICAgICBjbHIuY
    iAgKHVwZGF0ZV9IVURfcmluZ3MpLnc7CgkJY21waS53ICAjMCwoc3VwZXJfc29uaWNfZnJhbWVfY291bn
    QpLncKCQlibmUucwlvYmowMXN1cGVybG9vcAogICAgICAgICAgICAgICAgbW92ZS53ICAjNjAsKHN1cGV
    yX3NvbmljX2ZyYW1lX2NvdW50KS53CiAgICAgICAgICAgICAgICBtb3ZlLmIgICMxLCh1cGRhdGVfSFVE
    X3JpbmdzKS53OwoJCXN1YnEudwkjMSwoJiMwMzY7RkZGRkZFMjApLncKCk9iajAxU3VwZXJMb29wOgoJC
    XN1YnEudwkjMSwoc3VwZXJfc29uaWNfZnJhbWVfY291bnQpLncKCQl0c3QudyAgICgmIzAzNjtGRkZGRk
    UyMCkudwogICAgICAgICAgICAgICAgYmVxLncgICBtYWtlbm90c3VwZXIgICAgICAgICAgICAgIDtpZiB
    yaW5ncz0wLCBicmFuY2guCgpjb3VudGVuZDoKICAgICAgICAgICAgICAgIHJ0cwo=--><!--egc2--><!--g2--></div><!--eg2-->
    Apart from the fact that when the rings count below 10, it shows as 19, while the value is only 9, as when it tries to go below what looks like 11, sonic loses his super state.
     
  8. Selbi

    Selbi

    The Euphonic Mess Member
    1,485
    10
    18
    Northern Germany
    Sonic ERaZor
    That's probably because of the way you update the counter. You should do it with:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;"> <span style="color: #00bfff;">ori</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">81</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE1D</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; update the ring counter</span></pre><!--gc2--><!--CQlvcmkuYgkjJiMwMzY7ODEsKCYjMDM2O0ZGRkZGRTFEKS53CTsgdXBkYXRlIHRoZSByaW5nIGNvdW50
    ZXI=--><!--egc2--><!--g2--></div><!--eg2-->
     
  9. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,582
    3
    18
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    Selbi, that did the trick, thanks!

    Unfortunately, due to lack of sleep and anxiety, it seems my brain isn't working right. I think this may be something simple I'm missing, but I can't figure it out.
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;">&nbsp;
    <span style="color: #00bfff;">cmpi</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">32</span>,<span style="">(</span>ringcount<span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; Does sonic have 50 rings?</span>
    <span style="color: #00bfff;">blt</span>.<span style="color: #00bfff;">s</span> nsup
    &nbsp;</pre><!--gc2--><!--CiAgICAgICAgICAgICAgICBjbXBpLncgICMmIzAzNjszMiwocmluZ2NvdW50KS53IDsgRG9lcyBzb25p
    YyBoYXZlIDUwIHJpbmdzPwogICAgICAgICAgICAgICAgYmx0LnMgICBuc3VwCg==--><!--egc2--><!--g2--></div><!--eg2-->
    If I'm correct, BLT=Branch if less than. But sonic can still turn super with less than 50 rings. My mind is aching.
     
  10. amphobius

    amphobius

    doing more important things with my life Member
    2,120
    0
    16
    life
    Just follow what the S2 Disasm does;

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm" style="font-family:monospace;">&nbsp;
    Sonic_CheckGoSuper:
    <span style="color: #00bfff;">tst</span>.<span style="color: #00bfff;">b</span> <span style="">(</span>Super_Sonic_flag<span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; is Sonic already Super?</span>
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">s</span> return_1ABA4 <span style="color: #adadad; font-style: italic;">; if yes, branch</span>
    <span style="color: #00bfff;">cmpi</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">7</span>,<span style="">(</span>Emerald_count<span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; does Sonic have exactly 7 emeralds?</span>
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">s</span> return_1ABA4 <span style="color: #adadad; font-style: italic;">; if not, branch</span>
    <span style="color: #00bfff;">cmpi</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">50</span>,<span style="">(</span>Ring_count<span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; does Sonic have at least 50 rings?</span>
    <span style="color: #00bfff;">bcs</span>.<span style="color: #00bfff;">s</span> return_1ABA4 <span style="color: #adadad; font-style: italic;">; if not, branch</span>
    &nbsp;</pre><!--gc2--><!--ClNvbmljX0NoZWNrR29TdXBlcjoKCXRzdC5iCShTdXBlcl9Tb25pY19mbGFnKS53CTsgaXMgU29uaWMg
    YWxyZWFkeSBTdXBlcj8KCWJuZS5zCXJldHVybl8xQUJBNAkJOyBpZiB5ZXMsIGJyYW5jaAoJY21waS5iC
    SM3LChFbWVyYWxkX2NvdW50KS53CTsgZG9lcyBTb25pYyBoYXZlIGV4YWN0bHkgNyBlbWVyYWxkcz8KCW
    JuZS5zCXJldHVybl8xQUJBNAkJOyBpZiBub3QsIGJyYW5jaAoJY21waS53CSM1MCwoUmluZ19jb3VudCk
    udwk7IGRvZXMgU29uaWMgaGF2ZSBhdCBsZWFzdCA1MCByaW5ncz8KCWJjcy5zCXJldHVybl8xQUJBNAkJ
    OyBpZiBub3QsIGJyYW5jaAo=--><!--egc2--><!--g2--></div><!--eg2-->
    return_1ABA4 is just an rts - I'm sure your nsup is just that.
     
  11. Mikel

    Mikel

    Member
    <!--quoteo(post=507996:date=Sep 19 2010, 01:32 PM:name=PsychoSk8r)--><div class='quotetop'>QUOTE (PsychoSk8r @ Sep 19 2010, 01:32 PM) <a href="index.php?act=findpost&pid=507996">[​IMG]</a></div><div class='quotemain'><!--quotec-->Selbi, that did the trick, thanks!

    Unfortunately, due to lack of sleep and anxiety, it seems my brain isn't working right. I think this may be something simple I'm missing, but I can't figure it out.
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;">&nbsp;
    <span style="color: #00bfff;">cmpi</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">32</span>,<span style="">(</span>ringcount<span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; Does sonic have 50 rings?</span>
    <span style="color: #00bfff;">blt</span>.<span style="color: #00bfff;">s</span> nsup
    &nbsp;</pre><!--gc2--><!--CiAgICAgICAgICAgICAgICBjbXBpLncgICMmIzAzNjszMiwocmluZ2NvdW50KS53IDsgRG9lcyBzb25p
    YyBoYXZlIDUwIHJpbmdzPwogICAgICAgICAgICAgICAgYmx0LnMgICBuc3VwCg==--><!--egc2--><!--g2--></div><!--eg2-->
    If I'm correct, BLT=Branch if less than. But sonic can still turn super with less than 50 rings. My mind is aching.<!--QuoteEnd--></div><!--QuoteEEnd-->
    You may want to try BCS, as Sonic 2's Super Sonic code uses BCS instead of BLT to check if Sonic doesn't have 50 rings to become Super Sonic.
     
  12. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,582
    3
    18
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    Tried that, still no luck. That's practically exactly what I'm doing anyway. =P
     
  13. Mr. Mash

    Mr. Mash

    All fanbases are awful Member
    1,440
    0
    0
    drawing
    I didn't feel like this warranted a thread, but does the slot machine bonus stage in S3&K seem to get Robotnik-Robotnik-Robotnik more often on emulators than on carts? Maybe I'm just unlucky.
     
  14. E-122-Psi

    E-122-Psi

    Member
    2,133
    345
    63
    <!--quoteo(post=508167:date=Sep 19 2010, 07:33 PM:name=Mr. Mash)--><div class='quotetop'>QUOTE (Mr. Mash @ Sep 19 2010, 07:33 PM) <a href="index.php?act=findpost&pid=508167">[​IMG]</a></div><div class='quotemain'><!--quotec-->I didn't feel like this warranted a thread, but does the slot machine bonus stage in S3&K seem to get Robotnik-Robotnik-Robotnik more often on emulators than on carts? Maybe I'm just unlucky.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I get it a lot more on Sonic 2 as well.

    By the way got the pallette switch code to work and use a new secondary pallette during the Eggman boss. I'm now trying to place a routine to revert back to the normal pallette scheme when he flies off screen. Any particular place is the asm this is advisable?
     
  15. GenesisFan64

    GenesisFan64

    The bright side of the dark side. Member
    108
    0
    16
    <!--quoteo(post=507908:date=Sep 19 2010, 08:15 AM:name=Selbi)--><div class='quotetop'>QUOTE (Selbi @ Sep 19 2010, 08:15 AM) <a href="index.php?act=findpost&pid=507908">[​IMG]</a></div><div class='quotemain'><!--quotec-->since the format is $0RGB<!--QuoteEnd--></div><!--QuoteEEnd-->
    Excuse me...
    But the format is $0<!--coloro:#0000FF--><span style="color:#0000FF"><!--/coloro-->B[/COLOR]<!--coloro:#2E8B57--><span style="color:#2E8B57"><!--/coloro-->G[/COLOR]<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->R[/COLOR]


    Anyway, I have a problem with my hack...
    When Sonic touches a lamppost and dies, the level x-pos camera starts from $0
    <a href="http://cid-fdaa7b1229de9776.office.live.com/self.aspx/Publico/ssrg/2.avi" target="_blank">Video</a>

    (I know about the GFX, I can fix that myself)
    And I never touched the lamppost code since I started hacking with s2na.
     
  16. Ravenfreak

    Ravenfreak

    Is actually a guy. Tech Member
    2,969
    109
    43
    O'Fallon Mo
    Hacking Sonic Drift, Writer at Sonic Cage Dome
    So I have a question of my own. What is the SVN disassembly equivalent of "DeleteObject2"?
     
  17. FraGag

    FraGag

    Tech Member
    <!--quoteo(post=508565:date=Sep 20 2010, 08:11 PM:name=Ravenfreak)--><div class='quotetop'>QUOTE (Ravenfreak @ Sep 20 2010, 08:11 PM) <a href="index.php?act=findpost&pid=508565">[​IMG]</a></div><div class='quotemain'><!--quotec-->So I have a question of my own. What is the SVN disassembly equivalent of "DeleteObject2"?<!--QuoteEnd--></div><!--QuoteEEnd-->
    DeleteChild.

    (note to others: that's for Sonic 1, in Sonic 2 it's still DeleteObject2)
     
  18. Blastfrog

    Blastfrog

    See ya starside. Member
    Did SCD use SMPS for the fm sound effects? If so, how could go about ripping them to insert them into a S2 disassembly? Thanks. :)
     
  19. E-122-Psi

    E-122-Psi

    Member
    2,133
    345
    63
    I've been wondering how to edit sprite cycles between pallette lines (eg. the special stage blocks and springs). Since my character has a pink pallette I can use it to have a free space in the SS third pallette line and edit it to be blue. However I would also need to edit the cycle order to switch line one and three so the block color cycle would be the same (ie. instead of one, two, three, four it would be three, two, one, four). Same for the crystals surrounding the emeralds. Any manner of getting this to work?

    In addition I'm trying to edit the emeralds to look the same however the emerald mappings seem to be coded in an oddly manner, I'm trying to get the blue and pink emeralds to switch pallette lines, I've done it for all other mapping files using the emeralds except the actual special stage ones:

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;">; ---------------------------------------------------------------------------</span>
    <span style="color: #adadad; font-style: italic;">; Sprite mappings - special stage chaos emeralds</span>
    <span style="color: #adadad; font-style: italic;">; ---------------------------------------------------------------------------</span>
    Map_SS_Chaos1: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B96C-Map_SS_Chaos1
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B97E-Map_SS_Chaos1
    Map_SS_Chaos2: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B972-Map_SS_Chaos2
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B97E-Map_SS_Chaos2
    Map_SS_Chaos3: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B978-Map_SS_Chaos3
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B97E-Map_SS_Chaos3
    byte_1B96C: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">1</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>, <span style="color: #ff0000;">5</span>, <span style="color: #ff0000;">0</span>, <span style="color: #ff0000;">0</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>
    byte_1B972: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">1</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>, <span style="color: #ff0000;">5</span>, <span style="color: #ff0000;">0</span>, <span style="color: #ff0000;">4</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>
    byte_1B978: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">1</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>, <span style="color: #ff0000;">5</span>, <span style="color: #ff0000;">0</span>, <span style="color: #ff0000;">8</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>
    byte_1B97E: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">1</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>, <span style="color: #ff0000;">5</span>, <span style="color: #ff0000;">0</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">C</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>
    <span style="color: #00CC66;">even</span></pre><!--gc2--><!--OyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
    LS0tLS0tLS0tLS0tLS0tLS0KOyBTcHJpdGUgbWFwcGluZ3MgLSBzcGVjaWFsIHN0YWdlIGNoYW9zCWVtZ
    XJhbGRzCjsgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS
    0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCk1hcF9TU19DaGFvczE6CWRjLncgYnl0ZV8xQjk2Qy1NYXBfU1N
    fQ2hhb3MxCgkJZGMudyBieXRlXzFCOTdFLU1hcF9TU19DaGFvczEKTWFwX1NTX0NoYW9zMjoJZGMudyBi
    eXRlXzFCOTcyLU1hcF9TU19DaGFvczIKCQlkYy53IGJ5dGVfMUI5N0UtTWFwX1NTX0NoYW9zMgpNYXBfU
    1NfQ2hhb3MzOglkYy53IGJ5dGVfMUI5NzgtTWFwX1NTX0NoYW9zMwoJCWRjLncgYnl0ZV8xQjk3RS1NYX
    BfU1NfQ2hhb3MzCmJ5dGVfMUI5NkM6CWRjLmIgMQoJCWRjLmIgJiMwMzY7RjgsIDUsIDAsCTAsICYjMDM
    2O0Y4CmJ5dGVfMUI5NzI6CWRjLmIgMQoJCWRjLmIgJiMwMzY7RjgsIDUsIDAsCTQsICYjMDM2O0Y4CmJ5
    dGVfMUI5Nzg6CWRjLmIgMQoJCWRjLmIgJiMwMzY7RjgsIDUsIDAsCTgsICYjMDM2O0Y4CmJ5dGVfMUI5N
    0U6CWRjLmIgMQoJCWRjLmIgJiMwMzY7RjgsIDUsIDAsCSYjMDM2O0MsICYjMDM2O0Y4CgkJZXZlbg==--><!--egc2--><!--g2--></div><!--eg2-->

    Another pallette wise question I'll throw just in case; anyone know how to write a branch to note which pallette line a spring is using in Obj41 (eg. a branch to recognise 'Is spring yellow/red?').
     
  20. FraGag

    FraGag

    Tech Member
    <!--quoteo(post=509625:date=Sep 23 2010, 02:19 PM:name=E-122-Psi)--><div class='quotetop'>QUOTE (E-122-Psi @ Sep 23 2010, 02:19 PM) <a href="index.php?act=findpost&pid=509625">[​IMG]</a></div><div class='quotemain'><!--quotec-->I've been wondering how to edit sprite cycles between pallette lines (eg. the special stage blocks and springs). Since my character has a pink pallette I can use it to have a free space in the SS third pallette line and edit it to be blue. However I would also need to edit the cycle order to switch line one and three so the block color cycle would be the same (ie. instead of one, two, three, four it would be three, two, one, four). Same for the crystals surrounding the emeralds. Any manner of getting this to work?<!--QuoteEnd--></div><!--QuoteEEnd-->
    The palette cycle for the square blocks is defined at SS_WaRiVramSet. The other art settings are in _inc\Special stage mappings and VRAM pointers.asm. The values in both places are in the same format as for the objects (the value that's put in 2(aX)), so you'd have to replace $142 with $4142 and $4142 with $142.

    <!--quoteo(post=509625:date=Sep 23 2010, 02:19 PM:name=E-122-Psi)--><div class='quotetop'>QUOTE (E-122-Psi @ Sep 23 2010, 02:19 PM) <a href="index.php?act=findpost&pid=509625">[​IMG]</a></div><div class='quotemain'><!--quotec-->In addition I'm trying to edit the emeralds to look the same however the emerald mappings seem to be coded in an oddly manner, I'm trying to get the blue and pink emeralds to switch pallette lines, I've done it for all other mapping files using the emeralds except the actual special stage ones:

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;">; ---------------------------------------------------------------------------</span>
    <span style="color: #adadad; font-style: italic;">; Sprite mappings - special stage chaos emeralds</span>
    <span style="color: #adadad; font-style: italic;">; ---------------------------------------------------------------------------</span>
    Map_SS_Chaos1: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B96C-Map_SS_Chaos1
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B97E-Map_SS_Chaos1
    Map_SS_Chaos2: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B972-Map_SS_Chaos2
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B97E-Map_SS_Chaos2
    Map_SS_Chaos3: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B978-Map_SS_Chaos3
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> byte_1B97E-Map_SS_Chaos3
    byte_1B96C: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">1</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>, <span style="color: #ff0000;">5</span>, <span style="color: #ff0000;">0</span>, <span style="color: #ff0000;">0</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>
    byte_1B972: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">1</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>, <span style="color: #ff0000;">5</span>, <span style="color: #ff0000;">0</span>, <span style="color: #ff0000;">4</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>
    byte_1B978: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">1</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>, <span style="color: #ff0000;">5</span>, <span style="color: #ff0000;">0</span>, <span style="color: #ff0000;">8</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>
    byte_1B97E: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">1</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>, <span style="color: #ff0000;">5</span>, <span style="color: #ff0000;">0</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">C</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">F8</span>
    <span style="color: #00CC66;">even</span></pre><!--gc2--><!--OyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
    LS0tLS0tLS0tLS0tLS0tLS0KOyBTcHJpdGUgbWFwcGluZ3MgLSBzcGVjaWFsIHN0YWdlIGNoYW9zCWVtZ
    XJhbGRzCjsgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS
    0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCk1hcF9TU19DaGFvczE6CWRjLncgYnl0ZV8xQjk2Qy1NYXBfU1N
    fQ2hhb3MxCgkJZGMudyBieXRlXzFCOTdFLU1hcF9TU19DaGFvczEKTWFwX1NTX0NoYW9zMjoJZGMudyBi
    eXRlXzFCOTcyLU1hcF9TU19DaGFvczIKCQlkYy53IGJ5dGVfMUI5N0UtTWFwX1NTX0NoYW9zMgpNYXBfU
    1NfQ2hhb3MzOglkYy53IGJ5dGVfMUI5NzgtTWFwX1NTX0NoYW9zMwoJCWRjLncgYnl0ZV8xQjk3RS1NYX
    BfU1NfQ2hhb3MzCmJ5dGVfMUI5NkM6CWRjLmIgMQoJCWRjLmIgJiMwMzY7RjgsIDUsIDAsCTAsICYjMDM
    2O0Y4CmJ5dGVfMUI5NzI6CWRjLmIgMQoJCWRjLmIgJiMwMzY7RjgsIDUsIDAsCTQsICYjMDM2O0Y4CmJ5
    dGVfMUI5Nzg6CWRjLmIgMQoJCWRjLmIgJiMwMzY7RjgsIDUsIDAsCTgsICYjMDM2O0Y4CmJ5dGVfMUI5N
    0U6CWRjLmIgMQoJCWRjLmIgJiMwMzY7RjgsIDUsIDAsCSYjMDM2O0MsICYjMDM2O0Y4CgkJZXZlbg==--><!--egc2--><!--g2--></div><!--eg2--><!--QuoteEnd--></div><!--QuoteEEnd-->
    These mappings are used in _inc\Special stage mappings and VRAM pointers.asm:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm" style="font-family:monospace;"> <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">l</span> Map_SS_Chaos3
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">770</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">l</span> Map_SS_Chaos3
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">2770</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">l</span> Map_SS_Chaos3
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">4770</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">l</span> Map_SS_Chaos3
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">6770</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">l</span> Map_SS_Chaos1
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">770</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">l</span> Map_SS_Chaos2
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">770</span></pre><!--gc2--><!--ICAgIGRjLmwgTWFwX1NTX0NoYW9zMwogICAgZGMudyAmIzAzNjs3NzAKICAgIGRjLmwgTWFwX1NTX0No
    YW9zMwogICAgZGMudyAmIzAzNjsyNzcwCiAgICBkYy5sIE1hcF9TU19DaGFvczMKICAgIGRjLncgJiMwM
    zY7NDc3MAogICAgZGMubCBNYXBfU1NfQ2hhb3MzCiAgICBkYy53ICYjMDM2OzY3NzAKICAgIGRjLmwgTW
    FwX1NTX0NoYW9zMQogICAgZGMudyAmIzAzNjs3NzAKICAgIGRjLmwgTWFwX1NTX0NoYW9zMgogICAgZGM
    udyAmIzAzNjs3NzA=--><!--egc2--><!--g2--></div><!--eg2-->
    They are in the order you normally get them (I.e. the first is blue, the second is yellow, etc.). As we can see here, the first 4 are done with a palette change and the last 2 use different art tiles with the first palette line. So, to get the effect you want, swap the first $770 with the $4770.

    The emerald objects for the special stage results screen and the ending sequence use different mappings, so you'll have to edit those as well.

    <!--quoteo(post=509625:date=Sep 23 2010, 02:19 PM:name=E-122-Psi)--><div class='quotetop'>QUOTE (E-122-Psi @ Sep 23 2010, 02:19 PM) <a href="index.php?act=findpost&pid=509625">[​IMG]</a></div><div class='quotemain'><!--quotec-->Another pallette wise question I'll throw just in case; anyone know how to write a branch to note which pallette line a spring is using in Obj41 (eg. a branch to recognise 'Is spring yellow/red?').<!--QuoteEnd--></div><!--QuoteEEnd-->
    At loc_DB66, there's already a check to switch the palette line (from the first to the second; from red to yellow). If you look further up, you'll see that it sets the value in 2(a0) differently depending on its orientation (up/down or left/right), which is why it's using bset instead of move. If you want to use the 3rd palette line for red springs and the 2nd palette line for yellow springs, you'd have to add
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;"> <span style="color: #00bfff;">bclr</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">6</span>,<span style="color: #ff0000;">2</span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span></pre><!--gc2--><!--CQliY2xyCSM2LDIoYTAp--><!--egc2--><!--g2--></div><!--eg2-->
    before or after the bset (and of course you must change the values moved to 2(a0) earlier). If you're using the 4th and 2nd palette lines, then put that bclr instead of the bset.