From b400e7978bb626a14196fae7b45bb89dfeeae249 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Fri, 12 Dec 2008 06:11:15 +0000 Subject: 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 --- src/emu/sound/ymz280b.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/emu/sound/ymz280b.c') diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c index 19ce83ae373..53ae851c49d 100644 --- a/src/emu/sound/ymz280b.c +++ b/src/emu/sound/ymz280b.c @@ -24,7 +24,6 @@ #include #include "sndintrf.h" -#include "deprecat.h" #include "streams.h" #include "ymz280b.h" @@ -100,6 +99,7 @@ struct YMZ280BChip #endif INT16 *scratch; + const device_config *device; }; /* step size index shift table */ @@ -145,14 +145,14 @@ INLINE void update_irq_state(struct YMZ280BChip *chip) { chip->irq_state = 1; if (chip->irq_callback) - (*chip->irq_callback)(Machine, 1); + (*chip->irq_callback)(chip->device->machine, 1); else logerror("YMZ280B: IRQ generated, but no callback specified!"); } else if (!irq_bits && chip->irq_state) { chip->irq_state = 0; if (chip->irq_callback) - (*chip->irq_callback)(Machine, 0); + (*chip->irq_callback)(chip->device->machine, 0); else logerror("YMZ280B: IRQ generated, but no callback specified!"); } } @@ -576,7 +576,7 @@ static void ymz280b_update(void *param, stream_sample_t **inputs, stream_sample_ voice->playing = 0; /* set update_irq_state_timer. IRQ is signaled on next CPU execution. */ - timer_set(Machine, attotime_zero, chip, 0, update_irq_state_cb[v]); + timer_set(chip->device->machine, attotime_zero, chip, 0, update_irq_state_cb[v]); voice->irq_schedule = 1; } } @@ -636,6 +636,7 @@ static SND_START( ymz280b ) chip = auto_malloc(sizeof(*chip)); memset(chip, 0, sizeof(*chip)); + chip->device = device; chip->ext_ram_read = intf->ext_read; chip->ext_ram_write = intf->ext_write; @@ -868,7 +869,7 @@ static void write_to_register(struct YMZ280BChip *chip, int data) if (chip->ext_ram_write) { /* temporary hack until this is converted to a device */ - const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cpu_get_address_space(chip->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM); chip->ext_ram_write(space, chip->rom_readback_addr, data); } else -- cgit v1.2.3-70-g09d2