DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
src/hardware/sn76496.h
00001 /*
00002  *  Copyright (C) 2002-2013  The DOSBox Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 /* 
00020         Based of sn76496.c of the M.A.M.E. project
00021 */
00022 
00023 #include <math.h>
00024 #include "dosbox.h"
00025 #include "inout.h"
00026 #include "mixer.h"
00027 #include "mem.h"
00028 #include "setup.h"
00029 #include "pic.h"
00030 #include "dma.h"
00031 
00032 struct SN76496
00033 {
00034         int SampleRate;
00035         unsigned int UpdateStep;
00036         int VolTable[16];       /* volume table         */
00037         int Register[8];        /* registers */
00038         int LastRegister;       /* last register written */
00039         int Volume[4];          /* volume of voice 0-2 and noise */
00040         unsigned int RNG;               /* noise generator      */
00041         int NoiseFB;            /* noise feedback mask */
00042         int Period[4];
00043         int Count[4];
00044         int Output[4];
00045 };
00046 
00047 void SN76496Write(struct SN76496 *R, Bitu port, Bitu data);
00048 void SN76496Update(struct SN76496 *R, Bit16s *buffer, Bitu length);
00049 void SN76496Reset(struct SN76496 *R, Bitu Clock, Bitu sample_rate);