Software development kit

Using device of the WTD

User application can not use the following device because WTD is using the following device.

Library file

This library can play music and effect on the WonderSwan.
User can control the WTD by the function call of the WTD.

library version
library fileSegment address of DGROUP Work area MIDI Device
WTD_SRAM.LIBS-RAM
(0x10000 to 0x1FFFF)
4096 [Byte]
(segment class "BSS")
WTD can use MIDI.
And user application can not use serial port.
WTDHSRAM.LIBS-RAM
(0x10000 to 0x1FFFF)
2048 [Byte]
(segment class "BSS")
WTD can not use MIDI.
And user application can use serial port.
WTD_IRAM.LIBI-RAM
(0x00000 to 0x0FFFF)
4096 [Byte]
(segment class "BSS")
WTD can use MIDI.
And user application can not use serial port.
WTDHIRAM.LIBI-RAM
(0x00000 to 0x0FFFF)
2048 [Byte]
(segment class "BSS")
WTD can not use MIDI.
And user application can use serial port.

Those library are microsoft's format.
Those library are made MASM (Microsoft macro assembler version 6.11a).
We confirm that the LSI-C86 for WonderWitch can use those library.

In-direct library of the Wonder Witch
File name Segment address of DGROUP Work areaMIDI Device
WTD.FX S-RAM
(0x10000 to 0x1FFFF)
4096 [Byte]
(heap area)
WTD can use MIDI.
And user application can not use serial port.
WTD_H.FX S-RAM
(0x10000 to 0x1FFFF)
2048 [Byte]
(heap area)
WTD can not use MIDI.
And user application can use serial port.

library functions

Function call of the WTD is as follows.
About the details, please see document "DEVELOP.pdf".

library Function
void WTD_FunctionLoad(&Wtd_Function); Load of the function struct. (This fanction is library version only.)
If you want to use the library version, you must call this function.

In-direct library Function & Function struct.
int wtdIL.Stay(); Open and setup the WTD.
int wtdIL.StayOut(); Close and shutdown the WTD.
void wtdIL.Init(); Initialize the WTD
char wtdIL.MusicPlay(char far *Music); Play the music.
void wtdIL.MusicStop(); Stop the music.
char wtdIL.EffectPlay(char far *Effect) Play the effect.
void wtdIL.EffectStop(); Stop the effect.
void wtdIL.PcmPlay(char far *PCM); Play the PCM voice.
void wtdIL.PcmStop(); Stop the PCM voice.
char wtdIL.PcmVoiceSet(char no,char far *wave); Set the voice.
char wtdIL.SoftEmbSet(char no,char far *emb); Set the envelope
char far *wtdIL.ChangeFar(void far *add); Convert the far address of the i8086.
void wtdIL.SoundSetChannel(int mode); Direct device access.(Do not use.)
int wtdIL.SoundGetChannel(); Direct device access.(Do not use.)
void wtdIL.SoundSetOutput(int mode); Direct device access.(Do not use.)
int wtdIL.SoundGetOutput(int mode); Direct device access.(Do not use.)
int wtdIL.SoundGetRandom(); Get Rundom
void wtdIL.SetPlayMode(int mode); Direct device access.(Do not use.)
int wtdIL.GetPlayMode(); Direct device access.(Do not use.)
void wtdIL.SetMusicVolume(char volume); Set the volume of the music.
int wtdIL.GetMusicVolume(); Get the volume of the music.
void wtdIL.SetEffectVolume(char volume); Set the volume of the effect.
int wtdIL.GetEffectVolume(); Get the volume of the effect.
void wtdIL.SetPcmVolume(char volume); Set the volume of the PCM voice.
int wtdIL.GetPcmVolume(); Get the volume of the PCM voice.
void wtdIL.SetFIFO(int size,char far *FIFO); Set the FIFO buffer of the serial communication of the MIDI.

Structure of work area and Using memory of the WTD

Work area of the WTD is as follows.
About the details, please see document "DEVELOP.pdf".

Address Area
0x0000 to 0x00FFWork area for user.
0x0100 to 0x01FFVoice table for the PCM of the WonderSwan.
0x0200 to 0x037FEnvelope table for the expression, pitch bend and panpot.
0x0380 to 0x03FFCommon structure.
0x0400 to 0x05FFIndividual structure for the effect.
0x0600 to 0x0FFF (0x07FF)Individual structure for the music.

library version

WTD have a global variable "_WTD_work" (C-language name is WTD_work[0x1000] / WTD_work[0x0800]).
User application can access it global variable by exturn define.

In-direct library of the Wonder Witch

When stay WTD, WTD make work area on the heap area (4096byte / 2048byte).


Data format