• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

MUGCAP

Creator of PLA GBA and PKMN F&E Rom Hacks
2
Posts
1
Years
    • Seen May 5, 2024
    I'll be brief, I'll show you how to add songs manually without Sappy!
    Tools used to
    • HxD
    • Mid2Agb
    • Thumb

    Step 1 - Make your MIDI

    I recommend seeing these posts, topics and threads to learn how to do your MIDI.

    • Install All Instrument Patch on your ROM

    Make your music with up to 5 Tracks if you want more, go to 0x1DD0C8.
    There change :
    Spoiler: 00 C5 94 00

    for :
    Spoiler: 00 CC 94 00

    this will set the number of Direct Sound Tracks from 5 to 12.

    Step 2 - Editing .s file

    Turn your .mid into .s file and let's go!

    • Add .equ rom, 0x08000000
    • Replace voicegroup000 with the voicegroup offset or in my case the All Instrument Patch voicegroup, which lives at 0xB30C5C.
    • Add above Track 1, .org 0xYYYYYY, 0xFF

    20240310_003839_rmedited.jpg

    YY = offset where you want to place the music in the ROM. in my case 0x800000.

    If you want the music to loop, put this at the end of all tracks :

    20240310_004039_rmedited.jpg

    The .GOTO must appear, after it, it must be .word track_name, byte 0 and finally FINE!

    Related to this :

    20240310_004006_rmedited.jpg

    Step 3 - Assamble your .s file

    Assemble your .s file with Thumb, then open it in HxD.

    20240310_011827_rmedited.jpg

    Wow, why is there so much empty space? Simple!
    All pointers your music created start from the .org offset!
    Now we need to go to the end of the table and correct some errors.

    20240310_011851_rmedited.jpg

    Fearlessly replace all YY 00 with YY 08.
    YY = First Byte of Your offset, in my case 0x800000 = 80 00 to change to 80 08.

    20240310_011922_rmedited.jpg

    20240310_011945_rmedited.jpg

    This is our table that points to all song Tracks.
    Also change the 00 that comes after the 3 Bytes that define the displacement of your voicegroup. in my case 0xB30C5C = 5C 0C B3 00 change to 5C 0C B3 08.

    In the 0B position, it indicates the number of Tracks in the song, if there are five, it will be 05 for example. After comes the pointer to the voicegroup. Then, the pointers for the Tracks. If at the beginning of the table it indicates 09 for example, there will have to be nine pointers here.

    0B indicates eleven, which is why my table contains eleven pointers after the voicegroup.

    20240310_012506_rmedited.jpg

    All done! Copy the entire content from the .org offset to the end of the file, and place it at the same offset as in your ROM.

    Step 4 - Changing the songtable

    Now enter the sappy.xml file. Search for the hexadecimal number of the song you want to replace. Did you find the number? I want to change the Pallet Town song, so my number is 0x12C!

    Let's calculate, take this number from the song, and multiply it by 8.

    12C × 8 = 960

    Now take this result and add it to 4A32CC.

    960 + 4A32CC = 4A3C2C

    Ready! We find the pointer offset to the song we want to replace! Change the pointer we just found to the table offset of your song.
    The displacement must start with the Byte that will define the number of Tracks, remember? In my case 0B.

    Save and test your music, it should work perfectly, if there are errors, try to correct them with the other steps.

    Bonus !

    At the beginning of your song :
    Spoiler: BE XX BC 00 BB YY BD ZZ

    XX = Volume
    YY = BPM
    ZZ = Instrument used

    Change these things and you will get new fun or more satisfying experiences.

    • All Instrument Patch = https://www.pokecommunity.com/threads/all-instrument-patch-firered-ruby-emerald.332272/
    • My Youtube Channel / Pokémon Legends Arceus GBA Project = https://youtube.com/@MUGCAP?si=a6B7FKHMSE6Rx9rs
     
    Back
    Top