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

Author Topic: How to change sound effects in NES games  (Read 1039 times)

Justamariofan

  • Newbie
  • *
  • Posts: 3
    • View Profile
How to change sound effects in NES games
« on: October 09, 2019, 04:25:08 am »
I want to know if there is a way to change a sound effect in an NES game. Specifically replacing SMB2 Jump and 1UP sound effects with the first game's super jump and 1UP sound effect. Is there a program recommended for that use? If so, please do tell me.

Psyklax

  • Hero Member
  • *****
  • Posts: 1067
    • View Profile
    • Psyklax Translations
Re: How to change sound effects in NES games
« Reply #1 on: October 09, 2019, 09:36:45 am »
All sound in an NES game - music and sound - is coded into the game, and each game can do this differently. It's not as simple as replacing jump.wav with another one, you need to learn assembly to try something like this.

That's not to say that your request is impossible, it'll just take more effort than you might expect.

redmagejoe

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: How to change sound effects in NES games
« Reply #2 on: October 09, 2019, 03:15:56 pm »
To elaborate on Psylax's response, here's a breakdown of how the NES Audio Processing Unit works.

https://wiki.nesdev.com/w/index.php/APU

nesrocks

  • Hero Member
  • *****
  • Posts: 608
    • View Profile
    • nesrocks.com
Re: How to change sound effects in NES games
« Reply #3 on: October 09, 2019, 06:32:04 pm »
It is usually easier to change which sound effect (from the game's own sfx "library") is played, but I think that isn't of use to you in this case, is it?

Jorpho

  • Hero Member
  • *****
  • Posts: 4182
  • The cat screams with the voice of a man.
    • View Profile
Re: How to change sound effects in NES games
« Reply #4 on: October 09, 2019, 08:34:16 pm »
SMB1 at least has been exhaustively disassembled and you can at least identify exactly how its sounds are generated.  SMB2 has not gotten nearly as much attention.

A good starting point would be if you could find a hack that's already changed some or all of the sounds, but I for one can't recall ever hearing of such a thing.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Justamariofan

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to change sound effects in NES games
« Reply #5 on: October 13, 2019, 02:23:46 am »
Thanks for the tip but does anyone know what's the code for SMB2 jump and 1UP and SMB jump (as Super or Fire Mario) and 1UP or where I can find it so I can apply it?

redmagejoe

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: How to change sound effects in NES games
« Reply #6 on: October 13, 2019, 01:43:11 pm »
Thanks for the tip but does anyone know what's the code for SMB2 jump and 1UP and SMB jump (as Super or Fire Mario) and 1UP or where I can find it so I can apply it?

See:
SMB1 at least has been exhaustively disassembled and you can at least identify exactly how its sounds are generated.  SMB2 has not gotten nearly as much attention.

A good starting point would be if you could find a hack that's already changed some or all of the sounds, but I for one can't recall ever hearing of such a thing.

You're going to have to do a bit of trial-and-error testing on your own to locate the data you need in the ROM.

nesrocks

  • Hero Member
  • *****
  • Posts: 608
    • View Profile
    • nesrocks.com
Re: How to change sound effects in NES games
« Reply #7 on: October 13, 2019, 10:36:04 pm »
In my experience sound effects or songs are played using this type of code:
lda/ldx/ldy a value
jsr sfxplayer routine

So using fceux you want to have minimal code/data logged when you know a sfx has been activated. Then pause and look in the hex editor (ROM) for something that looks like (A9 ?? 20 ?? ??) where ?? can be any number. Then you change the number after the A9 (or A2 or A0) and activate the sfx again and see if it changed.

That is considering this is how sfx are played on smb. Personally I wouldn't look in the disassembly as a first approach, I'd go straight to this.