fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
at master 73 lines 2.5 kB view raw
1/***************************************************************************** 2 * pce * 3 *****************************************************************************/ 4 5/***************************************************************************** 6 * File name: src/arch/macplus/sound.h * 7 * Created: 2008-04-18 by Hampa Hug <hampa@hampa.ch> * 8 * Copyright: (C) 2008-2010 Hampa Hug <hampa@hampa.ch> * 9 *****************************************************************************/ 10 11/***************************************************************************** 12 * This program is free software. You can redistribute it and / or modify it * 13 * under the terms of the GNU General Public License version 2 as published * 14 * by the Free Software Foundation. * 15 * * 16 * This program is distributed in the hope that it will be useful, but * 17 * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 * Public License for more details. * 20 *****************************************************************************/ 21 22 23#ifndef PCE_MACPLUS_SOUND_H 24#define PCE_MACPLUS_SOUND_H 1 25 26 27#include <drivers/sound/sound.h> 28 29 30typedef struct { 31 sound_drv_t *drv; 32 33 const unsigned char *sbuf; 34 35 unsigned idx; 36 unsigned cnt; 37 uint16_t buf[370]; 38 unsigned long clk; 39 40 int enable; 41 unsigned volume; 42 43 unsigned long lowpass_freq; 44 sound_iir2_t iir; 45 46 uint16_t last_val; 47 int changed; 48 unsigned silence_cnt; 49} mac_sound_t; 50 51 52void mac_sound_init (mac_sound_t *ms); 53mac_sound_t *mac_sound_new (void); 54 55void mac_sound_free (mac_sound_t *ms); 56void mac_sound_del (mac_sound_t *ms); 57 58void mac_sound_set_sbuf (mac_sound_t *ms, const unsigned char *sbuf); 59 60void mac_sound_set_lowpass (mac_sound_t *ms, unsigned freq); 61 62void mac_sound_set_volume (mac_sound_t *ms, unsigned vol); 63 64void mac_sound_set_enable (mac_sound_t *ms, int on); 65 66int mac_sound_set_driver (mac_sound_t *ms, const char *driver); 67 68void mac_sound_vbl (mac_sound_t *ms); 69 70void mac_sound_clock (mac_sound_t *ms, unsigned long cnt); 71 72 73#endif