Files

107 lines
13 KiB
HTML

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>psg.h</title><link rel="stylesheet" type="text/css" href="../styles/main.css" /><script type="text/javascript" src="../styles/main.js"></script><script type="text/javascript">NDLoader.LoadJS("Content", "../styles/");</script></head>
<!-- Generated by Natural Docs, version 2.2 -->
<!-- saved from url=(0016)http://localhost -->
<body onload="NDLoader.OnLoad('Content');" class="NDPage NDContentPage">
<a name="Register"></a><a name="Topic965"></a><div class="CTopic TGroup LC first">
<div class="CTitle">Register</div>
</div>
<a name="PSG_SetRegister"></a><a name="Topic966"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_SetRegister</div>
<div id="NDPrototype966" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PSG_SetRegister(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">reg,</td></tr><tr><td class="PType first">u8&nbsp;</td><td class="PName last">value</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set the value of a given register</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">reg<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Register to set</p></td></tr><tr><td class="CDLEntry">value<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Value to set</p></td></tr></table></div>
</div>
<a name="PSG_GetRegister"></a><a name="Topic967"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_GetRegister</div>
<div id="NDPrototype967" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters">u8 PSG_GetRegister(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">reg</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Get the value of a given register</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">reg<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Register to get</p></td></tr></table><div class="CHeading">Return</div><p>Value of the register</p></div>
</div>
<a name="Helper"></a><a name="Topic968"></a><div class="CTopic TGroup LC">
<div class="CTitle">Helper</div>
</div>
<a name="PSG_SetTone"></a><a name="Topic969"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_SetTone</div>
<div id="NDPrototype969" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PSG_SetTone(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">chan,</td></tr><tr><td class="PType first">u16&nbsp;</td><td class="PName last">period</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set the tone period of a given channel (tone generator control register)</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">chan<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Channel to set (0 to 2; or PSG_CHANNEL_A, PSG_CHANNEL_B, PSG_CHANNEL_C)</p></td></tr><tr><td class="CDLEntry">period<div class="CDLParameterType">u16</div></td><td class="CDLDefinition"><p>Period to set (12-bits value)</p></td></tr></table></div>
</div>
<a name="PSG_SetNoise"></a><a name="Topic970"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_SetNoise</div>
<div id="NDPrototype970" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PSG_SetNoise(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">period</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set the noise period (noise generator control register)</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">period<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Period to set (5-bits value)</p></td></tr></table></div>
</div>
<a name="PSG_SetMixer"></a><a name="Topic971"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_SetMixer</div>
<div id="NDPrototype971" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PSG_SetMixer(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">mix</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Setup mixer by enabling tune and noise generators for each channel (mixer control enable register)</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">mix<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Mixer value to set</p></td></tr></table></div>
</div>
<a name="PSG_SetVolume"></a><a name="Topic972"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_SetVolume</div>
<div id="NDPrototype972" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PSG_SetVolume(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">chan,</td></tr><tr><td class="PType first">u8&nbsp;</td><td class="PName last">vol</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set the volume of a given channel (Amplitude control register)</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">chan<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Channel to set (0 to 2; or PSG_CHANNEL_A, PSG_CHANNEL_B, PSG_CHANNEL_C)</p></td></tr><tr><td class="CDLEntry">vol<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Volume to set (4-bits value)</p></td></tr></table></div>
</div>
<a name="PSG_SetEnvelope"></a><a name="Topic973"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_SetEnvelope</div>
<div id="NDPrototype973" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PSG_SetEnvelope(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u16&nbsp;</td><td class="PName last">period</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set the envelope period (Envelope priod control register)</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">period<div class="CDLParameterType">u16</div></td><td class="CDLDefinition"><p>Period to set (16-bits value)</p></td></tr></table></div>
</div>
<a name="PSG_SetShape"></a><a name="Topic974"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_SetShape</div>
<div id="NDPrototype974" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PSG_SetShape(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">shape</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set the envelope shape (Envelope shape control register)</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">shape<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Shape to set (4-bits value)</p></td></tr></table></div>
</div>
<a name="PSG_EnableTone"></a><a name="Topic975"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_EnableTone</div>
<div id="NDPrototype975" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PSG_EnableTone(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">chan,</td></tr><tr><td class="PType first"><span class="SHKeyword">bool</span>&nbsp;</td><td class="PName last">val</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Enable/disable tone on the given channel</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">chan<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Channel to set (0 to 2; or PSG_CHANNEL_A, PSG_CHANNEL_B, PSG_CHANNEL_C)</p></td></tr><tr><td class="CDLEntry">val<div class="CDLParameterType"><span class="SHKeyword">bool</span></div></td><td class="CDLDefinition"><p>TRUE to enable, FALSE to disable</p></td></tr></table></div>
</div>
<a name="PSG_EnableNoise"></a><a name="Topic976"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_EnableNoise</div>
<div id="NDPrototype976" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PSG_EnableNoise(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">chan,</td></tr><tr><td class="PType first"><span class="SHKeyword">bool</span>&nbsp;</td><td class="PName last">val</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Enable/disable noise on the given channel</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">chan<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Channel to set (0 to 2; or PSG_CHANNEL_A, PSG_CHANNEL_B, PSG_CHANNEL_C)</p></td></tr><tr><td class="CDLEntry">val<div class="CDLParameterType"><span class="SHKeyword">bool</span></div></td><td class="CDLDefinition"><p>TRUE to enable, FALSE to disable</p></td></tr></table></div>
</div>
<a name="PSG_EnableEnvelope"></a><a name="Topic977"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_EnableEnvelope</div>
<div id="NDPrototype977" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PSG_EnableEnvelope(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">chan,</td></tr><tr><td class="PType first"><span class="SHKeyword">bool</span>&nbsp;</td><td class="PName last">val</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Enable/disable envelope on the given channel</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">chan<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Channel to set (0 to 2; or PSG_CHANNEL_A, PSG_CHANNEL_B, PSG_CHANNEL_C)</p></td></tr></table></div>
</div>
<a name="PSG_Mute"></a><a name="Topic978"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_Mute</div>
<div id="NDPrototype978" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> PSG_Mute()</div></div>
<div class="CBody"><p>Silent the PSG (set according registers)</p></div>
</div>
<a name="PSG_Resume"></a><a name="Topic979"></a><div class="CTopic TFunction LC">
<div class="CTitle">PSG_Resume</div>
<div id="NDPrototype979" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> PSG_Resume()</div></div>
<div class="CBody"><p>Resume PSG sound</p></div>
</div>
<a name="Indirect"></a><a name="Topic980"></a><div class="CTopic TGroup LC">
<div class="CTitle">Indirect</div>
</div>
<a name="PSG_Apply"></a><a name="Topic981"></a><div class="CTopic TFunction LC last">
<div class="CTitle">PSG_Apply</div>
<div id="NDPrototype981" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> PSG_Apply()</div></div>
<div class="CBody"><p>Send data to PSG registers #0 to #13</p></div>
</div>
</body></html>