?? nes.c
字號:
/***************************************************************************
nes.c
Emulation of the sound chip used on the NES and in some Nintendo arcade
games (Donkey Kong 3, Punch Out).
Hardware info by Jeremy Chadwick and Hedley Rainne.
Based on psg.c.
As of this moment, everything in here is totally wrong and largely
incomplete, but it is enough to hear some recognizable tunes.
***************************************************************************/
/***************************************************************************
NES sound hardware info by Jeremy Chadwick and Hedley Rainne
For the Square Wave and Triangle Wave channels, a formulae can be used
to provide accurate playback of the NES's sound:
P = 111860.78 / (CHx + 1)
Where "P" is the actual played data, and CHx is the channel played.
The channel formulaes are the following:
CH1 = $4002 + ($4003 & 7) * 256 (Square Wave #1)
CH2 = $4006 + ($4007 & 7) * 256 (Square Wave #2)
CH3 = $400A + ($400B & 7) * 256 (Triangle Wave)
Where the $400x values are actual values written to that register.
For the PCM channel, there are two methods of implementation: via DMA,
and via the PCM Volume Port ($4011).
Samples are sent byte-by-byte into $4011, the result being quite
audible. However, only a few games seem to use this method, while most
use the DMA transfer approach.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -