logo
 drop

Main

Community

Submissions

Help

80480445 visitors

Author Topic: About the x.dmc file. I'll be very grateful if you know the answer!!  (Read 542 times)

w7n

  • Jr. Member
  • **
  • Posts: 64
  • Location: Nanjing, China
  • Kodoku no Kansokusha.
    • View Profile
    • w7n's SMB Hacks&NES projects page
I'm found numerous tutorials on how to convert x.wav files to x.dmc files. However, I haven't found any tutorial that tells me how to finally put this sound into the NES.
Can anyone tell me what part of data means what in a x.dmc file? How should I give values to the CPU Addr $4010, $4011, $4012, $4013, so that this sound can be heard?
Recently there's a trend in Chinese SNS & forums to defend the policies, saying that you're nothing without your country.
They would defend GFW even when many foreign sites are blocked, and defend Marxism even when they have to take the bullshit course in school. WTH.

BTW, Acfun comments zone=hell.

syntax error

  • Full Member
  • ***
  • Posts: 230
    • View Profile
Re: About the x.dmc file. I'll be very grateful if you know the answer!!
« Reply #1 on: December 29, 2011, 08:36:27 am »
Difficult to explain in a few words.
The NES has a limited PCM like playback function used for short sounds.

w7n

  • Jr. Member
  • **
  • Posts: 64
  • Location: Nanjing, China
  • Kodoku no Kansokusha.
    • View Profile
    • w7n's SMB Hacks&NES projects page
Re: About the x.dmc file. I'll be very grateful if you know the answer!!
« Reply #2 on: December 30, 2011, 02:54:20 am »
Difficult to explain in a few words.
The NES has a limited PCM like playback function used for short sounds.

I only need a quick tutorial as I can do ASM programming. Just tell me how, or show me a tutorial.
Recently there's a trend in Chinese SNS & forums to defend the policies, saying that you're nothing without your country.
They would defend GFW even when many foreign sites are blocked, and defend Marxism even when they have to take the bullshit course in school. WTH.

BTW, Acfun comments zone=hell.

never-obsolete

  • Newbie
  • *
  • Posts: 27
  • Location: AZ
    • View Profile
Re: About the x.dmc file. I'll be very grateful if you know the answer!!
« Reply #3 on: January 01, 2012, 04:49:15 am »
I haven't done too much with the NES sound hardware, but this is how I did it:

Code: [Select]
SND_DMC_CTRL equ $4010
SND_DMC_DA equ $4011
SND_DMC_ADDR equ $4012
SND_DMC_DL equ $4013
SND_CLOCK equ $4015


; A = sample id#
Func_playSample: asl
asl
tax
lda #$1F ; enable channels
sta SND_CLOCK
lda snd_sampleTable + 0, X ; set dmc parameters
sta SND_DMC_CTRL
lda snd_sampleTable + 1, X
sta SND_DMC_DA
lda snd_sampleTable + 2, X
sta SND_DMC_ADDR
lda snd_sampleTable + 3, X
sta SND_DMC_DL
_exit_playSample: rts

;     $4010  $4011  $4012                 $4013
snd_sampleTable:
.db $0E,   $7F,   _snd_sample00 / 64,   $17
.db $0F,   $00,   _snd_sample01 / 64,   $0B
.db $04,   $00,   _snd_sample00 / 64,   $0B

;------------------------------
_snd_sample01: .hex AAAAAAAAAAAFF09E9FF006AE7C1B98F0
.hex 0003000C01CE018000000000000F1FFF
.hex FBF3CFF3EFDEB8F9A6A2243981438086
.hex 19023851878615398CA6554D168CA345
.hex 4590CA56225270D65316D354D74B374B
.hex 5B6B56CEB55B5D59B6D5ABD6B5D76B6D
.hex ADAEB6D6B5B5AAD6AAACAAA954A994A4
.hex A94A4A8A9254A549294A54A52952A54A
.hex A554A954AA952AAA94952AAA55552A56
.hex 66AA9AAAB55AADAB5AB56B6B6B5AB5AA
.hex B556AAD55556AAAAAAAAAAAAAA955555
.hex FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

;------------------------------
_snd_sample00: .hex FEFFDEFFE3EF8C444031370980186000
.hex C0202F3AA357EF9FAFFFDEBF9EC92441
.hex 0900040018749BBF76EBCF7BDFF381E2
.hex 68311C31886AC08F06D4C5C72F1D63A7
.hex D0FC63CFB8DC7633EE30E2D008388401
.hex 421E7D9E7FE7EF3F7F3F87DC63188853
.hex 11060D62033C3324E71FF8F0F3CF71AE
.hex 1C8ECF08CEC240E18E182CD191ED9F0F
.hex CFC7CCF53839B819478846D60458639C
.hex 61798CF398F77827C70F8CF5862F918C
.hex 71C721E1C407A62E8AE743CF9E1F9E71
.hex F363C318C3B0E0E30F08E0718C393999
.hex F1BC7476E2F3C79719C6370F09C67123
.hex 88E0A9838B8CEF0DDAF473EE1CDB8E76
.hex 1A2E31C39C5907A1C0F1199C583CE339
.hex E38EB8E71CE3A70D8EC239E62636198C
.hex 7498CD4738B8F26EACB3B4E571278E8C
.hex 8F8E1C6B298E1C2C68D931E3559738D3
.hex B1CE38F1D4B34EA962C9A8ACA918E651
.hex 9A73299E39D3659D58BA61DA46AA3C52
.hex B131E0E5952ACCB29CACAB39666ACCAB
.hex 8B55A6A6AA3C5A3938B954AA95AA655A
.hex 9CC759B2AED4B1D463C5346A6569654C
.hex E354D6334D7192EA9AAB56555AFFFFFF

It doesn't do anything special, just plays drum samples (ripped from CV2).