Page 1 of 1

Need help tracking down the hex addresses of CV1 music!

Posted: Sat Sep 16, 2017 2:15 pm
by spookgoblin
Hey all,

I'm looking to modify the music in the intro sequence of Castlevania 1.
I've looked through Sliver X's documents but am having trouble finding the song data--more specifically, I'm having trouble finding the first note of that (or any) song. Does anyone have any ideas for how to track it down?

Many thanks!

Re: Need help tracking down the hex addresses of CV1 music!

Posted: Sat Sep 16, 2017 4:23 pm
by Bavi_H
The end of the Castlevania Music Format document lists offsets in the .NES file for the pointer locations of each track's channels. The next-to-last section in the document ("Calculating") briefly explains how to convert the pointer format to an offset into the .NES file.

Example: The document says the pointer for Track 1, channel Square 1 is at offset 825. Here's how to get to the first data byte for this channel.
  1. Use a hex editor to open the .NES file. (In FCEUX, you can go to the Debug menu and choose Hex Editor, then in the Hex Editor window, go to the View menu and choose ROM File.)
  2. Go to offset 825. (In the FCEUX Hex Editor window, go to the File menu, choose Goto Address and enter 825.)
  3. Make a note of the byte at that offset and the byte after it: 809B
  4. Use the conversion procedure in the document:
    1. Swap the bytes: 9B80
    2. Subtract hex 8000: 1B80
    3. Add hex 10: 1B90
  5. Go to offset 1B90. This is the first data byte for this channel -- D6 -- which the document explains is a tempo command.

Re: Need help tracking down the hex addresses of CV1 music!

Posted: Tue Sep 19, 2017 8:40 am
by spookgoblin
Ahh thank you!
The way you explained it seemed to click a lot better :)

I've got some tinkering to do!

Re: Need help tracking down the hex addresses of CV1 music!

Posted: Wed Oct 04, 2017 12:49 pm
by spookgoblin
Yay! I've successfully changed the music! :)
My future wife will be so ecstatic to hear a spooky wedding march in place of the intro jingle!


Now...
Does anyone know where the attribute table is for CV1? That's my last big hurdle.
I've tried using the debugger to help me find it based on writes to certain PPU RAM addresses but I'm not really sure what I'm doing. I know I'm looking for LDA with reference to certain hex addresses, but I don't know if I'm doing it right -_-

At the very least, I know that the PPU addresses that are responsible are:
$23C1
$23C9
$23D9

Anyone willing to help guide me to the right ROM addresses?
Thanks!