Start atlas

This commit is contained in:
2025-06-01 22:13:02 +02:00
parent 96a9a45c20
commit 84805b92cb
64 changed files with 954 additions and 243 deletions

View File

@@ -11,9 +11,9 @@
#include <stdlib.h>
#define SAMPLE_RATE 44100
#define NUM_SYNTH_VOICES 3
#define NUM_SYNTH_VOICES 256
typedef enum {
typedef enum Waveform {
WAVE_SINE,
WAVE_SQUARE,
WAVE_SAWTOOTH,
@@ -21,19 +21,24 @@ typedef enum {
WAVE_NOISE
} Waveform;
typedef struct {
uint8_t volume;
uint16_t frequency;
uint8_t phase;
typedef struct SynthVoice {
Waveform waveform;
uint8_t phase;
uint16_t frequency;
uint8_t volume;
SDL_Rect sourceRect;
} SynthVoice;
typedef struct {
typedef struct AudioData {
SynthVoice synthVoices[NUM_SYNTH_VOICES];
SDL_Rect *playerRect;
float maxPanDistance;
} AudioData;
extern AudioData audioData;
void audio_callback(void *userdata, Uint8 *stream, int len);
uint16_t getAvailableChannel();
#endif //RISCB_AUDIO_H