News: 11 March 2016 - Forum Rules

Author Topic: NES Music hacking?  (Read 902 times)

marchegiano

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
NES Music hacking?
« on: November 02, 2021, 10:02:07 am »
I just wanted to make sure there are no tools before I give up what I wanted to do.

I would like to change the music in Holy Diver on NES to Holy Diver the album. Well, you know what I mean, Dio sounding NES beeps and boops as close to the actual songs as I can get them.

I've found ways to rip music out of NES games and plenty of solutions for making the tracks themselves but nothing for swapping music.

So I assume it's a bit more in depth than finding the tool and using it. Probably well out of my league. Just wanted to make sure before I gave up on it.

Jorpho

  • Hero Member
  • *****
  • Posts: 5110
  • The cat screams with the voice of a man.
    • View Profile
Re: NES Music hacking?
« Reply #1 on: November 02, 2021, 11:22:29 am »
I've found ways to rip music out of NES games
Can you be more precise about what exactly you were looking at?

Quote
So I assume it's a bit more in depth than finding the tool and using it. Probably well out of my league.
Probably. That's why there aren't very many NES music hacks.

I would go into a little more detail but I'd rather not repeat things you already know.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Sanedan56

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: NES Music hacking?
« Reply #2 on: November 02, 2021, 03:52:12 pm »
It really depends on what game you're hacking.

If you would to edit the music yourself, I recommend starting by finding the where the notes are being processed in RAM. Then you should find where the notes are. You should also find commands that affect the song, like pitch and tempo. Take note of certain limitations like space available, and some games play music in RAM.

Sliver X

  • Hero Member
  • *****
  • Posts: 1091
  • der Wille zur Macht
    • View Profile
    • Panicus - A Fragment of Memory
Re: NES Music hacking?
« Reply #3 on: November 05, 2021, 12:04:20 pm »
The "proper" way would be to set breakpoints on the APU registers ($4015 would probably be the logical choice to monitor as it enables and disables channels?) and do tracing in a debugger to find where the music data is, then reverse engineering how the game is using the APU: There is no driver for sound on the NES, each programmer had complete control of the hardware and most had different ideas of how to generate the music.

A cruder way would be to run FCEUX's Code/Data Logger utility when starting an area of a game where a song begins, then stopping it shortly thereafter. Through trial and error (Randomly changing the green highlighted bytes in FCEUX's Hex Editor, also called Corruption) you will eventually find the data. Then you have to reverse engineer the data format the game is using to generate the songs.

Even with this, you have two problems: If you're trying to put a song from something else into the game, you'll need to transcribe the music to whatever data format the music is stored in. If you're writing original songs, you should probably either play an instrument you can compose on or have a passing knowledge of music theory. Both require actual musical knowledge of some sort (I composed music for NES games on a guitar and bass, then translated them into the format needed).

It's not simple to pull off, but I always had a lot of fun doing it.