Skip to content

About improved SNESAPU.DLL

dgrfactory edited this page Sep 23, 2021 · 36 revisions

Features

SNESAPU published here is based on version 2.0 of Alpha-II Productions with various improvements and customizations.
Some features are ported from version 3.0, however, in order to reduce maintenance costs and simplify, the functionality has been reduced compared to the official.

  • Supported 8-point sinc interporation.
  • Added low-pass filter used in the actual APU.
  • Same noise generation algorithm as in the actual APU.
  • Various additional options. (Force noise, and disable surround, pitch modulation, pitch bend, FIR, envelope, noise)
  • Supported Script700/TimerTrick compatible.
  • Supported data transfer to actual APU using external equipment.

How to emulate

To emulate SPC700 and DSP, call the SNESAPU APIs in the following order:

  1. void SetAPUOpt(u32 mixType, u32 numChn, u32 bits, u32 rate, u32 inter, u32 opts);
  2. void LoadSPCFile(void *pFile);
  3. void* EmuAPU(void *pBuf, u32 len, u8 type);

See APU.h for a description of each API.

Compatible Script700 support

The Script700 is an auxiliary script of SPC700 used in Japan.
Some songs (ex. puyopuyo, Furai no shiren) are not played simply by saving the SPC, because the SFC main CPU transfers additional data in real time.
Script700 allows you to play these special SPCs by mimicking the main CPU instructions.

KUROHANE Works has made a summary page for the list of known Script700.
See also: About special SPC (in Japanese)

For using Script 700, save Script 700 code to a file with same name as the SPC file, and change extension to '700'.
For example, if you want to apply Script700 to 'sample.spc', write the code in 'sample.700'.

For coding Script700, provided an extension plugin for VSCode.
This plug-in provides functions such as instruction highlighting.
See also: Script700 Helper

APU communication support using the parallel (LPT) port

Improved SNESAPU.DLL supports data transfer to SHVC-SOUND using the parallel port.
Refer to the following pages for the electronic circuits for transfer.
See also: Snes APU on a PC

To transfer data, install "GiveIO" or "InpOut32" first, and call the SNESAPU APIs in the following order:

  1. void LoadSPCFile(void *pFile);
  2. u32 TransmitSPC(u32 addr);
    • addr: Data address of parallel port. (ex. 0x378)
    • Result: 0=Success, not 0=Failed
Result Cause
-1 Not installed GiveIO or InpOut32.
-2 Not supported EPP/ECP mode.
-3 No space available for boot loader.
1 ~ 9 Failed reset SHVC-SOUND.
10 ~ 19
-10 ~ -19
Failed transfer memory loader.
20 ~ 29
-20 ~ -29
Failed transfer SPC buffer.

SPC module support on G.I.M.I.C

In Japan, there is Dojin hardware called G.I.M.I.C which operates a retro music chip and outputs high quality sound.
This device with GMC-SPC2 module can output SFC music without the need for make electronic circuitry.
The improved SNESAPU.DLL supports SPC playing using G.I.M.I.C and fast transfer.

Clone this wiki locally