Difference between revisions of "ADPCM Functions"
From Archaic Pixels
(→ad_play) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
{| | {| | ||
|- | |- | ||
− | ! void ad_reset(void); [b][ 3.02+ ][/b] | + | ! [color=green]void[/color] ad_reset([color=green]void[/color]); [b][ 3.02+ ][/b] |
|- | |- | ||
| | | | ||
Resets ADPCM hardware. | Resets ADPCM hardware. | ||
|} | |} | ||
+ | |||
== ad_stop == | == ad_stop == | ||
{| | {| | ||
|- | |- | ||
− | ! void ad_stop(void); [b][ 3.21+ ][/b] | + | ! [color=green]void[/color] ad_stop([color=green]void[/color]); [b][ 3.21+ ][/b] |
|- | |- | ||
| | | | ||
Stop playing adpcm. | Stop playing adpcm. | ||
|} | |} | ||
+ | |||
== ad_stat == | == ad_stat == | ||
{| | {| | ||
|- | |- | ||
− | ! int ad_stat(void); [b][ 3.21+ ][/b] | + | ! [color=blue]int[/color] ad_stat([color=green]void[/color]); [b][ 3.21+ ][/b] |
|- | |- | ||
| | | | ||
Line 29: | Line 31: | ||
playing isn't in progress else non zero value. | playing isn't in progress else non zero value. | ||
|} | |} | ||
+ | |||
== ad_trans == | == ad_trans == | ||
{| | {| | ||
|- | |- | ||
− | ! | + | ! [color=red]char[/color] ad_trans([color=blue]int[/color] ovl_index, [color=blue]int[/color] sect_offset, [color=red]char[/color] nb_sectors, [color=blue]int[/color] ad_addr); [b][ 3.21+ ][/b] |
|- | |- | ||
| | | | ||
Line 50: | Line 53: | ||
{| | {| | ||
|- | |- | ||
− | ! | + | ! [color=red]char[/color] ad_read([color=blue]int[/color] ad_addr, [color=red]char[/color] mode, [color=blue]int[/color] buf, [color=blue]int[/color] bytes); [b][ 3.21+ ][/b] |
|- | |- | ||
| | | | ||
Line 62: | Line 65: | ||
2-6 Directly into memory mapped to MMR #'mode' | 2-6 Directly into memory mapped to MMR #'mode' | ||
0xFF Offset in video ram. | 0xFF Offset in video ram. | ||
+ | |||
Non-zero return values indicate errors. | Non-zero return values indicate errors. | ||
|} | |} | ||
Line 68: | Line 72: | ||
{| | {| | ||
|- | |- | ||
− | ! | + | ! [color=red]char[/color] ad_write([color=blue]int[/color] ad_addr, [color=red]char[/color] mode, [color=blue]int[/color] buf, [color=blue]int[/color] bytes); [b][ 3.21+ ][/b] |
|- | |- | ||
| | | | ||
Line 74: | Line 78: | ||
Write 'bytes' bytes starting at offset 'ad_addr' in adpcm buffer. | Write 'bytes' bytes starting at offset 'ad_addr' in adpcm buffer. | ||
The mode 'mode' determines the meaning of the 'buf' offset. | The mode 'mode' determines the meaning of the 'buf' offset. | ||
+ | |||
Valid modes Meaning of 'buf' | Valid modes Meaning of 'buf' | ||
----------- ---------------- | ----------- ---------------- | ||
Line 79: | Line 84: | ||
2-6 Directly into memory mapped to MMR #'mode' | 2-6 Directly into memory mapped to MMR #'mode' | ||
0xFF Offset in video ram. | 0xFF Offset in video ram. | ||
+ | |||
Non-zero return values indicate errors. | Non-zero return values indicate errors. | ||
|} | |} | ||
Line 85: | Line 91: | ||
{| | {| | ||
|- | |- | ||
− | ! | + | ! [color=red]char[/color] ad_play([color=blue]int[/color] ad_addr, [color=blue]int[/color] bytes, [color=red]char[/color] freq, [color=red]char[/color] mode); [b][ 3.21+ ][/b] |
|- | |- | ||
| | | |
Latest revision as of 17:44, 13 September 2010
Contents
ADPCM Functions
ad_reset
void ad_reset(void); [ 3.02+ ] |
---|
Resets ADPCM hardware. |
ad_stop
void ad_stop(void); [ 3.21+ ] |
---|
Stop playing adpcm. |
ad_stat
int ad_stat(void); [ 3.21+ ] |
---|
Returns current adpcm status. Return FALSE(0) if adpcm playing isn't in progress else non zero value. |
ad_trans
char ad_trans(int ovl_index, int sect_offset, char nb_sectors, int ad_addr); [ 3.21+ ] |
---|
Transfer data from CDROM into adpcm buffer. Read it from the overlay segment specified by 'ovl_idx', with sector offset (ie. multiples of 2048 bytes) of 'sect_offset'. Read 'nb_sectors' sectors and store data into adpcm buffer starting from offset 'ad_addr'. Non-zero return values indicate errors. |
ad_read
char ad_read(int ad_addr, char mode, int buf, int bytes); [ 3.21+ ] |
---|
Read data from the adpcm buffer. Read 'bytes' bytes starting at offset 'ad_addr' in adpcm buffer. The mode 'mode' determines the meaning of the 'buf' offset. Valid modes Meaning of 'buf' ----------- ---------------- 0 Offset in the mapped ram. 2-6 Directly into memory mapped to MMR #'mode' 0xFF Offset in video ram. Non-zero return values indicate errors. |
ad_write
char ad_write(int ad_addr, char mode, int buf, int bytes); [ 3.21+ ] |
---|
Write data into the adpcm buffer. Write 'bytes' bytes starting at offset 'ad_addr' in adpcm buffer. The mode 'mode' determines the meaning of the 'buf' offset. Valid modes Meaning of 'buf' ----------- ---------------- 0 Offset in the mapped ram. 2-6 Directly into memory mapped to MMR #'mode' 0xFF Offset in video ram. Non-zero return values indicate errors. |
ad_play
char ad_play(int ad_addr, int bytes, char freq, char mode); [ 3.21+ ] |
---|
Play adpcm sound from data loaded in the adpcm buffer. Start playing from 'ad_addr' offset in the adpcm buffer, for 'bytes' bytes. The frequency used for playback is computed from 'freq' using the following formula : real_frequency_in_khz = 32 / (16 - 'freq'). Valid range for 'freq' is 0-15. If bit 0 of 'mode' is on, values of 'ad_addr', 'bytes' and 'freq' from the previous ad_play call are reused. If bit 7 of 'mode' is on, playback loops instead of stopping at the end of the range. |