view src/sdl/SoundDriver.h @ 396:c7a43f4ffd9d

fixed bug where A was always 0 when the self-modigying code was executed.
author Robert McIntyre <rlm@mit.edu>
date Fri, 13 Apr 2012 04:50:58 -0500
parents f9f4f1b99eed
children
line wrap: on
line source
1 // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
2 // Copyright (C) 2008 VBA-M development team
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2, or(at your option)
7 // any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software Foundation,
16 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #ifndef __VBA_SOUND_DRIVER_H__
19 #define __VBA_SOUND_DRIVER_H__
21 #include "Types.h"
23 /**
24 * Sound driver abstract interface for the core to use to output sound.
25 * Subclass this to implement a new sound driver.
26 */
27 class SoundDriver
28 {
29 public:
31 /**
32 * Destructor. Free the resources allocated by the sound driver.
33 */
34 virtual ~SoundDriver() { };
36 /**
37 * Initialize the sound driver.
38 * @param sampleRate In Hertz
39 */
40 virtual bool init() = 0;
42 /**
43 * Tell the driver that the sound stream has paused
44 */
45 virtual void pause() = 0;
47 /**
48 * Reset the sound driver
49 */
50 virtual void reset() = 0;
52 /**
53 * Tell the driver that the sound stream has resumed
54 */
55 virtual void resume() = 0;
57 /**
58 * Write length bytes of data from the finalWave buffer to the driver output buffer.
59 */
60 virtual void write(u16 * finalWave, int length) = 0;
62 virtual bool setThrottle(unsigned short throttle) = 0;
63 };
65 #endif // __VBA_SOUND_DRIVER_H__