libwwcl libwwcl
WWitch compatibility layer for the Wonderful toolchain
Loading...
Searching...
No Matches
sound.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Adrian "asie" Siekierka
3 *
4 * This software is provided 'as-is', without any express or implied
5 * warranty. In no event will the authors be held liable for any damages
6 * arising from the use of this software.
7 *
8 * Permission is granted to anyone to use this software for any purpose,
9 * including commercial applications, and to alter it and redistribute it
10 * freely, subject to the following restrictions:
11 *
12 * 1. The origin of this software must not be misrepresented; you must not
13 * claim that you wrote the original software. If you use this software
14 * in a product, an acknowledgment in the product documentation would be
15 * appreciated but is not required.
16 *
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 *
20 * 3. This notice may not be removed or altered from any source distribution.
21 */
22
27#ifndef __WF_LIBWW_SOUND_H__
28#define __WF_LIBWW_SOUND_H__
29
30#include "types.h"
31
37void sound_init(void);
38void sound_set_channel(uint8_t flags);
39uint8_t sound_get_channel(void);
40void sound_set_output(uint8_t flags);
41uint8_t sound_get_output(void);
42void sound_set_wave(uint8_t channel, const uint8_t __far* data);
43void sound_set_pitch(uint8_t channel, uint16_t frequency);
44uint16_t sound_get_pitch(uint8_t channel);
45void sound_set_volume(uint8_t channel, uint8_t volume);
46uint8_t sound_get_volume(uint8_t channel);
47void sound_set_sweep(uint8_t sweep, uint8_t step_time);
48void sound_set_noise(uint8_t flags);
49uint8_t sound_get_noise(void);
50uint16_t sound_get_random(void);
51
52/* 0% volume (muted) */
53#define SOUND_VOICE_MUTE 0
54/* 50% volume */
55#define SOUND_VOICE_HALF 2
56/* 100% volume */
57#define SOUND_VOICE_FULL 3
58
64void sound_set_voice_volume(uint8_t left, uint8_t right);
65
71
74#endif /* __WF_LIBWW_SOUND_H__ */
void sound_set_output(uint8_t flags)
uint8_t sound_get_noise(void)
void sound_set_pitch(uint8_t channel, uint16_t frequency)
void sound_set_volume(uint8_t channel, uint8_t volume)
uint8_t sound_get_volume(uint8_t channel)
uint8_t sound_get_voice_volume(void)
uint16_t sound_get_pitch(uint8_t channel)
void sound_set_sweep(uint8_t sweep, uint8_t step_time)
void sound_init(void)
uint8_t sound_get_output(void)
void sound_set_channel(uint8_t flags)
uint16_t sound_get_random(void)
void sound_set_noise(uint8_t flags)
uint8_t sound_get_channel(void)
void sound_set_wave(uint8_t channel, const uint8_t __far *data)
void sound_set_voice_volume(uint8_t left, uint8_t right)