How to play differents songs on differents act?

Discussion in 'Discussion and Q&A Archive' started by Ashuro, Nov 23, 2014.

Thread Status:
Not open for further replies.
  1. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Hi! (bad english)

    I've doing the Nineko's tutorial "Differents songs EVERYWHERE" but i don't know how i have to put the differents songs.

    GHZ1, GHZ2 and GHZ3 have the same music. How can i put an other song for GHZ2 and GHZ3? This is the question.

    I've trying to edit musiclist2 and musiclist3 in a hex editor, place the music bin files into the sound folder and edit the Sonic1.asm to load the bin files, but in the level select the game crash when i'm playing the songs and it don't work ingame.


    How how how?!
     
  2. DumbLemon

    DumbLemon am back Member

    Joined:
    Aug 19, 2014
    Messages:
    115
  3. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    Nice work, that's the old version of my tutorial, which shouldn't be followed anymore since it's so outdated. His problem is obiously something different, though I can't figure out what, and I don't have time right now since I'm posting from a phone. I just wanted to warn him not to follow your advice.
     
  4. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    DumbLemon this is exactly the tutorial i was found and do. 

    Nineko! Your tutorial is easy as well, but i'm not sure i've understand... 

    Do i have to put the music bin file of act 2 and 3 in the "sound" folder? 
    To edit the sonic1.asm and make sure the rom load the songs?
    Hex editing the files musiclist2 and 3, and put the nulber of the songs in the file?
     
     
  5. DumbLemon

    DumbLemon am back Member

    Joined:
    Aug 19, 2014
    Messages:
    115
    I did think I heard something about that guide being a bit dodgy however I thought even if it does not work (and it didn't) it would be good for him to know the direction hes going in. Ashuro I suggest you do not use the guide I have posted and try to find out whats wrong with the code by yourself unless nineko fix's it for you. I apologize for this hiccup in information.
     
  6. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    DumbLemon, you really are dumb. For one, the guide works, and it always did. Also, I recommended him not to use the one you linked, because that's the old version, and he's already using the improved one, which is located here, I could tell since he said "everywhere" which isn't part of the old version of the guide. Retro never got the new one.


    Once I won't be posting from a phone I'll try to provide more detailed help, but posting from a Lumia is a pain so that'll have to wait.
     
  7. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Nineko, i've look your new version, but you've not mentioned in your tuto how we can put the song files in the folder to be played in the game. '-'
     
  8. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Nineko, i know how you are a MASTER in the music sonic hacking, i've see this in Sonineko (great work).
     
  9. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    417
    Location:
    Town Creek, AL
    you can have act branches to get this to work,


    cmpi.b #1, (Act).w ; Is this act 1 (Act = $FFFFFE11)
    beq MusicAct2 ; If so, play musiclist for act 2
    cmpi.b #2, (Act).w ; Is this act 2 (Act = $FFFFFE11)
    beq MusicAct3 ; If so, play musiclist for act 3
    lea (MusicList).l,a1 ; Load MusicList for act 1
    Bra BGM_Cont ; Run the rest of the routine
    MusicAct2:
    lea (MusicList2).l,a1 ; Load MusicList for act 2
    Bra BGM_Cont ;Run the rest of the routine
    MusicAct3:
    lea (MusicList3).l,a1 ; Load MusicList for act 3
    BGM_Cont:
    ....

    and if i'm not mistaken, you can change the musiclist.bin to


    Musiclist: dc.b $81, $82, $83, $84, $85, $86
    even
    Musiclist2: dc.b $81, $82, $83, $84, $85, $86
    even
    Musiclist3: dc.b $81, $82, $83, $84, $85, $86
    even

    to change without a hex editor.
     
  10. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    This is actually quite simple. For this example, I'll use Sonic 1's sound driver, Hivebrain disasm. To add a song, simply put the .bin (or .asm, if you're a cool kid like I am and use ASM-formatted music =P) file into the "sound" folder of your hack's disassembly, then in the sound driver code (location depending on disassembly), locate MusicIndex, which in stock Sonic 1 looks like this:


    ; ---------------------------------------------------------------------------
    ; Music Pointers
    ; ---------------------------------------------------------------------------
    MusicIndex: dc.l Music81, Music82
    dc.l Music83, Music84
    dc.l Music85, Music86
    dc.l Music87, Music88
    dc.l Music89, Music8A
    dc.l Music8B, Music8C
    dc.l Music8D, Music8E
    dc.l Music8F, Music90
    dc.l Music91, Music92
    dc.l Music93

    And change it to look like this:


    ; ---------------------------------------------------------------------------
    ; Music Pointers
    ; ---------------------------------------------------------------------------
    MusicIndex: dc.l Music81, Music82
    dc.l Music83, Music84
    dc.l Music85, Music86
    dc.l Music87, Music88
    dc.l Music89, Music8A
    dc.l Music8B, Music8C
    dc.l Music8D, Music8E
    dc.l Music8F, Music90
    dc.l Music91, Music92
    dc.l Music93, Music94

    Then, under this:


    Music93: incbin soundmusic93.bin
    even

    Add this:


    Music94: incbin soundsong.bin
    even

    Replace "song" with your .bin file's name, and there you have it. One new song ready for action...or relaxation or wherever you're gonna use it.

    I hope this helped you~
     
    Last edited by a moderator: Nov 25, 2014
  11. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Thank you, Thomas!
     
Thread Status:
Not open for further replies.