It is currently Wed Dec 13, 2017 11:26 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Sat Jul 01, 2017 12:36 pm 
Offline
User avatar

Joined: Thu Jun 01, 2017 10:53 am
Posts: 1
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.


Top
 Profile  
 
PostPosted: Sat Jul 01, 2017 12:53 pm 
Offline
User avatar

Joined: Thu Jan 03, 2008 1:48 pm
Posts: 544
NOP
Code:
MODE           SYNTAX       HEX LEN TIM
Implied       NOP           $EA  1   2

the ST_ opcodes that point to APU registers with 16-bit little endian addressing (MSB last/LSB first):
Code:
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

Use a breakpoint system in an emulator to decode the indirect address writes to APU properly.


Last edited by B00daW on Sat Jul 01, 2017 1:25 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Jul 01, 2017 1:09 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1868
Location: DIGDUG
I'll look at it. I did this for another game once.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sat Jul 01, 2017 4:38 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 130
Location: Rio de Janeiro - Brazil
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).

_________________
http://nesrocks.com/blog/superpitfall30th/


Top
 Profile  
 
PostPosted: Sat Jul 01, 2017 5:39 pm 
Offline

Joined: Sun Mar 03, 2013 1:52 am
Posts: 99
Location: Texas, USA
Here is what I came up with:

Code:
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

Process I used:
  • 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).

Tools: I used the tools below that are built into the emulator FCEUX. I don't have time to explain how to use these tools in detail, but if you're interested, maybe the help file can get you started.

Debug menu:
  • Debugger
  • Hex Editor
  • Game Genie Decoder/Encoder
Tools menu:
  • Cheats
Hex Editor window:
  • 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.

Top
 Profile  
 
PostPosted: Sat Jul 01, 2017 5:57 pm 
Offline

Joined: Sun Mar 19, 2006 9:44 pm
Posts: 924
Location: Japan
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.

_________________
http://www.chrismcovell.com


Top
 Profile  
 
PostPosted: Sat Jul 01, 2017 6:28 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19342
Location: NE Indiana, USA (NTSC)
So if the game played the conjectured full version of the dying jingle, it'd be even more annoying, right?

Source


Top
 Profile  
 
PostPosted: Sat Jul 01, 2017 6:49 pm 
Offline

Joined: Sun Mar 19, 2006 9:44 pm
Posts: 924
Location: Japan
Look, it's not an effective in-joke if you need links in triplicate.... :x

_________________
http://www.chrismcovell.com


Top
 Profile  
 
PostPosted: Sat Jul 01, 2017 6:51 pm 
Offline

Joined: Sun Mar 03, 2013 1:52 am
Posts: 99
Location: Texas, USA
ccovell wrote:
The game code seems to rely on the music code taking its time to play out, eg. in the death tune
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:
Code:
.NES File Offset  Bank  PC Address  Compare  Value  Game Genie  Description
----------------  ----  ----------  -------  -----  ----------  -------------------------------
5D2               00    85C2        A5       60     AVKAZISZ    disable music (stalls on death)


Top
 Profile  
 
PostPosted: Sun Jul 02, 2017 1:38 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group