mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
* Refactor m4a for better names * Bring in m4a PC backend code * Update songs data to work on 64bit * Move m4a to it's own folder * Add linker map to sdl build --------- Co-authored-by: Oliver Bell <freshollie@gmail.com>
37 lines
799 B
C
37 lines
799 B
C
#ifndef CGB_AUDIO_H
|
|
#define CGB_AUDIO_H
|
|
|
|
#include "lib/m4a/m4a_internal.h"
|
|
|
|
struct AudioCGB {
|
|
u16 ch1Freq;
|
|
u8 ch1SweepCounter;
|
|
u8 ch1SweepCounterI;
|
|
bool8 ch1SweepDir;
|
|
u8 ch1SweepShift;
|
|
u8 Vol[4];
|
|
u8 VolI[4];
|
|
u8 Len[4];
|
|
u8 LenI[4];
|
|
bool8 LenOn[4];
|
|
u8 EnvCounter[4];
|
|
u8 EnvCounterI[4];
|
|
bool8 EnvDir[4];
|
|
bool8 DAC[4];
|
|
float WAVRAM[32];
|
|
u16 ch4LFSR[2];
|
|
float outBuffer[PCM_DMA_BUF_SIZE * 2];
|
|
};
|
|
|
|
void cgb_audio_init(u32 rate);
|
|
void cgb_set_sweep(u8 sweep);
|
|
void cgb_set_wavram();
|
|
void cgb_toggle_length(u8 channel, bool8 state);
|
|
void cgb_set_length(u8 channel, u8 length);
|
|
void cgb_set_envelope(u8 channel, u8 envelope);
|
|
void cgb_trigger_note(u8 channel);
|
|
void cgb_audio_generate(u16 samplesPerFrame);
|
|
float *cgb_get_buffer();
|
|
|
|
#endif
|