Basic Questions & Answers thread

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

  1. Selbi

    Selbi

    Impaled with Extreme Prejudice Member
    1,482
    0
    0
    Northern Germany
    Sonic ERaZor
    If you want to check if down and A is being pressed, you need to do this check:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm"> <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFF603</span><span style="">)</span>.<span style="color: #00bfff;">w</span>,<span style="font-weight:bold;">d0</span> <span style="color: #adadad; font-style: italic;">; move the current button press to d0</span>
    <span style="color: #00bfff;">and</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">42</span></span>,<span style="font-weight:bold;">d0</span> <span style="color: #adadad; font-style: italic;">; and the your value on it ($42/A+down in this case)</span>
    <span style="color: #00bfff;">beq</span>.<span style="color: #00bfff;">s</span> JD_Return <span style="color: #adadad; font-style: italic;">; if A + down is not being pressed, branch</span></pre><!--gc2--><!--CQltb3ZlLmIJKCYjMDM2O0ZGRkZGNjAzKS53LGQwCTsgbW92ZSB0aGUgY3VycmVudCBidXR0b24gcHJl
    c3MgdG8gZDAKCQlhbmQuYgkjJiMwMzY7NDIsZDAJCQk7IGFuZCB0aGUgeW91ciB2YWx1ZSBvbiBpdCAoJ
    iMwMzY7NDIvQStkb3duIGluIHRoaXMgY2FzZSkKCQliZXEucwlKRF9SZXR1cm4JCTsgaWYgQSArIGRvd2
    4gaXMgbm90IGJlaW5nIHByZXNzZWQsIGJyYW5jaA==--><!--egc2--><!--g2--></div><!--eg2-->
    And as an explaination, <a href="http://sonicresearch.org/forums/index.php?showtopic=1871" target="_blank">here</a> you have a tiny guide about button presses. If you want to check for multiple buttons being pressed at the same time, you just need to add the values together (so: $40=A + $02=down = $42=A+down).

    Oh, almost forgot something: I'd like to help you with your problems on MSN or something. If you agree, just shoot me a PM and I'll see what I can do (and don't be shy, I won't byte =P).
     
  2. T-Rae

    T-Rae

    Tryin' to get back into Sonic hacking... Member
    17
    0
    0
    Maryland
    none ATM
    Okay, two things. Does anybody know how to change the SEGA logo sound especially if you are using an assembler? Also, is there a way to import Sonic 3D Blast music into Sonic 1? I tried using the ESEII Sound Importer, but the version 2 beta is a little complicated for me to understand.
     
  3. MarkeyJester

    MarkeyJester

    ♡ ! Resident Jester
    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->*Selbi's post here (Too big and would be stupid to quote it fully)*<!--QuoteEnd--></div><!--QuoteEEnd-->
    The problem here is that it'll not branch if A "OR" Down is pressed, this is how it works.

    Lets say you are pressing A, Down & C at the same time, "ReadJoypads" is a subroutine of which will dump the controls from the ports to ram (Obviously to prevent having to read from the port constantly which would take more processing to do).

    move.b ($FFFFF603).w,d0

    So, we've loaded all the buttons from that ram space to d0 so we can modify it for checking. The way that the controls are read is in bits (0000 0000) each bit represents a button (SACB RLDU).

    S = Start
    A = Button A
    C = Button C
    B = Button B
    R = D-Pad Right
    L = D-Pad Left
    D = D-Pad Down
    U = D-Pad Up

    If the bit is set (1), then the button has been pressed, is it is clear (0), then the button has not been pressed, in our example we have A, Down & C pressed, so in bits that would be 0110 0010, and in Hex bytes that would be $62. The purpose of this command below is to clear ALL other buttons being pressed except the buttons you want checking:

    and.b #$42,d0

    This is clearing all bits except the ?'s 0?00 00?0, so now only button statuses A or Down are held in d0 (C was cleared).

    beq.s JD_Return

    Due to the ccr there is an automatic branch if certain requirements are met, this in a basic term asks the question, "If the ? bits (0?00 00?0) are null (if they are both 0), then branch. If ANY of those two ? bits are set (if any are 1), DO NOT BRANCH."

    ----

    So it seems your jumpdash will dash if A + Down are pressed, or is only A is pressed, or if only Down is pressed.

    It might be a simple idea to put:
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'> move.b ($FFFFF603).w,d0 ; move the current button press to d0
    and.b #$42,d0 ; get only buttons A and Down
    cmp.b #$42,d0 ; were both A and Down pressed?
    bne.s JD_Return ; if not, branch
    </div>

    ..and there you have it.
     
  4. Spanner

    Spanner

    The Tool Member
    3,250
    44
    28
    United Kingdom
    Sonic Hacking Contest
    <!--quoteo(post=412638:date=Feb 18 2010, 10:17 PM:name=Quickman)--><div class='quotetop'>QUOTE (Quickman @ Feb 18 2010, 10:17 PM) <a href="index.php?act=findpost&pid=412638"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Man, and I thought I was bad by not using SVN disassemblies.<!--QuoteEnd--></div><!--QuoteEEnd-->
    I still use the old disassembly. =P
    And the asm68k version doesn't even need s1comb.asm any more.
     
  5. Korou Tenshi

    Korou Tenshi

    Member
    439
    3
    18
    UK
    Unusual question, but I feel like doing a bit of hacking again, albeit simple stuff (adding levels and art, swapping music and level orders, maybe swapping bosses and such in Sonic 2).
    Problem is I'm running on Mac OSX, and stuff like SonEd and even disassemblies are unavailable to me, and I don't really want to be running parallels or anything as I have neither the disk space or the money.

    So yeah, to my question ~ How feasible would it be for me to actually do any of this stuff? What tools would I need, what would the processes be required, and how difficult would it be?
     
  6. E-122-Psi

    E-122-Psi

    Member
    1,835
    17
    18
    <!--quoteo(post=413867:date=Feb 20 2010, 06:38 PM:name=MarkeyJester)--><div class='quotetop'>QUOTE (MarkeyJester @ Feb 20 2010, 06:38 PM) <a href="index.php?act=findpost&pid=413867"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->*Selbi's post here (Too big and would be stupid to quote it fully)*<!--QuoteEnd--></div><!--QuoteEEnd-->
    The problem here is that it'll not branch if A "OR" Down is pressed, this is how it works.

    Lets say you are pressing A, Down & C at the same time, "ReadJoypads" is a subroutine of which will dump the controls from the ports to ram (Obviously to prevent having to read from the port constantly which would take more processing to do).

    move.b ($FFFFF603).w,d0

    So, we've loaded all the buttons from that ram space to d0 so we can modify it for checking. The way that the controls are read is in bits (0000 0000) each bit represents a button (SACB RLDU).

    S = Start
    A = Button A
    C = Button C
    B = Button B
    R = D-Pad Right
    L = D-Pad Left
    D = D-Pad Down
    U = D-Pad Up

    If the bit is set (1), then the button has been pressed, is it is clear (0), then the button has not been pressed, in our example we have A, Down & C pressed, so in bits that would be 0110 0010, and in Hex bytes that would be $62. The purpose of this command below is to clear ALL other buttons being pressed except the buttons you want checking:

    and.b #$42,d0

    This is clearing all bits except the ?'s 0?00 00?0, so now only button statuses A or Down are held in d0 (C was cleared).

    beq.s JD_Return

    Due to the ccr there is an automatic branch if certain requirements are met, this in a basic term asks the question, "If the ? bits (0?00 00?0) are null (if they are both 0), then branch. If ANY of those two ? bits are set (if any are 1), DO NOT BRANCH."

    ----

    So it seems your jumpdash will dash if A + Down are pressed, or is only A is pressed, or if only Down is pressed.

    It might be a simple idea to put:
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'> move.b ($FFFFF603).w,d0 ; move the current button press to d0
    and.b #$42,d0 ; get only buttons A and Down
    cmp.b #$42,d0 ; were both A and Down pressed?
    bne.s JD_Return ; if not, branch
    </div>

    ..and there you have it.
    <!--QuoteEnd--></div><!--QuoteEEnd-->

    While it has corrected the button activation it still hardly ever works. It seems random whether pressing the buttons activate a normal jump attack or the dash. If it helps here is my reworked code. It is assigned to Md_Jump2 and placed after Sonic_Roll

    Code (Text):
    1. ; ---------------------------------------------------------------------------
    2. ; Subroutine for Sonic's hammer spin animation
    3. ; ---------------------------------------------------------------------------
    4.  
    5. ; ||||||||||||||| S U B&nbsp;&nbsp;&nbsp;&nbsp;R O U T&nbsp;&nbsp;&nbsp;&nbsp;I N E |||||||||||||||||||||||||||||||||||||||
    6.  
    7. Sonic_HammerSpin:
    8. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move.b&nbsp;&nbsp;&nbsp;&nbsp;($FFFFF603).w,d0; move the current button press to d0
    9. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and.b&nbsp;&nbsp;&nbsp;&nbsp;#$42,d0&nbsp;&nbsp;&nbsp;&nbsp;; get only buttons A and Down
    10. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmp.b&nbsp;&nbsp;&nbsp;&nbsp;#$42,d0&nbsp;&nbsp;&nbsp;&nbsp;; were both A and Down pressed?
    11. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bne.s&nbsp;&nbsp;&nbsp;&nbsp;JD_End&nbsp;&nbsp;&nbsp;&nbsp;; if not, branch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    12. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tst.b&nbsp;&nbsp;&nbsp;&nbsp;($FFFFFFEB).w; was jumpdash flag set?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    13. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bne.w&nbsp;&nbsp;&nbsp;&nbsp;JD_End&nbsp;&nbsp;&nbsp;&nbsp;; if yes, branch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    14. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move.b&nbsp;&nbsp;&nbsp;&nbsp;#1,($FFFFFFEB).w; if not, set jumpdash flag
    15. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move.b&nbsp;&nbsp;&nbsp;&nbsp;#$20,$1C(a0); show hammer animation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    16. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move.w&nbsp;&nbsp;&nbsp;&nbsp;#$BC,d0&nbsp;&nbsp;&nbsp;&nbsp;; set jumpdash sound&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    17. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jsr&nbsp;&nbsp;&nbsp;&nbsp;(PlaySound).l; play jumpdash sound&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    18. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bclr&nbsp;&nbsp;&nbsp;&nbsp;#4,$22(a0); clear double jump flag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    19. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move.w&nbsp;&nbsp;&nbsp;&nbsp;#$800,d0; set normal jumpdash speed&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    20. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tst.b&nbsp;&nbsp;&nbsp;&nbsp;($FFFFFE2E).w; do you have speed shoes?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    21. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beq.s&nbsp;&nbsp;&nbsp;&nbsp;JD_ChkUW; if not, branch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    22. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move.w&nbsp;&nbsp;&nbsp;&nbsp;#$A00,d0; set speed shoes jumpdash speed
    23.  
    24. JD_ChkUW:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    25. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btst&nbsp;&nbsp;&nbsp;&nbsp;#6,$22(a0); is Sonic underwater?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    26. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beq.s&nbsp;&nbsp;&nbsp;&nbsp;JD_ChkDirection; if not, branch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    27. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move.w&nbsp;&nbsp;&nbsp;&nbsp;#$400,d0; set underwater jumpdash speed
    28.  
    29. JD_ChkDirection:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    30. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btst&nbsp;&nbsp;&nbsp;&nbsp;#0,$22(a0); is sonic facing left?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    31. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beq.s&nbsp;&nbsp;&nbsp;&nbsp;JD_Move&nbsp;&nbsp;&nbsp;&nbsp;; if yes, branch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    32. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;neg.w&nbsp;&nbsp;&nbsp;&nbsp;d0&nbsp;&nbsp;&nbsp;&nbsp;; if not, negate d0 (for jumping to the right)
    33.  
    34. JD_Move:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    35. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move.w&nbsp;&nbsp;&nbsp;&nbsp;#$F00,$12(a0); move sonic forward (y-velocity)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    36.  
    37.  
    38. JD_End:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    39. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; return
    40. ; End of function Sonic_JumpDash
    There are different animations for jumping (the spring animation plus a landing transition $21) and the animation for the dash is $20 rather than a roll, it works fine the times it activates it just seems to work rarely and randomly. Is the normal jump attack interfering or something?
     
  7. Selbi

    Selbi

    Impaled with Extreme Prejudice Member
    1,482
    0
    0
    Northern Germany
    Sonic ERaZor
    I'm not sure about this, but I think it's because you are using the same flag as a normal jumpdash ($FFFFFFEB). I'm not sure if you have any other moves using this flag anyway, but try using a different one. I'll just give you $FFFFFFB0, hoping you haven't used it yet. Also, make sure you are clearing that flag in Sonic_ResetOnFloor.
     
  8. E-122-Psi

    E-122-Psi

    Member
    1,835
    17
    18
    <!--quoteo(post=414114:date=Feb 21 2010, 10:26 AM:name=Selbi)--><div class='quotetop'>QUOTE (Selbi @ Feb 21 2010, 10:26 AM) <a href="index.php?act=findpost&pid=414114"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->I'm not sure about this, but I think it's because you are using the same flag as a normal jumpdash ($FFFFFFEB). I'm not sure if you have any other moves using this flag anyway, but try using a different one. I'll just give you $FFFFFFB0, hoping you haven't used it yet. Also, make sure you are clearing that flag in Sonic_ResetOnFloor.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I don't even know how to give flags to moves anyway.

    How do you clear a flag in Sonic_ResetOnFloor? I take it this is why it only works once.

    Still same thing otherwise, works on a whim, almost never first time, activating A jump attack instead. Aside from the Touch_Enemy/Monitor and Bounce coding, is there any other coding I'm supposed to add or edit?
     
  9. OK, this one, I need to know. Suppose you want to make a Sonic 1 level using a special project template. However, I have not seen a lot of templates for novice hackers. If anyone can make a GHZ template or find one off the internet, I'm sure to get started.
     
  10. Mikel

    Mikel

    Member
    496
    0
    16
    Oklahoma
    MUGEN Stuff
    <!--quoteo(post=414181:date=Feb 21 2010, 11:58 AM:name=E-122-Psi)--><div class='quotetop'>QUOTE (E-122-Psi @ Feb 21 2010, 11:58 AM) <a href="index.php?act=findpost&pid=414181"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><!--quoteo(post=414114:date=Feb 21 2010, 10:26 AM:name=Selbi)--><div class='quotetop'>QUOTE (Selbi @ Feb 21 2010, 10:26 AM) <a href="index.php?act=findpost&pid=414114"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->I'm not sure about this, but I think it's because you are using the same flag as a normal jumpdash ($FFFFFFEB). I'm not sure if you have any other moves using this flag anyway, but try using a different one. I'll just give you $FFFFFFB0, hoping you haven't used it yet. Also, make sure you are clearing that flag in Sonic_ResetOnFloor.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I don't even know how to give flags to moves anyway.

    How do you clear a flag in Sonic_ResetOnFloor? I take it this is why it only works once.

    Still same thing otherwise, works on a whim, almost never first time, activating A jump attack instead. Aside from the Touch_Enemy/Monitor and Bounce coding, is there any other coding I'm supposed to add or edit?
    <!--QuoteEnd--></div><!--QuoteEEnd-->
    I think Selbi means something like this:

    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm">Sonic_ResetOnFloor: <span style="color: #adadad; font-style: italic;">; XREF: PlatformObject; et al</span>
    <span style="color: #00bfff;">clr</span>.<span style="color: #00bfff;">b</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFFEB</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; clear jumpdash flag</span>
    <span style="color: #00bfff;">clr</span>.<span style="color: #00bfff;">b</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFFB0</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; clear HammerSpin flag</span>
    <span style="color: #00bfff;">btst</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">4</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">22</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">beq</span>.<span style="color: #00bfff;">s</span> loc_137AE
    <span style="color: #00bfff;">nop</span>
    <span style="color: #00bfff;">nop</span>
    <span style="color: #00bfff;">nop</span>
    &nbsp;
    loc_137AE:
    <span style="color: #00bfff;">bclr</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">5</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">22</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">bclr</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">22</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">bclr</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">4</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">22</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">btst</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">2</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">22</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">beq</span>.<span style="color: #00bfff;">s</span> loc_137E4
    <span style="color: #00bfff;">bclr</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">2</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">22</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">13</span></span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">16</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">9</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;"><span style="color: #ff0000;">17</span></span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;">1C</span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span> <span style="color: #adadad; font-style: italic;">; use running/walking animation</span>
    <span style="color: #00bfff;">subq</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">5</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;">C</span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    &nbsp;
    loc_137E4:
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="color: #ff0000;">$</span><span style="color: #ff0000;">3C</span><span style="">(</span><span style="font-weight:bold;">a0</span><span style="">)</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">0</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFF7D0</span><span style="">)</span>.<span style="color: #00bfff;">w</span>
    <span style="color: #00bfff;">rts</span></pre><!--gc2--><!--U29uaWNfUmVzZXRPbkZsb29yOgkJCTsgWFJFRjogUGxhdGZvcm1PYmplY3Q7IGV0IGFsCgkJY2xyLmIJ
    KCYjMDM2O0ZGRkZGRkVCKS53CTsgY2xlYXIganVtcGRhc2ggZmxhZwoJCWNsci5iCSgmIzAzNjtGRkZGR
    kZCMCkudwk7IGNsZWFyIEhhbW1lclNwaW4gZmxhZwoJCWJ0c3QJIzQsJiMwMzY7MjIoYTApCgkJYmVxLn
    MJbG9jXzEzN0FFCgkJbm9wCQoJCW5vcAkKCQlub3AJCgpsb2NfMTM3QUU6CgkJYmNscgkjNSwmIzAzNjs
    yMihhMCkKCQliY2xyCSMxLCYjMDM2OzIyKGEwKQoJCWJjbHIJIzQsJiMwMzY7MjIoYTApCgkJYnRzdAkj
    MiwmIzAzNjsyMihhMCkKCQliZXEucwlsb2NfMTM3RTQKCQliY2xyCSMyLCYjMDM2OzIyKGEwKQoJCW1vd
    mUuYgkjJiMwMzY7MTMsJiMwMzY7MTYoYTApCgkJbW92ZS5iCSM5LCYjMDM2OzE3KGEwKQoJCW1vdmUuYg
    kjMCwmIzAzNjsxQyhhMCkJOyB1c2UgcnVubmluZy93YWxraW5nIGFuaW1hdGlvbgoJCXN1YnEudwkjNSw
    mIzAzNjtDKGEwKQoKbG9jXzEzN0U0OgoJCW1vdmUuYgkjMCwmIzAzNjszQyhhMCkKCQltb3ZlLncJIzAs
    KCYjMDM2O0ZGRkZGN0QwKS53CgkJcnRz--><!--egc2--><!--g2--></div><!--eg2-->
     
  11. E-122-Psi

    E-122-Psi

    Member
    1,835
    17
    18
    Got it. It works! Thanx, fellas.
     
  12. GT Koopa

    GT Koopa

    Member
    1,999
    0
    16
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    Stumbled upon something, didn't know how useful it could be.

    Would <a href="http://mapeditor.org/" target="_blank">this program</a> help anybody here at Retro with anything at all?
     
  13. T-Rae

    T-Rae

    Tryin' to get back into Sonic hacking... Member
    17
    0
    0
    Maryland
    none ATM
    I have a question about porting music from another game. Is it possible to change what DAC voices are used in a music file by using a hex editor? The music that I ported plays fine but when it comes to the DAC playing I usually hear the messed up Sega sound playing. Also, is it possible to change how a music file plays because I have some music that I ported from xm to smps which plays from beginning to end and starts over again. With a hex editor, is there anyway I can loop the music from a certain point in the song?

    Also, I want to add a new monitor that gives out a random amount of rings when hit. It probably works somewhat the same as getting 10 rings but how exactly could this be done?
     
  14. nineko

    nineko

    I am the Holy Cat Tech Member
    <!--quoteo(post=415674:date=Feb 24 2010, 02:06 AM:name=T-Rae)--><div class='quotetop'>QUOTE (T-Rae @ Feb 24 2010, 02:06 AM) <a href="index.php?act=findpost&pid=415674"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Is it possible to change what DAC voices are used in a music file by using a hex editor?<!--QuoteEnd--></div><!--QuoteEEnd-->Yes. Assuming that you want to port songs from Sonic 3 to Sonic 1, for example, you'll have (at least) to change the kick from $86 to $81, and the snare from $81 to $82 (complete tables can be found <a href="http://info.sonicretro.org/SCHG:Music_Hacking#DAC_Sample_Definitions" target="_blank">here</a>). Of course make sure to change the snare first, or you'll end up with a bunch of $81s and you wouldn't know what to do with them. To find the portion of the smps song which contains the DAC channel, you have to look at the <a href="http://info.sonicretro.org/SCHG:Music_Hacking#Standard_SMPS" target="_blank">header</a>: get the pointer to the DAC channel, and the first pointer which is higher than that (it's usually the pointer to the voices). For example, if your pointer to the DAC channel is $1234, and amongst the other pointers you have $1200, $963, and $2345, your DAC channel will be between $1234 and $2345-1, unless there are crazy jumps around the song (if that's the case you're pretty much fucked unless you feel like following the pointers around). So just go to that range and do the needed replacements

    <!--quoteo(post=415674:date=Feb 24 2010, 02:06 AM:name=T-Rae)--><div class='quotetop'>QUOTE (T-Rae @ Feb 24 2010, 02:06 AM) <a href="index.php?act=findpost&pid=415674"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->With a hex editor, is there anyway I can loop the music from a certain point in the song?<!--QuoteEnd--></div><!--QuoteEEnd-->I bet you can if you have an infinite amount of time and patience. But every converter in the xm2/3/4smps series has built-in support to set a custom loop point. Just define it in your XM file and it will be automatically ported over. In Mod Plug Tracker, this setting is called "Restart Position", and it's in the General tab; it's measured in patterns, so you might need to split a pattern by hand in order to have it loop properly, but most of the times it's an easy cut and paste job.

    Good luck! :)
     
  15. T-Rae

    T-Rae

    Tryin' to get back into Sonic hacking... Member
    17
    0
    0
    Maryland
    none ATM
    <!--quoteo(post=415679:date=Feb 23 2010, 08:16 PM:name=nineko)--><div class='quotetop'>QUOTE (nineko @ Feb 23 2010, 08:16 PM) <a href="index.php?act=findpost&pid=415679"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><!--quoteo(post=415674:date=Feb 24 2010, 02:06 AM:name=T-Rae)--><div class='quotetop'>QUOTE (T-Rae @ Feb 24 2010, 02:06 AM) <a href="index.php?act=findpost&pid=415674"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Is it possible to change what DAC voices are used in a music file by using a hex editor?<!--QuoteEnd--></div><!--QuoteEEnd-->Yes. Assuming that you want to port songs from Sonic 3 to Sonic 1, for example, you'll have (at least) to change the kick from $86 to $81, and the snare from $81 to $82 (complete tables can be found <a href="http://info.sonicretro.org/SCHG:Music_Hacking#DAC_Sample_Definitions" target="_blank">here</a>). Of course make sure to change the snare first, or you'll end up with a bunch of $81s and you wouldn't know what to do with them. To find the portion of the smps song which contains the DAC channel, you have to look at the <a href="http://info.sonicretro.org/SCHG:Music_Hacking#Standard_SMPS" target="_blank">header</a>: get the pointer to the DAC channel, and the first pointer which is higher than that (it's usually the pointer to the voices). For example, if your pointer to the DAC channel is $1234, and amongst the other pointers you have $1200, $963, and $2345, your DAC channel will be between $1234 and $2345-1, unless there are crazy jumps around the song (if that's the case you're pretty much fucked unless you feel like following the pointers around). So just go to that range and do the needed replacements

    <!--quoteo(post=415674:date=Feb 24 2010, 02:06 AM:name=T-Rae)--><div class='quotetop'>QUOTE (T-Rae @ Feb 24 2010, 02:06 AM) <a href="index.php?act=findpost&pid=415674"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->With a hex editor, is there anyway I can loop the music from a certain point in the song?<!--QuoteEnd--></div><!--QuoteEEnd-->I bet you can if you have an infinite amount of time and patience. But every converter in the xm2/3/4smps series has built-in support to set a custom loop point. Just define it in your XM file and it will be automatically ported over. In Mod Plug Tracker, this setting is called "Restart Position", and it's in the General tab; it's measured in patterns, so you might need to split a pattern by hand in order to have it loop properly, but most of the times it's an easy cut and paste job.

    Good luck! :)
    <!--QuoteEnd--></div><!--QuoteEEnd-->

    Thanks Nineko, that helped me out a lot.
     
  16. BaconFace

    BaconFace

    DrTapeworm Member
    38
    0
    0
    Sorry if this a dumb question, but how do I get a level to use different enemies in Sonic 2? I want to use the Metropolis Zone crab in Emerald Hill Zone, and I think I might have to edit the graphics.
     
  17. amphobius

    amphobius

    doing more important things with my life Member
    2,121
    0
    16
    life
    Start playing around with the code around ArtLoadCues:. You may want to also edit the palletes as well.
     
  18. BaconFace

    BaconFace

    DrTapeworm Member
    38
    0
    0
    <!--quoteo(post=416882:date=Feb 25 2010, 07:40 PM:name=DalekSam)--><div class='quotetop'>QUOTE (DalekSam @ Feb 25 2010, 07:40 PM) <a href="index.php?act=findpost&pid=416882"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Start playing around with the code around ArtLoadCues:. You may want to also edit the palletes as well.<!--QuoteEnd--></div><!--QuoteEEnd-->
    And where would I find these? In the ASM files?
     
  19. Selbi

    Selbi

    Impaled with Extreme Prejudice Member
    1,482
    0
    0
    Northern Germany
    Sonic ERaZor
    <!--quoteo(post=416885:date=Feb 25 2010, 08:49 PM:name=BaconFace)--><div class='quotetop'>QUOTE (BaconFace @ Feb 25 2010, 08:49 PM) <a href="index.php?act=findpost&pid=416885"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><!--quoteo(post=416882:date=Feb 25 2010, 07:40 PM:name=DalekSam)--><div class='quotetop'>QUOTE (DalekSam @ Feb 25 2010, 07:40 PM) <a href="index.php?act=findpost&pid=416882"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Start playing around with the code around ArtLoadCues:. You may want to also edit the palletes as well.<!--QuoteEnd--></div><!--QuoteEEnd-->
    And where would I find these? In the ASM files?
    <!--QuoteEnd--></div><!--QuoteEEnd-->
    Why was searching around some locations the best thing I could do to take a break from an epic huge 10 pages report? I really don't know...

    Anyway, the ArtLoadCues routine is... oh... well... I just noticed: What the hell? Is it really that hard to press Ctrl + F in the ASM file and seach for <I>ArtLoadCues:</I>? In other words, yes it is there (s2.asm), but even if it's not, you could just check out the other files and search there, because it's gotta be somewhere.

    Ok, end of post. Enough break time.
     
  20. amphobius

    amphobius

    doing more important things with my life Member
    2,121
    0
    16
    life
    <!--quoteo(post=416902:date=Feb 25 2010, 08:08 PM:name=Selbi)--><div class='quotetop'>QUOTE (Selbi @ Feb 25 2010, 08:08 PM) <a href="index.php?act=findpost&pid=416902"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><!--quoteo(post=416885:date=Feb 25 2010, 08:49 PM:name=BaconFace)--><div class='quotetop'>QUOTE (BaconFace @ Feb 25 2010, 08:49 PM) <a href="index.php?act=findpost&pid=416885"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><!--quoteo(post=416882:date=Feb 25 2010, 07:40 PM:name=DalekSam)--><div class='quotetop'>QUOTE (DalekSam @ Feb 25 2010, 07:40 PM) <a href="index.php?act=findpost&pid=416882"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Start playing around with the code around ArtLoadCues:. You may want to also edit the palletes as well.<!--QuoteEnd--></div><!--QuoteEEnd-->
    And where would I find these? In the ASM files?
    <!--QuoteEnd--></div><!--QuoteEEnd-->
    Why was searching around some locations the best thing I could do to take a break from taking a break from an epic huge 10 pages report? I really don't know...

    Anyway, the ArtLoadCues routine is... oh... well... I just noticed: What the hell? Is it really that hard to press Ctrl + F in the ASM file and seach for <I>ArtLoadCues:</I>? In other words, yes it is there (s2.asm), but even if it's not, you could just check out the other files and search there, because it's gotta be somewhere.

    Ok, end of post. Enough break time.
    <!--QuoteEnd--></div><!--QuoteEEnd-->
    Try looking down.