DO NOT RUN THIS PROGRAM IN A DOS BOX!!
SPC Tool uses a custom video mode, and cannot be windowed. You can still run it under
Windows, but you must be at a full screen [Alt-Enter].
If you want to run SPC Tool without the GUI, see section 2.1 about Play Only mode.
Disclaimer
This program was written in my spare time for my purposes. I make no guarantee that it will run in part or in whole, as intended or implied on your system.
I've released it because I felt that some people may find it useful. If you find it useful, good. If not, don't complain.
Contents
- 1. Intro
- 1.1 What is it?
1.2 Features
1.3 System Requirements
1.4 Ripping .SPC's
- 2.1 Command Line Options
2.2 Key Commands
- 3.1 Main
3.2 Emulation
- 4.1 The Wave Table
4.2 Wave Options
4.3 Wave Forms
- 5.1 Logging to .WAV
5.2 Logging to .MID
- 6.1 Walking Around
6.2 Inside the SPC700
- A. Missing Features and Known Bugs
B. Program History
C. Credits
D. Contacting the Author
E. GM Program List
SPC Tool is a program that takes the functions of several programs already available and places them into one. What's the purpose of that? Well initially this started out as an idea I had to create a fast, low-level emulation core. The SPC700 was simple enough, and I set out about my task. When I finished I realized I hadn't accomplished much. (What good is a stand alone SPC700 emulator?) So I decided to add a DSP emulator, and as I was doing that I started adding other options and features. By now it's progressed to a point that I figure others could make use of it. So here it is.Like any emulator author, my goal is to create a perfect emulator. And although SPC Tool is probably the fastest and most accurate, that goal still has not been reached. This is version 0.61, meaning it's a public beta. There are bugs in this program. There are still features that are not yet fully implemented, or implemented at all. Use it for what it's worth.
- Anti Resonance
- CPU emulation -
- Emulation of all opcodes, except BRK
Integrated run-time debugger
DSP emulation -
- Non-standard output sample rates
ADSR/Gain envelope modification
Pitch modulation
Noise generation
Almost correct sample decompression
Correct FIR filtering on output rates other than 32kHz
Linear and cubic spline interpolation
Log output to WAV file
Log registers to MIDI file
SPC files -
- Support for song and fade length
Edit text in ID666 tag
Pull from ZST's
Waveforms -
- Rip BRR data as a WAV
Convert WAV to BRR using ADPCM compression
Coded entirely in assembly and compiled with TASM v5.2
I haven't actually tried this program on a 486, but I have run it on a P100. So it probably could run on a 486 100 at 8kHz.
- Minimum -
- 80486 w/ 480K free conventional memory
VGA video card
SoundBlaster or compatible with DSP v2.00 or higher
Recommended -
- Pentium with MMX support
100 percent IBM VGA compatible video card
SoundBlaster Live!
MS-Mouse v6.0 or higher
These are my system specs, and I've had no problems -
- PII 400
STB Voodoo 3 3000
SoundBlaster Live! Value
MS Optical IntelliMouse
I don't have an 8-bit sound card, so working out bugs is difficult. On one of the machines I tested, SPC Tool would lock up after pausing emulation. This appears to be a problem with certain 8-bit sound cards when running in high-speed DMA mode. The only work around to this is to run at 16kHz mono or less.
There is a device in the SNES. This device consists of an 8-bit CPU (Sony SPC700) and 64KB of RAM mounted on a circuit board. It's connected to the main board by a series of pins, and communication with it is carried out through one of four ports. Other than that, though, this device is completely separate physically and logically from the console.
The SPC700 runs at a whole 2.048MHz, has six internal registers, and can execute 256 opcodes. Obviously it's not as powerful as the computers of today, but in and of itself it's quite capable of performing many tasks. However, there are no input or display devices attached to it, so what good does it do us?
Well, the SPC700 does have a 16-bit DSP attached. This DSP functions much like the wave table sound cards today, capable of mixing 8 voices simultaneously at various pitch and volume. Programs can be written for the SPC700 that play music with the DSP just like people write programs for your PC that play music with your sound card.
Knowing that background, it's easier to understand how the music on the SNES works. A composer at [some gaming company] puts together a happy little tune using a sequencer on a PC. He then gives this song to the game programmers. They in turn place this song, along with some graphics, data, and code into a game. Part of that code consists of a program written for the SPC700 that can play this song. Most likely when the game boots it uploads this program to the SPC's RAM. Then at intervals in the game different songs are uploaded and played by this program.
Here's where the problem arises. The format of this song could be anything from a standard MIDI file to a proprietary format devised by the gaming company. But that doesn't matter, because the game programmers wrote a program that can play this song. Well, it doesn't matter to the common gamer anyway. For those of us who actually listen to video game music (admit it, some game music is actually pretty good) this is a problem because we don't know to play these songs!
Keep that thought for a second while I switch topics. Imagine if you could freeze the current state of your PC, and save all of your RAM to disk. Later on your computer crashes, but rather than rebooting, you just load all that data back into memory. Now your computer is back where it was as if nothing had changed. (This option to save the state of the machine is actually utilized by some laptops as a way to conserve power when sleeping, but you're probably more familiar with emulators using it as a cheap way to save the game.)
Now, coming back, you're playing your favorite SNES game on your PC. You look down at the dusty SNES console on the floor and wonder if your friend still has the Chrono Trigger cart you let him borrow last year, but then your attention is suddenly turned back to the monitor as that kick ass theme starts playing. You want to save the music, so you dump it to the hard drive, and later play it in a loop a few hundred times (or maybe not that long) with SPCAmp.
How is this possible? The emulated SPC has in its RAM both the song and the program needed to play it. When you save the song, you're mearly freezing the state of the SPC, and saving all the memory to disk. It's still unknown what the song is and how to play it, but you now have the program that can interpret it. By means of an emulator you can load this small memory dump and continue playing the song. The program inside has no idea that it's not really inside an SNES, or that it was even stopped at any time.
Instruments have to be stored using BRR blocks in order to be utilized by the DSP. By looking for characteristics in the data that matches BRR compression methods we can find stored waveforms. But since there's no standard format for the music, we don't have anything to search for. This is why .SPC's can't be ripped from ROMs directly.
FILE Input file Any standard 8.3 file name that belongs to an SPC dump, ZSNES saved state, or SNES ROM image.
/V Non-standard VGA SPC Tool runs in 90x60 text mode, and creates a graphical cursor by updating the character map. If your video card is not compatible with the standard VGA, attempts at updating the screen will produce garbage. This option turns the cursor into a friendly block, and uses slower BIOS routines to update the screen.
/J Japanese character set If a ROM is detected as being from Japan, the character set will be automatically switched to JIS-X0201.  However, if you want to use Katakana characters in the ID666 tag of an .SPC, use this to overload the default US ASCII character set.
Because of the nature of the graphical mouse, characters Mi through Yu will not be viewable unless you use /V.
/X Disable MMX instructions If you have an MMX processor, 64-bit instructions will be used for faster processing. (On Pentium IIs conditional move instructions will also be used.) If, for some strange reason, you don't want faster processing, this option will disable MMX support. This option has no effect on non-MMX CPU's.
/P[#] Play Only mode This removes any functionality of SPC Tool by disabling the GUI and all keys except Esc. Use this mode for playing songs in the background of Windows.
The value passed with /P is the pre-amplification level. If no value is passed, the default level (30) is used. Valid values are 0-99.
/O Disable sound card output This disables the sound card, though I'm not sure why you'd want to. If the sound card is disabled, all output will be written to disk as a .WAV file.
/8 Force 8-bit samples /M Force monaural samples The highest quality supported by your sound card will be detected automatically.
Mixing is performed in 32-bit stereo regardless of output type, so forcing mono won't speed things up.
/R# Output sample rate: The default is 32kHz, same as the SNES.
1-8000Hz 2-11025Hz 3-16000Hz 4-22050Hz 5-32000Hz 6-44100Hz 7-48000Hz 8-64000Hz
The 64kHz is there because it can be. Maybe someday a sound card will support it.
/I# Default interpolation: The default is cubic, but slower systems may need to change to linear.
1-None 2-Linear 3-Cubic Spline
Main commands -
F1 Help F11 Exit program F12 About Emulation -
F3 Save .SPC file Alt-F3 Log DSP F5 Emulate SPC700 Shift-F5 Reload RAM F7 Debug mode F8 Pause emulation Shift-F8 Reset SPC700 ~ Emulate at full speed +/- Adjust amplification 1-8 Mute channel Wave Table -
Shift-F2 Import waveform Shift-F3 Save waveform Shift-F9 Reload source directory Up/Down Select previous/next waveform PgUp/PgDn Move forward/back one page in wave table Space Play waveform Debug Mode -
F7 Emulate next instruction / Stop Emulation Shift-F7 Emulate to next line Alt-F3 Log Disassembly 0,1,2,3 Watch out-port 0-3 Alt-0,1,2 Watch timer 0-2 Ctrl-0,1,2 Watch counter 0-2 4 Watch control register port 5 Watch DSP address port 6 Watch DSP data port Esc Exit debug mode
Help
F1Provides basic help for current screen.Exit Program
F11 or Quit buttonStops any emulation and logging processes, and exits the program.About
F12Your standard about box. Also has some info about the current environment.Enter Debug Mode
F7Turns off the sound output and switches to the debug screen.Changing ID666 text
Click on text in the header windowText can be composed of any of the 256 ASCII characters.Changing song and fade length
Click on total time in the output window
Song Length: The length of the song, in seconds, not including the fade time. Values can range from 1 to 9999. Fade Time: The duration of the fade, in milliseconds, after song length. Values can range from 1 to 120000.
Emulate SPC
F5 or Play buttonCranks out the tunage man!Pause Emulation
F8 or Pause buttonStops the music or logging in progressReload RAM
Shift-F5 or Rewind buttonResets the music by reloading the RAM and CPU state. Reloading the RAM doesn't reload the wave table or unmute any channels.Emulate at full-speed
~ or Fast-forward buttonSpeeds up the song by not waiting for an interrupt to occur before creating the next block of sound. The speed of playback is solely dependent on your processor.Pressing the ~ key turns FF on and off.
Pressing the FF button turns FF on until it's released.Save .SPC File
F3 or... that upside down eject button
Write ID666 Tag Only: Just saves the text and song length. Write DSP Registers Only: Just saves the 128 bytes of DSP RAM. Save All .SPC Data: Saves ID666 tag, CPU state, SPC RAM, and DSP RAM. Use SPCAmp format: Checking this box causes the numerical values in the ID666 tag to be stored in binary form instead of text. If the SPC data was loaded from a .ZST, the first save will save everything regardless of which option you select.
Once changes are saved they cannot be undone.
Log DSP
Alt-F3 or Record button
MicroSoft Waveform: This logs the sound as you hear it to a .WAV file. MIDI: This logs the pitch, waveform, key registers, and changes in volume to a .MID file each time counter 0 is increased. Logging will begin as soon as you press OK. The filename will be the same as the .SPC, but with the appropriate extension.
By default, the .WAV file sample settings will be the same as the current settings.
During logging, the output sound is turned off.
Pre-amplification Level
+ and -.SPC's vary greatly in how they're mixed. SquareSoft music is often too quiet, while Capcom music can be too loud. This lets you adjust the level of amplification before output. If amplification is too high, clipping will occur.Mute Channel
1-8 or Clicking on channel numberDisables mixing a channel into the output or logging its updates.Reset SPC700
Shift-F8 or up arrow buttonErases all RAM and places the CPU in a loop. Not really useful for anything.
If the file loaded is an .SPC or .ZST, the Wave Table window contains a list of the waveforms loaded into RAM. This list is derrived from the source directory. A filter similar to the one used in the search algorithm is used to eliminate invalid instruments, but it's not completely accurate.If a ROM was scanned for BRR data, then the window contains the search results.
There are five columns in the table:
Select Waveform
Column .SPC or .ZST BRR Search Number The index in the source directory No meaning Offset Offset in RAM Offset in file Length Size of waveform in samples Size of waveform in samples Loop Starting sample of loop Waveform has a loop point BRR BRR compression methods used with waveform BRR compression methods used with waveform
Up or Down or ClickingSelects the waveform to modify.Scroll through table
PgUp or PgDn or the (partial) scroll bar
The Wave Options window is used to set how the waveform is mixed and logged.Left/Right clicking on a label will decrease/increase the value associated with it. In the case of Mid-C, the value will be lowered/raised a half-step.
Interpolation
InterSelects the type of interpolation to use for playback:Playback Rate for Middle-C
None The waveform is scaled for playback without any form of anti-aliasing. Use this if anti-aliasing softens the samples too much. Linear Delta samples in a scaled waveform are changed at an even rate. This method greatly improves sound quality by eliminating hard edges. Cubic Spline Delta samples in a scaled waveform are based on surrounding samples. This method recreates natural sounds better than linear, but may skew samples from synthesized sources.
Mid-CSpecifies the default sample rate for playback. Also used for logging. Values can range from 1 to 128000.The rest of the options are used for only MIDI logging, and are further explained in 3.4.2.Instrument Type
TypeCan be either Tone or Drum SetProgram Number
Prog #Values can range from 1 to 128Bank Number
Bank #Values can range from 0 to 127Amplification
AmpValues can range from 1 to 127Envelope Logging
EnvValue can be Ignore, EnvX, or ADSR
The Wave Form window is a graphical representation of the waveform. The domain is scaled so the waveform fits the window.
All waveform functions, except save, are disabled during emulation.
Play Waveform
Space or Play buttonPlays the waveform at the rate specified by Mid-CStop Playback
F8 or Stop buttonStops the waveform from playingImport Waveform
Shift-F2 or Eject buttonReplaces the BRR data with a user supplied 8 or 16-bit mono .WAV file. The best method of compression will be chosen by the import routine.Export .WAV File.WAV files longer than the BRR data will be truncated.
A baseline block will automatically be inserted at the beginning of the BRR data to reset the reference samples. Keep this is mind because it decreases your maximum wave length by 16 samples.
Imports into ROM files are permanent and cannot be undone.
Imports into .SPC's must be saved, and can be undone by reloading the RAM (F5 or Rewind).Waveforms that have been successfully imported will be displayed in green.
Shift-F3 or inverse eject buttonDecompresses the waveform and saves it as a .WAV file.Waveforms that have been successfully exported will be displayed in red.
Reload Wave Table
Shift-F9 or up arrow buttonReloads the wave table by scanning the source directory. This function also resets and options that have been set to their default values.Has no effect on ROMs.
SPC Tool has the ability to log the output of the DSP to disk in Micro$oft wave format, and the state of the DSP registers in a Musical Instrument Digital Interface format.Currently you cannot specify what filename to use to log to. The filename used is the same as the .SPC file, but with an appropriate extension.
After selecting which kind of logging to perform, logging will start as soon as you press OK. During the logging process the output to the sound card will be disabled. This is done for two reasons: First, it makes logging faster. Second, slow disk writes can cause the playback to become broken up.
Logging to Microsoft Wave format takes the same output you hear, and saves it to a .WAV file. .WAV files can be created at different sample rates and resolutions by changing the options in the lower half of the window, but aspects like song length, pre-amplification, and channel muting will remain the same.
Logging to MIDI is more difficult that to .WAV because each instrument has to have specific options set. In fact all the option fields, except interpolation, are used.Because of all the variables involved, SPC Tool wasn't intended to create perfect .MID files. Instead, it's pupose is to remove much of the guesswork and aid those who sequence video game music manually.
Middle C
The most important value, this is the playback sample rate for middle C, and is needed to determine which note to log. The default is 32kHz, though that's rarely the actual value used.
Tone or Drum?
By default, an instrument is logged as a tone, but instruments can be logged as percussion notes that are played on MIDI channel 10. Since percussion instruments have an indeterminate pitch, the Mid-C value is not used. (One less thing you have to do.)
Program Number
Specifies which program number to log in place of the waveform. (A list of program numbers can be found in Appendix E.)
Bank Change
If your MIDI device is capable of different banks, this value is logged as the MSB of the bank select word.
When the type of instrument is specified as Drum Set, this value acts as the note corresponding to the percussion instrument. (A list of percussion notes can be found in Appendix E.)
Amplification
Often the volume of the waveform and the instrument in your MIDI device are quite different. After the log volume is calculated, this value is used to adjust it. The method of adjustment is volume*(amp/8). So the default amplification of 32 will log the volume at 4x the level calculated.
The log volume will be clipped at 127.
Envelope Logging
The DSP uses ADSR envelope modification just like a MIDI device does. In rare instances, envelope modification isn't applied by the MIDI device. In these cases you can log the envelope value used by the DSP to recreate the same sound.
The default is Ignore which bases the log volume off the left and right channel volume only. Currently, EnvX and ADSR have the same effect which is to average the envelope value you see on the screen and the channel volume.
example
I'm now going to give an example to better explain how this works. In this case, I'm going to use the prelude music from Final Fantasy II. I chose that song for several reasons: Most people are familiar with it, it doesn't have many instruments, and it was originally sequenced on a Sound Canvas, so it converts to MIDI quite well.
Getting middle-C
The first thing you need to do is determine which waveforms get used as instruments. Do this by playing the song and seeing which ones get played. In this case, the first six waveforms don't get used. The three that do are 64, 65, and 66.
Now the tough part. Most musical formats store the pitch to play an instrument at as a note value (A#2, D-7, etc.) However, the pitch in an .SPC is stored as a playback rate (similar to how .MOD's store the pitch as a timer constant). So in order to figure out which notes instruments are being played at we need to know the value of a base note. By calculating the difference between the playback rate and the base rate we can figure out which note is being recreated. For SPC Tool I chose middle C (C-4) as the base note, because, well, it's middle C.
So how do we figure out what rate is middle C for a particular instrument? There's several ways, and I'll start with the easiest. First, though, I want to mention that the middle C rate doesn't have to be exact. The logging routine will pick the note that's closest. So as long as you're within 20-30Hz, you'll be okay.
1. Using the loop length
Look at the graph of the waveform. If there's a loop point it will be signified by a dotted line. Count how many cycles are in the loop portion. Next, figure out the length of the loop by subtracting the loop point from the length of the instrument. Now multiply the loop length by the middle C frequency, and divide the result by the number of cycles in a loop. Make sense? Probably not. Let's go the the FF2 .SPC.
The first instrument, 64, has no loop point. So that one's out. The next instrument has a loop length that covers almost the whole thing. So it's out also. Now the third instrument has a short loop length, and one oscillation can be clearly seen inside. Easy. So get the loop length, 688 - 656 = 32. Multiply by the frequency of middle C, 261.6255653. The answer is 32 * 262 = 8372. Since the loop covers one oscillation, we don't need to divide the answer by anything. So 8372 is the playback rate for this particular instrument.
2. Letting the computer decide
Analog X has made a program called Sample AutoTune that determines the frequency of a waveform. If you have AutoTune, save the instruments to disk that you want to calculate. Open AutoTune. For the note enter C4, for the sample rate select Enabled and deselect Specify, then choose Mono 16-bit. Open up explorer. Find the instruments you saved to disk, and drag them into AutoTune.
AutoTune will analyze each .WAV file and change the sample rate to match C-4. You'll need to use a .WAV editor to find out what the new sample rates are for each file.
3. Using an external program
Save the instruments to disk. Now use your favorite .WAV editor to look at them. Pick somewhere in the instrument where the amplitude and frequency appear to be rather constant, usually in the middle. Zoom up on that point until you have a 1:1 view. If the program you're using is any good, you'll be able to hi-light a section of the waveform, and it will tell you how many samples you have selected.%nbsp; Use the above formula to calculate the frequency.
Again, let's go with the easy one, which happens to be the first instrument. Zoom up in the middle of the waveform. Select ten oscillations. You should show 362 (plus or minus one) samples selected. Now apply the last method discussed: 362 * 261.63 / 10 = 9471Hz.
4. Just short of a random guess
What if the only .WAV editor you have is the POS that came with Winblows? Or the waveform is too complicated? I have one more method you can use. Play the .SPC. When the instrument is playing, take note of the playback rate. Plug this rate into the Mid-C value, and play the instrument. Does it sound like middle C? Try comparing it with other instruments, and adjust the rate in half-steps until you get it right.
For the second instrument we'll use this method. One of the playback rates is 12023. Plug that value in, and play the instrument. Nope, that's too high. So start decreasing the rate in half-steps. This can be done by clicking on the label Mid-C, or if you want to be more accurate you can do it by hand. The magic number in this case is the 12th root of 2, or 1.059463094. If you multiply the rate by this number you'll go up a half-step. If you divide the rate by this number you'll go down a half-step. Keep going down, comparing with the other instruments, until you get the right rate. In this case it'll be around 9550.
Choosing tone or drum
None of the instruments in the FF2 song are percussive, so leave them all as tone.
Which programs
This part can be difficult when authors create their own instruments, but this time it's easy. For instruments 64-66 use: 47 (Harp), 49 (Strings), and 74 (Flute).
Volume amplification
Like many of the SquareSoft songs, the volume is too low. These values work well on my Roland SCC-1, but may not for other devices: 45, 55, and 60
Envelope logging
Your MIDI device should have built-in ADSR for these instruments. Leave them all as Ignore.
Some examples of values used to log MIDI data:
Final Fantasy II - Prelude
64 9578 Tone 47 0 45 Ignore 65 9550 Tone 49 0 55 Ignore 66 8372 Tone 74 0 60 Ignore
Secret of Mana - Flight Bound for the Unknown
32 n/a Drum 1 36 18 Ignore 33 n/a Drum 1 38 16 Ignore 34 n/a Drum 1 42 11 Ignore 35 n/a Drum 1 46 11 Ignore 36 14070 Tone 49 0 45 Ignore 37 6297 Tone 2 0 36 Ignore 38 9425 Tone 76 0 38 Ignore 39 100464 Tone 37 0 29 Ignore 40 18750 Tone 69 0 37 Ignore 41 14210 Tone 64 8 44 Ignore 42 37674 Tone 13 0 42 Ignore
I think I may have taken the debugger a step further than I needed to, but if you really want to know what that SPC is doing or change it in any way, here's your chance.
In debug mode the sound output is disabled.
Emulate next instruction / Stop emulation
F7Emulates the current instruction pointed to by PC. If the debugger is watching a value, or waiting for a break point, this will stop it.Emulate to next line
Shift-F7Sets a breakpoint on the instruction after the current one.Exit debug mode
EscLog Disassembly
Alt-F3After turning on logging, every instruction disassembled will be written to the file SPCList.Txt. Logging can be stopped only by exiting debug mode.Modify value
Left clickAll values on screen can be modified except the Up Counters and Out Ports. Values are entered in hex.Watch memory location
Right clickWatching a location in memory causes the emulator to run until the value at that location changes. A watch can be placed on any value in SPC or DSP RAM, but only one watch can be placed at a time.Set break point
Setting a break point will cause the emulator to run until PC equals the value of the break point.Watch out-port
0 - 3Places a watch on the out-port value corresponding to the keypress.Watch timer
Alt-0 - Alt-2Places a watch on the corresponding timer [$FA-FC].Watch counter
Ctrl-0 - Ctrl-2Places a watch on the corresponding counter [$FD-FF].Watch control register
4Places a watch on the control register [$F1].Watch DSP address
5Places a watch on the DSP address port [$F2].Watch DSP data
6Places a watch on the DSP data port [$F3].
The screen is composed of seven windows:
Disassembly
This window shows the disassembly of the next instruction to be executed, as well as previous instructions. This is your typical disassembler with the program counter in the first column, the opcodes in the second, followed by the mnemonic and operands. Instructions that reference memory will be followed by a comment containing the pointer and the value pointed to.
Nothing in this window can be modified.
Registers
The six CPU registers and the timer up counter registers.
The CPU registers can be modified.
Direct Page 0 & 1
The direct pages are the first 512 bytes of RAM. The first 240 bytes (0-$EF) of page 0 are generally used for variables. The last 16 bytes ($F0-$FF) are set aside as function registers:
F0 Not used F1 Control register Used to turn the timers on and off, reset the in ports, and control access to ROM. F2 DSP Address The pointer into DSP RAM. F3 DSP Data The value in DSP RAM pointed to by $F2. Modifying this value will have an immediate effect in the DSP emulator. F4-F7 In ports 0 through 3 This is where data is received from the console. Of course, SPC Tool isn't attached to a console emulator, so these values will never change. However, you can change these values to simulate communication. For example, Castlevania IV uses port 0 to tell which sound effect to play. (Amazingly, the numbers sent to port 0 coincide with those on the options screen of the game.) F8-F9 Not used FA-FC Timer registers 0 through 2 The SPC700 has three timers. The first two run at 8kHz and the third at 64kHz. These timers can be used for anything, but are generally used to set the tempo of the song. By changing these values, you can speed up and slow down the music. FD-FF Counters 0 through 2 When the value of the up counter is the same as the value in the timer register, the value in the counter is increased. These registers are constantly being reset by the program in RAM, so modifying them is pointless. The next page of memory is used for the stack, but can also contain data. The current byte pointed to by SP will be hi-lighted.
All values can be modified.
Vector Table / IPL ROM
This window displays the last 64 bytes of memory. The memory here will contain either a small program used to transfer blocks of data from the console, or a table of vectors to sub-routines.
All values can be modified.
DSP Registers
128 bytes of memory used by the DSP to store the status of each channel:
Reg Channel status Values x0 R/W Left volume -128 to 127 x1 R/W Right volume -128 to 127 x2-x3 R/W Playback rate 1 to 16383 (4096 is 32kHz) x4 R/W Waveform 0 to 255 x5-x7 R/W Envelope varies x8 R Envelope heigth 0 to 127 (0 if not in ADSR mode) x9 R Wave out -128 to 127
Global status0C R/W Left volume -128 to 127 1C R/W Right volume -128 to 127 5D R/W Page containing wave table info 0 to 255 6C R/W Noise freqency 0 to 31 2C R/W Echo left volume -128 to 127 3C R/W Echo right volume -128 to 127 0D R/W Echo feedback -128 to 127 6D R/W Starting page for echo 0 to 255 7D R/W Echo delay 0 to 15 (0 to 240ms) 0F-7F R/W Echo FIR filter taps -128 to 127
Switch status4C R/W Key on bits 0-7 for channels 1-8 5C R/W Key off 7C R End block (Any write resets) 2D R/W Pitch modulation on/off 3D R/W Noise on/off 4D R/W Echo on/off Any modifications will have an immediate effect in the DSP emulator.
Analyzing
These values are used for debugging, and are not part of the SPC700.
Out ports Data sent to the console. Watch Stop emulation when this location in memory changes. Break Stop emulation when PC equals this value. The out ports cannot be modified.
A. Missing Features and Known Bugs
- DSP -
+ Echo volume isn't logged to MIDI (could be used for the reverb depth). - Logger only uses counter 0. - Logger doesn't catch pitch changes after a key-on signal (Arpeggio, portamento, and legato effects disappear) - Inaccurate envelope modification when the attack/decay time is very short and the output sample rate is less that 32kHz. - BRR decompression still isn't completely correct. CPU -
- Source directory in Star Ocean .SPC's is getting corrupted. - No read checking performed on 16-bit operations. - BRK instruction not implemented. - Disassembler may misinterpret some opcodes, though they will be emulated correctly. Main -
+ Programmed in real mode, which makes for a lot of far calls and segment overrides. + Some 8-bit sound cards lock up in high-speed DMA mode. + Full speed emulation sometimes crashes. + Configuration can't be saved. + Files can't be loaded from within the GUI. + Date dumped and program dumped with can't be modified. + Japanese character set is incomplete. + VU metering is done on the positive side of the base line. If a song has a negative DC offset, the bars will report incorrectly. + Scroll bar isn't finished. + BRR search can't be refined. + BRR search mode still has problems. + No error messages are displayed. If something didn't work, it just... didn't work. + Mouse cursor disappears under some parts of the screen (live with it). - Some video cards have display problems. - PgUp and PgDn don't work on some keyboards. - New screen routines could have some redraw problems. And other things I didn't feel like adding.
0.61 - 25.03.000.6 - 29.02.00
+ Added SNESAmp, a Winamp plug-in - MAIN Fixed high-speed DMA mode crashes, hopefully - MAIN Forgot to the set loop bit in instruments when importing + DSP Added MMX support for non-Intel CPU's - DSP Fixed a bug in the .WAV header - DSP Echo was too loud - DSP Echo was decaying too fast 0.5 - 26.01.00 First public beta
+ MAIN Improved command-line parsing + MAIN GUI can be disabled for a 'play only' mode + MAIN Added a poorly drawn, incomplete JIS-X0201 character set (If anyone has information/character maps, e-mail me.) + MAIN Screens are now dynamic (Should fix some problems, as well as create some new ones) + MAIN Buttons that get disabled now look disabled + MAIN Sound card can be disabled + MAIN Channels can be muted with the keyboard instead of the mouse + MAIN Can use the tilde key to fast forward + MAIN Wave options lists a GM instrument instead of a number + MAIN Wave form options can be changed with the mouse + MAIN Wave form options can be saved on exit + MAIN Output to .WAV can be customized - MAIN Loader correctly reads text ID666 tags - MAIN Fixed a major bug when files were loaded from a different directory - MAIN 16-bit DMA transfers can now reside above [1000:FFFF] - MAIN Rewrote DMA routines for 8-bit sound cards - MAIN 8kHz mixing works - MAIN Fixed a minor bug in the OK buttons of the dialog boxes + DSP Optimized interpolation routine + DSP Optimized FIR filter + DSP Mixing routine is now dynamically created to eliminate repetitive branching + DSP Improved interpolation routine to taper off the samples of instruments that don't end on the base-line (No more clicking in Starfox) + DSP Made pitch modulation 256 times finer - DSP A negative channel volume no longer corrupts the instrument - DSP Echo volume was corrupt in monaural mode (SB owners can hear now) - DSP ADSR is more accurate - DSP Bent line doesn't stall - DSP Linear interpolation doesn't overflow - DSP The noise generator is a little more random - DSP BRR decompression method 3 works better (No noise in Toy Story) - DSP Fixed a small bug in the pitch converting code - DSP Fixed a bug in pitch modulation when using cubic interpolation (wind doesn't crackle anymore) - DSP Echo works in the MMX code (MMX instructions are now enabled) - DSP Output is logged correctly when other than 16-bit stereo - DSP Temporary file created during MIDI logging gets deleted + CPU Added a hack to eliminate polling the counters (speeds up overall processing by as much as 25%) + CPU Optimized opcode handler and paragraph aligned short jump destinations + CPU Added a trace log option to debugger - CPU Fixed a stupid bug in the 16-bit memory checker that was causing random crashes and Vortex to get stuck - CPU PCALL jumps to the right location (Terranigma doesn't stall) - CPU STOP and SLEEP actually stop the CPU 0.1 - 13.12.99 Initial release
Thanks goes out to the following for...
SNES9x team invaluable help on handling some opcodes and most of the DSP, and help finding bugs Butcha info on the BRR ADPCM methods and .ZST's OpenCP team their cubic spline interpolation routine VLA for teaching me assembly, and the workings of ModeX and the DMA controller (this is thanks long overdue) ZSNES team giving us SPC's in the first place Zophar's Domain supplying me with .SPC's to test, and telling people about this program Datschge suggestions, bugs, and being a pain :) And everyone who's e-mailed me with support.
If you have questions or comments about SPC Tool ("How come my sound card doesn't work," is not a question about SPC Tool) you can e-mail me. I try to reply to all e-mail, however, working and going to school full-time does take its toll on my free time.
e-mail: antires@aol.com
web: Alpha-II Productions
This is a list of the general MIDI programs. Your MIDI device may have additional instruments in other banks. Consult your documentation for more information.
Tone Table
Piano Chromatic Percussion 1 Piano 1 9 Celesta 2 Piano 2 10 Glockenspiel 3 Piano 3 11 Music Box 4 Honky-tonk 12 Vibraphone 5 Electric Piano 1 13 Marimba 6 Electric Piano 2 14 Xylophone 7 Harpsichord 15 Tubular Bell 8 Clav. 16 Santur Organ Guitar 17 Organ 1 25 Nylon 18 Organ 2 26 Steel 19 Organ 3 27 Jazz 20 Church Organ 28 Clean 21 Reed Organ 29 Muted 22 Accordion 30 Overdrive 23 Harmonica 31 Distortion 24 Bandneon 32 Harmonics Bass Strings/Orchestra 17 Acoustic 81 Violin 18 Fingered 82 Viola 19 Picked 83 Cello 20 Fretless 84 Contrabass 21 Slap 1 85 Tremolo String 22 Slap 2 86 Pizzicato String 23 Synth 1 87 Harp 24 Synth 2 88 Timpani Ensemble Brass 25 Strings 89 Trumpet 26 Slow Strings 90 Trombone 27 Synth Strings 1 91 Tuba 28 Synth Strings 2 92 Muted Trumpet 29 Choir Aahs 93 French Horn 30 Voice Oohs 94 Brass 31 SynVox 95 Synth Brass 1 32 Orchestra Hit 96 Synth Brass 2 Reed Pipe 33 Soprano Sax 97 Piccolo 34 Alto Sax 98 Flute 35 Tenor Sax 99 Recorder 36 Baritone Sax 100 Pan Flute 37 Oboe 101 Bottle Blow 38 English Horn 102 Shakuhachi 39 Bassoon 103 Whistle 40 Clarinet 104 Ocarina Synth Lead Synth Pad 41 Square Wave 105 Fantasia 42 Saw Wave 106 Warm Pad 43 Syn. Calliope 107 Polysynth 44 Chiffer Lead 108 Space Voice 45 Charang 109 Bowed Glass 46 Solo Vox 110 Metal Pad 47 5th Saw Wave 111 Halo Pad 48 Bass & Lead 112 Sweep Pad Synth SFX Ethnic 49 Ice Rain 113 Sitar 50 Soundtrack 114 Banjo 51 Crystal 115 Shamisen 52 Atmosphere 116 Koto 53 Brightness 117 Kalimba 54 Goblin 118 Bag Pipe 55 Echo Drops 119 Fiddle 56 Star Theme 120 Shannai Percussive Sound Effects 57 Tinkle Bell 121 Guitar Fret Noise 58 Agogo 122 Breath Noise 59 Steel Drum 123 Seashore 60 Wood Block 124 Bird 61 Taiko 125 Telephone 62 Melo Tom 126 Helicopter 63 Synth Drum 127 Applause 64 Reverse Cymbal 128 Gun Shot Drum Table
Octave 1 Octave 2 36 Bass Drum 1 37 Side Stick 38 Snare Drum 1 39 Hand Clap 40 Snare Drum 2 41 Low Tom 2 42 Closed Hi-Hat 43 Low Tom 1 44 Pedal Hi-Hat 45 Mid Tom 2 46 Open Hi-Hat 35 Bass Drum 2 47 Mid Tom 1 Octave 3 Octave 4 48 High Tom 2 60 High Bongo 49 Crash Cymbal 1 61 Low Bongo 50 High Tom 1 62 Mute High Conga 51 Ride Cymbal 1 63 Open High Conga 52 Chinese Cymbal 64 Low Conga 53 Ride Cymbal Bell 65 High Timbale 54 Tambourine 66 Low Timbale 55 Splash Cymbal 67 High Agogo 56 Cowbell 68 Low Agogo 57 Crash Cymbal 2 69 Cabasa 58 Vibra-slap 70 Maracas 59 Ride Cymbal 2 71 Short High Whistle Octave 5 72 Long Low Whistle 73 Short Guiro 74 Long Guiro 75 Claves 76 High Wood Block 77 Low Wood Block 78 Mute Culca 79 Open Culca 80 Mute Triangle 81 Open Triangle