News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Castlevania - SOTN Music Hack  (Read 10382 times)

goxor

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Castlevania - SOTN Music Hack
« on: September 09, 2014, 01:47:21 am »
I'm interested in doing a simple hack of Castlevania - Symphony Of The Night for PSX.  Just want to replace a song with another song.  More specifically, the end credits "I Am The Wind", with "Nocturne" from the official soundtrack CD.

Also, for those who enjoy "I Am The Wind", I'd like to do another hack to replace every music track in the game with "I Am The Wind". 

Anyone have experience with this?  Is it possible?  And if so, know where I should start, what tools I need, etc.?

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1588
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #1 on: September 09, 2014, 02:32:20 am »
I'm interested in doing a simple hack of Castlevania - Symphony Of The Night for PSX.  Just want to replace a song with another song.  More specifically, the end credits "I Am The Wind", with "Nocturne" from the official soundtrack CD.

Also, for those who enjoy "I Am The Wind", I'd like to do another hack to replace every music track in the game with "I Am The Wind". 

Anyone have experience with this?  Is it possible?  And if so, know where I should start, what tools I need, etc.?
OH YES PLEASE!
I would help you, but I haven't got myself in PSX hacking.
Try disecting the ISO first and see if you can find audio files, that's my guess though.

I would love to see a hack replacing "I am the wind" with Nocturne SO MUCH!

goxor

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #2 on: September 09, 2014, 03:35:56 am »
Here's whats in the ISO:



Those .STR files must be the FMVs.

I know a lot of PSX games use .XA files for music, so I looked in the XA folder.  Nothing in there but DRACULAX.CCS at 76kb in size.

But in the SD folder there are two suspicious files:
CD1.DA   - 37,690kb
XA_STR1 - 362,656kb

XA_STR1 is also the largest file in the ISO, so I'm guessing it contains all the music. 

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1588
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #3 on: September 09, 2014, 03:39:27 am »
Here's whats in the ISO:



Those .STR files must be the FMVs.

I know a lot of PSX games use .XA files for music, so I looked in the XA folder.  Nothing in there but DRACULAX.CCS at 76kb in size.

But in the SD folder there are two suspicious files:
CD1.DA   - 37,690kb
XA_STR1 - 362,656kb

XA_STR1 is also the largest file in the ISO, so I'm guessing it contains all the music.
That DA file is intriguing...
Have you tried getting something out of those two files?
Also, what is the extension of the second one?

goxor

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #4 on: September 09, 2014, 04:28:39 am »
XA_STR1 doesn't seem to have an extension.



