Nintendo S-SMP

From Wikipedia, the free encyclopedia
  (Redirected from .SPC)
Jump to: navigation, search
Nintendo S-SMP

The Nintendo S-SMP is the audio processing unit of the Super Nintendo Entertainment System (SNES) video game console.

Technical details[edit]

The S-SMP audio processing unit consists of an 8-bit SPC700, a 16-bit DSP, 64 kB of SRAM shared by the two chips, and a 64 byte boot ROM. The audio subsystem is almost completely independent from the rest of the system: it is clocked at a nominal 24.576 MHz in both NTSC and PAL systems, and can only communicate with the CPU via 4 registers on Bus B.[1][2] It was designed by Ken Kutaragi and manufactured by Sony.

SPC700[edit]

The Sony SPC700[3] is the S-SMP's integrated 8-bit processing core manufactured by Sony with an instruction set similar to that of the MOS Technology 6502 (as used in the Commodore 1541 diskette drive and the Vic 20, Apple II, BBC Micro and in modified form in the original NES).

It is located on the left side of the sound module, it shares 64 KB of SRAM with the S-DSP (which actually outputs the sound) and runs at 2.048 MHz, divided by 12 off of the 24.576 MHz crystal. It has six internal registers, and can execute 256 opcodes, the SPC700 instruction set is quite similar to that of the 6502 microprocessor family, but includes many additional instructions, such as XCN (eXChange Nibble), which swaps the upper and lower 4-bit portions of the 8-bit accumulator, and an 8-by-8-to-16-bit multiply instruction. Sony also re-mapped all the opcode values (eg. 00h no longer is BRK, A9h no longer is LDA) and renamed the opcode mnemonics in their assembler (eg. TXY becomes "MOV x,y")[4].

It is described in the Nintendo SNES Development Manual[5] in this way:

A Sony SPC700 series is used in the CPU core of the SNES Sound Source. It is possible to access and address space of 64 Kbytes in the SPC series CPU. Address classification of the memory space is made according to purpose; addresses 0000 H ~ 00FF H are called page 0 and addresses 0100 H ~ 01 FF H are called page 1. In regard to the data in this region; when direct page designation is carried out by the direct page flag (P) within the program status word, it is possible to carry out data processing in wide-ranging addressing modes with a small number of machine cycles. Within the CPU there are the universal registers A, X, and Y, program status word (PSW) of the various flags, program counter (PC), and stack pointer (SP).

Other applications of the SPC700 range from sound chip to the CXP82832/82840/82852/82860 microcontroller series,[3] the Proson A/V receiver 2300 DTS uses an CXP82860 microcontroller that utilizes the SPC 700 core.

DSP[edit]

The S-DSP is capable of producing and mixing 8 simultaneous voices at any relevant pitch and volume in 16-bit stereo at a sample rate of 32 kHz. It has support for voice panning, ADSR envelope control, echo with filtering (via a programmable 8-tap FIR), and using noise as sound source (useful for certain sound effects such as wind). S-DSP sound samples are stored in RAM in compressed (BRR) format. Communications between the S-SMP and the S-DSP are carried out via memory-mapped I/O.

RAM[edit]

The RAM is accessed at 3.072 MHz, with accesses multiplexed between the S-SMP (​13) and the DSP (​23). This RAM is used to store the S-SMP code and stack, the audio samples and pointer table, and the DSP's echo buffer.

Operation[edit]

The S-SMP operates in a somewhat unconventional manner for a sound chip. A boot ROM is running on the S-SMP upon power-up or reset, and the main SNES CPU uses it to transfer code blocks and sound samples to the RAM, the code is machine code developed specifically for the SPC700 instruction set in much the same way that programs are written for the CPU; as such, the S-SMP can be considered as a coprocessor dedicated for sound on the SNES.

Since the module is mostly self-contained, the state of the APU can be saved as an .SPC file (named after the audio chip core), and can be emulated in a stand-alone manner to play back all game music (except for a few games that constantly stream their samples from ROM). Custom cartridges or PC interfaces can be used to load .SPC files onto a real SNES SPC700 and DSP.

Format[edit]

An SPC700 sound file (or SPC) is a video game music file consisting of scores and music data from RAM used by the S-DSP sound chip on the Super Nintendo Entertainment System (SNES) or Super Famicom. This sound data is usually obtained from a console emulator and not from the system itself.[citation needed]

The capabilities of the S-DSP in the SNES sound system allow for music synthesis by samples (analogous to MOD or IT music formats), allowing long stretches of audio to be produced from only 64 kilobytes of data, as seen in "Balance Is Restored" from Final Fantasy VI.[citation needed]

The S-DSP chip produces 16-bit sound at 32 kHz, but S-DSP emulators generally can be reconfigured to output at a different sampling rate (from 8 to 48 kHz).[citation needed]

SPC plugins are available for media player software such as VLC and portable MP3 players running Rockbox, some SPC players offer support for complex sound interpolation methods to attempt to enhance sound quality. Several programs exist to produce MIDI files from the score blocks of SPC files.[citation needed]

Programmers sometimes use a technique to overcome the 64KB limit of the SPC700/DSP, of swapping samples in and out of memory on the fly, the file format does not support sample swapping and thus musical scores that use this trick will be played back incorrectly.[citation needed]

See also[edit]

References[edit]

  1. ^ anomie. "Anomie's S-DSP Doc" (text). Romhacking.net. Retrieved 2007-04-21. 
  2. ^ anomie. "Anomie's SPC700 Doc" (text). Romhacking.net. Retrieved 2007-04-21. 
  3. ^ a b "CXP82832/82840/82852/82860 CMOS 8-bit Single Chip Microcomputer" (PDF).  090423 datasheetcatalog.org
  4. ^ "Full text of ``SNES Development Manual``".  archive.org
  5. ^ "NES Development and Strangulation Records message boards".  nesdev.com

External links[edit]