ADPCM Hardware Functions

ad_reset( void );

Resets ADPCM hardware.


ad_trans( unsigned char ovl_index, unsigned int sect_offset, unsigned char nb_sectors, unsigned int ad_addr );

Transfer data from CDROM into ADPCM buffer. Read it from the overlay segment specified by 'ovl_index', 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( unsigned int ad_addr, unsigned char mode, unsigned int buf, unsigned int bytes );

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( unsigned int ad_addr, unsigned char mode, unsigned int buf, unsigned int bytes );

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( unsigned int ad_addr, unsigned int bytes, unsigned char freq, unsigned char mode );

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.


ad_cplay( unsigned char ovl_index, unsigned int sect_offset, unsigned int nb_sectors, unsigned char freq );

ad_stop( void );

Stop playing ADPCM.


ad_stat( void );

Returns current ADPCM status. Return FALSE(0) if ADPCM playing isn't in progress else returns a non zero value.

Last updated