I found a utility called XAEX (http://www.zophar.net/utilities/psxutil/xaex.html)  It's supposed to extract .XA audio from suspect files, but I couldn't get it to work on my machine.


Bregalad

  • Hero Member
  • *****
  • Posts: 2753
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #5 on: September 09, 2014, 08:14:37 am »
All the sound streams are in the same file, and are interleaved. You probably don't even have to worry about that at all to accomplish this, you just need to find some pointers somewhere and change them to change the song that is played.

And this hack is a very good idea. I absolutely don't like the I am the wind song, but I love Notcurne. But since I can listen to music any time I would probably not play it anyway, but I like the idea, that's how the original game should have been.

goxor

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #6 on: September 09, 2014, 06:23:22 pm »
All the sound streams are in the same file, and are interleaved. You probably don't even have to worry about that at all to accomplish this, you just need to find some pointers somewhere and change them to change the song that is played.

I think you're right.  "Nocturne" is already in the game according to this: http://tcrf.net/Castlevania:_Symphony_of_the_Night_%28PlayStation%29#Nocturne

I'd need to tell it to load "Nocturne", instead of "I Am The Wind" - making this more complicated than simply swapping a file.     

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1588
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #7 on: September 09, 2014, 06:31:41 pm »
I think you're right.  "Nocturne" is already in the game according to this: http://tcrf.net/Castlevania:_Symphony_of_the_Night_%28PlayStation%29#Nocturne

I'd need to tell it to load "Nocturne", instead of "I Am The Wind" - making this more complicated than simply swapping a file.     
Actually I think it is the other way around.
Telling the game to load a different song seems to be way easier in my opinion.
According to the user above:
"You just need to find some pointers somewhere and change them to change the song that is played."

If you wanted to replace the file, you would have to disect the entire ISO, find the music file, extract the files, convert the mp3 to wav, and find a way to import it instead of I am the wind.

goxor

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #8 on: September 09, 2014, 09:08:43 pm »
Actually I think it is the other way around.
Telling the game to load a different song seems to be way easier in my opinion.
According to the user above:
"You just need to find some pointers somewhere and change them to change the song that is played."

If you wanted to replace the file, you would have to disect the entire ISO, find the music file, extract the files, convert the mp3 to wav, and find a way to import it instead of I am the wind.

Definitely.  What I meant is, I originally assumed each music track was it's own file.  Just swap it, re-compile, and done.  But seeing that it's embedded complicates things, and now we're talking about pointers - something I know nothing about.

This would probably be a huge time sink for me - a lot more than a typical weekend project.  Maybe not for someone more knowledgeable, but for me, I got no idea where to start.

Seems like the most obvious hack in gaming though.  Props to whoever pulls it off.  But for me...  I don't know if I have the time. 


ShadowOne333

  • Hero Member
  • *****
  • Posts: 1588
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #9 on: September 09, 2014, 11:29:52 pm »
Definitely.  What I meant is, I originally assumed each music track was it's own file.  Just swap it, re-compile, and done.  But seeing that it's embedded complicates things, and now we're talking about pointers - something I know nothing about.

This would probably be a huge time sink for me - a lot more than a typical weekend project.  Maybe not for someone more knowledgeable, but for me, I got no idea where to start.

Seems like the most obvious hack in gaming though.  Props to whoever pulls it off.  But for me...  I don't know if I have the time.
Easy there, it doesn't mean that you HAVE to do it that way.
Here:
http://www.romhacking.net/utilities/679/
http://www.romhacking.net/utilities/894/

Those two utilities might help you to get somewhere.
Try the second one first and see if you can rip the WAV file for "I Am The Wind"
If you can rip it, then just get the "Nocturne" MP3, convert it to WAV using the same lenght, etc as the WAV extracted from the XA and then insert it.

goxor

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #10 on: September 10, 2014, 02:56:14 am »
Alright, I shrugged, said "what the hell", and tried those out.

XA Audio Converter wasn't much use.  Couldn't find audio in any of the files I pointed it at.

PSound was more interesting.  It found a lot of sound effects in the .VB files scattered around the ISO, and several more in DRA.BIN.

Unfortunately it found nothing in XA_STR1, but I'm still convinced that's where the music is.

Other things I've found:
DRACULAX.CCS in the XA folder can be opened with notepad.  It's a CD-ROM Generator for Windows 1.10 configuration file.  Looks like it dictates the order that the files are placed on CD.

SYSTEM.CNF can also be opened with notepad.  It says:
BOOT = cdrom:SLUS_000.67;1
TCB = 4
EVENT = 16
STACK = 801fff00


Bregalad

  • Hero Member
  • *****
  • Posts: 2753
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #11 on: September 10, 2014, 04:32:04 am »
@ShadowOne333 : The playstation DON'T use any MP3 ! You are downright wrong. It uses XA compression, which is radically different. XA is ADPCM compression, MP3 is cosine-transform based compression.

@goxor : You shouuld really learn about pointers. This is straightforward to learn once you know hex, and is the absolute base of any romhacking. However I must admit there is few to none PS1 debugging tools to my knownledge, which is the major problem in this case.

KC

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #12 on: September 10, 2014, 05:05:42 am »
However I must admit there is few to none PS1 debugging tools to my knownledge
Except for no less than three different debuggers and full system specs. And assemblers if you need to make changes.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1588
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #13 on: September 10, 2014, 10:25:34 am »
@ShadowOne333 : The playstation DON'T use any MP3 ! You are downright wrong. It uses XA compression, which is radically different. XA is ADPCM compression, MP3 is cosine-transform based compression.

@goxor : You shouuld really learn about pointers. This is straightforward to learn once you know hex, and is the absolute base of any romhacking. However I must admit there is few to none PS1 debugging tools to my knownledge, which is the major problem in this case.
I know the PSX doesn't use MP3. No console videogame uses straight forward MP3.
I said that he should download the MP3 of Nocturne, convert it to WAV and then work to XA.

Bregalad

  • Hero Member
  • *****
  • Posts: 2753
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #14 on: September 10, 2014, 02:16:30 pm »
This doesn't make sense as Nocture is alredy in the game in XA format. But even ignoring this fact, that'd sound bad. Both MP3 and XA compression destroy data, but in different way. Both of them are not normally audible. But if you take a song with data destroyed by MP3 and encode it in XA or the other way arround, it'll sound bad quality.

goxor

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #15 on: September 10, 2014, 10:36:50 pm »
This doesn't make sense as Nocture is alredy in the game in XA format. But even ignoring this fact, that'd sound bad. Both MP3 and XA compression destroy data, but in different way. Both of them are not normally audible. But if you take a song with data destroyed by MP3 and encode it in XA or the other way arround, it'll sound bad quality.

It doesn't have to sound bad.  Most people can't tell the difference between a 320kbps MP3 and a lossless file.  Convert that to XA, and it would sound good enough for a PSX game. 

But we're getting ahead of ourselves...

Bregalad

  • Hero Member
  • *****
  • Posts: 2753
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #16 on: September 11, 2014, 04:12:24 am »
Quote
Most people can't tell the difference between a 320kbps MP3 and a lossless file.
Of course not, nor could I tell any difference either. Only a superhuman could.

BUT

If you encode as a MP3 (even 320kbps), then decode as a wav, then re-encode using a different algorithm (in this case XA), even if both algorithms individually make no hearable difference, in combination, the data destruction could very well be hearable. I might be a little paranoiac, but ideally you should always apply lossy compression as a final step before production, and never as an intermediate step while editing anything.

Lance

  • Jr. Member
  • **
  • Posts: 32
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #17 on: September 12, 2014, 01:42:00 am »
For your hack idea of changing every song to I am the Wind, have you looked at the Gameshark/PAR code 80138458 00** ?

It changes every track in the game to a certain piece of music, except for FMVs. The value for I am the Wind would be 3C.

However it has two minor problems I noticed when I tried it:

It even changes the Voice Overs to the song, which leads to glitchy side effects because the conversation cutscenes in game normally won't continue until the character is done speaking. Theoretically they should still work if the music isn't looped in game and stops as it should normally.

You may just have to have a completed save file in order to play the game like this if it doesn't though. Otherwise you'll be stuck there without the aid of the magical cutscene skip device.

For whatever reason, I had glitchy running properties for Richter in the beginning - he would only run in place when you tried to run with him.

---

I'm not familiar with PSX emu debuggers, but I've recently messed around with the one FCEUX has. If it's anything like that one, where you can make the game stop whenever the game is trying to read from or write to an address that deals with whatever you're looking for, the above address should surely help you get started.

It goes without saying that you'll need to delve into learning the PSX's ASM into order to make your hacks.

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3532
    • View Profile
    • Aeon Genesis
Re: Castlevania - SOTN Music Hack
« Reply #18 on: September 12, 2014, 01:43:47 am »
It even changes the Voice Overs to the song, which leads to glitchy side effects because the conversation cutscenes in game normally won't continue until the character is done speaking. Theoretically they should still work if the music isn't looped in game and stops as it should normally.

... I am cracking the fuck up thinking about Alucard singing I Am The Wind, followed by Shaft responding angrily with I Am The Wind.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1588
    • View Profile
Re: Castlevania - SOTN Music Hack
« Reply #19 on: September 12, 2014, 02:00:46 am »
For your hack idea of changing every song to I am the Wind, have you looked at the Gameshark/PAR code 80138458 00** ?

It changes every track in the game to a certain piece of music, except for FMVs. The value for I am the Wind would be 3C.

However it has two minor problems I noticed when I tried it:

It even changes the Voice Overs to the song, which leads to glitchy side effects because the conversation cutscenes in game normally won't continue until the character is done speaking. Theoretically they should still work if the music isn't looped in game and stops as it should normally.

You may just have to have a completed save file in order to play the game like this if it doesn't though. Otherwise you'll be stuck there without the aid of the magical cutscene skip device.

For whatever reason, I had glitchy running properties for Richter in the beginning - he would only run in place when you tried to run with him.

---

I'm not familiar with PSX emu debuggers, but I've recently messed around with the one FCEUX has. If it's anything like that one, where you can make the game stop whenever the game is trying to read from or write to an address that deals with whatever you're looking for, the above address should surely help you get started.

It goes without saying that you'll need to delve into learning the PSX's ASM into order to make your hacks.
He doesn't want to change ALL the songs in game to I Am The Wind, he only wants to change the credits song "I Am The Wind" with the song "Nocturne"