summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/c6280.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-12-12 06:11:15 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-12-12 06:11:15 +0000
commitb400e7978bb626a14196fae7b45bb89dfeeae249 (patch)
tree454f1b103d0f8e80e719dbf37251b2304c07a91e /src/emu/sound/c6280.c
parent9dc496610928a3adee6c2d46f954634fcb83063a (diff)
From: Atari Ace [mailto:atari_ace@verizon.net]
Sent: Thursday, December 11, 2008 6:52 PM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] deprecat.h cpu cleanup Hi mamedev, This patch purges the last few uses of deprecat.h from the cpu cores, plus a handful of other Machine cases elsewhere that were found by script inspection. ~aa -- Hi mamedev, This patch eliminates most uses of deprecat.h in the sound cores by attaching the device to the state object and using it where appropriate. Given that all the cpu objects use this convention, and three sound cores already do this, this seemed an appropriate approach. ~aa
Diffstat (limited to 'src/emu/sound/c6280.c')
-rw-r--r--src/emu/sound/c6280.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c
index f9cac74350a..3bd394b3964 100644
--- a/src/emu/sound/c6280.c
+++ b/src/emu/sound/c6280.c
@@ -55,7 +55,6 @@
#include "sndintrf.h"
#include "streams.h"
-#include "deprecat.h"
#include "c6280.h"
typedef struct {
@@ -72,6 +71,7 @@ typedef struct {
typedef struct {
sound_stream *stream;
+ const device_config *device;
UINT8 select;
UINT8 balance;
UINT8 lfo_frequency;
@@ -85,13 +85,8 @@ typedef struct {
/* only needed for io_buffer */
#include "cpu/h6280/h6280.h"
-/* Local function prototypes */
-static void c6280_init(c6280_t *p, double clk, double rate);
-static void c6280_write(c6280_t *p, int offset, int data);
-static void c6280_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length);
-
-static void c6280_init(c6280_t *p, double clk, double rate)
+static void c6280_init(const device_config *device, c6280_t *p, double clk, double rate)
{
int i;
double step;
@@ -102,6 +97,8 @@ static void c6280_init(c6280_t *p, double clk, double rate)
/* Clear context */
memset(p, 0, sizeof(c6280_t));
+ p->device = device;
+
/* Make waveform frequency table */
for(i = 0; i < 4096; i += 1)
{
@@ -268,7 +265,7 @@ static void c6280_update(void *param, stream_sample_t **inputs, stream_sample_t
p->channel[ch].noise_counter += step;
if(p->channel[ch].noise_counter >= 0x800)
{
- data = (mame_rand(Machine) & 1) ? 0x1F : 0;
+ data = (mame_rand(p->device->machine) & 1) ? 0x1F : 0;
}
p->channel[ch].noise_counter &= 0x7FF;
buffer[0][i] += (INT16)(vll * (data - 16));
@@ -318,11 +315,11 @@ static SND_START( c6280 )
info = auto_malloc(sizeof(*info));
memset(info, 0, sizeof(*info));
- /* Initialize PSG emulator */
- c6280_init(info, clock, rate);
+ /* Initialize PSG emulator */
+ c6280_init(device, info, clock, rate);
- /* Create stereo stream */
- info->stream = stream_create(device, 0, 2, rate, info, c6280_update);
+ /* Create stereo stream */
+ info->stream = stream_create(device, 0, 2, rate, info, c6280_update);
return info;
}