From 087c01882f38111d7d039c3573138b3e02e24039 Mon Sep 17 00:00:00 2001 From: davidhay Date: Tue, 24 Feb 2009 08:34:51 +0000 Subject: [PATCH] fix cps3 crash 02954 --- src/mame/audio/cps3.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mame/audio/cps3.c b/src/mame/audio/cps3.c index e1d28db90fe..6cfeab15f3d 100644 --- a/src/mame/audio/cps3.c +++ b/src/mame/audio/cps3.c @@ -10,6 +10,7 @@ #define CPS3_VOICES 16 static sound_stream *cps3_stream; +extern UINT8* cps3_user5region; typedef struct _cps3_voice_ { @@ -29,6 +30,10 @@ static STREAM_UPDATE( cps3_stream_update ) { int i; + // the actual 'user5' region only exists on the nocd sets, on the others it's allocated in the initialization. + // it's a shared gfx/sound region, so can't be allocated as part of the sound device. + chip.base = (INT8*)cps3_user5region; + /* Clear the buffers */ memset(outputs[0], 0, samples*sizeof(*outputs[0])); memset(outputs[1], 0, samples*sizeof(*outputs[1])); @@ -102,8 +107,6 @@ static DEVICE_START( cps3_sound ) cps3_stream = stream_create(device, 0, 2, device->clock / 384, NULL, cps3_stream_update); memset(&chip, 0, sizeof(chip)); - - chip.base = (INT8*)memory_region(device->machine,"user5"); } DEVICE_GET_INFO( cps3_sound )