don't click here

Odd Music Related Glitch

Discussion in 'Engineering & Reverse Engineering' started by Shadow Fire, Apr 4, 2013.

Thread Status:
Not open for further replies.
  1. Shadow Fire

    Shadow Fire

    Ultimate victory! Member
    1,557
    0
    16
    The Land of Darkness
    Sonic: The Lost Land (Series), The GCN (site)
    Okay, you may or may not be aware that I'm getting back into hacking thanks to RHS. However, in spite of the (slow) progress I've been making, I've run into an odd error.

    The music that plays for Slot $82 (02 in sound test), disables sound, until a different music track is played. It is the only one it seems to do it on, and RHS and I have both confirmed that it isn't the file.

    Does anybody have any clue as to what could be causing it? RHS and I are stuck on this.
     
  2. Tiddles

    Tiddles

    Diamond Dust Tech Member
    471
    0
    0
    Leicester, England
    Get in an accident and wake up in 1973
    I've never hacked S2 or used the S1 or S2 drivers, but the only time I've seen a similar effect is where the driver is treating that music ID as the 1up track. I don't know why that would be mapped to $81 or if it's anywhere near what's actually happening here, but it might be a direction that's worth investigating? Just a thought.
     
  3. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    10
    18
    United Kingdom
    YouTuber
    After speaking to ValleyBell, it seems that the life ID in the wrong ID slot. He was gonna post here, but he was off to bed, so I'll post it on his behalf, so give him your thanks if the following works.


    Go to "Sound_81to9F:". The first "cmpi.b" checks for the song ID of the extra life jingle. Change that to to whatever the 1-up jingle is actually at.


    Also, due to the crappy way the sound index extention works, you need to check, if it's index 00-7F or 80-FF.

    Here is the code:

    Code (ASM):
    1. Sound_81to9F:   ; XREF: Sound_ChkValue
    2.     cmpi.b  #$82,d7         ; is "extra life" music played? (sound 02 or 82)
    3.     bne.s   loc_72024       ; if not, branch
    4.     cmpi.b  #$01,($FFFFFFFC).w  ; is "extra life" music played? (sound 80-FF)
    5.     bne.s   loc_72024       ; if not, branch
    6.     tst.b   $27(a6)
    7. ;   blah, blah, blah
    This code should work.
     
  4. Shadow Fire

    Shadow Fire

    Ultimate victory! Member
    1,557
    0
    16
    The Land of Darkness
    Sonic: The Lost Land (Series), The GCN (site)
    Give ValleyBell my thanks, man. It would seem that was the one bit of code I missed when I changed the order of the music files.

    Lesson learned. No moar ASM hacking in the early hours of the morning.
     
Thread Status:
Not open for further replies.