#include <stdlib.h>
#include <stdio.h>
#include "adlib.h"
#include "fmopl.h"
#include "../../common/platform.h"
#include "../../common/common_utils.h"
#include "../../memory/memory.h"
#include "../../console/console.h"
Data Structures | |
struct | musicGroup_t |
Defines | |
#define | OPL_INTERNAL_FREQ 3600000 |
#define | OPL_NUM_CHIPS 1 |
#define | ADLIB_FREQ 22050 |
#define | alFMStatus 0x388 |
#define | alFMAddr 0x388 |
#define | alFMData 0x389 |
#define | alChar 0x20 |
#define | alScale 0x40 |
#define | alAttack 0x60 |
#define | alSus 0x80 |
#define | alWave 0xe0 |
#define | alFreqL 0xa0 |
#define | alFreqH 0xb0 |
#define | alFeedCon 0xc0 |
#define | alEffects 0xbd |
#define | ADLIB_MUSIC_SPEED 44100 |
#define | ADLIB_MUSIC_BYPS (ADLIB_MUSIC_SPEED*2) |
Functions | |
PUBLIC wtBoolean | ADLIB_Init (W32 freq) |
Start adlib hardware. | |
PUBLIC void | ADLIB_Shutdown (void) |
Shutdown adlib hardware. | |
PRIVATE void | ADLIB_SetFXInst (Instrument *inst) |
Set Adlib FX instruction. | |
PUBLIC void * | ADLIB_DecodeSound (AdLibSound *sound, W32 *length) |
Decode adlib sound. | |
PUBLIC void | ADLIB_LoadMusic (void *musbuffer) |
Setup music decoder. | |
PUBLIC W32 | ADLIB_UpdateMusic (W32 size, void *buffer) |
Decode adlib music sound. | |
PUBLIC W32 | ADLIB_getLength (void *musbuffer) |
Get music length in milliseconds. | |
Variables | |
PRIVATE W8 | carriers [9] = { 3, 4, 5, 11, 12,13, 19, 20, 21 } |
PRIVATE W8 | modifiers [9] = { 0, 1, 2, 8, 9, 10, 16, 17, 18 } |
PRIVATE FM_OPL * | hAdLib = NULL |
PRIVATE W16 * | sqHackPtr |
PRIVATE W32 | sqHackLen |
PRIVATE W32 | sqHackTime |
PRIVATE W32 | alTimeCount |
musicGroup_t * | music |
PUBLIC void* ADLIB_DecodeSound | ( | AdLibSound * | sound, | |
W32 * | length | |||
) |
Decode adlib sound.
[in] | inst | Valid pointer to Instrument structure. |
[out] | length | Length of decoded sound data in bytes. |
PUBLIC W32 ADLIB_getLength | ( | void * | musbuffer | ) |
Get music length in milliseconds.
[in] | musbuffer | musicGroup_t data structure. |
[in,out] | buffer | Hold decoded sound data. |
PUBLIC wtBoolean ADLIB_Init | ( | W32 | freq | ) |
Start adlib hardware.
PUBLIC void ADLIB_LoadMusic | ( | void * | musbuffer | ) |
Setup music decoder.
[in] | musbuffer | musicGroup_t data structure. |
PRIVATE void ADLIB_SetFXInst | ( | Instrument * | inst | ) |
Set Adlib FX instruction.
[in] | inst | Valid pointer to Instrument structure. |
PUBLIC W32 ADLIB_UpdateMusic | ( | W32 | size, | |
void * | buffer | |||
) |
Decode adlib music sound.
[in] | size | Number of bytes to write to buffer. |
[in,out] | buffer | Hold decoded sound data. |