Files
mazegame/engine/doc/html/files/pt3/pt3_player-h.html
T

137 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>pt3_player.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="Core"></a><a name="Topic317"></a><div class="CTopic TGroup LC first">
<div class="CTitle">Core</div>
</div>
<a name="PT3_Init"></a><a name="Topic318"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_Init</div>
<div id="NDPrototype318" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> PT3_Init()</div></div>
<div class="CBody"><p>Initialize the PT3 player</p></div>
</div>
<a name="PT3_InitSong"></a><a name="Topic319"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_InitSong</div>
<div id="NDPrototype319" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PT3_InitSong(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PModifierQualifier first"><span class="SHKeyword">const</span>&nbsp;</td><td class="PType"><span class="SHKeyword">void</span>*&nbsp;</td><td class="PName last">songADDR</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Initialize a given song to make it ready to playback</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">songAddr<div class="CDLParameterType"><span class="SHKeyword">const</span> <span class="SHKeyword">void</span>*</div></td><td class="CDLDefinition"><p>Start address of the data. If PT3_SKIP_HEADER is set, this address must be header address + 100 (if the data are not troncated)</p></td></tr></table></div>
</div>
<a name="PT3_Pause"></a><a name="Topic320"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_Pause</div>
<div id="NDPrototype320" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> PT3_Pause()</div></div>
<div class="CBody"><p>Pause song playback</p></div>
</div>
<a name="PT3_Resume"></a><a name="Topic321"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_Resume</div>
<div id="NDPrototype321" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> PT3_Resume()</div></div>
<div class="CBody"><p>Resume song playback</p></div>
</div>
<a name="PT3_SetLoop"></a><a name="Topic322"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_SetLoop</div>
<div id="NDPrototype322" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> PT3_SetLoop(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first"><span class="SHKeyword">bool</span>&nbsp;</td><td class="PName last">loop</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Change state of playback loop</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">loop<div class="CDLParameterType"><span class="SHKeyword">bool</span></div></td><td class="CDLDefinition"><p>Either loop or not (TRUE: do loop; FALSE: don't loop)</p></td></tr></table></div>
</div>
<a name="PT3_Silence"></a><a name="Topic323"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_Silence</div>
<div id="NDPrototype323" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> PT3_Silence()</div></div>
<div class="CBody"><p>Silence the PSG</p></div>
</div>
<a name="PT3_Decode"></a><a name="Topic324"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_Decode</div>
<div id="NDPrototype324" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> PT3_Decode()</div></div>
<div class="CBody"><p>Decode a frame from PT3 song</p></div>
</div>
<a name="PT3_UpdatePSG"></a><a name="Topic325"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_UpdatePSG</div>
<div id="NDPrototype325" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">void</span> PT3_UpdatePSG()</div></div>
<div class="CBody"><p>Send data to PSG registers Must be executed on each V-Blank interruption</p></div>
</div>
<a name="Inline"></a><a name="Topic326"></a><div class="CTopic TGroup LC">
<div class="CTitle">Inline</div>
</div>
<a name="PT3_SetNoteTable"></a><a name="Topic327"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_SetNoteTable</div>
<div id="NDPrototype327" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> PT3_SetNoteTable(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PModifierQualifier first"><span class="SHKeyword">const</span>&nbsp;</td><td class="PType"><span class="SHKeyword">void</span>*&nbsp;</td><td class="PName last">nt</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set notes table</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">nt<div class="CDLParameterType"><span class="SHKeyword">const</span> <span class="SHKeyword">void</span>*</div></td><td class="CDLDefinition"><p>Address of the note table to use</p></td></tr></table></div>
</div>
<a name="PT3_GetLoop"></a><a name="Topic328"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_GetLoop</div>
<div id="NDPrototype328" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> PT3_GetLoop()</div></div>
<div class="CBody"><p>Check if loop flag is set</p><div class="CHeading">Return</div><p>FALSE if loop flag is not set</p></div>
</div>
<a name="PT3_IsPlaying"></a><a name="Topic329"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_IsPlaying</div>
<div id="NDPrototype329" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> PT3_IsPlaying()</div></div>
<div class="CBody"><p>Check if playback flag is set</p><div class="CHeading">Return</div><p>FALSE if playback flag is not set</p></div>
</div>
<a name="PT3_Play"></a><a name="Topic330"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_Play</div>
<div id="NDPrototype330" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> PT3_Play()</div></div>
<div class="CBody"><p>Play the current music</p></div>
</div>
<a name="PT3_GetVolume"></a><a name="Topic331"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_GetVolume</div>
<div id="NDPrototype331" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> u8 PT3_GetVolume(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">chan</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Get the current amplitude of a 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>The channel number (0: channel A, 1: channel B, 2: channel C)</p></td></tr></table><div class="CHeading">Return</div><p>Volume in bits #0 to #3 and envelope seting in bit #4</p><pre class="CText">7 6 5 4 3 2 1 0<br />x x x M L3 L2 L1 L0<br /> │ └──┴──┴──┴── Channel A Amplitude (volume)<br /> └────────────── Volume controlled by Envelope enable/disable</pre></div>
</div>
<a name="PT3_GetFrequency"></a><a name="Topic332"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_GetFrequency</div>
<div id="NDPrototype332" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> u16 PT3_GetFrequency(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">chan</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Get the current frequency of a 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>The channel number (0: channel A, 1: channel B, 2: channel C)</p></td></tr></table><div class="CHeading">Return</div><p>12-bits tone period (1 to 4095).&nbsp; Frequency = 111,861 Hz / Period.&nbsp; Reange from 111,861 Hz (divide by 1) down to 27.3 Hz (divide by 4095)</p></div>
</div>
<a name="PT3_GetPSGRegister"></a><a name="Topic333"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_GetPSGRegister</div>
<div id="NDPrototype333" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> u8 PT3_GetPSGRegister(</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 a given PSG register value</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">reg<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>The PSG register number (0-13)</p></td></tr></table><div class="CHeading">Return</div><p>Value of the given register in the PT3 buffer</p></div>
</div>
<a name="Extra"></a><a name="Topic334"></a><div class="CTopic TGroup LC">
<div class="CTitle">Extra</div>
</div>
<a name="PT3_GetPattern"></a><a name="Topic335"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_GetPattern</div>
<div id="NDPrototype335" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> u8 PT3_GetPattern()</div></div>
<div class="CBody"><p>Get the current pattern number</p><div class="CHeading">Return</div><p>Pattern number between 0 and max</p></div>
</div>
<a name="PT3_Mute"></a><a name="Topic336"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_Mute</div>
<div id="NDPrototype336" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> PT3_Mute(</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">mute</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Mute a 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>The channel number (0: channel A, 1: channel B, 2: channel C)</p></td></tr><tr><td class="CDLEntry">mute<div class="CDLParameterType"><span class="SHKeyword">bool</span></div></td><td class="CDLDefinition"><p>Mute (TRUE) or un-mute (FALSE) the given channel</p></td></tr></table></div>
</div>
<a name="PT3_SetFinishCB"></a><a name="Topic337"></a><div class="CTopic TFunction LC">
<div class="CTitle">PT3_SetFinishCB</div>
<div id="NDPrototype337" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> PT3_SetFinishCB(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">callback&nbsp;</td><td class="PName last">cb</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set the function to be call when the music ended</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">cb<div class="CDLParameterType">callback</div></td><td class="CDLDefinition"><p>Function to be called when music ends</p></td></tr></table></div>
</div>
<a name="PT3_ResetFinishCB"></a><a name="Topic338"></a><div class="CTopic TFunction LC last">
<div class="CTitle">PT3_ResetFinishCB</div>
<div id="NDPrototype338" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> PT3_ResetFinishCB()</div></div>
<div class="CBody"><p>Reset the function to be call when the music ended</p></div>
</div>
</body></html>