don't click here

Some sound driver help :s

Discussion in 'Engineering & Reverse Engineering' started by Irixion, Dec 9, 2010.

Thread Status:
Not open for further replies.
  1. So, I have followed the 'extend slots' guide to get the samples from 00 to FF, everything's working great.0


    My spin dash sample is E0, and the SEGA, speed up, slow down has been moved over later.


    What I'm having trouble with is getting the Sound_ChkValue routine to work properly--

    E0 is spindash, E1-F8 are other sound effects, and they don't mess with the special sounds because those start at F9-FF.

    The spindash guide tells you to go to Sound_ChkValue, and change
    Code (Text):
    1.         cmpi.b    #$E0,d7
    2.         bcs.w    Sound_D0toDF; sound    $D0-$DF
    to

    Code (Text):
    1.         cmpi.b    #$D1,d7
    2.         bcs.w    Sound_D0toDF; sound    $D0
    3.  
    4.         cmp.b        #$DF,d7
    5.         ble        Sound_D1toDF


    My problem is, what would I do to get it to work in my situation? E0 is spindash, and if I try to do anything similar it just locks up completely. I've been going at this for days, so can anyone tell me what I need to change the two compares to to get this to work? :(
     
  2. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    Do you mean you tried this?
    Code (Text):
    1.         cmpi.b    #$D1,d7
    2.         bcs.w    Sound_D0toDF; sound    $D0
    3.  
    4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmp.b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#$E0,d7; <--this is the changed line
    5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ble&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sound_D1toDF
    If so, and if that doesn't work, what's the code immediately after this? And what's at the label Sound_D1toDF?
     
  3. Yeah, so, this is confusing the hell out of me so I'll just paste every check I have:
    Code (Text):
    1. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;#$E0,d7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; is at least F0 being played?
    2. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bge.w&nbsp;&nbsp; Sound_F0Plus&nbsp;&nbsp; ; if it is, or something higher than F0, go here
    3.  
    4.  
    5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;&nbsp;&nbsp;&nbsp;&nbsp; $E0 = Spindash
    6.  
    7. Load81to9F:
    8. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;#$9F,d7
    9. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bls.w&nbsp;&nbsp; Sound_81to9F&nbsp;&nbsp; ; Music $81-$9F
    10.  
    11.  
    12. Sound_ChkValue_OtherChecks:
    13. ;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;#$FF,d7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; is last sound playing?
    14. ;&nbsp;&nbsp;&nbsp;&nbsp;bge.w&nbsp;&nbsp; Sound_RingPush; if it is, go here (Use Ring.Push for last song)
    15.  
    16.  
    17. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;&nbsp;&nbsp;#$A0,d7
    18. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bcs.w&nbsp;&nbsp;&nbsp;&nbsp;locret_71F8C&nbsp;&nbsp; ; RTS
    19. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;&nbsp;&nbsp;#$CF,d7
    20. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bls.w&nbsp;&nbsp;&nbsp;&nbsp;Sound_RingPush ; Sound_A0toCF $A0-$CF
    21. ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;&nbsp;&nbsp;#$D0,d7
    22. ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bcs.w&nbsp;&nbsp;&nbsp;&nbsp;locret_71F8C&nbsp;&nbsp; ; RTS
    23. ;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;&nbsp;&nbsp;#$E0,d7
    24. ;&nbsp;&nbsp;&nbsp;&nbsp;bcs.w&nbsp;&nbsp;&nbsp;&nbsp;Sound_Noise&nbsp;&nbsp;&nbsp;&nbsp;; Sound_D0toDF $D0-$DF
    25. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;&nbsp;&nbsp;#$F0,d7
    26. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ble.w&nbsp;&nbsp;&nbsp;&nbsp;Sound_RingPush
    27.  
    28. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmp.b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#$E0,d7;;<--this is the changed line
    29. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ble&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sound_DashRev
    30. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    31.  
    32. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;&nbsp;&nbsp;#$E4,d7
    33. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bls.s&nbsp;&nbsp;&nbsp;&nbsp;Sound_Special&nbsp;&nbsp;; Sound_E0toE4 $E0-$E4
    34. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;&nbsp;&nbsp;#$F9,d7
    35. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bge.w&nbsp;&nbsp;&nbsp;&nbsp;Sound_Special
    36. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;#$FF,d7
    37. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bls.w&nbsp;&nbsp; Sound_MusPlay&nbsp;&nbsp;; Sound_E5toFF
     
  4. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    Your code is a mess and understandably incorrect:

    Code (Text):
    1. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;#$E0,d7; is at least F0 being played?
    2. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bge.w&nbsp;&nbsp; Sound_F0Plus; if it is, or something higher than F0, go here
    You're telling it to go to Sound_F0Plus on $E0 and higher. I would tell you what to do, but:

    Code (Text):
    1. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;&nbsp;&nbsp;#$F0,d7
    2. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ble.w&nbsp;&nbsp;&nbsp;&nbsp;Sound_RingPush
    3.  
    4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmp.b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#$E0,d7;;<--this is the changed line
    5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ble&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sound_DashRev
    6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    7.  
    8. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;&nbsp;&nbsp;#$E4,d7
    9. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bls.s&nbsp;&nbsp;&nbsp;&nbsp;Sound_Special; Sound_E0toE4 $E0-$E4
    10. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;&nbsp;&nbsp;#$F9,d7
    11. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bge.w&nbsp;&nbsp;&nbsp;&nbsp;Sound_Special
    12. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmpi.b&nbsp;&nbsp;#$FF,d7
    13. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bls.w&nbsp;&nbsp; Sound_MusPlay; Sound_E5toFF
    I don't understand your logical thought here. You start by going to RingPush on $F0 or less — this is $E0 — and then a second check of $E0 which will never happen because the previous branch already did happen, and then a check for $E4 or below to do special sounds which you say you moved up but apparently didn't? Oh wait you did... but moved it up to $F9... but the previous code is still there so that is never reached...

    Yeah, huh.

    My suggestion is to start over and think about the logical flow of the program. Don't just blindly change lines of code; you'll never go anywhere that way.
     
  5. Yeah, I didn't want to start over but it appears like I'll have to. I'll post stuff in here if I Need some more help.
     
  6. Sorry for the double post but—The clone driver, how would I apply the spindash rev guide to it? The lines are different in the clone driver, and the sound effect is already in there...
     
Thread Status:
Not open for further replies.