Hacking DIY - Change the Level Complete Music

In this romhack you are going to change the level complete music that is played when the rivets board is finished.

For this hack you need a copy of the original 'dkong.zip' (Donkey Kong (US set 1)) and the HxD Editor to edit the romfiles.
A download link for the HxD Editor can be found on the 'LINKS' page.


Create a working folder for the romhack and place the copy of the original 'dkong.zip' into this folder.


Extract the file 's_3i_b.bin' from the 'dkong.zip' to the working folder.



There are two different tunes when the level is completed: one when an even level is finished and one when an odd level is finished.


Code taken from the Donkey Kong Hacking Kit, see the 'LINKS' page for link to this kit.

From the code we learn that the even level tune has index #05 (hexadecimal) and the odd level tune has index #0C (hexadecimal).

These are indexes in the following table in the sound rom with #05 corresponding to line 505 and #0C corresponding to line 50C.


These in turn are indexes into another table with the even level tune (line 505) pointing to #12 (corresponding to line 512 in the following table) and the odd level tune (line 50C) pointing to #14 (corresponding to line 514 in the following table).


Line 512 defines the pattern number for the even level tune (#13) and line 50C defines the pattern number for the odd level tune (#11).


Pattern #12 is an alternative tune that is present in the sound rom but is not used in the game.


Let's implement the change to make the unused pattern #12 the music played when finishing both the even and odd levels.

Start the HxD Editor and open the file 's_3i_b.bin'. This file contains the sound rom code. Scroll to the line '00000510'. You find the data block #0512 - #0515 there.


You can now change this block into the desired data for the alternative tune '12 00 12 00'. Just click in front of a number that you want to change to position the cursor and type the new number(s).


Save the file 's_3i_b.bin' after making the desired edits.


Add the file 's_3i_b.bin' from the working folder back to the 'dkong.zip'.

The dkong.zip now contains the romhack that plays the alternative tune when finishing the level. Test it by starting the rom with an emulator. Remember that the emulator must ignore the checksum errors that are caused by the changes that you made.


There is another unused tune in the sound rom. That tune is pattern #0C. You can repeat the steps and change the block from #0512 - #0515 to '0C 00 0C 00' to hear that tune too.