Castlevania 1 - "turning off" the music
Moderator: Moderators
Castlevania 1 - "turning off" the music
Hello everyone. My goal is to have an NES ROM file of Castlevania 1 that plays normally, minus the music. The SFX would still play however, so simply turning off the sound channels or muting the game does not produce the desired result. Why would I want this? For video making purposes, and I suppose game music bands might find it useful as well. A couple of examples:
https://www.youtube.com/watch?v=o6iRuyeE3ug&t=782s Link to the Past (please don't share this one. the gameplay is so bad LOL. mainly just a proof of concept.)
https://www.youtube.com/watch?v=qRGNrjs0vXo Gradius II
https://www.youtube.com/watch?v=oG900fADjVg Dracula X
In the past I've been lucky with games like Link to the Past and MegaMan 1-3 which have level editors that allow you to do this, however the best CV level editor, Stake, does not. Instead it has a pointer, which looks like you can just swap the songs around, but not to nothing. It does have an Advanced Editing Mode that shows you three sound channels and 3 values. Example for stage 1:
Square 1: 9C83
Triangle: 9DB5
Square 2: 9D18
but I don't know what to do with this information and you seem unable to change their values. There is a glitch in the game that let's you play stage 1 without music, but only lasts until the boss, and there's a Game Genie code that turns off the SFX only, so that's no good LOL. There is a Castlevania ROM map here:
http://datacrystal.romhacking.net/wiki/ ... ia:ROM_map
but sadly lists nothing about music. So if anyone can offer some advice on tools, or pointers on how to approach the problem, that would be splendid. I'd like to eventually have a catalog of "Silent Games". Thanks for reading.
https://www.youtube.com/watch?v=o6iRuyeE3ug&t=782s Link to the Past (please don't share this one. the gameplay is so bad LOL. mainly just a proof of concept.)
https://www.youtube.com/watch?v=qRGNrjs0vXo Gradius II
https://www.youtube.com/watch?v=oG900fADjVg Dracula X
In the past I've been lucky with games like Link to the Past and MegaMan 1-3 which have level editors that allow you to do this, however the best CV level editor, Stake, does not. Instead it has a pointer, which looks like you can just swap the songs around, but not to nothing. It does have an Advanced Editing Mode that shows you three sound channels and 3 values. Example for stage 1:
Square 1: 9C83
Triangle: 9DB5
Square 2: 9D18
but I don't know what to do with this information and you seem unable to change their values. There is a glitch in the game that let's you play stage 1 without music, but only lasts until the boss, and there's a Game Genie code that turns off the SFX only, so that's no good LOL. There is a Castlevania ROM map here:
http://datacrystal.romhacking.net/wiki/ ... ia:ROM_map
but sadly lists nothing about music. So if anyone can offer some advice on tools, or pointers on how to approach the problem, that would be splendid. I'd like to eventually have a catalog of "Silent Games". Thanks for reading.
Re: Castlevania 1 - "turning off" the music
NOP
the ST_ opcodes that point to APU registers with 16-bit little endian addressing (MSB last/LSB first):
Use a breakpoint system in an emulator to decode the indirect address writes to APU properly.
Code: Select all
MODE SYNTAX HEX LEN TIM
Implied NOP $EA 1 2
Code: Select all
MODE SYNTAX HEX LEN TIM
Zero Page STA $44 $85 2 3
Zero Page,X STA $44,X $95 2 4
Absolute STA $4400 $8D 3 4
Absolute,X STA $4400,X $9D 3 5
Absolute,Y STA $4400,Y $99 3 5
Indirect,X STA ($44,X) $81 2 6
Indirect,Y STA ($44),Y $91 2 6
MODE SYNTAX HEX LEN TIM
Zero Page STX $44 $86 2 3
Zero Page,Y STX $44,Y $96 2 4
Absolute STX $4400 $8E 3 4
MODE SYNTAX HEX LEN TIM
Zero Page STY $44 $84 2 3
Zero Page,X STY $44,X $94 2 4
Absolute STY $4400 $8C 3 4
Last edited by B00daW on Sat Jul 01, 2017 1:25 pm, edited 1 time in total.
Re: Castlevania 1 - "turning off" the music
I'll look at it. I did this for another game once.
nesdoug.com -- blog/tutorial on programming for the NES
Re: Castlevania 1 - "turning off" the music
Setting 0x48D to 60 mutes all sounds, so I'm thinking that the only way would be to set all music pointers to a "mute" sfx (one by one).
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
Re: Castlevania 1 - "turning off" the music
Here is what I came up with:
Process I used:
Debug menu:
Code: Select all
Tested with
MD5: 756170ba1e06fa26c60d10114dc6a5ae Castlevania (USA)
MD5: 728e05f245ab8b7fe61083f6919dc485 Castlevania (USA) (Rev A)
.NES File Offset Bank PC Address Compare Value Game Genie Description
---------------- ---- ---------- ------- ----- ---------- --------------------------
698 00 8688 F0 50 ASEEATEY mutes melodic notes
646 00 8636 F0 70 AYUATTEY mutes one drum sound
64A 00 863A F0 70 AYUEZTEY mutes the other drum sound
- The APU registers link reminded me the sound registers start at 4000.
- Using breakpoints on writes to 4000, I found the general area of the music code.
- From the romhacking.net links, I found a document about the music format: http://www.romhacking.net/documents/150/
This helped me identify what certain comparison values in the code were likely for (drums E9 and EA and rests C0). - I googled for the 6502 instruction set to refresh myself with it and found this document's section on branches helpful: http://www.6502.org/tutorials/6502opcodes.html#BRA
It suggested using a comparison with the overflow flag as a way to force or prevent a branch. - I modified the compares for the drums to always fail (F0 BEQ to 70 BVS) and modified the compare for the rests to always succeed (F0 BEQ to 50 BVC).
Debug menu:
- Debugger
- Hex Editor
- Game Genie Decoder/Encoder
- Cheats
- View menu: ROM File
- File menu: Goto Address
Last edited by Bavi_H on Sat Jul 01, 2017 6:00 pm, edited 1 time in total.
Re: Castlevania 1 - "turning off" the music
Nice job with the GG codes.
If you can hack the game ROM, try this:
Using a hex editor, hack the following locations in the headered PRG1 ROM:
at 0x1c1bd in the ROM:
20 F0 FF
at 0x20000 in the ROM:
C9 26 90 02 A9 00 8D F6 07 60
This code silences music code numbers 27 and above.
[edit] some caveats:
The game code seems to rely on the music code taking its time to play out, eg. in the death tune, so when you die, it'll quickly restart play.
Music codes after 27 include some sound effects, so separating them all out is a more involved hack.
If you can hack the game ROM, try this:
Using a hex editor, hack the following locations in the headered PRG1 ROM:
at 0x1c1bd in the ROM:
20 F0 FF
at 0x20000 in the ROM:
C9 26 90 02 A9 00 8D F6 07 60
This code silences music code numbers 27 and above.
[edit] some caveats:
The game code seems to rely on the music code taking its time to play out, eg. in the death tune, so when you die, it'll quickly restart play.
Music codes after 27 include some sound effects, so separating them all out is a more involved hack.
Re: Castlevania 1 - "turning off" the music
So if the game played the conjectured full version of the dying jingle, it'd be even more annoying, right?
Source
Source
Re: Castlevania 1 - "turning off" the music
Look, it's not an effective in-joke if you need links in triplicate....
Re: Castlevania 1 - "turning off" the music
Yeah, I ran into that too. In my initial attempt, I identified a place in the code that seemed to be reached for music only and just changed it to RTS. But when you die, the game never proceeds:ccovell wrote:The game code seems to rely on the music code taking its time to play out, eg. in the death tune
Code: Select all
.NES File Offset Bank PC Address Compare Value Game Genie Description
---------------- ---- ---------- ------- ----- ---------- -------------------------------
5D2 00 85C2 A5 60 AVKAZISZ disable music (stalls on death)
Re: Castlevania 1 - "turning off" the music
You don't even need to do any modification to the game ; just watch the first 2 demoes scenes (but not the 3rd) then press start.
The music would still start at a boss fight, though, and I'm pretty sure the music resumes when you reaches level 2.
The music would still start at a boss fight, though, and I'm pretty sure the music resumes when you reaches level 2.