From ddc2acd46b41dc9f9941bbe4540c2c7d0a67185c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Wed, 2 Apr 2014 18:04:40 +0000 Subject: [PATCH] removed assert from src/emu/cpu/sh4/sh4dmac.c and always set proper channel in sh4_ddt_dma (nw) --- src/emu/cpu/sh4/sh4dmac.c | 1 - src/mame/machine/dc.c | 2 +- src/mame/machine/maple-dc.c | 8 ++++---- src/mess/machine/dccons.c | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/emu/cpu/sh4/sh4dmac.c b/src/emu/cpu/sh4/sh4dmac.c index 62e8dca3f77..f53c8b5a922 100644 --- a/src/emu/cpu/sh4/sh4dmac.c +++ b/src/emu/cpu/sh4/sh4dmac.c @@ -436,7 +436,6 @@ void sh4_dma_ddt(device_t *device, struct sh4_ddt_dma *s) if (sh4->cpu_type != CPU_TYPE_SH4) fatalerror("sh4_dma_ddt uses sh4->m[] with SH3\n"); - assert(s->channel >= 0 && s->channel < ARRAY_LENGTH(sh4->dma_timer_active)); if (sh4->dma_timer_active[s->channel]) return; if (s->mode >= 0) { diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c index b62c871b968..9247c9e6028 100644 --- a/src/mame/machine/dc.c +++ b/src/mame/machine/dc.c @@ -86,7 +86,7 @@ void dc_state::generic_dma(UINT32 main_adr, void *dma_ptr, UINT32 length, UINT32 ddt.length = length; ddt.size =size; ddt.direction = to_mainram; - ddt.channel = -1; + ddt.channel = 0; ddt.mode = -1; sh4_dma_ddt(m_maincpu, &ddt); } diff --git a/src/mame/machine/maple-dc.c b/src/mame/machine/maple-dc.c index 0686668b0f7..3955412a4b6 100644 --- a/src/mame/machine/maple-dc.c +++ b/src/mame/machine/maple-dc.c @@ -118,7 +118,7 @@ void maple_dc_device::dma_step() ddtdata.size = 4; // bytes per word ddtdata.buffer = header; // destination buffer ddtdata.direction = 0; // 0 source to buffer, 1 buffer to source - ddtdata.channel = -1; // not used + ddtdata.channel = 0; ddtdata.mode = -1; // copy from/to buffer sh4_dma_ddt(cpu, &ddtdata); dma_adr += 8; @@ -134,7 +134,7 @@ void maple_dc_device::dma_step() ddtdata.size = 4; // bytes per word ddtdata.buffer = data; // destination buffer ddtdata.direction = 0; // 0 source to buffer, 1 buffer to source - ddtdata.channel = -1; // not used + ddtdata.channel = 0; ddtdata.mode = -1; // copy from/to buffer sh4_dma_ddt(cpu, &ddtdata); dma_adr += length*4; @@ -189,7 +189,7 @@ void maple_dc_device::dma_step() ddtdata.size = 4; // bytes per word ddtdata.buffer = &data; // destination buffer ddtdata.direction = 1; // 0 source to buffer, 1 buffer to source - ddtdata.channel = -1; // not used + ddtdata.channel = 0; ddtdata.mode = -1; // copy from/to buffer sh4_dma_ddt(cpu, &ddtdata); dma_state = dma_endflag ? DMA_DONE : DMA_SEND; @@ -214,7 +214,7 @@ void maple_dc_device::dma_step() ddtdata.size = 4; // bytes per word ddtdata.buffer = data; // destination buffer ddtdata.direction = 1; // 0 source to buffer, 1 buffer to source - ddtdata.channel = -1; // not used + ddtdata.channel = 0; ddtdata.mode = -1; // copy from/to buffer sh4_dma_ddt(cpu, &ddtdata); dma_dest += length*4; diff --git a/src/mess/machine/dccons.c b/src/mess/machine/dccons.c index 1591448f6b4..c5ad881d3f8 100644 --- a/src/mess/machine/dccons.c +++ b/src/mess/machine/dccons.c @@ -68,7 +68,7 @@ TIMER_CALLBACK_MEMBER(dc_cons_state::atapi_xfer_end ) ddtdata.size = 4; ddtdata.buffer = sector_buffer; ddtdata.direction=1; // 0 source to buffer, 1 buffer to destination - ddtdata.channel= -1; // not used + ddtdata.channel= 0; ddtdata.mode= -1; // copy from/to buffer printf("ATAPI: DMA one sector to %x, %x remaining\n", atapi_xferbase, atapi_xferlen); sh4_dma_ddt(m_maincpu, &ddtdata);