1.1.1 • Published 5 years ago

spc-reader v1.1.1

Weekly downloads
5
License
WTFPL
Repository
github
Last release
5 years ago

Build Status npm.io

SpcReader

SpcReader is a JS library for reading and parsing date from SPC700 files.

Installation

To install SpcReader into your project:

npm i --save spc-reader

Usage

SpcReader's default export is an async factory method for parsing SPCs.

import SpcReader, { ISpc } from 'spc-reader';

// Read by file path
const mySpc: ISpc = await SpcReader('aquatic-ambiance.spc');

// Read by buffer
const anotherSpc: ISpc = await SpcReader(fs.readFileSync('blargg-stage.spc'));

Public Exports

In addition SpcReader, the following items are also exported for public use.

ISpc

ISpc is an interface that describes the parts and data of an SPC file.

PropertyTypeDescription
hasID666MetadatabooleanWhether the SPC file contains ID666 metadata. This is the SPC equivalent of ID3 tags.
regPCnumberThe program counter register.
regAnumberThe accumulator (A) register.
regXnumberThe X register.
regYnumberThe Y register.
regPSWnumberThe program status word register.
regSPnumberThe lower byte of the stack pointer.
metadataIId666?Any ID666 metadata available. If there is none, is undefined.
programDataUint8ArrayThe SPC program data. Will always be 65,536 bytes.
dspRegistersUint8ArrayThe DSP registers data. Will always be 128 bytes.
iplRamUint8ArrayThe data from the IPL RAM area. Will always be 64 bytes.

IId666

IId666 is an interface that describes the various metadata properties of the ID666 tags.

PropertyTypeDescription
titlestringTitle of the song.
gamestringThe name of the game the song is from.
dumpedBystringThe name of the person/program that dumped the SPC.
commentsstringFree form comments field.
dumpedOnDateThe date the SPC data was dumped. Not guaranteed to be a real date.
lengthnumberThe length of the song in seconds before beginning fade out.
fadeOutLengthnumberThe length of the fade out in milliseconds.
artiststringThe name of the song's artist.
defaultChannelDisabledbooleanI honestly don't know...
emulatorEmulatorAn ID code identifying the emulator that the SPC was dumped from.

Emulator

Emulator is an enum defining some of the ID codes for the emulator property of the IId666 interface.

ValueName
0Unknown
1ZSNES
2Snes9x
1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago