* [2SF] Used more up-to-date asmjit, despite the ugly looking code.
| ... | ... |
@@ -15,8 +15,7 @@ |
| 15 | 15 |
// along with this program; if not, write to the Free Software Foundation, |
| 16 | 16 |
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | 17 |
|
| 18 |
-#ifndef __VBA_SOUND_DRIVER_H__ |
|
| 19 |
-#define __VBA_SOUND_DRIVER_H__ |
|
| 18 |
+#pragma once |
|
| 20 | 19 |
|
| 21 | 20 |
#include <cstdint> |
| 22 | 21 |
|
| ... | ... |
@@ -60,5 +59,3 @@ public: |
| 60 | 59 |
|
| 61 | 60 |
virtual void setThrottle(unsigned short throttle) { }
|
| 62 | 61 |
}; |
| 63 |
- |
|
| 64 |
-#endif // __VBA_SOUND_DRIVER_H__ |
(As an aside, blargg's code style makes me go blarg myself.)
| ... | ... |
@@ -27,11 +27,10 @@ |
| 27 | 27 |
class SoundDriver |
| 28 | 28 |
{
|
| 29 | 29 |
public: |
| 30 |
- |
|
| 31 | 30 |
/** |
| 32 | 31 |
* Destructor. Free the resources allocated by the sound driver. |
| 33 | 32 |
*/ |
| 34 |
- virtual ~SoundDriver() { };
|
|
| 33 |
+ virtual ~SoundDriver() { }
|
|
| 35 | 34 |
|
| 36 | 35 |
/** |
| 37 | 36 |
* Initialize the sound driver. |
| ... | ... |
@@ -57,9 +56,9 @@ public: |
| 57 | 56 |
/** |
| 58 | 57 |
* Write length bytes of data from the finalWave buffer to the driver output buffer. |
| 59 | 58 |
*/ |
| 60 |
- virtual void write(uint16_t * finalWave, int length) = 0; |
|
| 59 |
+ virtual void write(uint16_t *finalWave, int length) = 0; |
|
| 61 | 60 |
|
| 62 |
- virtual void setThrottle(unsigned short throttle) { };
|
|
| 61 |
+ virtual void setThrottle(unsigned short throttle) { }
|
|
| 63 | 62 |
}; |
| 64 | 63 |
|
| 65 | 64 |
#endif // __VBA_SOUND_DRIVER_H__ |
| ... | ... |
@@ -57,7 +57,7 @@ public: |
| 57 | 57 |
/** |
| 58 | 58 |
* Write length bytes of data from the finalWave buffer to the driver output buffer. |
| 59 | 59 |
*/ |
| 60 |
- virtual void write(u16 * finalWave, int length) = 0; |
|
| 60 |
+ virtual void write(uint16_t * finalWave, int length) = 0; |
|
| 61 | 61 |
|
| 62 | 62 |
virtual void setThrottle(unsigned short throttle) { };
|
| 63 | 63 |
}; |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,65 @@ |
| 1 |
+// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. |
|
| 2 |
+// Copyright (C) 2008 VBA-M development team |
|
| 3 |
+ |
|
| 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 17 |
+ |
|
| 18 |
+#ifndef __VBA_SOUND_DRIVER_H__ |
|
| 19 |
+#define __VBA_SOUND_DRIVER_H__ |
|
| 20 |
+ |
|
| 21 |
+#include "Types.h" |
|
| 22 |
+ |
|
| 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: |
|
| 30 |
+ |
|
| 31 |
+ /** |
|
| 32 |
+ * Destructor. Free the resources allocated by the sound driver. |
|
| 33 |
+ */ |
|
| 34 |
+ virtual ~SoundDriver() { };
|
|
| 35 |
+ |
|
| 36 |
+ /** |
|
| 37 |
+ * Initialize the sound driver. |
|
| 38 |
+ * @param sampleRate In Hertz |
|
| 39 |
+ */ |
|
| 40 |
+ virtual bool init(long sampleRate) = 0; |
|
| 41 |
+ |
|
| 42 |
+ /** |
|
| 43 |
+ * Tell the driver that the sound stream has paused |
|
| 44 |
+ */ |
|
| 45 |
+ virtual void pause() = 0; |
|
| 46 |
+ |
|
| 47 |
+ /** |
|
| 48 |
+ * Reset the sound driver |
|
| 49 |
+ */ |
|
| 50 |
+ virtual void reset() = 0; |
|
| 51 |
+ |
|
| 52 |
+ /** |
|
| 53 |
+ * Tell the driver that the sound stream has resumed |
|
| 54 |
+ */ |
|
| 55 |
+ virtual void resume() = 0; |
|
| 56 |
+ |
|
| 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; |
|
| 61 |
+ |
|
| 62 |
+ virtual void setThrottle(unsigned short throttle) { };
|
|
| 63 |
+}; |
|
| 64 |
+ |
|
| 65 |
+#endif // __VBA_SOUND_DRIVER_H__ |