From c4041799fc3c6e6cdcce6121ea2c121fd504a3b6 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Tue, 25 May 2021 15:01:42 +0200 Subject: Add sample playing prototype (not on UXN yet) --- src/common.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/common.h') diff --git a/src/common.h b/src/common.h index 5766565..048708b 100644 --- a/src/common.h +++ b/src/common.h @@ -14,6 +14,7 @@ WITH REGARD TO THIS SOFTWARE. #include "shorthand.h" +#define CPU_FREQUENCY (2 << 23) // // Memory sections. // @@ -585,10 +586,11 @@ int bios_div(int num, int denom); #define SOUND_ENABLE_NOISE_RIGHT (1 << 0xF) typedef enum { + SOUND_DSOUND = (0x0 << 0), SOUND_SQUARE1 = (0x1 << 0), SOUND_SQUARE2 = (0x1 << 1), - SOUND_WAVE = (0x1 << 2), - SOUND_NOISE = (0x1 << 3), + SOUND_WAVE = (0x1 << 2), + SOUND_NOISE = (0x1 << 3), } SoundChannel; u16 @@ -613,6 +615,10 @@ sound_volume(SoundChannel channels, u8 volume) { #define SOUND_DSOUND_TIMER_B (1 << 0xE) #define SOUND_DSOUND_RESET_B (1 << 0xF) +// Direct sound FIFO queues. +#define SOUND_FIFO_A ((u16*)(MEM_IO + 0xA0)) +#define SOUND_FIFO_B ((u16*)(MEM_IO + 0xA4)) + // Sound status bits. #define SOUND_ENABLE (1 << 0x7) -- cgit v1.2.1