Initialize the PT3 player
| void PT3_InitSong( |
| ) |
Initialize a given song to make it ready to playback
| songAddr const void* | Start address of the data. If PT3_SKIP_HEADER is set, this address must be header address + 100 (if the data are not troncated) |
Pause song playback
Resume song playback
| void PT3_SetLoop( |
| ) |
Change state of playback loop
| loop bool | Either loop or not (TRUE: do loop; FALSE: don't loop) |
Silence the PSG
Decode a frame from PT3 song
Send data to PSG registers Must be executed on each V-Blank interruption
| inline void PT3_SetNoteTable( |
| ) |
Set notes table
| nt const void* | Address of the note table to use |
Check if loop flag is set
FALSE if loop flag is not set
Check if playback flag is set
FALSE if playback flag is not set
Play the current music
| inline u8 PT3_GetVolume( |
| ) |
Get the current amplitude of a given channel
| chan u8 | The channel number (0: channel A, 1: channel B, 2: channel C) |
Volume in bits #0 to #3 and envelope seting in bit #4
7 6 5 4 3 2 1 0
x x x M L3 L2 L1 L0
│ └───┴───┴───┴── Channel A Amplitude (volume)
└────────────────── Volume controlled by Envelope enable/disable
| inline u16 PT3_GetFrequency( |
| ) |
Get the current frequency of a given channel
| chan u8 | The channel number (0: channel A, 1: channel B, 2: channel C) |
12-bits tone period (1 to 4095). Frequency = 111,861 Hz / Period. Reange from 111,861 Hz (divide by 1) down to 27.3 Hz (divide by 4095)
| inline u8 PT3_GetPSGRegister( |
| ) |
Get a given PSG register value
| reg u8 | The PSG register number (0-13) |
Value of the given register in the PT3 buffer
Get the current pattern number
Pattern number between 0 and max
| inline void PT3_Mute( |
| ) |
Mute a given channel
| chan u8 | The channel number (0: channel A, 1: channel B, 2: channel C) |
| mute bool | Mute (TRUE) or un-mute (FALSE) the given channel |
| inline void PT3_SetFinishCB( |
| ) |
Set the function to be call when the music ended
| cb callback | Function to be called when music ends |
Reset the function to be call when the music ended