summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/fghtbskt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/audio/fghtbskt.c')
-rw-r--r--src/mame/audio/fghtbskt.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mame/audio/fghtbskt.c b/src/mame/audio/fghtbskt.c
new file mode 100644
index 00000000000..5c4b06deb16
--- /dev/null
+++ b/src/mame/audio/fghtbskt.c
@@ -0,0 +1,27 @@
+/*
+
+Fighting Basketball PCM unsigned 8 bit mono samples
+
+*/
+
+#include "driver.h"
+#include "sound/samples.h"
+
+static INT16 *samplebuf;
+
+WRITE8_HANDLER( fghtbskt_samples_w )
+{
+ if( data & 1 )
+ sample_start_raw(0, samplebuf + ((data & 0xf0) << 8), 0x2000, 8000, 0);
+}
+
+void fghtbskt_sh_start(void)
+{
+ int i;
+ UINT8 *ROM = memory_region(REGION_SOUND1);
+
+ samplebuf = auto_malloc(memory_region_length(REGION_SOUND1) * 2);
+
+ for(i=0;i<memory_region_length(REGION_SOUND1);i++)
+ samplebuf[i] = ((INT8)(ROM[i] ^ 0x80)) * 256;
+}