diff options
author | Bad Diode <bd@badd10de.dev> | 2021-05-25 15:01:42 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-05-25 15:01:42 +0200 |
commit | c4041799fc3c6e6cdcce6121ea2c121fd504a3b6 (patch) | |
tree | 041641c56544c323a31adbe72dd10bfc711430ef /src/common.h | |
parent | efdfd887caea6450284a0e1e2ceb2b6141f15486 (diff) | |
download | uxngba-c4041799fc3c6e6cdcce6121ea2c121fd504a3b6.tar.gz uxngba-c4041799fc3c6e6cdcce6121ea2c121fd504a3b6.zip |
Add sample playing prototype (not on UXN yet)
Diffstat (limited to 'src/common.h')
-rw-r--r-- | src/common.h | 10 |
1 files changed, 8 insertions, 2 deletions
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. | |||
14 | 14 | ||
15 | #include "shorthand.h" | 15 | #include "shorthand.h" |
16 | 16 | ||
17 | #define CPU_FREQUENCY (2 << 23) | ||
17 | // | 18 | // |
18 | // Memory sections. | 19 | // Memory sections. |
19 | // | 20 | // |
@@ -585,10 +586,11 @@ int bios_div(int num, int denom); | |||
585 | #define SOUND_ENABLE_NOISE_RIGHT (1 << 0xF) | 586 | #define SOUND_ENABLE_NOISE_RIGHT (1 << 0xF) |
586 | 587 | ||
587 | typedef enum { | 588 | typedef enum { |
589 | SOUND_DSOUND = (0x0 << 0), | ||
588 | SOUND_SQUARE1 = (0x1 << 0), | 590 | SOUND_SQUARE1 = (0x1 << 0), |
589 | SOUND_SQUARE2 = (0x1 << 1), | 591 | SOUND_SQUARE2 = (0x1 << 1), |
590 | SOUND_WAVE = (0x1 << 2), | 592 | SOUND_WAVE = (0x1 << 2), |
591 | SOUND_NOISE = (0x1 << 3), | 593 | SOUND_NOISE = (0x1 << 3), |
592 | } SoundChannel; | 594 | } SoundChannel; |
593 | 595 | ||
594 | u16 | 596 | u16 |
@@ -613,6 +615,10 @@ sound_volume(SoundChannel channels, u8 volume) { | |||
613 | #define SOUND_DSOUND_TIMER_B (1 << 0xE) | 615 | #define SOUND_DSOUND_TIMER_B (1 << 0xE) |
614 | #define SOUND_DSOUND_RESET_B (1 << 0xF) | 616 | #define SOUND_DSOUND_RESET_B (1 << 0xF) |
615 | 617 | ||
618 | // Direct sound FIFO queues. | ||
619 | #define SOUND_FIFO_A ((u16*)(MEM_IO + 0xA0)) | ||
620 | #define SOUND_FIFO_B ((u16*)(MEM_IO + 0xA4)) | ||
621 | |||
616 | // Sound status bits. | 622 | // Sound status bits. |
617 | #define SOUND_ENABLE (1 << 0x7) | 623 | #define SOUND_ENABLE (1 << 0x7) |
618 | 624 | ||