diff options
author | 2009-03-12 15:25:58 +0000 | |
---|---|---|
committer | 2009-03-12 15:25:58 +0000 | |
commit | 475762a3fd2a353734109495f197ca948f3bf81c (patch) | |
tree | 2c7c74dfbb96b37402686a033275e6d56b6f8a27 /src/emu/sound | |
parent | a5c832f8f710e15847fd045cc7399dc4d2a06c03 (diff) |
Sound cores compile cleanly.
Diffstat (limited to 'src/emu/sound')
90 files changed, 582 insertions, 579 deletions
diff --git a/src/emu/sound/2151intf.c b/src/emu/sound/2151intf.c index f1191a946ce..b3b25351c52 100644 --- a/src/emu/sound/2151intf.c +++ b/src/emu/sound/2151intf.c @@ -36,14 +36,14 @@ INLINE ym2151_state *get_safe_token(const device_config *device) static STREAM_UPDATE( ym2151_update ) { - ym2151_state *info = param; + ym2151_state *info = (ym2151_state *)param; ym2151_update_one(info->chip, outputs, samples); } static STATE_POSTLOAD( ym2151intf_postload ) { - ym2151_state *info = param; + ym2151_state *info = (ym2151_state *)param; ym2151_postload(machine, info->chip); } @@ -51,10 +51,10 @@ static STATE_POSTLOAD( ym2151intf_postload ) static DEVICE_START( ym2151 ) { static const ym2151_interface dummy = { 0 }; - ym2151_state *info = device->token; + ym2151_state *info = get_safe_token(device); int rate; - info->intf = device->static_config ? device->static_config : &dummy; + info->intf = device->static_config ? (const ym2151_interface *)device->static_config : &dummy; rate = device->clock/64; @@ -73,13 +73,13 @@ static DEVICE_START( ym2151 ) static DEVICE_STOP( ym2151 ) { - ym2151_state *info = device->token; + ym2151_state *info = get_safe_token(device); ym2151_shutdown(info->chip); } static DEVICE_RESET( ym2151 ) { - ym2151_state *info = device->token; + ym2151_state *info = get_safe_token(device); ym2151_reset_chip(info->chip); } diff --git a/src/emu/sound/2203intf.c b/src/emu/sound/2203intf.c index 04af9db7156..26349969ddd 100644 --- a/src/emu/sound/2203intf.c +++ b/src/emu/sound/2203intf.c @@ -29,25 +29,25 @@ INLINE ym2203_state *get_safe_token(const device_config *device) static void psg_set_clock(void *param, int clock) { - ym2203_state *info = param; + ym2203_state *info = (ym2203_state *)param; ay8910_set_clock_ym(info->psg, clock); } static void psg_write(void *param, int address, int data) { - ym2203_state *info = param; + ym2203_state *info = (ym2203_state *)param; ay8910_write_ym(info->psg, address, data); } static int psg_read(void *param) { - ym2203_state *info = param; + ym2203_state *info = (ym2203_state *)param; return ay8910_read_ym(info->psg); } static void psg_reset(void *param) { - ym2203_state *info = param; + ym2203_state *info = (ym2203_state *)param; ay8910_reset_ym(info->psg); } @@ -62,7 +62,7 @@ static const ssg_callbacks psgintf = /* IRQ Handler */ static void IRQHandler(void *param,int irq) { - ym2203_state *info = param; + ym2203_state *info = (ym2203_state *)param; if (info->intf->handler != NULL) (*info->intf->handler)(info->device, irq); } @@ -70,27 +70,27 @@ static void IRQHandler(void *param,int irq) /* Timer overflow callback from timer.c */ static TIMER_CALLBACK( timer_callback_2203_0 ) { - ym2203_state *info = ptr; + ym2203_state *info = (ym2203_state *)ptr; ym2203_timer_over(info->chip,0); } static TIMER_CALLBACK( timer_callback_2203_1 ) { - ym2203_state *info = ptr; + ym2203_state *info = (ym2203_state *)ptr; ym2203_timer_over(info->chip,1); } /* update request from fm.c */ void ym2203_update_request(void *param) { - ym2203_state *info = param; + ym2203_state *info = (ym2203_state *)param; stream_update(info->stream); } static void timer_handler(void *param,int c,int count,int clock) { - ym2203_state *info = param; + ym2203_state *info = (ym2203_state *)param; if( count == 0 ) { /* Reset FM Timer */ timer_enable(info->timer[c], 0); @@ -105,14 +105,14 @@ static void timer_handler(void *param,int c,int count,int clock) static STREAM_UPDATE( ym2203_stream_update ) { - ym2203_state *info = param; + ym2203_state *info = (ym2203_state *)param; ym2203_update_one(info->chip, outputs[0], samples); } static STATE_POSTLOAD( ym2203_intf_postload ) { - ym2203_state *info = param; + ym2203_state *info = (ym2203_state *)param; ym2203_postload(info->chip); } @@ -128,8 +128,8 @@ static DEVICE_START( ym2203 ) }, NULL }; - const ym2203_interface *intf = device->static_config ? device->static_config : &generic_2203; - ym2203_state *info = device->token; + const ym2203_interface *intf = device->static_config ? (const ym2203_interface *)device->static_config : &generic_2203; + ym2203_state *info = get_safe_token(device); int rate = device->clock/72; /* ??? */ info->intf = intf; @@ -153,14 +153,14 @@ static DEVICE_START( ym2203 ) static DEVICE_STOP( ym2203 ) { - ym2203_state *info = device->token; + ym2203_state *info = get_safe_token(device); ym2203_shutdown(info->chip); ay8910_stop_ym(info->psg); } static DEVICE_RESET( ym2203 ) { - ym2203_state *info = device->token; + ym2203_state *info = get_safe_token(device); ym2203_reset_chip(info->chip); } diff --git a/src/emu/sound/2413intf.c b/src/emu/sound/2413intf.c index 4f274bc6c45..f1c111018ea 100644 --- a/src/emu/sound/2413intf.c +++ b/src/emu/sound/2413intf.c @@ -45,13 +45,13 @@ void YM2413DAC_update(int chip,stream_sample_t **inputs, stream_sample_t **_buff static STREAM_UPDATE( ym2413_stream_update ) { - ym2413_state *info = param; + ym2413_state *info = (ym2413_state *)param; ym2413_update_one(info->chip, outputs, samples); } static void _stream_update(void *param, int interval) { - ym2413_state *info = param; + ym2413_state *info = (ym2413_state *)param; stream_update(info->stream); } diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c index 712787118ac..f1a88166168 100644 --- a/src/emu/sound/2608intf.c +++ b/src/emu/sound/2608intf.c @@ -42,25 +42,25 @@ INLINE ym2608_state *get_safe_token(const device_config *device) static void psg_set_clock(void *param, int clock) { - ym2608_state *info = param; + ym2608_state *info = (ym2608_state *)param; ay8910_set_clock_ym(info->psg, clock); } static void psg_write(void *param, int address, int data) { - ym2608_state *info = param; + ym2608_state *info = (ym2608_state *)param; ay8910_write_ym(info->psg, address, data); } static int psg_read(void *param) { - ym2608_state *info = param; + ym2608_state *info = (ym2608_state *)param; return ay8910_read_ym(info->psg); } static void psg_reset(void *param) { - ym2608_state *info = param; + ym2608_state *info = (ym2608_state *)param; ay8910_reset_ym(info->psg); } @@ -76,26 +76,26 @@ static const ssg_callbacks psgintf = /* IRQ Handler */ static void IRQHandler(void *param,int irq) { - ym2608_state *info = param; + ym2608_state *info = (ym2608_state *)param; if(info->intf->handler) info->intf->handler(info->device, irq); } /* Timer overflow callback from timer.c */ static TIMER_CALLBACK( timer_callback_2608_0 ) { - ym2608_state *info = ptr; + ym2608_state *info = (ym2608_state *)ptr; ym2608_timer_over(info->chip,0); } static TIMER_CALLBACK( timer_callback_2608_1 ) { - ym2608_state *info = ptr; + ym2608_state *info = (ym2608_state *)ptr; ym2608_timer_over(info->chip,1); } static void timer_handler(void *param,int c,int count,int clock) { - ym2608_state *info = param; + ym2608_state *info = (ym2608_state *)param; if( count == 0 ) { /* Reset FM Timer */ timer_enable(info->timer[c], 0); @@ -111,20 +111,20 @@ static void timer_handler(void *param,int c,int count,int clock) /* update request from fm.c */ void ym2608_update_request(void *param) { - ym2608_state *info = param; + ym2608_state *info = (ym2608_state *)param; stream_update(info->stream); } static STREAM_UPDATE( ym2608_stream_update ) { - ym2608_state *info = param; + ym2608_state *info = (ym2608_state *)param; ym2608_update_one(info->chip, outputs, samples); } static STATE_POSTLOAD( ym2608_intf_postload ) { - ym2608_state *info = param; + ym2608_state *info = (ym2608_state *)param; ym2608_postload(info->chip); } @@ -140,7 +140,7 @@ static DEVICE_START( ym2608 ) }, NULL }; - const ym2608_interface *intf = device->static_config ? device->static_config : &generic_2608; + const ym2608_interface *intf = device->static_config ? (const ym2608_interface *)device->static_config : &generic_2608; int rate = device->clock/72; void *pcmbufa; int pcmsizea; diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c index e6c8804d488..4070e56556e 100644 --- a/src/emu/sound/2610intf.c +++ b/src/emu/sound/2610intf.c @@ -41,25 +41,25 @@ INLINE ym2610_state *get_safe_token(const device_config *device) static void psg_set_clock(void *param, int clock) { - ym2610_state *info = param; + ym2610_state *info = (ym2610_state *)param; ay8910_set_clock_ym(info->psg, clock); } static void psg_write(void *param, int address, int data) { - ym2610_state *info = param; + ym2610_state *info = (ym2610_state *)param; ay8910_write_ym(info->psg, address, data); } static int psg_read(void *param) { - ym2610_state *info = param; + ym2610_state *info = (ym2610_state *)param; return ay8910_read_ym(info->psg); } static void psg_reset(void *param) { - ym2610_state *info = param; + ym2610_state *info = (ym2610_state *)param; ay8910_reset_ym(info->psg); } @@ -75,26 +75,26 @@ static const ssg_callbacks psgintf = /* IRQ Handler */ static void IRQHandler(void *param,int irq) { - ym2610_state *info = param; + ym2610_state *info = (ym2610_state *)param; if(info->intf->handler) info->intf->handler(info->device, irq); } /* Timer overflow callback from timer.c */ static TIMER_CALLBACK( timer_callback_0 ) { - ym2610_state *info = ptr; + ym2610_state *info = (ym2610_state *)ptr; ym2610_timer_over(info->chip,0); } static TIMER_CALLBACK( timer_callback_1 ) { - ym2610_state *info = ptr; + ym2610_state *info = (ym2610_state *)ptr; ym2610_timer_over(info->chip,1); } static void timer_handler(void *param,int c,int count,int clock) { - ym2610_state *info = param; + ym2610_state *info = (ym2610_state *)param; if( count == 0 ) { /* Reset FM Timer */ timer_enable(info->timer[c], 0); @@ -111,27 +111,27 @@ static void timer_handler(void *param,int c,int count,int clock) /* update request from fm.c */ void ym2610_update_request(void *param) { - ym2610_state *info = param; + ym2610_state *info = (ym2610_state *)param; stream_update(info->stream); } static STREAM_UPDATE( ym2610_stream_update ) { - ym2610_state *info = param; + ym2610_state *info = (ym2610_state *)param; ym2610_update_one(info->chip, outputs, samples); } static STREAM_UPDATE( ym2610b_stream_update ) { - ym2610_state *info = param; + ym2610_state *info = (ym2610_state *)param; ym2610b_update_one(info->chip, outputs, samples); } static STATE_POSTLOAD( ym2610_intf_postload ) { - ym2610_state *info = param; + ym2610_state *info = (ym2610_state *)param; ym2610_postload(info->chip); } @@ -145,7 +145,7 @@ static DEVICE_START( ym2610 ) AY8910_DEFAULT_LOADS, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }; - const ym2610_interface *intf = device->static_config ? device->static_config : &generic_2610; + const ym2610_interface *intf = device->static_config ? (const ym2610_interface *)device->static_config : &generic_2610; int rate = device->clock/72; void *pcmbufa,*pcmbufb; int pcmsizea,pcmsizeb; diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c index 313c9f7ba48..85372874c18 100644 --- a/src/emu/sound/2612intf.c +++ b/src/emu/sound/2612intf.c @@ -43,26 +43,26 @@ INLINE ym2612_state *get_safe_token(const device_config *device) /* IRQ Handler */ static void IRQHandler(void *param,int irq) { - ym2612_state *info = param; + ym2612_state *info = (ym2612_state *)param; if(info->intf->handler) info->intf->handler(info->device, irq); } /* Timer overflow callback from timer.c */ static TIMER_CALLBACK( timer_callback_2612_0 ) { - ym2612_state *info = ptr; + ym2612_state *info = (ym2612_state *)ptr; ym2612_timer_over(info->chip,0); } static TIMER_CALLBACK( timer_callback_2612_1 ) { - ym2612_state *info = ptr; + ym2612_state *info = (ym2612_state *)ptr; ym2612_timer_over(info->chip,1); } static void timer_handler(void *param,int c,int count,int clock) { - ym2612_state *info = param; + ym2612_state *info = (ym2612_state *)param; if( count == 0 ) { /* Reset FM Timer */ timer_enable(info->timer[c], 0); @@ -78,7 +78,7 @@ static void timer_handler(void *param,int c,int count,int clock) /* update request from fm.c */ void ym2612_update_request(void *param) { - ym2612_state *info = param; + ym2612_state *info = (ym2612_state *)param; stream_update(info->stream); } @@ -88,14 +88,14 @@ void ym2612_update_request(void *param) static STREAM_UPDATE( ym2612_stream_update ) { - ym2612_state *info = param; + ym2612_state *info = (ym2612_state *)param; ym2612_update_one(info->chip, outputs, samples); } static STATE_POSTLOAD( ym2612_intf_postload ) { - ym2612_state *info = param; + ym2612_state *info = (ym2612_state *)param; ym2612_postload(info->chip); } @@ -106,7 +106,7 @@ static DEVICE_START( ym2612 ) ym2612_state *info = get_safe_token(device); int rate = device->clock/72; - info->intf = device->static_config ? device->static_config : &dummy; + info->intf = device->static_config ? (const ym2612_interface *)device->static_config : &dummy; info->device = device; /* FM init */ diff --git a/src/emu/sound/262intf.c b/src/emu/sound/262intf.c index 30369f8f61d..40f750e49da 100644 --- a/src/emu/sound/262intf.c +++ b/src/emu/sound/262intf.c @@ -36,25 +36,25 @@ INLINE ymf262_state *get_safe_token(const device_config *device) static void IRQHandler_262(void *param,int irq) { - ymf262_state *info = param; + ymf262_state *info = (ymf262_state *)param; if (info->intf->handler) (info->intf->handler)(info->device, irq); } static TIMER_CALLBACK( timer_callback_262_0 ) { - ymf262_state *info = ptr; + ymf262_state *info = (ymf262_state *)ptr; ymf262_timer_over(info->chip, 0); } static TIMER_CALLBACK( timer_callback_262_1 ) { - ymf262_state *info = ptr; + ymf262_state *info = (ymf262_state *)ptr; ymf262_timer_over(info->chip, 1); } static void timer_handler_262(void *param,int timer, attotime period) { - ymf262_state *info = param; + ymf262_state *info = (ymf262_state *)param; if( attotime_compare(period, attotime_zero) == 0 ) { /* Reset FM Timer */ timer_enable(info->timer[timer], 0); @@ -67,13 +67,13 @@ static void timer_handler_262(void *param,int timer, attotime period) static STREAM_UPDATE( ymf262_stream_update ) { - ymf262_state *info = param; + ymf262_state *info = (ymf262_state *)param; ymf262_update_one(info->chip, outputs, samples); } static void _stream_update(void *param, int interval) { - ymf262_state *info = param; + ymf262_state *info = (ymf262_state *)param; stream_update(info->stream); } @@ -84,7 +84,7 @@ static DEVICE_START( ymf262 ) ymf262_state *info = get_safe_token(device); int rate = device->clock/288; - info->intf = device->static_config ? device->static_config : &dummy; + info->intf = device->static_config ? (const ymf262_interface *)device->static_config : &dummy; info->device = device; /* stream system initialize */ diff --git a/src/emu/sound/3526intf.c b/src/emu/sound/3526intf.c index 53146bb3e69..7ec8deecf76 100644 --- a/src/emu/sound/3526intf.c +++ b/src/emu/sound/3526intf.c @@ -48,24 +48,24 @@ INLINE ym3526_state *get_safe_token(const device_config *device) /* IRQ Handler */ static void IRQHandler(void *param,int irq) { - ym3526_state *info = param; + ym3526_state *info = (ym3526_state *)param; if (info->intf->handler) (info->intf->handler)(info->device, irq ? ASSERT_LINE : CLEAR_LINE); } /* Timer overflow callback from timer.c */ static TIMER_CALLBACK( timer_callback_0 ) { - ym3526_state *info = ptr; + ym3526_state *info = (ym3526_state *)ptr; ym3526_timer_over(info->chip,0); } static TIMER_CALLBACK( timer_callback_1 ) { - ym3526_state *info = ptr; + ym3526_state *info = (ym3526_state *)ptr; ym3526_timer_over(info->chip,1); } /* TimerHandler from fm.c */ static void TimerHandler(void *param,int c,attotime period) { - ym3526_state *info = param; + ym3526_state *info = (ym3526_state *)param; if( attotime_compare(period, attotime_zero) == 0 ) { /* Reset FM Timer */ timer_enable(info->timer[c], 0); @@ -79,13 +79,13 @@ static void TimerHandler(void *param,int c,attotime period) static STREAM_UPDATE( ym3526_stream_update ) { - ym3526_state *info = param; + ym3526_state *info = (ym3526_state *)param; ym3526_update_one(info->chip, outputs[0], samples); } static void _stream_update(void *param, int interval) { - ym3526_state *info = param; + ym3526_state *info = (ym3526_state *)param; stream_update(info->stream); } @@ -96,7 +96,7 @@ static DEVICE_START( ym3526 ) ym3526_state *info = get_safe_token(device); int rate = device->clock/72; - info->intf = device->static_config ? device->static_config : &dummy; + info->intf = device->static_config ? (const ym3526_interface *)device->static_config : &dummy; info->device = device; /* stream system initialize */ diff --git a/src/emu/sound/3812intf.c b/src/emu/sound/3812intf.c index a784ea54ffd..056599db6e3 100644 --- a/src/emu/sound/3812intf.c +++ b/src/emu/sound/3812intf.c @@ -48,24 +48,24 @@ INLINE ym3812_state *get_safe_token(const device_config *device) static void IRQHandler(void *param,int irq) { - ym3812_state *info = param; + ym3812_state *info = (ym3812_state *)param; if (info->intf->handler) (info->intf->handler)(info->device, irq ? ASSERT_LINE : CLEAR_LINE); } static TIMER_CALLBACK( timer_callback_0 ) { - ym3812_state *info = ptr; + ym3812_state *info = (ym3812_state *)param; ym3812_timer_over(info->chip,0); } static TIMER_CALLBACK( timer_callback_1 ) { - ym3812_state *info = ptr; + ym3812_state *info = (ym3812_state *)param; ym3812_timer_over(info->chip,1); } static void TimerHandler(void *param,int c,attotime period) { - ym3812_state *info = param; + ym3812_state *info = (ym3812_state *)param; if( attotime_compare(period, attotime_zero) == 0 ) { /* Reset FM Timer */ timer_enable(info->timer[c], 0); @@ -79,13 +79,13 @@ static void TimerHandler(void *param,int c,attotime period) static STREAM_UPDATE( ym3812_stream_update ) { - ym3812_state *info = param; + ym3812_state *info = (ym3812_state *)param; ym3812_update_one(info->chip, outputs[0], samples); } static void _stream_update(void * param, int interval) { - ym3812_state *info = param; + ym3812_state *info = (ym3812_state *)param; stream_update(info->stream); } @@ -96,7 +96,7 @@ static DEVICE_START( ym3812 ) ym3812_state *info = get_safe_token(device); int rate = device->clock/72; - info->intf = device->static_config ? device->static_config : &dummy; + info->intf = device->static_config ? (const ym3812_interface *)device->static_config : &dummy; info->device = device; /* stream system initialize */ diff --git a/src/emu/sound/5110intf.c b/src/emu/sound/5110intf.c index 53e95538314..63cf69cc3a1 100644 --- a/src/emu/sound/5110intf.c +++ b/src/emu/sound/5110intf.c @@ -86,7 +86,7 @@ static DEVICE_START( tms5110 ) static const tms5110_interface dummy = { 0 }; tms5110_state *info = get_safe_token(device); - info->intf = device->static_config ? device->static_config : &dummy; + info->intf = device->static_config ? (const tms5110_interface *)device->static_config : &dummy; info->table = device->region; info->chip = tms5110_create(device, TMS5110_IS_5110A); @@ -250,7 +250,7 @@ int tms5110_ready_r(const device_config *device) static STREAM_UPDATE( tms5110_update ) { - tms5110_state *info = param; + tms5110_state *info = (tms5110_state *)param; INT16 sample_data[MAX_SAMPLE_CHUNK]; stream_sample_t *buffer = outputs[0]; diff --git a/src/emu/sound/5220intf.c b/src/emu/sound/5220intf.c index f3daac7c3fb..788cdf6e033 100644 --- a/src/emu/sound/5220intf.c +++ b/src/emu/sound/5220intf.c @@ -59,7 +59,7 @@ static DEVICE_START( tms5220 ) static const tms5220_interface dummy = { 0 }; tms5220_state *info = get_safe_token(device); - info->intf = device->static_config ? device->static_config : &dummy; + info->intf = device->static_config ? (const tms5220_interface *)device->static_config : &dummy; info->chip = tms5220_create(device); assert_always(info->chip != NULL, "Error creating TMS5220 chip"); @@ -203,7 +203,7 @@ int tms5220_int_r(const device_config *device) static STREAM_UPDATE( tms5220_update ) { - tms5220_state *info = param; + tms5220_state *info = (tms5220_state *)param; INT16 sample_data[MAX_SAMPLE_CHUNK]; stream_sample_t *buffer = outputs[0]; diff --git a/src/emu/sound/8950intf.c b/src/emu/sound/8950intf.c index a435102fa80..c677bcff9d7 100644 --- a/src/emu/sound/8950intf.c +++ b/src/emu/sound/8950intf.c @@ -47,22 +47,22 @@ INLINE y8950_state *get_safe_token(const device_config *device) static void IRQHandler(void *param,int irq) { - y8950_state *info = param; + y8950_state *info = (y8950_state *)param; if (info->intf->handler) (info->intf->handler)(info->device, irq ? ASSERT_LINE : CLEAR_LINE); } static TIMER_CALLBACK( timer_callback_0 ) { - y8950_state *info = ptr; + y8950_state *info = (y8950_state *)ptr; y8950_timer_over(info->chip,0); } static TIMER_CALLBACK( timer_callback_1 ) { - y8950_state *info = ptr; + y8950_state *info = (y8950_state *)ptr; y8950_timer_over(info->chip,1); } static void TimerHandler(void *param,int c,attotime period) { - y8950_state *info = param; + y8950_state *info = (y8950_state *)param; if( attotime_compare(period, attotime_zero) == 0 ) { /* Reset FM Timer */ timer_enable(info->timer[c], 0); @@ -76,7 +76,7 @@ static void TimerHandler(void *param,int c,attotime period) static unsigned char Y8950PortHandler_r(void *param) { - y8950_state *info = param; + y8950_state *info = (y8950_state *)param; if (info->intf->portread) return info->intf->portread(info->device,0); return 0; @@ -84,14 +84,14 @@ static unsigned char Y8950PortHandler_r(void *param) static void Y8950PortHandler_w(void *param,unsigned char data) { - y8950_state *info = param; + y8950_state *info = (y8950_state *)param; if (info->intf->portwrite) info->intf->portwrite(info->device,0,data); } static unsigned char Y8950KeyboardHandler_r(void *param) { - y8950_state *info = param; + y8950_state *info = (y8950_state *)param; if (info->intf->keyboardread) return info->intf->keyboardread(info->device,0); return 0; @@ -99,20 +99,20 @@ static unsigned char Y8950KeyboardHandler_r(void *param) static void Y8950KeyboardHandler_w(void *param,unsigned char data) { - y8950_state *info = param; + y8950_state *info = (y8950_state *)param; if (info->intf->keyboardwrite) info->intf->keyboardwrite(info->device,0,data); } static STREAM_UPDATE( y8950_stream_update ) { - y8950_state *info = param; + y8950_state *info = (y8950_state *)param; y8950_update_one(info->chip, outputs[0], samples); } static void _stream_update(void *param, int interval) { - y8950_state *info = param; + y8950_state *info = (y8950_state *)param; stream_update(info->stream); } @@ -123,7 +123,7 @@ static DEVICE_START( y8950 ) y8950_state *info = get_safe_token(device); int rate = device->clock/72; - info->intf = device->static_config ? device->static_config : &dummy; + info->intf = device->static_config ? (const y8950_interface *)device->static_config : &dummy; info->device = device; /* stream system initialize */ diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c index 2c6e10f0d3c..db4408125a8 100644 --- a/src/emu/sound/aica.c +++ b/src/emu/sound/aica.c @@ -1275,7 +1275,7 @@ static int AICA_IRQCB(void *param) static STREAM_UPDATE( AICA_Update ) { - aica_state *AICA = param; + aica_state *AICA = (aica_state *)param; bufferl = outputs[0]; bufferr = outputs[1]; length = samples; @@ -1288,7 +1288,7 @@ static DEVICE_START( aica ) aica_state *AICA = get_safe_token(device); - intf = device->static_config; + intf = (const aica_interface *)device->static_config; // init the emulation AICA_Init(device, AICA, intf); @@ -1312,11 +1312,11 @@ void aica_set_ram_base(const device_config *device, void *base, int size) aica_state *AICA = get_safe_token(device); if (AICA) { - AICA->AICARAM = base; + AICA->AICARAM = (unsigned char *)base; AICA->AICARAM_LENGTH = size; AICA->RAM_MASK = AICA->AICARAM_LENGTH-1; AICA->RAM_MASK16 = AICA->RAM_MASK & 0x7ffffe; - AICA->DSP.AICARAM = base; + AICA->DSP.AICARAM = (UINT16 *)base; AICA->DSP.AICARAM_LENGTH = size; } } diff --git a/src/emu/sound/astrocde.c b/src/emu/sound/astrocde.c index 7a6e21823c6..cea3b6ad936 100644 --- a/src/emu/sound/astrocde.c +++ b/src/emu/sound/astrocde.c @@ -89,7 +89,7 @@ INLINE astrocade_state *get_safe_token(const device_config *device) static STREAM_UPDATE( astrocade_update ) { - astrocade_state *chip = param; + astrocade_state *chip = (astrocade_state *)param; stream_sample_t *dest = outputs[0]; UINT16 noise_state; UINT8 master_count; diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c index 595abde6d6d..0e6a5e82682 100644 --- a/src/emu/sound/ay8910.c +++ b/src/emu/sound/ay8910.c @@ -339,7 +339,7 @@ INLINE void build_3D_table(double rl, const ay_ym_param *par, const ay_ym_param double min = 10.0, max = 0.0; double *temp; - temp = malloc(8*32*32*32*sizeof(*temp)); + temp = (double *)malloc(8*32*32*32*sizeof(*temp)); for (e=0; e < 8; e++) for (j1=0; j1 < 32; j1++) @@ -545,7 +545,7 @@ static void ay8910_write_reg(ay8910_context *psg, int r, int v) static STREAM_UPDATE( ay8910_update ) { - ay8910_context *psg = param; + ay8910_context *psg = (ay8910_context *)param; stream_sample_t *buf[NUM_CHANNELS]; int chan; @@ -731,11 +731,11 @@ static void ay8910_statesave(ay8910_context *psg, const device_config *device) void *ay8910_start_ym(void *infoptr, sound_type chip_type, const device_config *device, int clock, const ay8910_interface *intf) { - ay8910_context *info = infoptr; + ay8910_context *info = (ay8910_context *)infoptr; if (info == NULL) { - info = auto_malloc(sizeof(*info)); + info = (ay8910_context *)auto_malloc(sizeof(*info)); memset(info, 0, sizeof(*info)); } info->device = device; @@ -787,7 +787,7 @@ void ay8910_stop_ym(void *chip) void ay8910_reset_ym(void *chip) { - ay8910_context *psg = chip; + ay8910_context *psg = (ay8910_context *)chip; int i; psg->register_latch = 0; @@ -835,13 +835,13 @@ void ay8910_set_volume(const device_config *device,int channel,int volume) void ay8910_set_clock_ym(void *chip, int clock) { - ay8910_context *psg = chip; + ay8910_context *psg = (ay8910_context *)chip; stream_set_sample_rate(psg->channel, clock / 8 ); } void ay8910_write_ym(void *chip, int addr, int data) { - ay8910_context *psg = chip; + ay8910_context *psg = (ay8910_context *)chip; if (addr & 1) { /* Data port */ @@ -864,7 +864,7 @@ void ay8910_write_ym(void *chip, int addr, int data) int ay8910_read_ym(void *chip) { - ay8910_context *psg = chip; + ay8910_context *psg = (ay8910_context *)chip; int r = psg->register_latch; if (r > 15) return 0; @@ -912,7 +912,7 @@ static DEVICE_START( ay8910 ) AY8910_DEFAULT_LOADS, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }; - const ay8910_interface *intf = (device->static_config ? device->static_config : &generic_ay8910); + const ay8910_interface *intf = (device->static_config ? (const ay8910_interface *)device->static_config : &generic_ay8910); ay8910_start_ym(get_safe_token(device), SOUND_AY8910, device, device->clock, intf); } @@ -924,7 +924,7 @@ static DEVICE_START( ym2149 ) AY8910_DEFAULT_LOADS, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }; - const ay8910_interface *intf = (device->static_config ? device->static_config : &generic_ay8910); + const ay8910_interface *intf = (device->static_config ? (const ay8910_interface *)device->static_config : &generic_ay8910); ay8910_start_ym(get_safe_token(device), SOUND_YM2149, device, device->clock, intf); } diff --git a/src/emu/sound/bsmt2000.c b/src/emu/sound/bsmt2000.c index 1a93826dc54..f1e9825792d 100644 --- a/src/emu/sound/bsmt2000.c +++ b/src/emu/sound/bsmt2000.c @@ -186,7 +186,7 @@ static STREAM_UPDATE( bsmt2000_update ) { stream_sample_t *left = outputs[0]; stream_sample_t *right = outputs[1]; - bsmt2000_chip *chip = param; + bsmt2000_chip *chip = (bsmt2000_chip *)param; bsmt2000_voice *voice; int samp, voicenum; diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c index 68bb3ec66e8..0d258903405 100644 --- a/src/emu/sound/c140.c +++ b/src/emu/sound/c140.c @@ -272,7 +272,7 @@ INLINE int limit(INT32 in) static STREAM_UPDATE( update_stereo ) { - c140_state *info = param; + c140_state *info = (c140_state *)param; int i,j; INT32 rvol,lvol; @@ -467,7 +467,7 @@ static STREAM_UPDATE( update_stereo ) static DEVICE_START( c140 ) { - const c140_interface *intf = device->static_config; + const c140_interface *intf = (const c140_interface *)device->static_config; c140_state *info = get_safe_token(device); info->sample_rate=info->baserate=device->clock; @@ -496,7 +496,7 @@ static DEVICE_START( c140 ) } /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ - info->mixer_buffer_left = auto_malloc(2 * sizeof(INT16)*info->sample_rate ); + info->mixer_buffer_left = (INT16 *)auto_malloc(2 * sizeof(INT16)*info->sample_rate ); info->mixer_buffer_right = info->mixer_buffer_left + info->sample_rate; } diff --git a/src/emu/sound/c352.c b/src/emu/sound/c352.c index 71c2df438d8..93344471a03 100644 --- a/src/emu/sound/c352.c +++ b/src/emu/sound/c352.c @@ -337,7 +337,7 @@ static void c352_mix_one_channel(c352_state *info, unsigned long ch, long sample static STREAM_UPDATE( c352_update ) { - c352_state *info = param; + c352_state *info = (c352_state *)param; int i, j; stream_sample_t *bufferl = outputs[0]; stream_sample_t *bufferr = outputs[1]; diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c index a6b0923a6be..fc9feadd895 100644 --- a/src/emu/sound/c6280.c +++ b/src/emu/sound/c6280.c @@ -99,7 +99,7 @@ INLINE c6280_t *get_safe_token(const device_config *device) static void c6280_init(const device_config *device, c6280_t *p, double clk, double rate) { - const c6280_interface *intf = device->static_config; + const c6280_interface *intf = (const c6280_interface *)device->static_config; int i; double step; @@ -231,7 +231,7 @@ static STREAM_UPDATE( c6280_update ) }; int ch; int i; - c6280_t *p = param; + c6280_t *p = (c6280_t *)param; int lmal = (p->balance >> 4) & 0x0F; int rmal = (p->balance >> 0) & 0x0F; diff --git a/src/emu/sound/cdda.c b/src/emu/sound/cdda.c index 2d1b8195c4d..20ba3ec46a4 100644 --- a/src/emu/sound/cdda.c +++ b/src/emu/sound/cdda.c @@ -44,7 +44,7 @@ static void get_audio_data(cdda_info *info, stream_sample_t *bufL, stream_sample static STREAM_UPDATE( cdda_update ) { - cdda_info *info = param; + cdda_info *info = (cdda_info *)param; get_audio_data(info, &outputs[0][0], &outputs[1][0], samples); } @@ -59,9 +59,9 @@ static DEVICE_START( cdda ) cdda_info *info = get_safe_token(device); /* allocate an audio cache */ - info->audio_cache = auto_malloc( CD_MAX_SECTOR_DATA * MAX_SECTORS ); + info->audio_cache = (UINT8 *)auto_malloc( CD_MAX_SECTOR_DATA * MAX_SECTORS ); - intf = device->static_config; + intf = (const struct CDDAinterface *)device->static_config; info->stream = stream_create(device, 0, 2, 44100, info, cdda_update); diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c index 1370586e443..b72c04160b5 100644 --- a/src/emu/sound/cdp1869.c +++ b/src/emu/sound/cdp1869.c @@ -171,7 +171,7 @@ static TIMER_CALLBACK( prd_changed_tick ) static STATE_POSTLOAD( cdp1869_state_save_postload ) { - update_prd_changed_timer(param); + update_prd_changed_timer((cdp1869_t *)param); } /*------------------------------------------------- @@ -783,7 +783,7 @@ void cdp1869_update(const device_config *device, bitmap_t *bitmap, const rectang static STREAM_UPDATE( cdp1869_stream_update ) { - cdp1869_t *cdp1869 = param; + cdp1869_t *cdp1869 = (cdp1869_t *)param; INT16 signal = cdp1869->signal; stream_sample_t *buffer = outputs[0]; @@ -847,7 +847,7 @@ static DEVICE_START( cdp1869 ) cdp1869_t *cdp1869 = get_safe_token(device); /* validate arguments */ - cdp1869->intf = device->static_config; + cdp1869->intf = (const cdp1869_interface *)device->static_config; assert(cdp1869->intf->page_ram_r != NULL); assert(cdp1869->intf->pcb_r != NULL); diff --git a/src/emu/sound/cdp1869.h b/src/emu/sound/cdp1869.h index 40fdb841788..ce906e21cb8 100644 --- a/src/emu/sound/cdp1869.h +++ b/src/emu/sound/cdp1869.h @@ -114,11 +114,11 @@ typedef UINT8 (*cdp1869_page_ram_read_func)(const device_config *device, UINT16 typedef void (*cdp1869_page_ram_write_func)(const device_config *device, UINT16 pma, UINT8 data); typedef int (*cdp1869_pcb_read_func)(const device_config *device, UINT16 pma, UINT8 cma); -typedef enum _cdp1869_format cdp1869_format; enum _cdp1869_format { CDP1869_NTSC = 0, CDP1869_PAL }; +typedef enum _cdp1869_format cdp1869_format; /* interface */ typedef struct _cdp1869_interface cdp1869_interface; diff --git a/src/emu/sound/cem3394.c b/src/emu/sound/cem3394.c index 09a3c8a176c..e3ba18f8d09 100644 --- a/src/emu/sound/cem3394.c +++ b/src/emu/sound/cem3394.c @@ -152,7 +152,7 @@ INLINE cem3394_state *get_safe_token(const device_config *device) /* generate sound to the mix buffer in mono */ static STREAM_UPDATE( cem3394_update ) { - cem3394_state *chip = param; + cem3394_state *chip = (cem3394_state *)param; int int_volume = (chip->volume * chip->mixer_internal) / 256; int ext_volume = (chip->volume * chip->mixer_external) / 256; UINT32 step = chip->step, position, end_position = 0; @@ -328,7 +328,7 @@ static STREAM_UPDATE( cem3394_update ) static DEVICE_START( cem3394 ) { - const cem3394_interface *intf = device->static_config; + const cem3394_interface *intf = (const cem3394_interface *)device->static_config; cem3394_state *chip = get_safe_token(device); chip->device = device; @@ -344,8 +344,8 @@ static DEVICE_START( cem3394 ) chip->filter_zero_freq = intf->filter_zero_freq; /* allocate memory for a mixer buffer and external buffer (1 second should do it!) */ - chip->mixer_buffer = auto_malloc(chip->sample_rate * sizeof(INT16)); - chip->external_buffer = auto_malloc(chip->sample_rate * sizeof(INT16)); + chip->mixer_buffer = (INT16 *)auto_malloc(chip->sample_rate * sizeof(INT16)); + chip->external_buffer = (INT16 *)auto_malloc(chip->sample_rate * sizeof(INT16)); state_save_register_device_item_array(device, 0, chip->values); state_save_register_device_item(device, 0, chip->wave_select); diff --git a/src/emu/sound/dac.c b/src/emu/sound/dac.c index 5992861adf9..ccfe6cba39c 100644 --- a/src/emu/sound/dac.c +++ b/src/emu/sound/dac.c @@ -30,7 +30,7 @@ INLINE dac_state *get_safe_token(const device_config *device) static STREAM_UPDATE( DAC_update ) { - dac_state *info = param; + dac_state *info = (dac_state *)param; stream_sample_t *buffer = outputs[0]; INT16 out = info->output; diff --git a/src/emu/sound/digitalk.c b/src/emu/sound/digitalk.c index f5b943735da..a043cb7724a 100644 --- a/src/emu/sound/digitalk.c +++ b/src/emu/sound/digitalk.c @@ -542,7 +542,7 @@ static void digitalker_step(digitalker *dg) static STREAM_UPDATE(digitalker_update) { - digitalker *dg = param; + digitalker *dg = (digitalker *)param; stream_sample_t *sout = outputs[0]; int cpos = 0; while(cpos != samples) { diff --git a/src/emu/sound/disc_dev.c b/src/emu/sound/disc_dev.c index 49bed9eb22f..7f038afcbb7 100644 --- a/src/emu/sound/disc_dev.c +++ b/src/emu/sound/disc_dev.c @@ -158,8 +158,8 @@ struct dsd_ls624_context static DISCRETE_STEP(dsd_555_astbl) { - const discrete_555_desc *info = node->custom; - struct dsd_555_astbl_context *context = node->context; + const discrete_555_desc *info = (const discrete_555_desc *)node->custom; + struct dsd_555_astbl_context *context = (struct dsd_555_astbl_context *)node->context; int count_f = 0; int count_r = 0; @@ -376,8 +376,8 @@ static DISCRETE_STEP(dsd_555_astbl) static DISCRETE_RESET(dsd_555_astbl) { - const discrete_555_desc *info = node->custom; - struct dsd_555_astbl_context *context = node->context; + const discrete_555_desc *info = (const discrete_555_desc *)node->custom; + struct dsd_555_astbl_context *context = (struct dsd_555_astbl_context *)node->context; node_description *v_charge_node; context->use_ctrlv = (node->input_is_node >> 4) & 1; @@ -457,8 +457,8 @@ static DISCRETE_RESET(dsd_555_astbl) static DISCRETE_STEP(dsd_555_mstbl) { - const discrete_555_desc *info = node->custom; - struct dsd_555_mstbl_context *context = node->context; + const discrete_555_desc *info = (const discrete_555_desc *)node->custom; + struct dsd_555_mstbl_context *context = (struct dsd_555_mstbl_context *)node->context; double v_cap; /* Current voltage on capacitor, before dt */ double v_cap_next = 0; /* Voltage on capacitor, after dt */ @@ -542,8 +542,8 @@ static DISCRETE_STEP(dsd_555_mstbl) static DISCRETE_RESET(dsd_555_mstbl) { - const discrete_555_desc *info = node->custom; - struct dsd_555_mstbl_context *context = node->context; + const discrete_555_desc *info = (const discrete_555_desc *)node->custom; + struct dsd_555_mstbl_context *context = (struct dsd_555_mstbl_context *)node->context; context->output_type = info->options & DISC_555_OUT_MASK; if ((context->output_type == DISC_555_OUT_COUNT_F) || (context->output_type == DISC_555_OUT_COUNT_R)) @@ -611,8 +611,8 @@ static DISCRETE_RESET(dsd_555_mstbl) static DISCRETE_STEP(dsd_555_cc) { - const discrete_555_cc_desc *info = node->custom; - struct dsd_555_cc_context *context = node->context; + const discrete_555_cc_desc *info = (const discrete_555_cc_desc *)node->custom; + struct dsd_555_cc_context *context = (struct dsd_555_cc_context *)node->context; int count_f = 0; int count_r = 0; @@ -931,8 +931,8 @@ static DISCRETE_STEP(dsd_555_cc) static DISCRETE_RESET(dsd_555_cc) { - const discrete_555_cc_desc *info = node->custom; - struct dsd_555_cc_context *context = node->context; + const discrete_555_cc_desc *info = (const discrete_555_cc_desc *)node->custom; + struct dsd_555_cc_context *context = (struct dsd_555_cc_context *)node->context; double r_temp, r_discharge = 0, r_charge = 0; @@ -1161,8 +1161,8 @@ static DISCRETE_RESET(dsd_555_cc) static DISCRETE_STEP(dsd_555_vco1) { - const discrete_555_vco1_desc *info = node->custom; - struct dsd_555_vco1_context *context = node->context; + const discrete_555_vco1_desc *info = (const discrete_555_vco1_desc *)node->custom; + struct dsd_555_vco1_context *context = (struct dsd_555_vco1_context *)node->context; int count_f = 0; int count_r = 0; @@ -1314,8 +1314,8 @@ static DISCRETE_STEP(dsd_555_vco1) static DISCRETE_RESET(dsd_555_vco1) { - const discrete_555_vco1_desc *info = node->custom; - struct dsd_555_vco1_context *context = node->context; + const discrete_555_vco1_desc *info = (const discrete_555_vco1_desc *)node->custom; + struct dsd_555_vco1_context *context = (struct dsd_555_vco1_context *)node->context; double v_ratio_r3, v_ratio_r4_1, r_in_1; @@ -1392,8 +1392,8 @@ static DISCRETE_RESET(dsd_555_vco1) static DISCRETE_STEP(dsd_566) { - const discrete_566_desc *info = node->custom; - struct dsd_566_context *context = node->context; + const discrete_566_desc *info = (const discrete_566_desc *)node->custom; + struct dsd_566_context *context = (struct dsd_566_context *)node->context; double i; /* Charging current created by vIn */ double dt; /* change in time */ @@ -1513,8 +1513,8 @@ static DISCRETE_STEP(dsd_566) static DISCRETE_RESET(dsd_566) { - const discrete_566_desc *info = node->custom; - struct dsd_566_context *context = node->context; + const discrete_566_desc *info = (const discrete_566_desc *)node->custom; + struct dsd_566_context *context = (struct dsd_566_context *)node->context; node_description *v_charge_node; double v_diff, temp; @@ -1598,7 +1598,7 @@ static DISCRETE_RESET(dsd_566) static DISCRETE_STEP(dsd_ls624) { - struct dsd_ls624_context *context = node->context; + struct dsd_ls624_context *context = (struct dsd_ls624_context *)node->context; if (DSD_LS624__ENABLE) { @@ -1653,7 +1653,7 @@ static DISCRETE_STEP(dsd_ls624) static DISCRETE_RESET(dsd_ls624) { - struct dsd_ls624_context *context = node->context; + struct dsd_ls624_context *context = (struct dsd_ls624_context *)node->context; context->remain = 0; context->state = 0; diff --git a/src/emu/sound/disc_flt.c b/src/emu/sound/disc_flt.c index 72c6f98ffd4..c1189867cd8 100644 --- a/src/emu/sound/disc_flt.c +++ b/src/emu/sound/disc_flt.c @@ -141,7 +141,7 @@ struct dst_rcintegrate_context static DISCRETE_STEP(dst_crfilter) { - struct dst_rcfilter_context *context = node->context; + struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context; if(DST_CRFILTER__ENABLE) { @@ -156,7 +156,7 @@ static DISCRETE_STEP(dst_crfilter) static DISCRETE_RESET(dst_crfilter) { - struct dst_rcfilter_context *context = node->context; + struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context; context->exponent = RC_CHARGE_EXP(DST_CRFILTER__R * DST_CRFILTER__C); context->vCap = 0; @@ -208,7 +208,7 @@ static void calculate_filter1_coefficients(double fc, double type, static DISCRETE_STEP(dst_filter1) { - struct dss_filter1_context *context = node->context; + struct dss_filter1_context *context = (struct dss_filter1_context *)node->context; double gain = 1.0; @@ -225,7 +225,7 @@ static DISCRETE_STEP(dst_filter1) static DISCRETE_RESET(dst_filter1) { - struct dss_filter1_context *context = node->context; + struct dss_filter1_context *context = (struct dss_filter1_context *)node->context; calculate_filter1_coefficients(DST_FILTER1__FREQ, DST_FILTER1__TYPE, &context->a1, &context->b0, &context->b1); node->output[0] = 0; @@ -293,7 +293,7 @@ static void calculate_filter2_coefficients(double fc, double d, double type, static DISCRETE_STEP(dst_filter2) { - struct dss_filter2_context *context = node->context; + struct dss_filter2_context *context = (struct dss_filter2_context *)node->context; double gain = 1.0; @@ -313,7 +313,7 @@ static DISCRETE_STEP(dst_filter2) static DISCRETE_RESET(dst_filter2) { - struct dss_filter2_context *context = node->context; + struct dss_filter2_context *context = (struct dss_filter2_context *)node->context; calculate_filter2_coefficients(DST_FILTER2__FREQ, DST_FILTER2__DAMP, DST_FILTER2__TYPE, &context->a1, &context->a2, @@ -342,8 +342,8 @@ static DISCRETE_RESET(dst_filter2) static DISCRETE_STEP(dst_op_amp_filt) { - const discrete_op_amp_filt_info *info = node->custom; - struct dst_op_amp_filt_context *context = node->context; + const discrete_op_amp_filt_info *info = (const discrete_op_amp_filt_info *)node->custom; + struct dst_op_amp_filt_context *context = (struct dst_op_amp_filt_context *)node->context; double i, v = 0; @@ -425,8 +425,8 @@ static DISCRETE_STEP(dst_op_amp_filt) static DISCRETE_RESET(dst_op_amp_filt) { - const discrete_op_amp_filt_info *info = node->custom; - struct dst_op_amp_filt_context *context = node->context; + const discrete_op_amp_filt_info *info = (const discrete_op_amp_filt_info *)node->custom; + struct dst_op_amp_filt_context *context = (struct dst_op_amp_filt_context *)node->context; /* Convert the passed filter type into an int for easy use. */ context->type = (int)DST_OP_AMP_FILT__TYPE & DISC_OP_AMP_FILTER_TYPE_MASK; @@ -539,7 +539,7 @@ static DISCRETE_RESET(dst_op_amp_filt) static DISCRETE_STEP(dst_rcdisc) { - struct dst_rcdisc_context *context = node->context; + struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context; switch (context->state) { @@ -566,7 +566,7 @@ static DISCRETE_STEP(dst_rcdisc) static DISCRETE_RESET(dst_rcdisc) { - struct dst_rcdisc_context *context = node->context; + struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context; node->output[0] = 0; @@ -598,7 +598,7 @@ static DISCRETE_RESET(dst_rcdisc) static DISCRETE_STEP(dst_rcdisc2) { - struct dst_rcdisc_context *context = node->context; + struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context; double diff; @@ -612,7 +612,7 @@ static DISCRETE_STEP(dst_rcdisc2) static DISCRETE_RESET(dst_rcdisc2) { - struct dst_rcdisc_context *context = node->context; + struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context; node->output[0] = 0; @@ -642,7 +642,7 @@ static DISCRETE_RESET(dst_rcdisc2) static DISCRETE_STEP(dst_rcdisc3) { - struct dst_rcdisc_context *context = node->context; + struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context; double diff; @@ -671,7 +671,7 @@ static DISCRETE_STEP(dst_rcdisc3) static DISCRETE_RESET(dst_rcdisc3) { - struct dst_rcdisc_context *context = node->context; + struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context; node->output[0] = 0; @@ -706,7 +706,7 @@ static DISCRETE_RESET(dst_rcdisc3) static DISCRETE_STEP(dst_rcdisc4) { - struct dst_rcdisc4_context *context = node->context; + struct dst_rcdisc4_context *context = (struct dst_rcdisc4_context *)node->context; int inp1 = (DST_RCDISC4__IN == 0) ? 0 : 1; @@ -732,7 +732,7 @@ static DISCRETE_STEP(dst_rcdisc4) static DISCRETE_RESET( dst_rcdisc4) { - struct dst_rcdisc4_context *context = node->context; + struct dst_rcdisc4_context *context = (struct dst_rcdisc4_context *)node->context; double v, i, r, rT; @@ -818,7 +818,7 @@ static DISCRETE_RESET( dst_rcdisc4) static DISCRETE_STEP( dst_rcdisc5) { - struct dst_rcdisc_context *context = node->context; + struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context; double diff,u; @@ -845,7 +845,7 @@ static DISCRETE_STEP( dst_rcdisc5) static DISCRETE_RESET( dst_rcdisc5) { - struct dst_rcdisc_context *context = node->context; + struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context; node->output[0] = 0; @@ -881,7 +881,7 @@ static DISCRETE_RESET( dst_rcdisc5) static DISCRETE_STEP(dst_rcdisc_mod) { - struct dst_rcdisc_mod_context *context = node->context; + struct dst_rcdisc_mod_context *context = (struct dst_rcdisc_mod_context *)node->context; double diff, v_cap, u, vD; int mod_state, mod1_state, mod2_state; @@ -916,7 +916,7 @@ static DISCRETE_STEP(dst_rcdisc_mod) static DISCRETE_RESET(dst_rcdisc_mod) { - struct dst_rcdisc_mod_context *context = node->context; + struct dst_rcdisc_mod_context *context = (struct dst_rcdisc_mod_context *)node->context; double rc[2], rc2[2]; @@ -971,7 +971,7 @@ static DISCRETE_RESET(dst_rcdisc_mod) static DISCRETE_STEP(dst_rcfilter) { - struct dst_rcfilter_context *context = node->context; + struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context; /************************************************************************/ /* Next Value = PREV + (INPUT_VALUE - PREV)*(1-(EXP(-TIMEDELTA/RC))) */ @@ -990,7 +990,7 @@ static DISCRETE_STEP(dst_rcfilter) static DISCRETE_RESET(dst_rcfilter) { - struct dst_rcfilter_context *context = node->context; + struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context; context->exponent = RC_CHARGE_EXP(DST_RCFILTER__R * DST_RCFILTER__C); context->vCap = 0; @@ -1020,7 +1020,7 @@ static DISCRETE_RESET(dst_rcfilter) // FIXME: This needs optimization ! static DISCRETE_STEP(dst_rcfilter_sw) { - struct dst_rcfilter_sw_context *context = node->context; + struct dst_rcfilter_sw_context *context = (struct dst_rcfilter_sw_context *)node->context; int i,j ; int bits = (int)DST_RCFILTER_SW__SWITCH; @@ -1071,7 +1071,7 @@ static DISCRETE_STEP(dst_rcfilter_sw) static DISCRETE_RESET(dst_rcfilter_sw) { - struct dst_rcfilter_sw_context *context = node->context; + struct dst_rcfilter_sw_context *context = (struct dst_rcfilter_sw_context *)node->context; int i; @@ -1127,7 +1127,7 @@ static DISCRETE_RESET(dst_rcfilter_sw) static DISCRETE_STEP( dst_rcintegrate) { - struct dst_rcintegrate_context *context = node->context; + struct dst_rcintegrate_context *context = (struct dst_rcintegrate_context *)node->context; double diff, u, iQ, iQc, iC, RG, vE; double vP; @@ -1188,7 +1188,7 @@ static DISCRETE_STEP( dst_rcintegrate) } static DISCRETE_RESET(dst_rcintegrate) { - struct dst_rcintegrate_context *context = node->context; + struct dst_rcintegrate_context *context = (struct dst_rcintegrate_context *)node->context; double r; double dt = discrete_current_context->sample_time; @@ -1232,7 +1232,7 @@ static DISCRETE_RESET(dst_rcintegrate) static DISCRETE_STEP(dst_sallen_key) { - struct dss_filter2_context *context = node->context; + struct dss_filter2_context *context = (struct dss_filter2_context *)node->context; double gain = 1.0; @@ -1252,8 +1252,8 @@ static DISCRETE_STEP(dst_sallen_key) static DISCRETE_RESET(dst_sallen_key) { - struct dss_filter2_context *context = node->context; - const discrete_op_amp_filt_info *info = node->custom; + struct dss_filter2_context *context = (struct dss_filter2_context *)node->context; + const discrete_op_amp_filt_info *info = (const discrete_op_amp_filt_info *)node->custom; double freq, q; @@ -1343,7 +1343,7 @@ static DISCRETE_RESET(dst_rcdiscN) static DISCRETE_STEP(dst_rcdiscN) { - struct dss_filter1_context *context = node->context; + struct dss_filter1_context *context = (struct dss_filter1_context *)node->context; double gain = 1.0; @@ -1394,7 +1394,7 @@ struct dss_rcdisc2_context static DISCRETE_STEP(dst_rcdisc2N) { - struct dss_rcdisc2_context *context = node->context; + struct dss_rcdisc2_context *context = (struct dss_rcdisc2_context *)node->context; double input = ((DST_RCDISC2N__ENABLE == 0) ? DST_RCDISC2N__IN0 : DST_RCDISC2N__IN1); @@ -1409,7 +1409,7 @@ static DISCRETE_STEP(dst_rcdisc2N) static DISCRETE_RESET(dst_rcdisc2N) { - struct dss_rcdisc2_context *context = node->context; + struct dss_rcdisc2_context *context = (struct dss_rcdisc2_context *)node->context; double f1,f2; f1 = 1.0 / (2 * M_PI * DST_RCDISC2N__R0 * DST_RCDISC2N__C); diff --git a/src/emu/sound/disc_inp.c b/src/emu/sound/disc_inp.c index 18a0be48a11..94764d181f9 100644 --- a/src/emu/sound/disc_inp.c +++ b/src/emu/sound/disc_inp.c @@ -49,7 +49,7 @@ READ8_DEVICE_HANDLER(discrete_sound_r) /* Read the node input value if allowed */ if (node) { - UINT8 *node_data = node->context; + UINT8 *node_data = (UINT8 *)node->context; /* Bring the system up to now */ stream_update(info->discrete_stream); @@ -73,7 +73,7 @@ WRITE8_DEVICE_HANDLER(discrete_sound_w) /* Update the node input value if it's a proper input node */ if (node) { - UINT8 *node_data = node->context; + UINT8 *node_data = (UINT8 *)node->context; UINT8 last_data = *node_data; UINT8 new_data = 0; @@ -129,7 +129,7 @@ WRITE8_DEVICE_HANDLER(discrete_sound_w) static DISCRETE_STEP(dss_adjustment) { - struct dss_adjustment_context *context = node->context; + struct dss_adjustment_context *context = (struct dss_adjustment_context *)node->context; INT32 rawportval = input_port_read_direct(context->port); @@ -149,13 +149,13 @@ static DISCRETE_STEP(dss_adjustment) static DISCRETE_RESET(dss_adjustment) { - struct dss_adjustment_context *context = node->context; + struct dss_adjustment_context *context = (struct dss_adjustment_context *)node->context; double min, max; if (node->custom) { - context->port = input_port_by_tag(device->machine->portconfig, node->custom); + context->port = input_port_by_tag(device->machine->portconfig, (const char *)node->custom); if (context->port == NULL) fatalerror("DISCRETE_ADJUSTMENT_TAG - NODE_%d has invalid tag", node->node-NODE_00); } @@ -214,7 +214,7 @@ static DISCRETE_RESET(dss_constant) ************************************************************************/ static DISCRETE_RESET(dss_input) { - UINT8 *node_data = node->context; + UINT8 *node_data = (UINT8 *)node->context; switch (node->module.type) { @@ -234,7 +234,7 @@ static DISCRETE_RESET(dss_input) static DISCRETE_STEP(dss_input_pulse) { - UINT8 *node_data = node->context; + UINT8 *node_data = (UINT8 *)node->context; /* Set a valid output */ node->output[0] = *node_data; @@ -260,7 +260,7 @@ static DISCRETE_STEP(dss_input_pulse) static DISCRETE_STEP(dss_input_stream) { /* the context pointer is set to point to the current input stream data in discrete_stream_update */ - stream_sample_t **ptr = node->context; + stream_sample_t **ptr = (stream_sample_t **)node->context; stream_sample_t *data = *ptr; node->output[0] = data ? (*data) * DSS_INPUT_STREAM__GAIN + DSS_INPUT_STREAM__OFFSET : 0; diff --git a/src/emu/sound/disc_mth.c b/src/emu/sound/disc_mth.c index 45ff4fc1941..244f3ea09c2 100644 --- a/src/emu/sound/disc_mth.c +++ b/src/emu/sound/disc_mth.c @@ -205,7 +205,7 @@ static DISCRETE_STEP(dst_adder) static DISCRETE_STEP(dst_comp_adder) { - struct dst_comp_adder_context *context = node->context; + struct dst_comp_adder_context *context = (struct dst_comp_adder_context *)node->context; int select; select = (int)DST_COMP_ADDER__SELECT; @@ -215,8 +215,8 @@ static DISCRETE_STEP(dst_comp_adder) static DISCRETE_RESET(dst_comp_adder) { - const discrete_comp_adder_table *info = node->custom; - struct dst_comp_adder_context *context = node->context; + const discrete_comp_adder_table *info = (const discrete_comp_adder_table *)node->custom; + struct dst_comp_adder_context *context = (struct dst_comp_adder_context *)node->context; int i, bit; int length = 1 << info->length; @@ -298,8 +298,8 @@ static DISCRETE_STEP(dst_clamp) static DISCRETE_STEP(dst_dac_r1) { - const discrete_dac_r1_ladder *info = node->custom; - struct dst_dac_r1_context *context = node->context; + const discrete_dac_r1_ladder *info = (const discrete_dac_r1_ladder *)node->custom; + struct dst_dac_r1_context *context = (struct dst_dac_r1_context *)node->context; int bit, bit_val, data; double v, i_bit, i_total, x_time; @@ -355,8 +355,8 @@ static DISCRETE_STEP(dst_dac_r1) static DISCRETE_RESET(dst_dac_r1) { - const discrete_dac_r1_ladder *info = node->custom; - struct dst_dac_r1_context *context = node->context; + const discrete_dac_r1_ladder *info = (const discrete_dac_r1_ladder *)node->custom; + struct dst_dac_r1_context *context = (struct dst_dac_r1_context *)node->context; int bit; @@ -420,7 +420,7 @@ static DISCRETE_RESET(dst_dac_r1) static DISCRETE_STEP(dst_diode_mix) { - struct dst_diode_mix__context *context = node->context; + struct dst_diode_mix__context *context = (struct dst_diode_mix__context *)node->context; double val, max = 0; int addr; @@ -436,8 +436,8 @@ static DISCRETE_STEP(dst_diode_mix) static DISCRETE_RESET(dst_diode_mix) { - const double *info = node->custom; - struct dst_diode_mix__context *context = node->context; + const double *info = (const double *)node->custom; + struct dst_diode_mix__context *context = (struct dst_diode_mix__context *)node->context; int addr; @@ -574,8 +574,8 @@ static int dst_trigger_function(int trig0, int trig1, int trig2, int function) static DISCRETE_STEP(dst_integrate) { - const discrete_integrate_info *info = node->custom; - struct dst_integrate_context *context = node->context; + const discrete_integrate_info *info = (const discrete_integrate_info *)node->custom; + struct dst_integrate_context *context = (struct dst_integrate_context *)node->context; int trig0, trig1; double i_neg = 0; /* current into - input */ @@ -619,8 +619,8 @@ static DISCRETE_STEP(dst_integrate) static DISCRETE_RESET(dst_integrate) { - const discrete_integrate_info *info = node->custom; - struct dst_integrate_context *context = node->context; + const discrete_integrate_info *info = (const discrete_integrate_info *)node->custom; + struct dst_integrate_context *context = (struct dst_integrate_context *)node->context; double i, v; if (info->type & DISC_OP_AMP_IS_NORTON) @@ -851,7 +851,7 @@ static DISCRETE_STEP(dst_logic_nxor) static DISCRETE_STEP(dst_logic_dff) { - struct dst_flipflop_context *context = node->context; + struct dst_flipflop_context *context = (struct dst_flipflop_context *)node->context; int clk = (int)DST_LOGIC_DFF__CLOCK; @@ -873,7 +873,7 @@ static DISCRETE_STEP(dst_logic_dff) static DISCRETE_RESET(dst_logic_ff) { - struct dst_flipflop_context *context = node->context; + struct dst_flipflop_context *context = (struct dst_flipflop_context *)node->context; context->last_clk = 0; node->output[0] = 0; @@ -901,7 +901,7 @@ static DISCRETE_RESET(dst_logic_ff) static DISCRETE_STEP(dst_logic_jkff) { - struct dst_flipflop_context *context = node->context; + struct dst_flipflop_context *context = (struct dst_flipflop_context *)node->context; int clk = (int)DST_LOGIC_JKFF__CLOCK; int j = (int)DST_LOGIC_JKFF__J; @@ -959,7 +959,7 @@ static DISCRETE_STEP(dst_logic_jkff) static DISCRETE_STEP(dst_lookup_table) { - const double *table = node->custom; + const double *table = (const double *)node->custom; int addr = DST_LOOKUP_TABLE__IN; @@ -1025,8 +1025,8 @@ static DISCRETE_STEP(dst_lookup_table) static DISCRETE_STEP(dst_mixer) { - const discrete_mixer_desc *info = node->custom; - struct dst_mixer_context *context = node->context; + const discrete_mixer_desc *info = (const discrete_mixer_desc *)node->custom; + struct dst_mixer_context *context = (struct dst_mixer_context *)node->context; double v, vTemp, r_total, rTemp, rTemp2 = 0; double i = 0; /* total current of inputs */ @@ -1168,8 +1168,8 @@ static DISCRETE_STEP(dst_mixer) static DISCRETE_RESET(dst_mixer) { - const discrete_mixer_desc *info = node->custom; - struct dst_mixer_context *context = node->context; + const discrete_mixer_desc *info = (const discrete_mixer_desc *)node->custom; + struct dst_mixer_context *context = (struct dst_mixer_context *)node->context; node_description *r_node; int bit; @@ -1292,7 +1292,7 @@ static DISCRETE_RESET(dst_mixer) static DISCRETE_STEP(dst_multiplex) { - struct dst_size_context *context = node->context; + struct dst_size_context *context = (struct dst_size_context *)node->context; int addr; @@ -1317,7 +1317,7 @@ static DISCRETE_STEP(dst_multiplex) static DISCRETE_RESET(dst_multiplex) { - struct dst_size_context *context = node->context; + struct dst_size_context *context = (struct dst_size_context *)node->context; context->size = node->active_inputs - 2; @@ -1345,7 +1345,7 @@ static DISCRETE_RESET(dst_multiplex) static DISCRETE_STEP(dst_oneshot) { - struct dst_oneshot_context *context = node->context; + struct dst_oneshot_context *context = (struct dst_oneshot_context *)node->context; int trigger = (DST_ONESHOT__TRIG != 0); @@ -1405,7 +1405,7 @@ static DISCRETE_STEP(dst_oneshot) static DISCRETE_RESET(dst_oneshot) { - struct dst_oneshot_context *context = node->context; + struct dst_oneshot_context *context = (struct dst_oneshot_context *)node->context; context->countdown = 0; context->state = 0; @@ -1436,7 +1436,7 @@ static DISCRETE_RESET(dst_oneshot) static DISCRETE_STEP(dst_ramp) { - struct dss_ramp_context *context = node->context; + struct dss_ramp_context *context = (struct dss_ramp_context *)node->context; if(DST_RAMP__ENABLE) { @@ -1463,7 +1463,7 @@ static DISCRETE_STEP(dst_ramp) static DISCRETE_RESET(dst_ramp) { - struct dss_ramp_context *context = node->context; + struct dss_ramp_context *context = (struct dss_ramp_context *)node->context; node->output[0] = DST_RAMP__CLAMP; context->step = DST_RAMP__GRAD / discrete_current_context->sample_rate; @@ -1489,7 +1489,7 @@ static DISCRETE_RESET(dst_ramp) static DISCRETE_STEP(dst_samphold) { - struct dst_samphold_context *context = node->context; + struct dst_samphold_context *context = (struct dst_samphold_context *)node->context; if(DST_SAMPHOLD__ENABLE) { @@ -1526,7 +1526,7 @@ static DISCRETE_STEP(dst_samphold) static DISCRETE_RESET(dst_samphold) { - struct dst_samphold_context *context = node->context; + struct dst_samphold_context *context = (struct dst_samphold_context *)node->context; node->output[0] = 0; context->last_input = -1; @@ -1632,7 +1632,7 @@ static DISCRETE_STEP(dst_transform) double number1,top; int trans_stack_ptr = 0; - const char *fPTR = node->custom; + const char *fPTR = (const char *)node->custom; node->output[0] = 0; top = HUGE_VAL; @@ -1738,8 +1738,8 @@ static DISCRETE_STEP(dst_transform) static DISCRETE_STEP(dst_op_amp) { - const discrete_op_amp_info *info = node->custom; - struct dst_op_amp_context *context = node->context; + const discrete_op_amp_info *info = (const discrete_op_amp_info *)node->custom; + struct dst_op_amp_context *context = (struct dst_op_amp_context *)node->context; double i_pos = 0; double i_neg = 0; @@ -1798,8 +1798,8 @@ static DISCRETE_STEP(dst_op_amp) static DISCRETE_RESET(dst_op_amp) { - const discrete_op_amp_info *info = node->custom; - struct dst_op_amp_context *context = node->context; + const discrete_op_amp_info *info = (const discrete_op_amp_info *)node->custom; + struct dst_op_amp_context *context = (struct dst_op_amp_context *)node->context; context->has_r1 = info->r1 > 0; context->has_r4 = info->r4 > 0; @@ -1840,8 +1840,8 @@ static DISCRETE_RESET(dst_op_amp) static DISCRETE_STEP(dst_op_amp_1sht) { - const discrete_op_amp_1sht_info *info = node->custom; - struct dst_op_amp_1sht_context *context = node->context; + const discrete_op_amp_1sht_info *info = (const discrete_op_amp_1sht_info *)node->custom; + struct dst_op_amp_1sht_context *context = (struct dst_op_amp_1sht_context *)node->context; double i_pos; double i_neg; @@ -1880,8 +1880,8 @@ static DISCRETE_STEP(dst_op_amp_1sht) static DISCRETE_RESET(dst_op_amp_1sht) { - const discrete_op_amp_1sht_info *info = node->custom; - struct dst_op_amp_1sht_context *context = node->context; + const discrete_op_amp_1sht_info *info = (const discrete_op_amp_1sht_info *)node->custom; + struct dst_op_amp_1sht_context *context = (struct dst_op_amp_1sht_context *)node->context; context->exponent1c = RC_CHARGE_EXP(RES_2_PARALLEL(info->r3, info->r4) * info->c1); context->exponent1d = RC_CHARGE_EXP(info->r4 * info->c1); @@ -1915,8 +1915,8 @@ static DISCRETE_RESET(dst_op_amp_1sht) static DISCRETE_STEP(dst_tvca_op_amp) { - const discrete_op_amp_tvca_info *info = node->custom; - struct dst_tvca_op_amp_context *context = node->context; + const discrete_op_amp_tvca_info *info = (const discrete_op_amp_tvca_info *)node->custom; + struct dst_tvca_op_amp_context *context = (struct dst_tvca_op_amp_context *)node->context; int trig0, trig1, trig2, f3; double i2 = 0; /* current through r2 */ @@ -1995,8 +1995,8 @@ static DISCRETE_STEP(dst_tvca_op_amp) static DISCRETE_RESET(dst_tvca_op_amp) { - const discrete_op_amp_tvca_info *info = node->custom; - struct dst_tvca_op_amp_context *context = node->context; + const discrete_op_amp_tvca_info *info = (const discrete_op_amp_tvca_info *)node->custom; + struct dst_tvca_op_amp_context *context = (struct dst_tvca_op_amp_context *)node->context; context->r67 = info->r6 + info->r7; diff --git a/src/emu/sound/disc_wav.c b/src/emu/sound/disc_wav.c index 9ac0f488a03..4b90113c316 100644 --- a/src/emu/sound/disc_wav.c +++ b/src/emu/sound/disc_wav.c @@ -183,7 +183,7 @@ static const int disc_7492_count[6] = {0x00, 0x01, 0x02, 0x04, 0x05, 0x06}; static DISCRETE_STEP(dss_counter) { - struct dss_counter_context *context = node->context; + struct dss_counter_context *context = (struct dss_counter_context *)node->context; double cycles; int clock = 0, last_count, inc = 0; int max; @@ -282,7 +282,7 @@ static DISCRETE_STEP(dss_counter) static DISCRETE_RESET(dss_counter) { - struct dss_counter_context *context = node->context; + struct dss_counter_context *context = (struct dss_counter_context *)node->context; if ((int)DSS_COUNTER__CLOCK_TYPE & DISC_COUNTER_IS_7492) { @@ -393,8 +393,8 @@ static DISCRETE_RESET(dss_lfsr); static DISCRETE_STEP(dss_lfsr) { - const discrete_lfsr_desc *lfsr_desc = node->custom; - struct dss_lfsr_context *context = node->context; + const discrete_lfsr_desc *lfsr_desc = (const discrete_lfsr_desc *)node->custom; + struct dss_lfsr_context *context = (struct dss_lfsr_context *)node->context; double cycles; int clock, inc = 0; int fb0, fb1, fbresult; @@ -483,8 +483,8 @@ static DISCRETE_STEP(dss_lfsr) static DISCRETE_RESET(dss_lfsr) { - const discrete_lfsr_desc *lfsr_desc = node->custom; - struct dss_lfsr_context *context = node->context; + const discrete_lfsr_desc *lfsr_desc = (const discrete_lfsr_desc *)node->custom; + struct dss_lfsr_context *context = (struct dss_lfsr_context *)node->context; int fb0 , fb1, fbresult; context->reset_on_high = (lfsr_desc->flags & DISC_LFSR_FLAG_RESET_TYPE_H) ? 1 : 0; @@ -537,7 +537,7 @@ static DISCRETE_RESET(dss_lfsr) static DISCRETE_STEP(dss_noise) { - struct dss_noise_context *context = node->context; + struct dss_noise_context *context = (struct dss_noise_context *)node->context; if(DSS_NOISE__ENABLE) { @@ -574,7 +574,7 @@ static DISCRETE_STEP(dss_noise) static DISCRETE_RESET(dss_noise) { - struct dss_noise_context *context = node->context; + struct dss_noise_context *context = (struct dss_noise_context *)node->context; context->phase=0; DISCRETE_STEP_CALL( dss_noise ); @@ -603,7 +603,7 @@ static DISCRETE_RESET(dss_noise) static DISCRETE_STEP(dss_note) { - struct dss_note_context *context = node->context; + struct dss_note_context *context = (struct dss_note_context *)node->context; double cycles; int clock = 0, last_count2, inc = 0; @@ -693,7 +693,7 @@ static DISCRETE_STEP(dss_note) static DISCRETE_RESET(dss_note) { - struct dss_note_context *context = node->context; + struct dss_note_context *context = (struct dss_note_context *)node->context; context->clock_type = (int)DSS_NOTE__CLOCK_TYPE & DISC_CLK_MASK; context->out_type = (int)DSS_NOTE__CLOCK_TYPE & DISC_OUT_MASK; @@ -732,8 +732,8 @@ static DISCRETE_RESET(dss_note) static DISCRETE_STEP(dss_op_amp_osc) { - const discrete_op_amp_osc_info *info = node->custom; - struct dss_op_amp_osc_context *context = node->context; + const discrete_op_amp_osc_info *info = (const discrete_op_amp_osc_info *)node->custom; + struct dss_op_amp_osc_context *context = (struct dss_op_amp_osc_context *)node->context; double i; /* Charging current created by vIn */ @@ -905,8 +905,8 @@ static DISCRETE_STEP(dss_op_amp_osc) static DISCRETE_RESET(dss_op_amp_osc) { - const discrete_op_amp_osc_info *info = node->custom; - struct dss_op_amp_osc_context *context = node->context; + const discrete_op_amp_osc_info *info = (const discrete_op_amp_osc_info *)node->custom; + struct dss_op_amp_osc_context *context = (struct dss_op_amp_osc_context *)node->context; const double *r_info_ptr; const double **r_context_ptr; int loop; @@ -1048,7 +1048,7 @@ static DISCRETE_RESET(dss_op_amp_osc) static DISCRETE_STEP(dss_sawtoothwave) { - struct dss_sawtoothwave_context *context = node->context; + struct dss_sawtoothwave_context *context = (struct dss_sawtoothwave_context *)node->context; if(DSS_SAWTOOTHWAVE__ENABLE) { @@ -1074,7 +1074,7 @@ static DISCRETE_STEP(dss_sawtoothwave) static DISCRETE_RESET(dss_sawtoothwave) { - struct dss_sawtoothwave_context *context = node->context; + struct dss_sawtoothwave_context *context = (struct dss_sawtoothwave_context *)node->context; double start; /* Establish starting phase, convert from degrees to radians */ @@ -1108,8 +1108,8 @@ static DISCRETE_RESET(dss_sawtoothwave) static DISCRETE_STEP(dss_schmitt_osc) { - const discrete_schmitt_osc_desc *info = node->custom; - struct dss_schmitt_osc_context *context = node->context; + const discrete_schmitt_osc_desc *info = (const discrete_schmitt_osc_desc *)node->custom; + struct dss_schmitt_osc_context *context = (struct dss_schmitt_osc_context *)node->context; double supply, v_cap, new_vCap, t, exponent; @@ -1182,8 +1182,8 @@ static DISCRETE_STEP(dss_schmitt_osc) static DISCRETE_RESET(dss_schmitt_osc) { - const discrete_schmitt_osc_desc *info = node->custom; - struct dss_schmitt_osc_context *context = node->context; + const discrete_schmitt_osc_desc *info = (const discrete_schmitt_osc_desc *)node->custom; + struct dss_schmitt_osc_context *context = (struct dss_schmitt_osc_context *)node->context; double rSource; context->enable_type = info->options & DISC_SCHMITT_OSC_ENAB_MASK; @@ -1227,7 +1227,7 @@ static DISCRETE_RESET(dss_schmitt_osc) static DISCRETE_STEP(dss_sinewave) { - struct dss_sinewave_context *context = node->context; + struct dss_sinewave_context *context = (struct dss_sinewave_context *)node->context; /* Set the output */ if(DSS_SINEWAVE__ENABLE) @@ -1253,7 +1253,7 @@ static DISCRETE_STEP(dss_sinewave) static DISCRETE_RESET(dss_sinewave) { - struct dss_sinewave_context *context = node->context; + struct dss_sinewave_context *context = (struct dss_sinewave_context *)node->context; double start; /* Establish starting phase, convert from degrees to radians */ @@ -1286,7 +1286,7 @@ static DISCRETE_RESET(dss_sinewave) static DISCRETE_STEP(dss_squarewave) { - struct dss_squarewave_context *context = node->context; + struct dss_squarewave_context *context = (struct dss_squarewave_context *)node->context; /* Establish trigger phase from duty */ context->trigger=((100-DSS_SQUAREWAVE__DUTY)/100)*(2.0*M_PI); @@ -1319,7 +1319,7 @@ static DISCRETE_STEP(dss_squarewave) static DISCRETE_RESET(dss_squarewave) { - struct dss_squarewave_context *context = node->context; + struct dss_squarewave_context *context = (struct dss_squarewave_context *)node->context; double start; /* Establish starting phase, convert from degrees to radians */ @@ -1352,7 +1352,7 @@ static DISCRETE_RESET(dss_squarewave) static DISCRETE_STEP(dss_squarewfix) { - struct dss_squarewfix_context *context = node->context; + struct dss_squarewfix_context *context = (struct dss_squarewfix_context *)node->context; context->t_left -= context->sample_step; @@ -1381,7 +1381,7 @@ static DISCRETE_STEP(dss_squarewfix) static DISCRETE_RESET(dss_squarewfix) { - struct dss_squarewfix_context *context = node->context; + struct dss_squarewfix_context *context = (struct dss_squarewfix_context *)node->context; context->sample_step = 1.0 / discrete_current_context->sample_rate; context->flip_flop = 1; @@ -1430,7 +1430,7 @@ static DISCRETE_RESET(dss_squarewfix) static DISCRETE_STEP(dss_squarewave2) { - struct dss_squarewave_context *context = node->context; + struct dss_squarewave_context *context = (struct dss_squarewave_context *)node->context; double newphase; if(DSS_SQUAREWAVE2__ENABLE) @@ -1465,7 +1465,7 @@ static DISCRETE_STEP(dss_squarewave2) static DISCRETE_RESET(dss_squarewave2) { - struct dss_squarewave_context *context = node->context; + struct dss_squarewave_context *context = (struct dss_squarewave_context *)node->context; double start; /* Establish starting phase, convert from degrees to radians */ @@ -1501,8 +1501,8 @@ static DISCRETE_RESET(dss_squarewave2) INLINE double dss_inverter_tftab(node_description *node, double x) { - const discrete_inverter_osc_desc *info = node->custom; - struct dss_inverter_osc_context *context = node->context; + const discrete_inverter_osc_desc *info = (const discrete_inverter_osc_desc *)node->custom; + struct dss_inverter_osc_context *context = (struct dss_inverter_osc_context *)node->context; x = x / info->vB; if (x > 0) @@ -1513,8 +1513,8 @@ INLINE double dss_inverter_tftab(node_description *node, double x) INLINE double dss_inverter_tf(node_description *node, double x) { - const discrete_inverter_osc_desc *info = node->custom; - struct dss_inverter_osc_context *context = node->context; + const discrete_inverter_osc_desc *info = (const discrete_inverter_osc_desc *)node->custom; + struct dss_inverter_osc_context *context = (struct dss_inverter_osc_context *)node->context; if (x < 0.0) return info->vB; @@ -1526,8 +1526,8 @@ INLINE double dss_inverter_tf(node_description *node, double x) static DISCRETE_STEP(dss_inverter_osc) { - struct dss_inverter_osc_context *context = node->context; - const discrete_inverter_osc_desc *info = node->custom; + struct dss_inverter_osc_context *context = (struct dss_inverter_osc_context *)node->context; + const discrete_inverter_osc_desc *info = (const discrete_inverter_osc_desc *)node->custom; double diff, vG1, vG2, vG3, vI; double vMix, rMix; @@ -1633,8 +1633,8 @@ static DISCRETE_STEP(dss_inverter_osc) static DISCRETE_RESET(dss_inverter_osc) { - struct dss_inverter_osc_context *context = node->context; - const discrete_inverter_osc_desc *info = node->custom; + struct dss_inverter_osc_context *context = (struct dss_inverter_osc_context *)node->context; + const discrete_inverter_osc_desc *info = (const discrete_inverter_osc_desc *)node->custom; int i; @@ -1677,7 +1677,7 @@ static DISCRETE_RESET(dss_inverter_osc) static DISCRETE_STEP(dss_trianglewave) { - struct dss_trianglewave_context *context = node->context; + struct dss_trianglewave_context *context = (struct dss_trianglewave_context *)node->context; if(DSS_TRIANGLEWAVE__ENABLE) { @@ -1704,7 +1704,7 @@ static DISCRETE_STEP(dss_trianglewave) static DISCRETE_RESET(dss_trianglewave) { - struct dss_trianglewave_context *context = node->context; + struct dss_trianglewave_context *context = (struct dss_trianglewave_context *)node->context; double start; /* Establish starting phase, convert from degrees to radians */ diff --git a/src/emu/sound/discrete.c b/src/emu/sound/discrete.c index 60dd17191f4..f71bb6b0ccd 100644 --- a/src/emu/sound/discrete.c +++ b/src/emu/sound/discrete.c @@ -232,7 +232,7 @@ static const discrete_module module_list[] = node_description *discrete_find_node(void *chip, int node) { - discrete_info *info = chip ? chip : discrete_current_context; + discrete_info *info = chip ? (discrete_info *)chip : discrete_current_context; if (node < NODE_START || node > NODE_END) return NULL; return info->indexed_node[NODE_INDEX(node)]; } @@ -248,7 +248,7 @@ node_description *discrete_find_node(void *chip, int node) static DEVICE_START( discrete ) { discrete_sound_block *intf = (discrete_sound_block *)device->static_config; - discrete_info *info = device->token; + discrete_info *info = get_safe_token(device); char name[32]; info->device = device; @@ -292,15 +292,15 @@ static DEVICE_START( discrete ) discrete_log("discrete_start() - Sanity check counted %d nodes", info->node_count); /* allocate memory for the array of actual nodes */ - info->node_list = auto_malloc(info->node_count * sizeof(info->node_list[0])); + info->node_list = (node_description *)auto_malloc(info->node_count * sizeof(info->node_list[0])); memset(info->node_list, 0, info->node_count * sizeof(info->node_list[0])); /* allocate memory for the node execution order array */ - info->running_order = auto_malloc(info->node_count * sizeof(info->running_order[0])); + info->running_order = (node_description **)auto_malloc(info->node_count * sizeof(info->running_order[0])); memset(info->running_order, 0, info->node_count * sizeof(info->running_order[0])); /* allocate memory to hold pointers to nodes by index */ - info->indexed_node = auto_malloc(DISCRETE_MAX_NODES * sizeof(info->indexed_node[0])); + info->indexed_node = (node_description **)auto_malloc(DISCRETE_MAX_NODES * sizeof(info->indexed_node[0])); memset(info->indexed_node, 0, DISCRETE_MAX_NODES * sizeof(info->indexed_node[0])); /* initialize the node data */ @@ -327,7 +327,7 @@ static DEVICE_START( discrete ) static DEVICE_STOP( discrete ) { - discrete_info *info = device->token; + discrete_info *info = get_safe_token(device); int log_num; #if (DISCRETE_PROFILING) @@ -387,7 +387,7 @@ static DEVICE_STOP( discrete ) static DEVICE_RESET( discrete ) { - discrete_info *info = device->token; + discrete_info *info = get_safe_token(device); int nodenum; discrete_current_context = info; @@ -421,7 +421,7 @@ static DEVICE_RESET( discrete ) static STREAM_UPDATE( discrete_stream_update ) { - discrete_info *info = param; + discrete_info *info = (discrete_info *)param; int samplenum, nodenum, outputnum; double val; INT16 wave_data_l, wave_data_r; @@ -596,7 +596,7 @@ static void init_nodes(discrete_info *info, discrete_sound_block *block_list, co /* setup module if custom */ if (block->type == DST_CUSTOM) { - const discrete_custom_info *custom = node->custom; + const discrete_custom_info *custom = (const discrete_custom_info *)node->custom; node->module.reset = custom->reset; node->module.step = custom->step; node->module.contextsize = custom->contextsize; diff --git a/src/emu/sound/dmadac.c b/src/emu/sound/dmadac.c index 33598a73065..1e0e64b068e 100644 --- a/src/emu/sound/dmadac.c +++ b/src/emu/sound/dmadac.c @@ -74,7 +74,7 @@ INLINE dmadac_state *get_safe_token(const device_config *device) static STREAM_UPDATE( dmadac_update ) { - dmadac_state *ch = param; + dmadac_state *ch = (dmadac_state *)param; stream_sample_t *output = outputs[0]; INT16 *source = ch->buffer; UINT32 curout = ch->bufout; @@ -103,10 +103,10 @@ static STREAM_UPDATE( dmadac_update ) static DEVICE_START( dmadac ) { - dmadac_state *info = device->token; + dmadac_state *info = get_safe_token(device); /* allocate a clear a buffer */ - info->buffer = auto_malloc(sizeof(info->buffer[0]) * BUFFER_SIZE); + info->buffer = (INT16 *)auto_malloc(sizeof(info->buffer[0]) * BUFFER_SIZE); memset(info->buffer, 0, sizeof(info->buffer[0]) * BUFFER_SIZE); /* reset the state */ diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c index 76f31fa54be..2ea4d7b5c53 100644 --- a/src/emu/sound/es5503.c +++ b/src/emu/sound/es5503.c @@ -143,7 +143,7 @@ static void es5503_halt_osc(ES5503Chip *chip, int onum, int type, UINT32 *accumu static TIMER_CALLBACK( es5503_timer_cb ) { - ES5503Osc *osc = ptr; + ES5503Osc *osc = (ES5503Osc *)ptr; ES5503Chip *chip = (ES5503Chip *)osc->chip; stream_update(chip->stream); @@ -155,7 +155,7 @@ static STREAM_UPDATE( es5503_pcm_update ) INT32 *mixp; int osc, snum, i; UINT32 ramptr; - ES5503Chip *chip = param; + ES5503Chip *chip = (ES5503Chip *)param; memset(mix, 0, sizeof(mix)); @@ -238,7 +238,7 @@ static DEVICE_START( es5503 ) int osc; ES5503Chip *chip = get_safe_token(device); - intf = device->static_config; + intf = (const es5503_interface *)device->static_config; chip->irq_callback = intf->irq_callback; chip->adc_read = intf->adc_read; diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c index 557ea92df6d..a3948c479b3 100644 --- a/src/emu/sound/es5506.c +++ b/src/emu/sound/es5506.c @@ -194,7 +194,7 @@ static void compute_tables(es5506_state *chip) int i; /* allocate ulaw lookup table */ - chip->ulaw_lookup = auto_malloc(sizeof(chip->ulaw_lookup[0]) << ULAW_MAXBITS); + chip->ulaw_lookup = (INT16 *)auto_malloc(sizeof(chip->ulaw_lookup[0]) << ULAW_MAXBITS); /* generate ulaw lookup table */ for (i = 0; i < (1 << ULAW_MAXBITS); i++) @@ -213,7 +213,7 @@ static void compute_tables(es5506_state *chip) } /* allocate volume lookup table */ - chip->volume_lookup = auto_malloc(sizeof(chip->volume_lookup[0]) * 4096); + chip->volume_lookup = (UINT16 *)auto_malloc(sizeof(chip->volume_lookup[0]) * 4096); /* generate ulaw lookup table */ for (i = 0; i < 4096; i++) @@ -781,7 +781,7 @@ logerror("IRQ raised on voice %d!!\n",v); static STREAM_UPDATE( es5506_update ) { - es5506_state *chip = param; + es5506_state *chip = (es5506_state *)param; INT32 *lsrc = chip->scratch, *rsrc = chip->scratch; stream_sample_t *ldest = outputs[0]; stream_sample_t *rdest = outputs[1]; @@ -833,7 +833,7 @@ static STREAM_UPDATE( es5506_update ) static void es5506_start_common(const device_config *device, const void *config, sound_type sndtype) { - const es5506_interface *intf = config; + const es5506_interface *intf = (const es5506_interface *)config; es5506_state *chip = get_safe_token(device); int j; UINT32 accum_mask; @@ -873,7 +873,7 @@ static void es5506_start_common(const device_config *device, const void *config, } /* allocate memory */ - chip->scratch = auto_malloc(sizeof(chip->scratch[0]) * 2 * MAX_SAMPLE_CHUNK); + chip->scratch = (INT32 *)auto_malloc(sizeof(chip->scratch[0]) * 2 * MAX_SAMPLE_CHUNK); /* success */ } @@ -1446,7 +1446,7 @@ void es5506_voice_bank_w(const device_config *device, int voice, int bank) static DEVICE_START( es5505 ) { - const es5505_interface *intf = device->static_config; + const es5505_interface *intf = (const es5505_interface *)device->static_config; es5506_interface es5506intf; memset(&es5506intf, 0, sizeof(es5506intf)); diff --git a/src/emu/sound/es8712.c b/src/emu/sound/es8712.c index a21247a1251..8142aea0e29 100644 --- a/src/emu/sound/es8712.c +++ b/src/emu/sound/es8712.c @@ -179,7 +179,7 @@ static void generate_adpcm(es8712_state *chip, stream_sample_t *buffer, int samp static STREAM_UPDATE( es8712_update ) { stream_sample_t *buffer = outputs[0]; - es8712_state *chip = param; + es8712_state *chip = (es8712_state *)param; /* generate them into our buffer */ generate_adpcm(chip, buffer, samples); @@ -220,7 +220,7 @@ static void es8712_state_save_register(es8712_state *chip, const device_config * static DEVICE_START( es8712 ) { - es8712_state *chip = device->token; + es8712_state *chip = get_safe_token(device); compute_tables(); @@ -250,7 +250,7 @@ static DEVICE_START( es8712 ) static DEVICE_RESET( es8712 ) { - es8712_state *chip = device->token; + es8712_state *chip = get_safe_token(device); if (chip->playing) { @@ -270,7 +270,7 @@ static DEVICE_RESET( es8712 ) void es8712_set_bank_base(const device_config *device, int base) { - es8712_state *chip = device->token; + es8712_state *chip = get_safe_token(device); stream_update(chip->stream); chip->bank_offset = base; } @@ -284,7 +284,7 @@ void es8712_set_bank_base(const device_config *device, int base) void es8712_set_frequency(const device_config *device, int frequency) { - es8712_state *chip = device->token; + es8712_state *chip = get_safe_token(device); /* update the stream and set the new base */ stream_update(chip->stream); diff --git a/src/emu/sound/fm.c b/src/emu/sound/fm.c index cf51deb3890..972298c90a8 100644 --- a/src/emu/sound/fm.c +++ b/src/emu/sound/fm.c @@ -1739,9 +1739,9 @@ static int init_tables(void) /* we never reach zero here due to ((i*2)+1) */ if (m>0.0) - o = 8*log(1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(1.0/m)/log(2.0); /* convert to 'decibels' */ else - o = 8*log(-1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(-1.0/m)/log(2.0); /* convert to 'decibels' */ o = o / (ENV_STEP/4); @@ -2260,7 +2260,7 @@ typedef struct /* Generate samples for one of the YM2203s */ void ym2203_update_one(void *chip, FMSAMPLE *buffer, int length) { - YM2203 *F2203 = chip; + YM2203 *F2203 = (YM2203 *)chip; FM_OPN *OPN = &F2203->OPN; int i; FMSAMPLE *buf = buffer; @@ -2344,7 +2344,7 @@ void ym2203_update_one(void *chip, FMSAMPLE *buffer, int length) void ym2203_reset_chip(void *chip) { int i; - YM2203 *F2203 = chip; + YM2203 *F2203 = (YM2203 *)chip; FM_OPN *OPN = &F2203->OPN; /* Reset Prescaler */ @@ -2454,7 +2454,7 @@ void * ym2203_init(void *param, const device_config *device, int clock, int rate /* shut down emulator */ void ym2203_shutdown(void *chip) { - YM2203 *FM2203 = chip; + YM2203 *FM2203 = (YM2203 *)chip; FMCloseTable(); free(FM2203); @@ -2463,7 +2463,7 @@ void ym2203_shutdown(void *chip) /* YM2203 I/O interface */ int ym2203_write(void *chip,int a,UINT8 v) { - YM2203 *F2203 = chip; + YM2203 *F2203 = (YM2203 *)chip; FM_OPN *OPN = &F2203->OPN; if( !(a&1) ) @@ -2504,7 +2504,7 @@ int ym2203_write(void *chip,int a,UINT8 v) UINT8 ym2203_read(void *chip,int a) { - YM2203 *F2203 = chip; + YM2203 *F2203 = (YM2203 *)chip; int addr = F2203->OPN.ST.address; UINT8 ret = 0; @@ -2521,7 +2521,7 @@ UINT8 ym2203_read(void *chip,int a) int ym2203_timer_over(void *chip,int c) { - YM2203 *F2203 = chip; + YM2203 *F2203 = (YM2203 *)chip; if( c ) { /* Timer B */ @@ -3427,7 +3427,7 @@ INLINE void YM2608IRQMaskWrite(FM_OPN *OPN, YM2608 *F2608, int v) /* Generate samples for one of the YM2608s */ void ym2608_update_one(void *chip, FMSAMPLE **buffer, int length) { - YM2608 *F2608 = chip; + YM2608 *F2608 = (YM2608 *)chip; FM_OPN *OPN = &F2608->OPN; YM_DELTAT *DELTAT = &F2608->deltaT; int i,j; @@ -3630,12 +3630,12 @@ static void YM2608_save_state(YM2608 *F2608, const device_config *device) static void YM2608_deltat_status_set(void *chip, UINT8 changebits) { - YM2608 *F2608 = chip; + YM2608 *F2608 = (YM2608 *)chip; FM_STATUS_SET(&(F2608->OPN.ST), changebits); } static void YM2608_deltat_status_reset(void *chip, UINT8 changebits) { - YM2608 *F2608 = chip; + YM2608 *F2608 = (YM2608 *)chip; FM_STATUS_RESET(&(F2608->OPN.ST), changebits); } /* YM2608(OPNA) */ @@ -3698,7 +3698,7 @@ void * ym2608_init(void *param, const device_config *device, int clock, int rate /* shut down emulator */ void ym2608_shutdown(void *chip) { - YM2608 *F2608 = chip; + YM2608 *F2608 = (YM2608 *)chip; FMCloseTable(); free(F2608); @@ -3708,7 +3708,7 @@ void ym2608_shutdown(void *chip) void ym2608_reset_chip(void *chip) { int i; - YM2608 *F2608 = chip; + YM2608 *F2608 = (YM2608 *)chip; FM_OPN *OPN = &F2608->OPN; YM_DELTAT *DELTAT = &F2608->deltaT; @@ -3789,7 +3789,7 @@ void ym2608_reset_chip(void *chip) /* v = value */ int ym2608_write(void *chip, int a,UINT8 v) { - YM2608 *F2608 = chip; + YM2608 *F2608 = (YM2608 *)chip; FM_OPN *OPN = &F2608->OPN; int addr; @@ -3885,7 +3885,7 @@ int ym2608_write(void *chip, int a,UINT8 v) UINT8 ym2608_read(void *chip,int a) { - YM2608 *F2608 = chip; + YM2608 *F2608 = (YM2608 *)chip; int addr = F2608->OPN.ST.address; UINT8 ret = 0; @@ -3925,7 +3925,7 @@ UINT8 ym2608_read(void *chip,int a) int ym2608_timer_over(void *chip,int c) { - YM2608 *F2608 = chip; + YM2608 *F2608 = (YM2608 *)chip; switch(c) { @@ -3970,7 +3970,7 @@ int ym2608_timer_over(void *chip,int c) /* Generate samples for one of the YM2610s */ void ym2610_update_one(void *chip, FMSAMPLE **buffer, int length) { - YM2610 *F2610 = chip; + YM2610 *F2610 = (YM2610 *)chip; FM_OPN *OPN = &F2610->OPN; YM_DELTAT *DELTAT = &F2610->deltaT; int i,j; @@ -4107,7 +4107,7 @@ void ym2610_update_one(void *chip, FMSAMPLE **buffer, int length) /* Generate samples for one of the YM2610Bs */ void ym2610b_update_one(void *chip, FMSAMPLE **buffer, int length) { - YM2610 *F2610 = chip; + YM2610 *F2610 = (YM2610 *)chip; FM_OPN *OPN = &F2610->OPN; YM_DELTAT *DELTAT = &F2610->deltaT; int i,j; @@ -4314,12 +4314,12 @@ static void YM2610_save_state(YM2610 *F2610, const device_config *device) static void YM2610_deltat_status_set(void *chip, UINT8 changebits) { - YM2610 *F2610 = chip; + YM2610 *F2610 = (YM2610 *)chip; F2610->adpcm_arrivedEndAddress |= changebits; } static void YM2610_deltat_status_reset(void *chip, UINT8 changebits) { - YM2610 *F2610 = chip; + YM2610 *F2610 = (YM2610 *)chip; F2610->adpcm_arrivedEndAddress &= (~changebits); } @@ -4375,7 +4375,7 @@ void *ym2610_init(void *param, const device_config *device, int clock, int rate, /* shut down emulator */ void ym2610_shutdown(void *chip) { - YM2610 *F2610 = chip; + YM2610 *F2610 = (YM2610 *)chip; FMCloseTable(); free(F2610); @@ -4385,7 +4385,7 @@ void ym2610_shutdown(void *chip) void ym2610_reset_chip(void *chip) { int i; - YM2610 *F2610 = chip; + YM2610 *F2610 = (YM2610 *)chip; FM_OPN *OPN = &F2610->OPN; YM_DELTAT *DELTAT = &F2610->deltaT; @@ -4450,7 +4450,7 @@ void ym2610_reset_chip(void *chip) /* v = value */ int ym2610_write(void *chip, int a, UINT8 v) { - YM2610 *F2610 = chip; + YM2610 *F2610 = (YM2610 *)chip; FM_OPN *OPN = &F2610->OPN; int addr; int ch; @@ -4552,7 +4552,7 @@ int ym2610_write(void *chip, int a, UINT8 v) UINT8 ym2610_read(void *chip,int a) { - YM2610 *F2610 = chip; + YM2610 *F2610 = (YM2610 *)chip; int addr = F2610->OPN.ST.address; UINT8 ret = 0; @@ -4580,7 +4580,7 @@ UINT8 ym2610_read(void *chip,int a) int ym2610_timer_over(void *chip,int c) { - YM2610 *F2610 = chip; + YM2610 *F2610 = (YM2610 *)chip; if( c ) { /* Timer B */ @@ -4626,7 +4626,7 @@ static int dacen; /* Generate samples for one of the YM2612s */ void ym2612_update_one(void *chip, FMSAMPLE **buffer, int length) { - YM2612 *F2612 = chip; + YM2612 *F2612 = (YM2612 *)chip; FM_OPN *OPN = &F2612->OPN; int i; FMSAMPLE *bufL,*bufR; @@ -4827,7 +4827,7 @@ void * ym2612_init(void *param, const device_config *device, int clock, int rate /* shut down emulator */ void ym2612_shutdown(void *chip) { - YM2612 *F2612 = chip; + YM2612 *F2612 = (YM2612 *)chip; FMCloseTable(); free(F2612); @@ -4837,7 +4837,7 @@ void ym2612_shutdown(void *chip) void ym2612_reset_chip(void *chip) { int i; - YM2612 *F2612 = chip; + YM2612 *F2612 = (YM2612 *)chip; FM_OPN *OPN = &F2612->OPN; OPNSetPres( OPN, 6*24, 6*24, 0); @@ -4873,7 +4873,7 @@ void ym2612_reset_chip(void *chip) /* v = value */ int ym2612_write(void *chip, int a, UINT8 v) { - YM2612 *F2612 = chip; + YM2612 *F2612 = (YM2612 *)chip; int addr; v &= 0xff; /* adjust to 8 bit bus */ @@ -4936,7 +4936,7 @@ int ym2612_write(void *chip, int a, UINT8 v) UINT8 ym2612_read(void *chip,int a) { - YM2612 *F2612 = chip; + YM2612 *F2612 = (YM2612 *)chip; switch( a&3){ case 0: /* status 0 */ @@ -4952,7 +4952,7 @@ UINT8 ym2612_read(void *chip,int a) int ym2612_timer_over(void *chip,int c) { - YM2612 *F2612 = chip; + YM2612 *F2612 = (YM2612 *)chip; if( c ) { /* Timer B */ diff --git a/src/emu/sound/fmopl.c b/src/emu/sound/fmopl.c index 675315b1cf6..951114f9ca7 100644 --- a/src/emu/sound/fmopl.c +++ b/src/emu/sound/fmopl.c @@ -1187,9 +1187,9 @@ static int init_tables(void) /* we never reach zero here due to ((i*2)+1) */ if (m>0.0) - o = 8*log(1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(1.0/m)/log(2.0); /* convert to 'decibels' */ else - o = 8*log(-1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(-1.0/m)/log(2.0); /* convert to 'decibels' */ o = o / (ENV_STEP/4); @@ -1978,7 +1978,7 @@ static FM_OPL *OPLCreate(const device_config *device, UINT32 clock, UINT32 rate, #endif /* allocate memory block */ - ptr = malloc(state_size); + ptr = (char *)malloc(state_size); if (ptr==NULL) return NULL; @@ -2169,48 +2169,48 @@ void * ym3812_init(const device_config *device, UINT32 clock, UINT32 rate) void ym3812_shutdown(void *chip) { - FM_OPL *YM3812 = chip; + FM_OPL *YM3812 = (FM_OPL *)chip; /* emulator shutdown */ OPLDestroy(YM3812); } void ym3812_reset_chip(void *chip) { - FM_OPL *YM3812 = chip; + FM_OPL *YM3812 = (FM_OPL *)chip; OPLResetChip(YM3812); } int ym3812_write(void *chip, int a, int v) { - FM_OPL *YM3812 = chip; + FM_OPL *YM3812 = (FM_OPL *)chip; return OPLWrite(YM3812, a, v); } unsigned char ym3812_read(void *chip, int a) { - FM_OPL *YM3812 = chip; + FM_OPL *YM3812 = (FM_OPL *)chip; /* YM3812 always returns bit2 and bit1 in HIGH state */ return OPLRead(YM3812, a) | 0x06 ; } int ym3812_timer_over(void *chip, int c) { - FM_OPL *YM3812 = chip; + FM_OPL *YM3812 = (FM_OPL *)chip; return OPLTimerOver(YM3812, c); } void ym3812_set_timer_handler(void *chip, OPL_TIMERHANDLER timer_handler, void *param) { - FM_OPL *YM3812 = chip; + FM_OPL *YM3812 = (FM_OPL *)chip; OPLSetTimerHandler(YM3812, timer_handler, param); } void ym3812_set_irq_handler(void *chip,OPL_IRQHANDLER IRQHandler,void *param) { - FM_OPL *YM3812 = chip; + FM_OPL *YM3812 = (FM_OPL *)chip; OPLSetIRQHandler(YM3812, IRQHandler, param); } void ym3812_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void *param) { - FM_OPL *YM3812 = chip; + FM_OPL *YM3812 = (FM_OPL *)chip; OPLSetUpdateHandler(YM3812, UpdateHandler, param); } @@ -2224,7 +2224,7 @@ void ym3812_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void * */ void ym3812_update_one(void *chip, OPLSAMPLE *buffer, int length) { - FM_OPL *OPL = chip; + FM_OPL *OPL = (FM_OPL *)chip; UINT8 rhythm = OPL->rhythm&0x20; OPLSAMPLE *buf = buffer; int i; @@ -2305,47 +2305,47 @@ void *ym3526_init(const device_config *device, UINT32 clock, UINT32 rate) void ym3526_shutdown(void *chip) { - FM_OPL *YM3526 = chip; + FM_OPL *YM3526 = (FM_OPL *)chip; /* emulator shutdown */ OPLDestroy(YM3526); } void ym3526_reset_chip(void *chip) { - FM_OPL *YM3526 = chip; + FM_OPL *YM3526 = (FM_OPL *)chip; OPLResetChip(YM3526); } int ym3526_write(void *chip, int a, int v) { - FM_OPL *YM3526 = chip; + FM_OPL *YM3526 = (FM_OPL *)chip; return OPLWrite(YM3526, a, v); } unsigned char ym3526_read(void *chip, int a) { - FM_OPL *YM3526 = chip; + FM_OPL *YM3526 = (FM_OPL *)chip; /* YM3526 always returns bit2 and bit1 in HIGH state */ return OPLRead(YM3526, a) | 0x06 ; } int ym3526_timer_over(void *chip, int c) { - FM_OPL *YM3526 = chip; + FM_OPL *YM3526 = (FM_OPL *)chip; return OPLTimerOver(YM3526, c); } void ym3526_set_timer_handler(void *chip, OPL_TIMERHANDLER timer_handler, void *param) { - FM_OPL *YM3526 = chip; + FM_OPL *YM3526 = (FM_OPL *)chip; OPLSetTimerHandler(YM3526, timer_handler, param); } void ym3526_set_irq_handler(void *chip,OPL_IRQHANDLER IRQHandler,void *param) { - FM_OPL *YM3526 = chip; + FM_OPL *YM3526 = (FM_OPL *)chip; OPLSetIRQHandler(YM3526, IRQHandler, param); } void ym3526_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void *param) { - FM_OPL *YM3526 = chip; + FM_OPL *YM3526 = (FM_OPL *)chip; OPLSetUpdateHandler(YM3526, UpdateHandler, param); } @@ -2359,7 +2359,7 @@ void ym3526_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void * */ void ym3526_update_one(void *chip, OPLSAMPLE *buffer, int length) { - FM_OPL *OPL = chip; + FM_OPL *OPL = (FM_OPL *)chip; UINT8 rhythm = OPL->rhythm&0x20; OPLSAMPLE *buf = buffer; int i; @@ -2429,12 +2429,12 @@ void ym3526_update_one(void *chip, OPLSAMPLE *buffer, int length) static void Y8950_deltat_status_set(void *chip, UINT8 changebits) { - FM_OPL *Y8950 = chip; + FM_OPL *Y8950 = (FM_OPL *)chip; OPL_STATUS_SET(Y8950, changebits); } static void Y8950_deltat_status_reset(void *chip, UINT8 changebits) { - FM_OPL *Y8950 = chip; + FM_OPL *Y8950 = (FM_OPL *)chip; OPL_STATUS_RESET(Y8950, changebits); } @@ -2462,52 +2462,52 @@ void *y8950_init(const device_config *device, UINT32 clock, UINT32 rate) void y8950_shutdown(void *chip) { - FM_OPL *Y8950 = chip; + FM_OPL *Y8950 = (FM_OPL *)chip; /* emulator shutdown */ OPLDestroy(Y8950); } void y8950_reset_chip(void *chip) { - FM_OPL *Y8950 = chip; + FM_OPL *Y8950 = (FM_OPL *)chip; OPLResetChip(Y8950); } int y8950_write(void *chip, int a, int v) { - FM_OPL *Y8950 = chip; + FM_OPL *Y8950 = (FM_OPL *)chip; return OPLWrite(Y8950, a, v); } unsigned char y8950_read(void *chip, int a) { - FM_OPL *Y8950 = chip; + FM_OPL *Y8950 = (FM_OPL *)chip; return OPLRead(Y8950, a); } int y8950_timer_over(void *chip, int c) { - FM_OPL *Y8950 = chip; + FM_OPL *Y8950 = (FM_OPL *)chip; return OPLTimerOver(Y8950, c); } void y8950_set_timer_handler(void *chip, OPL_TIMERHANDLER timer_handler, void *param) { - FM_OPL *Y8950 = chip; + FM_OPL *Y8950 = (FM_OPL *)chip; OPLSetTimerHandler(Y8950, timer_handler, param); } void y8950_set_irq_handler(void *chip,OPL_IRQHANDLER IRQHandler,void *param) { - FM_OPL *Y8950 = chip; + FM_OPL *Y8950 = (FM_OPL *)chip; OPLSetIRQHandler(Y8950, IRQHandler, param); } void y8950_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void *param) { - FM_OPL *Y8950 = chip; + FM_OPL *Y8950 = (FM_OPL *)chip; OPLSetUpdateHandler(Y8950, UpdateHandler, param); } void y8950_set_delta_t_memory(void *chip, void * deltat_mem_ptr, int deltat_mem_size ) { - FM_OPL *OPL = chip; + FM_OPL *OPL = (FM_OPL *)chip; OPL->deltat->memory = (UINT8 *)(deltat_mem_ptr); OPL->deltat->memory_size = deltat_mem_size; } @@ -2522,7 +2522,7 @@ void y8950_set_delta_t_memory(void *chip, void * deltat_mem_ptr, int deltat_mem_ void y8950_update_one(void *chip, OPLSAMPLE *buffer, int length) { int i; - FM_OPL *OPL = chip; + FM_OPL *OPL = (FM_OPL *)chip; UINT8 rhythm = OPL->rhythm&0x20; YM_DELTAT *DELTAT = OPL->deltat; OPLSAMPLE *buf = buffer; @@ -2592,7 +2592,7 @@ void y8950_update_one(void *chip, OPLSAMPLE *buffer, int length) void y8950_set_port_handler(void *chip,OPL_PORTHANDLER_W PortHandler_w,OPL_PORTHANDLER_R PortHandler_r,void * param) { - FM_OPL *OPL = chip; + FM_OPL *OPL = (FM_OPL *)chip; OPL->porthandler_w = PortHandler_w; OPL->porthandler_r = PortHandler_r; OPL->port_param = param; @@ -2600,7 +2600,7 @@ void y8950_set_port_handler(void *chip,OPL_PORTHANDLER_W PortHandler_w,OPL_PORTH void y8950_set_keyboard_handler(void *chip,OPL_PORTHANDLER_W KeyboardHandler_w,OPL_PORTHANDLER_R KeyboardHandler_r,void * param) { - FM_OPL *OPL = chip; + FM_OPL *OPL = (FM_OPL *)chip; OPL->keyboardhandler_w = KeyboardHandler_w; OPL->keyboardhandler_r = KeyboardHandler_r; OPL->keyboard_param = param; diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c index 8d7ff73e186..5021a29b605 100644 --- a/src/emu/sound/gaelco.c +++ b/src/emu/sound/gaelco.c @@ -77,7 +77,7 @@ struct _gaelco_sound_state INT16 volume_table[VOLUME_LEVELS][256]; }; -static void * wavraw; /* raw waveform */ +static wav_file * wavraw; /* raw waveform */ INLINE gaelco_sound_state *get_safe_token(const device_config *device) { @@ -96,7 +96,7 @@ INLINE gaelco_sound_state *get_safe_token(const device_config *device) static STREAM_UPDATE( gaelco_update ) { - gaelco_sound_state *info = param; + gaelco_sound_state *info = (gaelco_sound_state *)param; int j, ch; /* fill all data needed */ @@ -256,7 +256,7 @@ WRITE16_DEVICE_HANDLER( gaelcosnd_w ) static DEVICE_START( gaelco ) { int j, vol; - const gaelcosnd_interface *intf = device->static_config; + const gaelcosnd_interface *intf = (const gaelcosnd_interface *)device->static_config; gaelco_sound_state *info = get_safe_token(device); diff --git a/src/emu/sound/hc55516.c b/src/emu/sound/hc55516.c index 1872c4b519f..93e6ede932e 100644 --- a/src/emu/sound/hc55516.c +++ b/src/emu/sound/hc55516.c @@ -70,9 +70,9 @@ static void start_common(const device_config *device, UINT8 _shiftreg_mask, int hc55516_state *chip = get_safe_token(device); /* compute the fixed charge, decay, and leak time constants */ - charge = pow(exp(-1), 1.0 / (FILTER_CHARGE_TC * 16000.0)); - decay = pow(exp(-1), 1.0 / (FILTER_DECAY_TC * 16000.0)); - leak = pow(exp(-1), 1.0 / (INTEGRATOR_LEAK_TC * 16000.0)); + charge = pow(exp(-1.0), 1.0 / (FILTER_CHARGE_TC * 16000.0)); + decay = pow(exp(-1.0), 1.0 / (FILTER_DECAY_TC * 16000.0)); + leak = pow(exp(-1.0), 1.0 / (INTEGRATOR_LEAK_TC * 16000.0)); chip->clock = device->clock; chip->shiftreg_mask = _shiftreg_mask; @@ -189,7 +189,7 @@ static void process_digit(hc55516_state *chip) static STREAM_UPDATE( hc55516_update ) { - hc55516_state *chip = param; + hc55516_state *chip = (hc55516_state *)param; stream_sample_t *buffer = outputs[0]; int i; INT32 sample, slope; diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c index 60bfeadb11f..e3257411b4e 100644 --- a/src/emu/sound/ics2115.c +++ b/src/emu/sound/ics2115.c @@ -96,7 +96,7 @@ static void recalc_irq(ics2115_state *chip) static STREAM_UPDATE( update ) { - ics2115_state *chip = param; + ics2115_state *chip = (ics2115_state *)param; int osc, i; int rec_irq = 0; @@ -164,14 +164,14 @@ static void keyon(ics2115_state *chip, int osc) static TIMER_CALLBACK( timer_cb_0 ) { - ics2115_state *chip = ptr; + ics2115_state *chip = (ics2115_state *)ptr; chip->irq_pend |= 1<<0; recalc_irq(chip); } static TIMER_CALLBACK( timer_cb_1 ) { - ics2115_state *chip = ptr; + ics2115_state *chip = (ics2115_state *)ptr; chip->irq_pend |= 1<<1; recalc_irq(chip); } @@ -455,11 +455,11 @@ static DEVICE_START( ics2115 ) int i; chip->device = device; - chip->intf = device->static_config; + chip->intf = (const ics2115_interface *)device->static_config; chip->rom = device->region; chip->timer[0].timer = timer_alloc(device->machine, timer_cb_0, chip); chip->timer[1].timer = timer_alloc(device->machine, timer_cb_1, chip); - chip->ulaw = auto_malloc(256*sizeof(INT16)); + chip->ulaw = (INT16 *)auto_malloc(256*sizeof(INT16)); chip->stream = stream_create(device, 0, 2, 33075, chip, update); for(i=0; i<256; i++) { diff --git a/src/emu/sound/iremga20.c b/src/emu/sound/iremga20.c index 1a9ab88f96a..acc1b32d536 100644 --- a/src/emu/sound/iremga20.c +++ b/src/emu/sound/iremga20.c @@ -69,7 +69,7 @@ INLINE ga20_state *get_safe_token(const device_config *device) static STREAM_UPDATE( IremGA20_update ) { - ga20_state *chip = param; + ga20_state *chip = (ga20_state *)param; UINT32 rate[4], pos[4], frac[4], end[4], vol[4], play[4]; UINT8 *pSamples; stream_sample_t *outL, *outR; diff --git a/src/emu/sound/k005289.c b/src/emu/sound/k005289.c index 0585dae1dcc..5266041ca75 100644 --- a/src/emu/sound/k005289.c +++ b/src/emu/sound/k005289.c @@ -78,7 +78,7 @@ static void make_mixer_table(k005289_state *info, int voices) int gain = 16; /* allocate memory */ - info->mixer_table = auto_malloc(256 * voices * sizeof(INT16)); + info->mixer_table = (INT16 *)auto_malloc(256 * voices * sizeof(INT16)); /* find the middle of the table */ info->mixer_lookup = info->mixer_table + (128 * voices); @@ -97,7 +97,7 @@ static void make_mixer_table(k005289_state *info, int voices) /* generate sound to the mix buffer */ static STREAM_UPDATE( K005289_update ) { - k005289_state *info = param; + k005289_state *info = (k005289_state *)param; k005289_sound_channel *voice=info->channel_list; stream_sample_t *buffer = outputs[0]; short *mix; @@ -171,7 +171,7 @@ static DEVICE_START( k005289 ) info->mclock = device->clock; /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ - info->mixer_buffer = auto_malloc(2 * sizeof(short) * info->rate); + info->mixer_buffer = (short *)auto_malloc(2 * sizeof(short) * info->rate); /* build the mixer table */ make_mixer_table(info, 2); diff --git a/src/emu/sound/k007232.c b/src/emu/sound/k007232.c index e31983b702f..e8299225f73 100644 --- a/src/emu/sound/k007232.c +++ b/src/emu/sound/k007232.c @@ -227,7 +227,7 @@ static void KDAC_A_make_fncode( KDAC_A_PCM *info ){ static STREAM_UPDATE( KDAC_A_update ) { - KDAC_A_PCM *info = param; + KDAC_A_PCM *info = (KDAC_A_PCM *)param; int i; memset(outputs[0],0,samples * sizeof(*outputs[0])); @@ -308,7 +308,7 @@ static DEVICE_START( k007232 ) int i; KDAC_A_PCM *info = get_safe_token(device); - info->intf = (device->static_config != NULL) ? device->static_config : &defintrf; + info->intf = (device->static_config != NULL) ? (const k007232_interface *)device->static_config : &defintrf; /* Set up the chips */ diff --git a/src/emu/sound/k051649.c b/src/emu/sound/k051649.c index 9da21cae5ea..7ac4b9b4896 100644 --- a/src/emu/sound/k051649.c +++ b/src/emu/sound/k051649.c @@ -72,7 +72,7 @@ static void make_mixer_table(k051649_state *info, int voices) int gain = 8; /* allocate memory */ - info->mixer_table = auto_malloc(512 * voices * sizeof(INT16)); + info->mixer_table = (INT16 *)auto_malloc(512 * voices * sizeof(INT16)); /* find the middle of the table */ info->mixer_lookup = info->mixer_table + (256 * voices); @@ -91,7 +91,7 @@ static void make_mixer_table(k051649_state *info, int voices) /* generate sound to the mix buffer */ static STREAM_UPDATE( k051649_update ) { - k051649_state *info = param; + k051649_state *info = (k051649_state *)param; k051649_sound_channel *voice=info->channel_list; stream_sample_t *buffer = outputs[0]; short *mix; @@ -145,7 +145,7 @@ static DEVICE_START( k051649 ) info->mclock = device->clock; /* allocate a buffer to mix into - 1 second's worth should be more than enough */ - info->mixer_buffer = auto_malloc(2 * sizeof(short) * info->rate); + info->mixer_buffer = (short *)auto_malloc(2 * sizeof(short) * info->rate); /* build the mixer table */ make_mixer_table(info, 5); diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c index 14473c36131..d03b673d86b 100644 --- a/src/emu/sound/k053260.c +++ b/src/emu/sound/k053260.c @@ -117,7 +117,7 @@ static STREAM_UPDATE( k053260_update ) { UINT32 delta[4], end[4], pos[4]; int dataL, dataR; signed char d; - k053260_state *ic = param; + k053260_state *ic = (k053260_state *)param; /* precache some values */ for ( i = 0; i < 4; i++ ) { @@ -217,7 +217,7 @@ static DEVICE_START( k053260 ) /* Initialize our chip structure */ ic->device = device; - ic->intf = (device->static_config != NULL) ? device->static_config : &defintrf; + ic->intf = (device->static_config != NULL) ? (const k053260_interface *)device->static_config : &defintrf; ic->mode = 0; ic->rom = device->region; diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c index 95a149aed86..d6025c62fbd 100644 --- a/src/emu/sound/k054539.c +++ b/src/emu/sound/k054539.c @@ -58,6 +58,14 @@ CHANNEL_DEBUG enables the following keys: rendering instead of sample-based. */ +typedef struct _k054539_channel k054539_channel; +struct _k054539_channel { + UINT32 pos; + UINT32 pfrac; + INT32 val; + INT32 pval; +}; + typedef struct _k054539_state k054539_state; struct _k054539_state { const k054539_interface *intf; @@ -81,12 +89,7 @@ struct _k054539_state { UINT32 rom_mask; sound_stream * stream; - struct k054539_channel { - UINT32 pos; - UINT32 pfrac; - INT32 val; - INT32 pval; - } channels[8]; + k054539_channel channels[8]; }; INLINE k054539_state *get_safe_token(const device_config *device) @@ -132,7 +135,7 @@ static void k054539_keyoff(k054539_state *info, int channel) static STREAM_UPDATE( k054539_update ) { - k054539_state *info = param; + k054539_state *info = (k054539_state *)param; #define VOL_CAP 1.80 static const INT16 dpcm[16] = { @@ -146,7 +149,7 @@ static STREAM_UPDATE( k054539_update ) UINT32 rom_mask; unsigned char *base1, *base2; - struct k054539_channel *chan; + k054539_channel *chan; stream_sample_t *bufl, *bufr; int cur_pos, cur_pfrac, cur_val, cur_pval; int delta, rdelta, fdelta, pdelta; @@ -438,7 +441,7 @@ else static TIMER_CALLBACK( k054539_irq ) { - k054539_state *info = ptr; + k054539_state *info = (k054539_state *)ptr; if(info->regs[0x22f] & 0x20) info->intf->irq(info->device); } @@ -452,7 +455,7 @@ static void k054539_init_chip(const device_config *device, k054539_state *info) info->k054539_flags |= K054539_UPDATE_AT_KEYON; //* make it default until proven otherwise // Real size of 0x4000, the addon is to simplify the reverb buffer computations - info->ram = auto_malloc(0x4000*2+device->clock/50*2); + info->ram = (unsigned char *)auto_malloc(0x4000*2+device->clock/50*2); info->reverb_pos = 0; info->cur_ptr = 0; memset(info->ram, 0, 0x4000*2+device->clock/50*2); @@ -611,7 +614,7 @@ WRITE8_DEVICE_HANDLER( k054539_w ) static STATE_POSTLOAD( reset_zones ) { - k054539_state *info = param; + k054539_state *info = (k054539_state *)param; int data = info->regs[0x22e]; info->cur_zone = data == 0x80 ? info->ram : @@ -653,7 +656,7 @@ static DEVICE_START( k054539 ) info->k054539_gain[i] = 1.0; info->k054539_flags = K054539_RESET_FLAGS; - info->intf = (device->static_config != NULL) ? device->static_config : &defintrf; + info->intf = (device->static_config != NULL) ? (const k054539_interface *)device->static_config : &defintrf; /* I've tried various equations on volume control but none worked consistently. @@ -675,7 +678,7 @@ static DEVICE_START( k054539 ) // Formula is such that pan[i]**2+pan[0xe-i]**2 = 1 (constant output power) // and pan[0xe] = 1 (full panning) for(i=0; i<0xf; i++) - info->pantab[i] = sqrt(i) / sqrt(0xe); + info->pantab[i] = sqrt((double)i) / sqrt((double)0xe); k054539_init_chip(device, info); diff --git a/src/emu/sound/msm5205.c b/src/emu/sound/msm5205.c index 81081e1de10..c8af8bc95db 100644 --- a/src/emu/sound/msm5205.c +++ b/src/emu/sound/msm5205.c @@ -103,7 +103,7 @@ static void ComputeTables (msm5205_state *voice) /* stream update callbacks */ static STREAM_UPDATE( MSM5205_update ) { - msm5205_state *voice = param; + msm5205_state *voice = (msm5205_state *)param; stream_sample_t *buffer = outputs[0]; /* if this voice is active */ @@ -123,7 +123,7 @@ static STREAM_UPDATE( MSM5205_update ) /* timer callback at VCLK low eddge */ static TIMER_CALLBACK( MSM5205_vclk_callback ) { - msm5205_state *voice = ptr; + msm5205_state *voice = (msm5205_state *)ptr; int val; int new_signal; /* callback user handler and latch next data */ @@ -182,7 +182,7 @@ static DEVICE_START( msm5205 ) msm5205_state *voice = get_safe_token(device); /* save a global pointer to our interface */ - voice->intf = device->static_config; + voice->intf = (const msm5205_interface *)device->static_config; voice->device = device; voice->clock = device->clock; diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c index 1912bf8c894..96d5c26c7ad 100644 --- a/src/emu/sound/msm5232.c +++ b/src/emu/sound/msm5232.c @@ -712,7 +712,7 @@ INLINE void TG_group_advance(MSM5232 *chip, int groupidx) static STREAM_UPDATE( MSM5232_update_one ) { - MSM5232 * chip = param; + MSM5232 * chip = (MSM5232 *)param; stream_sample_t *buf1 = outputs[0]; stream_sample_t *buf2 = outputs[1]; stream_sample_t *buf3 = outputs[2]; @@ -787,9 +787,9 @@ static STREAM_UPDATE( MSM5232_update_one ) static DEVICE_START( msm5232 ) { - const msm5232_interface *intf = device->static_config; + const msm5232_interface *intf = (const msm5232_interface *)device->static_config; int rate = device->clock/CLOCK_RATE_DIVIDER; - MSM5232 *chip = device->token; + MSM5232 *chip = get_safe_token(device); chip->device = device; diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c index 70667af0f25..fefb043b952 100644 --- a/src/emu/sound/multipcm.c +++ b/src/emu/sound/multipcm.c @@ -427,7 +427,7 @@ static void WriteSlot(MultiPCM *ptChip,struct _SLOT *slot,int reg,unsigned char static STREAM_UPDATE( MultiPCM_update ) { - MultiPCM *ptChip = param; + MultiPCM *ptChip = (MultiPCM *)param; stream_sample_t *datap[2]; int i,sl; diff --git a/src/emu/sound/n63701x.c b/src/emu/sound/n63701x.c index a74547952f2..2607ef8575d 100644 --- a/src/emu/sound/n63701x.c +++ b/src/emu/sound/n63701x.c @@ -59,7 +59,7 @@ INLINE namco_63701x *get_safe_token(const device_config *device) static STREAM_UPDATE( namco_63701x_update ) { - namco_63701x *chip = param; + namco_63701x *chip = (namco_63701x *)param; int ch; for (ch = 0;ch < 2;ch++) diff --git a/src/emu/sound/namco.c b/src/emu/sound/namco.c index 2480d3e82af..471b7f9de6e 100644 --- a/src/emu/sound/namco.c +++ b/src/emu/sound/namco.c @@ -139,7 +139,7 @@ static void build_decoded_waveform(namco_sound *chip, UINT8 *rgnbase) size = 32 * 8; /* 32 samples, 8 waveforms */ } - p = auto_malloc(size * MAX_VOLUME * sizeof (INT16)); + p = (INT16 *)auto_malloc(size * MAX_VOLUME * sizeof (INT16)); for (v = 0; v < MAX_VOLUME; v++) { @@ -172,7 +172,7 @@ INLINE UINT32 namco_update_one(namco_sound *chip, stream_sample_t *buffer, int l /* generate sound to the mix buffer in mono */ static STREAM_UPDATE( namco_update_mono ) { - namco_sound *chip = param; + namco_sound *chip = (namco_sound *)param; stream_sample_t *buffer = outputs[0]; sound_channel *voice; @@ -255,7 +255,7 @@ static STREAM_UPDATE( namco_update_mono ) /* generate sound to the mix buffer in stereo */ static STREAM_UPDATE( namco_update_stereo ) { - namco_sound *chip = param; + namco_sound *chip = (namco_sound *)param; sound_channel *voice; /* zap the contents of the buffers */ @@ -366,7 +366,7 @@ static STREAM_UPDATE( namco_update_stereo ) static DEVICE_START( namco ) { sound_channel *voice; - const namco_interface *intf = device->static_config; + const namco_interface *intf = (const namco_interface *)device->static_config; int clock_multiple; namco_sound *chip = get_safe_token(device); @@ -701,7 +701,7 @@ WRITE8_DEVICE_HANDLER( namco_15xx_w ) static WRITE8_DEVICE_HANDLER( namcos1_sound_w ) { - namco_sound *chip = device->token; + namco_sound *chip = get_safe_token(device); sound_channel *voice; int ch; int nssw; diff --git a/src/emu/sound/namco52.c b/src/emu/sound/namco52.c index f94fd4a2a90..1872748a701 100644 --- a/src/emu/sound/namco52.c +++ b/src/emu/sound/namco52.c @@ -86,7 +86,7 @@ static void namco_52xx_reset(namco_52xx *chip); static STREAM_UPDATE( namco_52xx_stream_update_one ) { - namco_52xx *chip = param; + namco_52xx *chip = (namco_52xx *)param; int i, rom_pos, whole_pb_cycles, buf; stream_sample_t *buffer = outputs[0]; @@ -141,15 +141,15 @@ static void namco_52xx_reset(namco_52xx *chip) static DEVICE_RESET( namco_52xx ) { - namco_52xx_reset(device->token); + namco_52xx_reset(get_safe_token(device)); } static DEVICE_START( namco_52xx ) { - namco_52xx *chip = device->token; + namco_52xx *chip = get_safe_token(device); int rate = device->clock/32; - chip->intf = device->static_config; + chip->intf = (const namco_52xx_interface *)device->static_config; chip->rom = device->region; chip->rom_len = device->regionbytes; diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c index 3d1c61298ae..0f217c50f77 100644 --- a/src/emu/sound/nes_apu.c +++ b/src/emu/sound/nes_apu.c @@ -668,7 +668,7 @@ WRITE8_DEVICE_HANDLER( nes_psg_w ) {apu_write(get_safe_token(device),offset,data /* UPDATE APU SYSTEM */ static STREAM_UPDATE( nes_psg_update_sound ) { - nesapu_state *info = param; + nesapu_state *info = (nesapu_state *)param; apu_update(info, outputs[0], samples); } @@ -676,7 +676,7 @@ static STREAM_UPDATE( nes_psg_update_sound ) /* INITIALIZE APU SYSTEM */ static DEVICE_START( nesapu ) { - const nes_interface *intf = device->static_config; + const nes_interface *intf = (const nes_interface *)device->static_config; nesapu_state *info = get_safe_token(device); int rate = device->clock / 4; int i; diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c index 68629460d88..5bd3136b19b 100644 --- a/src/emu/sound/nile.c +++ b/src/emu/sound/nile.c @@ -144,7 +144,7 @@ WRITE16_DEVICE_HANDLER( nile_snd_w ) static STREAM_UPDATE( nile_update ) { - nile_state *info = param; + nile_state *info = (nile_state *)param; UINT8 *sound_ram = info->sound_ram; int v, i, snum; UINT16 *slot; diff --git a/src/emu/sound/okim6258.c b/src/emu/sound/okim6258.c index 0e7a4952c2a..33028d00de3 100644 --- a/src/emu/sound/okim6258.c +++ b/src/emu/sound/okim6258.c @@ -132,7 +132,7 @@ static INT16 clock_adpcm(okim6258_state *chip, UINT8 nibble) static STREAM_UPDATE( okim6258_update ) { - okim6258_state *chip = param; + okim6258_state *chip = (okim6258_state *)param; stream_sample_t *buffer = outputs[0]; memset(outputs[0], 0, samples * sizeof(*outputs[0])); @@ -194,7 +194,7 @@ static void okim6258_state_save_register(okim6258_state *info, const device_conf static DEVICE_START( okim6258 ) { - const okim6258_interface *intf = device->static_config; + const okim6258_interface *intf = (const okim6258_interface *)device->static_config; okim6258_state *info = get_safe_token(device); compute_tables(); diff --git a/src/emu/sound/okim6295.c b/src/emu/sound/okim6295.c index c39becd72d8..5434b1be735 100644 --- a/src/emu/sound/okim6295.c +++ b/src/emu/sound/okim6295.c @@ -263,7 +263,7 @@ static void generate_adpcm(okim6295_state *chip, struct ADPCMVoice *voice, INT16 static STREAM_UPDATE( okim6295_update ) { - okim6295_state *chip = param; + okim6295_state *chip = (okim6295_state *)param; int i; memset(outputs[0], 0, samples * sizeof(*outputs[0])); @@ -329,7 +329,7 @@ static void okim6295_state_save_register(okim6295_state *info, const device_conf static DEVICE_START( okim6295 ) { - const okim6295_interface *intf = device->static_config; + const okim6295_interface *intf = (const okim6295_interface *)device->static_config; okim6295_state *info = get_safe_token(device); int voice; int divisor = intf->pin7 ? 132 : 165; diff --git a/src/emu/sound/okim6376.c b/src/emu/sound/okim6376.c index d95a4e44c1d..c3b4ab2639b 100644 --- a/src/emu/sound/okim6376.c +++ b/src/emu/sound/okim6376.c @@ -235,7 +235,7 @@ static void generate_adpcm(okim6376_state *chip, struct ADPCMVoice *voice, INT16 static STREAM_UPDATE( okim6376_update ) { - okim6376_state *chip = param; + okim6376_state *chip = (okim6376_state *)param; int i; memset(outputs[0], 0, samples * sizeof(*outputs[0])); diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c index 946e0080dd5..7d36c711ade 100644 --- a/src/emu/sound/pokey.c +++ b/src/emu/sound/pokey.c @@ -536,7 +536,7 @@ INLINE pokey_state *get_safe_token(const device_config *device) static STREAM_UPDATE( pokey_update ) { - pokey_state *chip = param; + pokey_state *chip = (pokey_state *)param; stream_sample_t *buffer = outputs[0]; PROCESS_POKEY(chip); } @@ -679,7 +679,7 @@ static DEVICE_START( pokey ) static TIMER_CALLBACK( pokey_timer_expire ) { - pokey_state *p = ptr; + pokey_state *p = (pokey_state *)ptr; int timers = param; LOG_TIMER(("POKEY #%p timer %d with IRQEN $%02x\n", p, timers, p->IRQEN)); @@ -749,7 +749,7 @@ static char *audctl2str(int val) static TIMER_CALLBACK( pokey_serin_ready_cb ) { - pokey_state *p = ptr; + pokey_state *p = (pokey_state *)ptr; if( p->IRQEN & IRQ_SERIN ) { /* set the enabled timer irq status bits */ @@ -762,7 +762,7 @@ static TIMER_CALLBACK( pokey_serin_ready_cb ) static TIMER_CALLBACK( pokey_serout_ready_cb ) { - pokey_state *p = ptr; + pokey_state *p = (pokey_state *)ptr; if( p->IRQEN & IRQ_SEROR ) { p->IRQST |= IRQ_SEROR; @@ -773,7 +773,7 @@ static TIMER_CALLBACK( pokey_serout_ready_cb ) static TIMER_CALLBACK( pokey_serout_complete ) { - pokey_state *p = ptr; + pokey_state *p = (pokey_state *)ptr; if( p->IRQEN & IRQ_SEROC ) { p->IRQST |= IRQ_SEROC; @@ -784,7 +784,7 @@ static TIMER_CALLBACK( pokey_serout_complete ) static TIMER_CALLBACK( pokey_pot_trigger ) { - pokey_state *p = ptr; + pokey_state *p = (pokey_state *)ptr; int pot = param; LOG(("POKEY #%p POT%d triggers after %dus\n", p, pot, (int)(1000000 * attotime_to_double(timer_timeelapsed(p->ptimer[pot]))))); p->ALLPOT &= ~(1 << pot); /* set the enabled timer irq status bits */ diff --git a/src/emu/sound/psx.c b/src/emu/sound/psx.c index da1f6d592b1..4cb23de5072 100644 --- a/src/emu/sound/psx.c +++ b/src/emu/sound/psx.c @@ -124,7 +124,7 @@ INLINE int limit( int v ) static STREAM_UPDATE( PSXSPU_update ) { - struct psxinfo *chip = param; + struct psxinfo *chip = (struct psxinfo *)param; int v; int voll; int volr; @@ -267,7 +267,7 @@ static DEVICE_START( psxspu ) int n_effect; int n_channel; - chip->intf = device->static_config; + chip->intf = (const psx_spu_interface *)device->static_config; chip->device = device; chip->g_p_n_psxram = *(chip->intf->p_psxram); @@ -316,7 +316,7 @@ static DEVICE_START( psxspu ) chip->m_p_n_effect[ n_effect ] = 0; } - chip->m_p_n_spuram = auto_malloc( SPU_RAM_SIZE ); + chip->m_p_n_spuram = (UINT16 *)auto_malloc( SPU_RAM_SIZE ); state_save_register_device_item( device, 0, chip->m_n_mainvolumeleft ); state_save_register_device_item( device, 0, chip->m_n_mainvolumeright ); diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c index 914dfd5002b..bf1c9d5b1ef 100644 --- a/src/emu/sound/qsound.c +++ b/src/emu/sound/qsound.c @@ -118,7 +118,7 @@ static DEVICE_START( qsound ) /* Create pan table */ for (i=0; i<33; i++) { - chip->pan_table[i]=(int)((256/sqrt(32)) * sqrt(i)); + chip->pan_table[i]=(int)((256/sqrt(32.0)) * sqrt((double)i)); } LOG(("Pan table\n")); @@ -317,7 +317,7 @@ static void qsound_set_command(qsound_state *chip, int data, int value) static STREAM_UPDATE( qsound_update ) { - qsound_state *chip = param; + qsound_state *chip = (qsound_state *)param; int i,j; int rvol, lvol, count; struct QSOUND_CHANNEL *pC=&chip->channel[0]; diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c index 70fdcc7b05a..aa9c7322b97 100644 --- a/src/emu/sound/rf5c400.c +++ b/src/emu/sound/rf5c400.c @@ -119,7 +119,7 @@ static UINT8 decode80(UINT8 val) static STREAM_UPDATE( rf5c400_update ) { int i, ch; - rf5c400_state *info = param; + rf5c400_state *info = (rf5c400_state *)param; INT16 *rom = info->rom; UINT32 start, end, loop; UINT64 pos; diff --git a/src/emu/sound/rf5c68.c b/src/emu/sound/rf5c68.c index 0a79cc42e2f..2775de83ea6 100644 --- a/src/emu/sound/rf5c68.c +++ b/src/emu/sound/rf5c68.c @@ -52,7 +52,7 @@ INLINE rf5c68_state *get_safe_token(const device_config *device) static STREAM_UPDATE( rf5c68_update ) { - rf5c68_state *chip = param; + rf5c68_state *chip = (rf5c68_state *)param; stream_sample_t *left = outputs[0]; stream_sample_t *right = outputs[1]; int i, j; diff --git a/src/emu/sound/s14001a.c b/src/emu/sound/s14001a.c index 3f04481349a..d47ca6c5e0d 100644 --- a/src/emu/sound/s14001a.c +++ b/src/emu/sound/s14001a.c @@ -545,7 +545,7 @@ static STREAM_UPDATE( s14001a_pcm_update ) { INT32 mix[48000]; INT32 *mixp; - S14001AChip *chip = param; + S14001AChip *chip = (S14001AChip *)param; int i; memset(mix, 0, sizeof(mix)); diff --git a/src/emu/sound/saa1099.c b/src/emu/sound/saa1099.c index 37fd4e3600a..4f2a90afed7 100644 --- a/src/emu/sound/saa1099.c +++ b/src/emu/sound/saa1099.c @@ -226,7 +226,7 @@ static void saa1099_envelope(saa1099_state *saa, int ch) static STREAM_UPDATE( saa1099_update ) { - saa1099_state *saa = param; + saa1099_state *saa = (saa1099_state *)param; int j, ch; /* if the channels are disabled we're done */ diff --git a/src/emu/sound/samples.c b/src/emu/sound/samples.c index 63eb1df9f82..22174b7699a 100644 --- a/src/emu/sound/samples.c +++ b/src/emu/sound/samples.c @@ -153,7 +153,7 @@ static int read_wav_sample(mame_file *f, struct loaded_sample *sample) unsigned char *tempptr; int sindex; - sample->data = auto_malloc(sizeof(*sample->data) * length); + sample->data = (INT16 *)auto_malloc(sizeof(*sample->data) * length); mame_fread(f, sample->data, length); /* convert 8-bit data to signed samples */ @@ -164,7 +164,7 @@ static int read_wav_sample(mame_file *f, struct loaded_sample *sample) else { /* 16-bit data is fine as-is */ - sample->data = auto_malloc(sizeof(*sample->data) * (length/2)); + sample->data = (INT16 *)auto_malloc(sizeof(*sample->data) * (length/2)); mame_fread(f, sample->data, length); sample->length /= 2; if (ENDIANNESS_NATIVE != ENDIANNESS_LITTLE) @@ -201,7 +201,7 @@ struct loaded_samples *readsamples(const char *const *samplenames, const char *b return NULL; /* allocate the array */ - samples = auto_malloc(sizeof(struct loaded_samples) + (i-1) * sizeof(struct loaded_sample)); + samples = (struct loaded_samples *)auto_malloc(sizeof(struct loaded_samples) + (i-1) * sizeof(struct loaded_sample)); memset(samples, 0, sizeof(struct loaded_samples) + (i-1) * sizeof(struct loaded_sample)); samples->total = i; @@ -387,7 +387,7 @@ int sample_playing(const device_config *device,int channel) static STREAM_UPDATE( sample_update_sound ) { - sample_channel *chan = param; + sample_channel *chan = (sample_channel *)param; stream_sample_t *buffer = outputs[0]; if (chan->source && !chan->paused) @@ -439,7 +439,7 @@ static STREAM_UPDATE( sample_update_sound ) static STATE_POSTLOAD( samples_postload ) { - samples_info *info = param; + samples_info *info = (samples_info *)param; int i; /* loop over channels */ @@ -475,7 +475,7 @@ static STATE_POSTLOAD( samples_postload ) static DEVICE_START( samples ) { int i; - const samples_interface *intf = device->static_config; + const samples_interface *intf = (const samples_interface *)device->static_config; samples_info *info = get_safe_token(device); info->device = device; @@ -487,7 +487,7 @@ static DEVICE_START( samples ) /* allocate channels */ info->numchannels = intf->channels; assert(info->numchannels < MAX_CHANNELS); - info->channel = auto_malloc(sizeof(*info->channel) * info->numchannels); + info->channel = (sample_channel *)auto_malloc(sizeof(*info->channel) * info->numchannels); for (i = 0; i < info->numchannels; i++) { info->channel[i].stream = stream_create(device, 0, 1, device->machine->sample_rate, &info->channel[i], sample_update_sound); diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c index e8a03156466..892bdd4e528 100644 --- a/src/emu/sound/scsp.c +++ b/src/emu/sound/scsp.c @@ -1223,7 +1223,7 @@ int SCSP_IRQCB(void *param) static STREAM_UPDATE( SCSP_Update ) { - struct _SCSP *SCSP = param; + struct _SCSP *SCSP = (struct _SCSP *)param; bufferl = outputs[0]; bufferr = outputs[1]; length = samples; @@ -1236,7 +1236,7 @@ static DEVICE_START( scsp ) struct _SCSP *SCSP = get_safe_token(device); - intf = device->static_config; + intf = (const scsp_interface *)device->static_config; // init the emulation SCSP_Init(device, SCSP, intf); @@ -1255,8 +1255,8 @@ void scsp_set_ram_base(const device_config *device, void *base) struct _SCSP *SCSP = get_safe_token(device); if (SCSP) { - SCSP->SCSPRAM = base; - SCSP->DSP.SCSPRAM = base; + SCSP->SCSPRAM = (unsigned char *)base; + SCSP->DSP.SCSPRAM = (UINT16 *)base; SCSP->SCSPRAM_LENGTH = 0x80000; SCSP->DSP.SCSPRAM_LENGTH = 0x80000/2; } diff --git a/src/emu/sound/segapcm.c b/src/emu/sound/segapcm.c index 5d4b0813a32..6413a5e6fde 100644 --- a/src/emu/sound/segapcm.c +++ b/src/emu/sound/segapcm.c @@ -28,7 +28,7 @@ INLINE segapcm_state *get_safe_token(const device_config *device) static STREAM_UPDATE( SEGAPCM_update ) { - segapcm_state *spcm = param; + segapcm_state *spcm = (segapcm_state *)param; int ch; /* clear the buffers */ @@ -88,12 +88,12 @@ static STREAM_UPDATE( SEGAPCM_update ) static DEVICE_START( segapcm ) { - const sega_pcm_interface *intf = device->static_config; + const sega_pcm_interface *intf = (const sega_pcm_interface *)device->static_config; int mask, rom_mask, len; segapcm_state *spcm = get_safe_token(device); spcm->rom = (const UINT8 *)device->region; - spcm->ram = auto_malloc(0x800); + spcm->ram = (UINT8 *)auto_malloc(0x800); memset(spcm->ram, 0xff, 0x800); diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c index aa32887ffcd..b6c3bc1c6fe 100644 --- a/src/emu/sound/sid6581.c +++ b/src/emu/sound/sid6581.c @@ -31,7 +31,7 @@ static STREAM_UPDATE( sid_update ) static void sid_start(const device_config *device, SIDTYPE sidtype) { - SID6581 *sid = device->token; + SID6581 *sid = get_sid(device); const sid6581_interface *iface = (const sid6581_interface*) device->static_config; sid->device = device; @@ -49,7 +49,7 @@ static void sid_start(const device_config *device, SIDTYPE sidtype) static DEVICE_RESET( sid ) { - SID6581 *sid = device->token; + SID6581 *sid = get_sid(device); sidEmuReset(sid); } diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c index bfe491709f5..6f7b0c33910 100644 --- a/src/emu/sound/sn76477.c +++ b/src/emu/sound/sn76477.c @@ -1988,7 +1988,7 @@ static STREAM_UPDATE( SN76477_update ) double voltage_out; double center_to_peak_voltage_out; - sn76477_state *sn = param; + sn76477_state *sn = (sn76477_state *)param; stream_sample_t *buffer = outputs[0]; diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c index 6e9ec1c9ae9..417c6016fa6 100644 --- a/src/emu/sound/sn76496.c +++ b/src/emu/sound/sn76496.c @@ -145,7 +145,7 @@ WRITE8_DEVICE_HANDLER( sn76496_w ) static STREAM_UPDATE( SN76496Update ) { int i; - sn76496_state *R = param; + sn76496_state *R = (sn76496_state *)param; stream_sample_t *buffer = outputs[0]; diff --git a/src/emu/sound/snkwave.c b/src/emu/sound/snkwave.c index d7fb7d779a4..a4395982cc4 100644 --- a/src/emu/sound/snkwave.c +++ b/src/emu/sound/snkwave.c @@ -65,7 +65,7 @@ static void update_waveform(snkwave_state *chip, unsigned int offset, UINT8 data /* generate sound to the mix buffer */ static STREAM_UPDATE( snkwave_update ) { - snkwave_state *chip = param; + snkwave_state *chip = (snkwave_state *)param; stream_sample_t *buffer = outputs[0]; /* zap the contents of the buffer */ diff --git a/src/emu/sound/sp0250.c b/src/emu/sound/sp0250.c index 5c096485d0f..2672c6a07f9 100644 --- a/src/emu/sound/sp0250.c +++ b/src/emu/sound/sp0250.c @@ -132,13 +132,13 @@ static void sp0250_load_values(sp0250_state *sp) static TIMER_CALLBACK( sp0250_timer_tick ) { - sp0250_state *sp = ptr; + sp0250_state *sp = (sp0250_state *)ptr; stream_update(sp->stream); } static STREAM_UPDATE( sp0250_update ) { - sp0250_state *sp = param; + sp0250_state *sp = (sp0250_state *)param; stream_sample_t *output = outputs[0]; int i; for (i = 0; i < samples; i++) @@ -205,7 +205,7 @@ static STREAM_UPDATE( sp0250_update ) static DEVICE_START( sp0250 ) { - const struct sp0250_interface *intf = device->static_config; + const struct sp0250_interface *intf = (const struct sp0250_interface *)device->static_config; sp0250_state *sp = get_safe_token(device); sp->device = device; diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c index 807471ededf..11011cbe598 100644 --- a/src/emu/sound/sp0256.c +++ b/src/emu/sound/sp0256.c @@ -1105,7 +1105,7 @@ static void sp0256_micro(sp0256_state *sp) static STREAM_UPDATE( sp0256_update ) { - sp0256_state *sp = param; + sp0256_state *sp = (sp0256_state *)param; stream_sample_t *output = outputs[0]; int output_index = 0; int length, did_samp, old_idx; @@ -1182,7 +1182,7 @@ static STREAM_UPDATE( sp0256_update ) static DEVICE_START( sp0256 ) { - const sp0256_interface *intf = device->static_config; + const sp0256_interface *intf = (const sp0256_interface *)device->static_config; sp0256_state *sp = get_safe_token(device); sp->device = device; @@ -1201,7 +1201,7 @@ static DEVICE_START( sp0256 ) /* -------------------------------------------------------------------- */ /* Allocate a scratch buffer for generating ~10kHz samples. */ /* -------------------------------------------------------------------- */ - sp->scratch = malloc_or_die(SCBUF_SIZE * sizeof(INT16)); + sp->scratch = (INT16 *)malloc_or_die(SCBUF_SIZE * sizeof(INT16)); sp->sc_head = sp->sc_tail = 0; /* -------------------------------------------------------------------- */ diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c index 5936f7e3d2d..19519a4756b 100644 --- a/src/emu/sound/st0016.c +++ b/src/emu/sound/st0016.c @@ -66,7 +66,7 @@ WRITE8_DEVICE_HANDLER( st0016_snd_w ) static STREAM_UPDATE( st0016_update ) { - st0016_state *info = param; + st0016_state *info = (st0016_state *)param; UINT8 *sound_ram = *info->sound_ram; int v, i, snum; unsigned char *slot; @@ -142,7 +142,7 @@ static STREAM_UPDATE( st0016_update ) static DEVICE_START( st0016 ) { - const st0016_interface *intf = device->static_config; + const st0016_interface *intf = (const st0016_interface *)device->static_config; st0016_state *info = get_safe_token(device); info->sound_ram = intf->p_soundram; diff --git a/src/emu/sound/tiaintf.c b/src/emu/sound/tiaintf.c index 327db696a70..53c3c7e5769 100644 --- a/src/emu/sound/tiaintf.c +++ b/src/emu/sound/tiaintf.c @@ -22,7 +22,7 @@ INLINE tia_state *get_safe_token(const device_config *device) static STREAM_UPDATE( tia_update ) { - tia_state *info = param; + tia_state *info = (tia_state *)param; tia_process(info->chip, outputs[0], samples); } diff --git a/src/emu/sound/tiasound.c b/src/emu/sound/tiasound.c index c17bec7cafa..c686010a2d3 100644 --- a/src/emu/sound/tiasound.c +++ b/src/emu/sound/tiasound.c @@ -160,7 +160,7 @@ static const UINT8 Div31[POLY5_SIZE] = void tia_write(void *_chip, offs_t offset, UINT8 data) { - struct tia *chip = _chip; + struct tia *chip = (struct tia *)_chip; UINT16 new_val = 0; UINT8 chan; @@ -261,7 +261,7 @@ void tia_write(void *_chip, offs_t offset, UINT8 data) void tia_process(void *_chip, stream_sample_t *buffer, int length) { - struct tia *chip = _chip; + struct tia *chip = (struct tia *)_chip; UINT8 audc0, audc1; UINT8 div_n_cnt0, div_n_cnt1; UINT8 p5_0, p5_1; @@ -547,7 +547,7 @@ void *tia_sound_init(int clock, int sample_rate, int gain) struct tia *chip; int chan; - chip = malloc(sizeof(*chip)); + chip = (struct tia *)malloc(sizeof(*chip)); if (!chip) return NULL; memset(chip, 0, sizeof(*chip)); diff --git a/src/emu/sound/tms3615.c b/src/emu/sound/tms3615.c index c16d07a6dd2..7061c9aca1f 100644 --- a/src/emu/sound/tms3615.c +++ b/src/emu/sound/tms3615.c @@ -33,7 +33,7 @@ INLINE tms_state *get_safe_token(const device_config *device) static STREAM_UPDATE( tms3615_sound_update ) { - tms_state *tms = param; + tms_state *tms = (tms_state *)param; int samplerate = tms->samplerate; stream_sample_t *buffer8 = outputs[TMS3615_FOOTAGE_8]; stream_sample_t *buffer16 = outputs[TMS3615_FOOTAGE_16]; diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c index b7c601b573f..7679a97ea7a 100644 --- a/src/emu/sound/tms36xx.c +++ b/src/emu/sound/tms36xx.c @@ -353,7 +353,7 @@ INLINE tms_state *get_safe_token(const device_config *device) static STREAM_UPDATE( tms36xx_sound_update ) { - tms_state *tms = param; + tms_state *tms = (tms_state *)param; int samplerate = tms->samplerate; stream_sample_t *buffer = outputs[0]; @@ -501,7 +501,7 @@ static DEVICE_START( tms36xx ) tms_state *tms = get_safe_token(device); int enable; - tms->intf = device->static_config; + tms->intf = (const tms36xx_interface *)device->static_config; tms->channel = stream_create(device, 0, 1, device->clock * 64, tms, tms36xx_sound_update); tms->samplerate = device->clock * 64; diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c index a13582a649f..9adf77d6faa 100644 --- a/src/emu/sound/tms5110.c +++ b/src/emu/sound/tms5110.c @@ -157,7 +157,7 @@ static void parse_frame(struct tms5110 *tms); void tms5110_set_variant(void *chip, int variant) { - struct tms5110 *tms = chip; + struct tms5110 *tms = (struct tms5110 *)chip; switch (variant) { @@ -181,7 +181,7 @@ void *tms5110_create(const device_config *device, int variant) { struct tms5110 *tms; - tms = malloc_or_die(sizeof(*tms)); + tms = (struct tms5110 *)malloc_or_die(sizeof(*tms)); memset(tms, 0, sizeof(*tms)); tms->device = device; @@ -247,7 +247,7 @@ void tms5110_destroy(void *chip) void tms5110_reset_chip(void *chip) { - struct tms5110 *tms = chip; + struct tms5110 *tms = (struct tms5110 *)chip; /* initialize the FIFO */ memset(tms->fifo, 0, sizeof(tms->fifo)); @@ -284,7 +284,7 @@ void tms5110_reset_chip(void *chip) void tms5110_set_M0_callback(void *chip, int (*func)(const device_config *)) { - struct tms5110 *tms = chip; + struct tms5110 *tms = (struct tms5110 *)chip; tms->M0_callback = func; } @@ -296,7 +296,7 @@ void tms5110_set_M0_callback(void *chip, int (*func)(const device_config *)) void tms5110_set_load_address(void *chip, void (*func)(const device_config *, int)) { - struct tms5110 *tms = chip; + struct tms5110 *tms = (struct tms5110 *)chip; tms->set_load_address = func; } @@ -388,7 +388,7 @@ static void perform_dummy_read(struct tms5110 *tms) int tms5110_status_read(void *chip) { - struct tms5110 *tms = chip; + struct tms5110 *tms = (struct tms5110 *)chip; if (DEBUG_5110) logerror("Status read: TS=%d\n", tms->talk_status); return (tms->talk_status << 0); /*CTL1 = still talking ? */ @@ -404,7 +404,7 @@ int tms5110_status_read(void *chip) int tms5110_ready_read(void *chip) { - struct tms5110 *tms = chip; + struct tms5110 *tms = (struct tms5110 *)chip; return (tms->fifo_count < FIFO_SIZE-1); } @@ -418,7 +418,7 @@ int tms5110_ready_read(void *chip) void tms5110_process(void *chip, INT16 *buffer, unsigned int size) { - struct tms5110 *tms = chip; + struct tms5110 *tms = (struct tms5110 *)chip; int buf_count=0; int i, interp_period, bitout; INT16 Y11, cliptemp; @@ -738,7 +738,7 @@ empty: void tms5110_CTL_set(void *chip, int data) { - struct tms5110 *tms = chip; + struct tms5110 *tms = (struct tms5110 *)chip; tms->CTL_pins = data & 0xf; } @@ -750,7 +750,7 @@ void tms5110_CTL_set(void *chip, int data) void tms5110_PDC_set(void *chip, int data) { - struct tms5110 *tms = chip; + struct tms5110 *tms = (struct tms5110 *)chip; if (tms->PDC != (data & 0x1) ) { tms->PDC = data & 0x1; diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c index f2286ffec43..d00d5f5bacd 100644 --- a/src/emu/sound/tms5220.c +++ b/src/emu/sound/tms5220.c @@ -179,7 +179,7 @@ void *tms5220_create(const device_config *device) { struct tms5220 *tms; - tms = malloc_or_die(sizeof(*tms)); + tms = (struct tms5220 *)malloc_or_die(sizeof(*tms)); memset(tms, 0, sizeof(*tms)); tms->device = device; @@ -248,7 +248,7 @@ void tms5220_destroy(void *chip) void tms5220_reset_chip(void *chip) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; /* initialize the FIFO */ /*memset(tms->fifo, 0, sizeof(tms->fifo));*/ @@ -292,7 +292,7 @@ void tms5220_reset_chip(void *chip) void tms5220_set_irq(void *chip, void (*func)(const device_config *, int)) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; tms->irq_func = func; } @@ -305,7 +305,7 @@ void tms5220_set_irq(void *chip, void (*func)(const device_config *, int)) void tms5220_set_read(void *chip, int (*func)(const device_config *, int)) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; tms->read_callback = func; } @@ -318,7 +318,7 @@ void tms5220_set_read(void *chip, int (*func)(const device_config *, int)) void tms5220_set_load_address(void *chip, void (*func)(const device_config *, int)) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; tms->load_address_callback = func; } @@ -331,7 +331,7 @@ void tms5220_set_load_address(void *chip, void (*func)(const device_config *, in void tms5220_set_read_and_branch(void *chip, void (*func)(const device_config *)) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; tms->read_and_branch_callback = func; } @@ -344,7 +344,7 @@ void tms5220_set_read_and_branch(void *chip, void (*func)(const device_config *) void tms5220_set_variant(void *chip, tms5220_variant new_variant) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; tms->variant = new_variant; } @@ -357,7 +357,7 @@ void tms5220_set_variant(void *chip, tms5220_variant new_variant) void tms5220_data_write(void *chip, int data) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; /* add this byte to the FIFO */ if (tms->fifo_count < FIFO_SIZE) @@ -411,7 +411,7 @@ void tms5220_data_write(void *chip, int data) int tms5220_status_read(void *chip) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; if (tms->RDB_flag) { /* if last command was read, return data register */ @@ -440,7 +440,7 @@ int tms5220_status_read(void *chip) int tms5220_ready_read(void *chip) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; return (tms->fifo_count < FIFO_SIZE-1); } @@ -453,7 +453,7 @@ int tms5220_ready_read(void *chip) int tms5220_cycles_to_ready(void *chip) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; int answer; @@ -495,7 +495,7 @@ int tms5220_cycles_to_ready(void *chip) int tms5220_int_read(void *chip) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; return tms->irq_pin; } @@ -509,7 +509,7 @@ int tms5220_int_read(void *chip) void tms5220_process(void *chip, INT16 *buffer, unsigned int size) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; int buf_count=0; int i, interp_period, bitout; @@ -798,7 +798,7 @@ static INT16 clip_and_wrap(INT16 cliptemp) static INT16 lattice_filter(void *chip) { - struct tms5220 *tms = chip; + struct tms5220 *tms = (struct tms5220 *)chip; /* Lattice filter here */ /* Aug/05/07: redone as unrolled loop, for clarity - LN*/ /* Copied verbatim from table I in US patent 4,209,804: diff --git a/src/emu/sound/upd7759.c b/src/emu/sound/upd7759.c index cd96389f198..63b447d1f73 100644 --- a/src/emu/sound/upd7759.c +++ b/src/emu/sound/upd7759.c @@ -473,7 +473,7 @@ static void advance_state(upd7759_state *chip) static STREAM_UPDATE( upd7759_update ) { - upd7759_state *chip = param; + upd7759_state *chip = (upd7759_state *)param; INT32 clocks_left = chip->clocks_left; INT16 sample = chip->sample; UINT32 step = chip->step; @@ -536,7 +536,7 @@ static STREAM_UPDATE( upd7759_update ) static TIMER_CALLBACK( upd7759_slave_update ) { - upd7759_state *chip = ptr; + upd7759_state *chip = (upd7759_state *)ptr; UINT8 olddrq = chip->drq; /* update the stream */ @@ -593,7 +593,7 @@ static void upd7759_reset(upd7759_state *chip) static DEVICE_RESET( upd7759 ) { - upd7759_reset(device->token); + upd7759_reset(get_safe_token(device)); } @@ -640,8 +640,8 @@ static void register_for_save(upd7759_state *chip, const device_config *device) static DEVICE_START( upd7759 ) { static const upd7759_interface defintrf = { 0 }; - const upd7759_interface *intf = (device->static_config != NULL) ? device->static_config : &defintrf; - upd7759_state *chip = device->token; + const upd7759_interface *intf = (device->static_config != NULL) ? (const upd7759_interface *)device->static_config : &defintrf; + upd7759_state *chip = get_safe_token(device); chip->device = device; diff --git a/src/emu/sound/vlm5030.c b/src/emu/sound/vlm5030.c index 8dd95608636..aff1d037b09 100644 --- a/src/emu/sound/vlm5030.c +++ b/src/emu/sound/vlm5030.c @@ -86,7 +86,7 @@ chirp 12-..: vokume 0 : silent #define IP_SIZE_FAST (120/FR_SIZE) #define IP_SIZE_FASTER ( 80/FR_SIZE) -typedef struct _vlm5030_state vml5030_state; +typedef struct _vlm5030_state vlm5030_state; struct _vlm5030_state { const device_config *device; @@ -219,16 +219,16 @@ static const INT16 K5_table[] = { 0, -8127, -16384, -24511, 32638, 24511, 16254, 8127 }; -INLINE vml5030_state *get_safe_token(const device_config *device) +INLINE vlm5030_state *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_VLM5030); - return (vml5030_state *)device->token; + return (vlm5030_state *)device->token; } -static int get_bits(vml5030_state *chip, int sbit,int bits) +static int get_bits(vlm5030_state *chip, int sbit,int bits) { int offset = chip->address + (sbit>>3); int data; @@ -242,7 +242,7 @@ static int get_bits(vml5030_state *chip, int sbit,int bits) } /* get next frame */ -static int parse_frame (vml5030_state *chip) +static int parse_frame (vlm5030_state *chip) { unsigned char cmd; int i; @@ -299,7 +299,7 @@ static int parse_frame (vml5030_state *chip) /* decode and buffering data */ static STREAM_UPDATE( vlm5030_update_callback ) { - vml5030_state *chip = param; + vlm5030_state *chip = (vlm5030_state *)param; int buf_count=0; int interp_effect; int i; @@ -454,13 +454,13 @@ phase_stop: } /* realtime update */ -static void vlm5030_update(vml5030_state *chip) +static void vlm5030_update(vlm5030_state *chip) { stream_update(chip->channel); } /* setup parameteroption when RST=H */ -static void vlm5030_setup_parameter(vml5030_state *chip, UINT8 param) +static void vlm5030_setup_parameter(vlm5030_state *chip, UINT8 param) { /* latch parameter value */ chip->parameter = param; @@ -488,7 +488,7 @@ static void vlm5030_setup_parameter(vml5030_state *chip, UINT8 param) static STATE_POSTLOAD( vlm5030_restore_state ) { - vml5030_state *chip = param; + vlm5030_state *chip = (vlm5030_state *)param; int i; int interp_effect = FR_SIZE - (chip->interp_count%FR_SIZE); @@ -504,7 +504,7 @@ static STATE_POSTLOAD( vlm5030_restore_state ) } -static void vlm5030_reset(vml5030_state *chip) +static void vlm5030_reset(vlm5030_state *chip) { chip->phase = PH_RESET; chip->address = 0; @@ -534,14 +534,14 @@ static DEVICE_RESET( vlm5030 ) /* set speech rom address */ void vlm5030_set_rom(const device_config *device, void *speech_rom) { - vml5030_state *chip = get_safe_token(device); + vlm5030_state *chip = get_safe_token(device); chip->rom = (UINT8 *)speech_rom; } /* get BSY pin level */ int vlm5030_bsy(const device_config *device) { - vml5030_state *chip = get_safe_token(device); + vlm5030_state *chip = get_safe_token(device); vlm5030_update(chip); return chip->pin_BSY; } @@ -549,14 +549,14 @@ int vlm5030_bsy(const device_config *device) /* latch contoll data */ WRITE8_DEVICE_HANDLER( vlm5030_data_w ) { - vml5030_state *chip = get_safe_token(device); + vlm5030_state *chip = get_safe_token(device); chip->latch_data = (UINT8)data; } /* set RST pin level : reset / set table address A8-A15 */ void vlm5030_rst (const device_config *device, int pin ) { - vml5030_state *chip = get_safe_token(device); + vlm5030_state *chip = get_safe_token(device); if( chip->pin_RST ) { if( !pin ) @@ -581,7 +581,7 @@ void vlm5030_rst (const device_config *device, int pin ) /* set VCU pin level : ?? unknown */ void vlm5030_vcu(const device_config *device, int pin) { - vml5030_state *chip = get_safe_token(device); + vlm5030_state *chip = get_safe_token(device); /* direct mode / indirect mode */ chip->pin_VCU = pin; return; @@ -590,7 +590,7 @@ void vlm5030_vcu(const device_config *device, int pin) /* set ST pin level : set table address A0-A7 / start speech */ void vlm5030_st(const device_config *device, int pin ) { - vml5030_state *chip = get_safe_token(device); + vlm5030_state *chip = get_safe_token(device); int table; if( chip->pin_ST != pin ) @@ -651,10 +651,10 @@ static DEVICE_START( vlm5030 ) { const vlm5030_interface defintrf = { 0 }; int emulation_rate; - vml5030_state *chip = get_safe_token(device); + vlm5030_state *chip = get_safe_token(device); chip->device = device; - chip->intf = (device->static_config != NULL) ? device->static_config : &defintrf; + chip->intf = (device->static_config != NULL) ? (const vlm5030_interface *)device->static_config : &defintrf; emulation_rate = device->clock / 440; @@ -708,7 +708,7 @@ DEVICE_GET_INFO( vlm5030 ) switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ - case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(vml5030_state); break; + case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(vlm5030_state); break; /* --- the following bits of info are returned as pointers to data or functions --- */ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( vlm5030 ); break; diff --git a/src/emu/sound/vrender0.c b/src/emu/sound/vrender0.c index 9c3a938032b..e6523750994 100644 --- a/src/emu/sound/vrender0.c +++ b/src/emu/sound/vrender0.c @@ -37,7 +37,7 @@ static void VR0_RenderAudio(vr0_state *VR0, int nsamples,stream_sample_t *l,stre static STREAM_UPDATE( VR0_Update ) { - vr0_state *VR0 = param; + vr0_state *VR0 = (vr0_state *)param; VR0_RenderAudio(VR0, samples,outputs[0],outputs[1]); } @@ -109,7 +109,7 @@ static DEVICE_START( vrender0 ) const vr0_interface *intf; vr0_state *VR0 = get_safe_token(device); - intf=device->static_config; + intf=(const vr0_interface *)device->static_config; memcpy(&(VR0->Intf),intf,sizeof(vr0_interface)); memset(VR0->SOUNDREGS,0,sizeof(VR0->SOUNDREGS)); diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c index ea5bb33f137..7244b016ec9 100644 --- a/src/emu/sound/x1_010.c +++ b/src/emu/sound/x1_010.c @@ -114,7 +114,7 @@ INLINE x1_010_state *get_safe_token(const device_config *device) --------------------------------------------------------------*/ static STREAM_UPDATE( seta_update ) { - x1_010_state *info = param; + x1_010_state *info = (x1_010_state *)param; X1_010_CHANNEL *reg; int ch, i, volL, volR, freq; register INT8 *start, *end, data; @@ -204,8 +204,8 @@ static STREAM_UPDATE( seta_update ) static DEVICE_START( x1_010 ) { int i; - const x1_010_interface *intf = device->static_config; - x1_010_state *info = device->token; + const x1_010_interface *intf = (const x1_010_interface *)device->static_config; + x1_010_state *info = get_safe_token(device); info->region = device->region; info->base_clock = device->clock; diff --git a/src/emu/sound/ym2151.c b/src/emu/sound/ym2151.c index 6f2c35fa37b..1d689c50c8b 100644 --- a/src/emu/sound/ym2151.c +++ b/src/emu/sound/ym2151.c @@ -543,9 +543,9 @@ static void init_tables(void) /* we never reach zero here due to ((i*2)+1) */ if (m>0.0) - o = 8*log(1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(1.0/m)/log(2.0); /* convert to 'decibels' */ else - o = 8*log(-1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(-1.0/m)/log(2.0); /* convert to 'decibels' */ o = o / (ENV_STEP/4); @@ -782,7 +782,7 @@ INLINE void envelope_KONKOFF(YM2151Operator * op, int v) static TIMER_CALLBACK( irqAon_callback ) { - YM2151 *chip = ptr; + YM2151 *chip = (YM2151 *)ptr; int oldstate = chip->irqlinestate; chip->irqlinestate |= 1; @@ -792,7 +792,7 @@ static TIMER_CALLBACK( irqAon_callback ) static TIMER_CALLBACK( irqBon_callback ) { - YM2151 *chip = ptr; + YM2151 *chip = (YM2151 *)ptr; int oldstate = chip->irqlinestate; chip->irqlinestate |= 2; @@ -802,7 +802,7 @@ static TIMER_CALLBACK( irqBon_callback ) static TIMER_CALLBACK( irqAoff_callback ) { - YM2151 *chip = ptr; + YM2151 *chip = (YM2151 *)ptr; int oldstate = chip->irqlinestate; chip->irqlinestate &= ~1; @@ -812,7 +812,7 @@ static TIMER_CALLBACK( irqAoff_callback ) static TIMER_CALLBACK( irqBoff_callback ) { - YM2151 *chip = ptr; + YM2151 *chip = (YM2151 *)ptr; int oldstate = chip->irqlinestate; chip->irqlinestate &= ~2; @@ -822,7 +822,7 @@ static TIMER_CALLBACK( irqBoff_callback ) static TIMER_CALLBACK( timer_callback_a ) { - YM2151 *chip = ptr; + YM2151 *chip = (YM2151 *)ptr; timer_adjust_oneshot(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], 0); chip->timer_A_index_old = chip->timer_A_index; if (chip->irq_enable & 0x04) @@ -835,7 +835,7 @@ static TIMER_CALLBACK( timer_callback_a ) } static TIMER_CALLBACK( timer_callback_b ) { - YM2151 *chip = ptr; + YM2151 *chip = (YM2151 *)ptr; timer_adjust_oneshot(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], 0); chip->timer_B_index_old = chip->timer_B_index; if (chip->irq_enable & 0x08) @@ -847,7 +847,7 @@ static TIMER_CALLBACK( timer_callback_b ) #if 0 static TIMER_CALLBACK( timer_callback_chip_busy ) { - YM2151 *chip = ptr; + YM2151 *chip = (YM2151 *)ptr; chip->status &= 0x7f; /* reset busy flag */ } #endif @@ -1043,7 +1043,7 @@ INLINE void refresh_EG(YM2151Operator * op) /* write a register on YM2151 chip number 'n' */ void ym2151_write_reg(void *_chip, int r, int v) { - YM2151 *chip = _chip; + YM2151 *chip = (YM2151 *)_chip; YM2151Operator *op = &chip->oper[ (r&0x07)*4+((r&0x18)>>3) ]; /* adjust bus to 8 bits */ @@ -1367,7 +1367,7 @@ static TIMER_CALLBACK( cymfile_callback ) int ym2151_read_status( void *_chip ) { - YM2151 *chip = _chip; + YM2151 *chip = (YM2151 *)_chip; return chip->status; } @@ -1557,7 +1557,7 @@ void * ym2151_init(const device_config *device, int clock, int rate) void ym2151_shutdown(void *_chip) { - YM2151 *chip = _chip; + YM2151 *chip = (YM2151 *)_chip; free (chip); @@ -1588,7 +1588,7 @@ void ym2151_shutdown(void *_chip) void ym2151_reset_chip(void *_chip) { int i; - YM2151 *chip = _chip; + YM2151 *chip = (YM2151 *)_chip; /* initialize hardware registers */ @@ -2377,7 +2377,7 @@ void ym2151_update_one(void *chip, SAMP **buffers, int length) bufL = buffers[0]; bufR = buffers[1]; - PSG = chip; + PSG = (YM2151 *)chip; #ifdef USE_MAME_TIMERS /* ASG 980324 - handled by real timers now */ @@ -2483,13 +2483,13 @@ void ym2151_update_one(void *chip, SAMP **buffers, int length) void ym2151_set_irq_handler(void *chip, void(*handler)(const device_config *device, int irq)) { - YM2151 *PSG = chip; + YM2151 *PSG = (YM2151 *)chip; PSG->irqhandler = handler; } void ym2151_set_port_write_handler(void *chip, write8_device_func handler) { - YM2151 *PSG = chip; + YM2151 *PSG = (YM2151 *)chip; PSG->porthandler = handler; } diff --git a/src/emu/sound/ym2413.c b/src/emu/sound/ym2413.c index ed60626f833..4988348bfeb 100644 --- a/src/emu/sound/ym2413.c +++ b/src/emu/sound/ym2413.c @@ -1198,9 +1198,9 @@ static int init_tables(void) /* we never reach zero here due to ((i*2)+1) */ if (m>0.0) - o = 8*log(1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(1.0/m)/log(2.0); /* convert to 'decibels' */ else - o = 8*log(-1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(-1.0/m)/log(2.0); /* convert to 'decibels' */ o = o / (ENV_STEP/4); @@ -2012,7 +2012,7 @@ static YM2413 *OPLLCreate(const device_config *device, int clock, int rate) state_size = sizeof(YM2413); /* allocate memory block */ - ptr = malloc(state_size); + ptr = (char *)malloc(state_size); if (ptr==NULL) return NULL; @@ -2084,7 +2084,7 @@ void * ym2413_init(const device_config *device, int clock, int rate) void ym2413_shutdown(void *chip) { - YM2413 *OPLL = chip; + YM2413 *OPLL = (YM2413 *)chip; /* emulator shutdown */ OPLLDestroy(OPLL); @@ -2092,25 +2092,25 @@ void ym2413_shutdown(void *chip) void ym2413_reset_chip(void *chip) { - YM2413 *OPLL = chip; + YM2413 *OPLL = (YM2413 *)chip; OPLLResetChip(OPLL); } void ym2413_write(void *chip, int a, int v) { - YM2413 *OPLL = chip; + YM2413 *OPLL = (YM2413 *)chip; OPLLWrite(OPLL, a, v); } unsigned char ym2413_read(void *chip, int a) { - YM2413 *OPLL = chip; + YM2413 *OPLL = (YM2413 *)chip; return OPLLRead(OPLL, a) & 0x03 ; } void ym2413_set_update_handler(void *chip,OPLL_UPDATEHANDLER UpdateHandler,void *param) { - YM2413 *OPLL = chip; + YM2413 *OPLL = (YM2413 *)chip; OPLLSetUpdateHandler(OPLL, UpdateHandler, param); } @@ -2124,7 +2124,7 @@ void ym2413_set_update_handler(void *chip,OPLL_UPDATEHANDLER UpdateHandler,void */ void ym2413_update_one(void *_chip, SAMP **buffers, int length) { - YM2413 *chip = _chip; + YM2413 *chip = (YM2413 *)_chip; UINT8 rhythm = chip->rhythm&0x20; SAMP *bufMO = buffers[0]; SAMP *bufRO = buffers[1]; diff --git a/src/emu/sound/ymf262.c b/src/emu/sound/ymf262.c index 9980e0a3701..ad0306e6437 100644 --- a/src/emu/sound/ymf262.c +++ b/src/emu/sound/ymf262.c @@ -1181,9 +1181,9 @@ static int init_tables(void) /* we never reach zero here due to ((i*2)+1) */ if (m>0.0) - o = 8*log(1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(1.0/m)/log(2.0); /* convert to 'decibels' */ else - o = 8*log(-1.0/m)/log(2); /* convert to 'decibels' */ + o = 8*log(-1.0/m)/log(2.0); /* convert to 'decibels' */ o = o / (ENV_STEP/4); @@ -2469,16 +2469,16 @@ void * ymf262_init(const device_config *device, int clock, int rate) void ymf262_shutdown(void *chip) { - OPL3Destroy(chip); + OPL3Destroy((OPL3 *)chip); } void ymf262_reset_chip(void *chip) { - OPL3ResetChip(chip); + OPL3ResetChip((OPL3 *)chip); } int ymf262_write(void *chip, int a, int v) { - return OPL3Write(chip, a, v); + return OPL3Write((OPL3 *)chip, a, v); } unsigned char ymf262_read(void *chip, int a) @@ -2492,24 +2492,24 @@ unsigned char ymf262_read(void *chip, int a) /* YMF278(OPL4) returns bit2 in LOW and bit1 in HIGH state ??? info from manual - not verified */ - return OPL3Read(chip, a); + return OPL3Read((OPL3 *)chip, a); } int ymf262_timer_over(void *chip, int c) { - return OPL3TimerOver(chip, c); + return OPL3TimerOver((OPL3 *)chip, c); } void ymf262_set_timer_handler(void *chip, OPL3_TIMERHANDLER timer_handler, void *param) { - OPL3SetTimerHandler(chip, timer_handler, param); + OPL3SetTimerHandler((OPL3 *)chip, timer_handler, param); } void ymf262_set_irq_handler(void *chip,OPL3_IRQHANDLER IRQHandler,void *param) { - OPL3SetIRQHandler(chip, IRQHandler, param); + OPL3SetIRQHandler((OPL3 *)chip, IRQHandler, param); } void ymf262_set_update_handler(void *chip,OPL3_UPDATEHANDLER UpdateHandler,void *param) { - OPL3SetUpdateHandler(chip, UpdateHandler, param); + OPL3SetUpdateHandler((OPL3 *)chip, UpdateHandler, param); } @@ -2522,7 +2522,7 @@ void ymf262_set_update_handler(void *chip,OPL3_UPDATEHANDLER UpdateHandler,void */ void ymf262_update_one(void *_chip, OPL3SAMPLE **buffers, int length) { - OPL3 *chip = _chip; + OPL3 *chip = (OPL3 *)_chip; UINT8 rhythm = chip->rhythm&0x20; OPL3SAMPLE *ch_a = buffers[0]; diff --git a/src/emu/sound/ymf271.c b/src/emu/sound/ymf271.c index 8e202bcc955..bf7ec832c54 100644 --- a/src/emu/sound/ymf271.c +++ b/src/emu/sound/ymf271.c @@ -690,7 +690,7 @@ static STREAM_UPDATE( ymf271_update ) int i, j; int op; INT32 *mixp; - YMF271Chip *chip = param; + YMF271Chip *chip = (YMF271Chip *)param; memset(mix, 0, sizeof(mix[0])*samples*2); @@ -1358,7 +1358,7 @@ static void ymf271_write_pcm(YMF271Chip *chip, int data) static TIMER_CALLBACK( ymf271_timer_a_tick ) { - YMF271Chip *chip = ptr; + YMF271Chip *chip = (YMF271Chip *)ptr; chip->status |= 1; @@ -1371,7 +1371,7 @@ static TIMER_CALLBACK( ymf271_timer_a_tick ) static TIMER_CALLBACK( ymf271_timer_b_tick ) { - YMF271Chip *chip = ptr; + YMF271Chip *chip = (YMF271Chip *)ptr; chip->status |= 2; @@ -1574,7 +1574,7 @@ static void init_tables(void) for (i=0; i < ARRAY_LENGTH(wavetable); i++) { - wavetable[i] = auto_malloc(SIN_LEN * sizeof(INT16)); + wavetable[i] = (INT16 *)auto_malloc(SIN_LEN * sizeof(INT16)); } for (i=0; i < SIN_LEN; i++) @@ -1652,7 +1652,7 @@ static void init_tables(void) alfo_table[3][i] = (i < (LFO_LENGTH/2)) ? ALFO_MAX-tri_wave : tri_wave; } - mix = auto_malloc(48000*2*sizeof(*mix)); + mix = (INT32 *)auto_malloc(48000*2*sizeof(*mix)); } static void init_state(YMF271Chip *chip, const device_config *device) @@ -1755,7 +1755,7 @@ static DEVICE_START( ymf271 ) chip->device = device; chip->clock = device->clock; - intf = (device->static_config != NULL) ? device->static_config : &defintrf; + intf = (device->static_config != NULL) ? (const ymf271_interface *)device->static_config : &defintrf; ymf271_init(device, chip, device->region, intf->irq_callback, &intf->ext_read, &intf->ext_write); chip->stream = stream_create(device, 0, 2, device->clock/384, chip, ymf271_update); diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c index cb1a8b0139b..2cb16088f62 100644 --- a/src/emu/sound/ymf278b.c +++ b/src/emu/sound/ymf278b.c @@ -266,7 +266,7 @@ static void ymf278b_envelope_next(YMF278BSlot *slot) static STREAM_UPDATE( ymf278b_pcm_update ) { - YMF278BChip *chip = param; + YMF278BChip *chip = (YMF278BChip *)param; int i, j; YMF278BSlot *slot = NULL; INT16 sample = 0; @@ -355,7 +355,7 @@ static void ymf278b_irq_check(running_machine *machine, YMF278BChip *chip) static TIMER_CALLBACK( ymf278b_timer_a_tick ) { - YMF278BChip *chip = ptr; + YMF278BChip *chip = (YMF278BChip *)ptr; if(!(chip->enable & 0x40)) { chip->current_irq |= 0x40; @@ -365,7 +365,7 @@ static TIMER_CALLBACK( ymf278b_timer_a_tick ) static TIMER_CALLBACK( ymf278b_timer_b_tick ) { - YMF278BChip *chip = ptr; + YMF278BChip *chip = (YMF278BChip *)ptr; if(!(chip->enable & 0x20)) { chip->current_irq |= 0x20; @@ -676,7 +676,7 @@ static void ymf278b_init(const device_config *device, YMF278BChip *chip, void (* chip->irq_line = CLEAR_LINE; chip->clock = device->clock; - mix = auto_malloc(44100*2*sizeof(*mix)); + mix = (INT32 *)auto_malloc(44100*2*sizeof(*mix)); } static DEVICE_START( ymf278b ) @@ -687,7 +687,7 @@ static DEVICE_START( ymf278b ) YMF278BChip *chip = get_safe_token(device); chip->device = device; - intf = (device->static_config != NULL) ? device->static_config : &defintrf; + intf = (device->static_config != NULL) ? (const ymf278b_interface *)device->static_config : &defintrf; ymf278b_init(device, chip, intf->irq_callback); chip->stream = stream_create(device, 0, 2, device->clock/768, chip, ymf278b_pcm_update); diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c index 1d6e08581bc..40750d9be5a 100644 --- a/src/emu/sound/ymz280b.c +++ b/src/emu/sound/ymz280b.c @@ -203,7 +203,7 @@ INLINE void update_volumes(struct YMZ280BVoice *voice) static STATE_POSTLOAD( YMZ280B_state_save_update_step ) { - ymz280b_state *chip = param; + ymz280b_state *chip = (ymz280b_state *)param; int j; for (j = 0; j < 8; j++) { @@ -217,7 +217,7 @@ static STATE_POSTLOAD( YMZ280B_state_save_update_step ) static void update_irq_state_timer_common(void *param, int voicenum) { - ymz280b_state *chip = param; + ymz280b_state *chip = (ymz280b_state *)param; struct YMZ280BVoice *voice = &chip->voice[voicenum]; if(!voice->irq_schedule) return; @@ -500,7 +500,7 @@ static int generate_pcm16(struct YMZ280BVoice *voice, UINT8 *base, INT16 *buffer static STREAM_UPDATE( ymz280b_update ) { - ymz280b_state *chip = param; + ymz280b_state *chip = (ymz280b_state *)param; stream_sample_t *lacc = outputs[0]; stream_sample_t *racc = outputs[1]; int v; @@ -640,7 +640,7 @@ static STREAM_UPDATE( ymz280b_update ) static DEVICE_START( ymz280b ) { static const ymz280b_interface defintrf = { 0 }; - const ymz280b_interface *intf = (device->static_config != NULL) ? device->static_config : &defintrf; + const ymz280b_interface *intf = (device->static_config != NULL) ? (const ymz280b_interface *)device->static_config : &defintrf; ymz280b_state *chip = get_safe_token(device); chip->device = device; @@ -659,7 +659,7 @@ static DEVICE_START( ymz280b ) chip->stream = stream_create(device, 0, 2, INTERNAL_SAMPLE_RATE, chip, ymz280b_update); /* allocate memory */ - chip->scratch = auto_malloc(sizeof(chip->scratch[0]) * MAX_SAMPLE_CHUNK); + chip->scratch = (INT16 *)auto_malloc(sizeof(chip->scratch[0]) * MAX_SAMPLE_CHUNK); /* state save */ { |