Music help in ASM

Discussion in 'Discussion and Q&A Archive' started by GasparXR, Apr 10, 2008.

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

    GasparXR Rides the metal monster Member

    Joined:
    Aug 10, 2007
    Messages:
    84
    Location:
    Ontario, Canada
    Haven't posted here in a while...


    And here I come with some n00b questions=P


    I've learned a little ASM, and I'm so far pretty good with hex, but I'm STILL stuck on editing music for some reason. Let's get down to the point. I want to port the ARZ music from S2 into S1(Rev 00), and of course, not being that much of a n00b, knew that pointers have to changed and such. Here's the problem.


    ASM does automatically redirect pointers to the right place. BUT, I've never seen anything on Sonic Retro, here, and other Sonic hacking places around the net on how to edit music in ASM. Is it possible? (Stupid question X_X)
     
  2. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    As far as I know, most dissassemblies and/or asm point to music files. For example.



    Code:
    ;**********
    
    ;ARZ music
    
    ;**********
    
    Music_Arz: /disassembly/sound/sound94.bin&#59;load this music file
    
    ;**********

    This is from the top of my head. To edit the music for ARZ, you find the loacation of it's file and edit it in hex or whatever. How you edit it? No idea; I'm shit with music.
     
  3. amphobius

    amphobius spreader of the pink text Member

    Joined:
    Feb 24, 2008
    Messages:
    970
    Location:
    United Kingdom
    There is ESE II Music Importer, you know.
     
  4. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    That doesn't convert all music files well. It's not completely finished anyway as far as I know.
     
  5. GasparXR

    GasparXR Rides the metal monster Member

    Joined:
    Aug 10, 2007
    Messages:
    84
    Location:
    Ontario, Canada
    Well I did know where the .bin files for the music are, but thanks anyway.
     
  6. Spanner

    Spanner The Tool Member

    Joined:
    Aug 9, 2007
    Messages:
    2,570
    ESEII Music Porter does most of the work except fixing DAC & tempo.


    Loading music for a specific part for example invincibility is done by the following:



    Code:
    move.w	#$87,d0&#59; 87 is obviously the song number so #$81 would load GHZ's music.
    
    jmp	(PlaySound).l&#59; play invincibility music
    What you can do is replace a tune that's already known in the disassembly for example music81 but you can add more in MusicList by adding Music** (** representing the tune number) to it:



    Code:
    ; ---------------------------------------------------------------------------
    
    ; 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
    Finally, it is incbin'd in the disassembly like this:



    Code:
    Music93:	incbin	sound\music93.bin
    
    		even
    So if you wanted to add a tune you simply copypaste but replacing for example music93 with music94.


    That should be about everything covered.
     
  7. GasparXR

    GasparXR Rides the metal monster Member

    Joined:
    Aug 10, 2007
    Messages:
    84
    Location:
    Ontario, Canada
    Yep, that helps. So what your saying is, under the MusicIndex I add Music94 after Music93, then incbin Music94(like how you showed in the example with music93), and then of course put whatever song I want into the sound folder as Music94?


    I kinda got lost with it, lol.
     
Thread Status:
Not open for further replies.