summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2010-12-23 00:18:57 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2010-12-23 00:18:57 +0000
commite1d838b1eecdb6df1fa92894a211dc0ea98d080f (patch)
tree45a7d6b70ea2f998f6bdb6930b3a99f233570652 /src
parent0f0bdc3623b2a4d638fe29e01718cd2d447938ac (diff)
Added DMA commands 0x82 and 0x09 to raiden2.c, no whatsnew
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/raiden2.c51
-rw-r--r--src/mame/includes/raiden2.h3
2 files changed, 48 insertions, 6 deletions
diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c
index 43a7379eed5..95f0bcfe975 100644
--- a/src/mame/drivers/raiden2.c
+++ b/src/mame/drivers/raiden2.c
@@ -189,6 +189,11 @@ WRITE16_MEMBER(raiden2_state::cop_pgm_trigger_w)
cop_latch_trigger = data;
}
+WRITE16_MEMBER(raiden2_state::cop_dma_adr_rel_w)
+{
+ COMBINE_DATA(&cop_dma_adr_rel);
+}
+
WRITE16_MEMBER(raiden2_state::cop_dma_v1_w)
{
COMBINE_DATA(&cop_dma_v1);
@@ -223,9 +228,6 @@ WRITE16_MEMBER(raiden2_state::cop_dma_trigger_w)
{
// logerror("COP DMA mode=%x adr=%x size=%x vals=%x %x %x\n", cop_dma_mode, cop_dma_adr, cop_dma_size, cop_dma_v1, cop_dma_v2, cop_dma_v3);
- //if(cop_dma_mode != 0x14 && cop_dma_mode != 0x15)
- // printf("%02x\n",cop_dma_mode);
-
switch(cop_dma_mode) {
case 0x14: {
int rsize = 32*(0x7f-cop_dma_size);
@@ -235,6 +237,44 @@ WRITE16_MEMBER(raiden2_state::cop_dma_trigger_w)
sprites_cur_start = rsize;
break;
}
+ case 0x82: {
+ UINT32 src,dst,size;
+ int i;
+
+ src = (cop_dma_adr << 6) + (cop_dma_adr_rel * 0x400);
+ dst = (cop_dma_v3 << 6);
+ size = ((cop_dma_size << 5) - (cop_dma_v3 << 6) + 0x20)/2;
+
+ //printf("%08x %08x %08x\n",src,dst,size);
+
+ for(i = 0;i < size;i++)
+ {
+ space.write_word(dst, space.read_word(src));
+ src+=2;
+ dst+=2;
+ }
+
+ break;
+ }
+ case 0x09: {
+ UINT32 src,dst,size;
+ int i;
+
+ src = (cop_dma_adr << 6);
+ dst = (cop_dma_v3 << 6);
+ size = ((cop_dma_size << 5) - (cop_dma_v3 << 6) + 0x20)/2;
+
+// printf("%08x %08x %08x\n",src,dst,size);
+
+ for(i = 0;i < size;i++)
+ {
+ space.write_word(dst, space.read_word(src));
+ src+=2;
+ dst+=2;
+ }
+
+ break;
+ }
}
}
@@ -858,6 +898,8 @@ static ADDRESS_MAP_START( raiden2_cop_mem, ADDRESS_SPACE_PROGRAM, 16, raiden2_st
AM_RANGE(0x0043c, 0x0043d) AM_WRITE(cop_pgm_trigger_w)
AM_RANGE(0x00444, 0x00445) AM_WRITE(cop_scale_w)
AM_RANGE(0x00470, 0x00471) AM_WRITE(cop_tile_bank_2_w)
+
+ AM_RANGE(0x00476, 0x00477) AM_WRITE(cop_dma_adr_rel_w)
AM_RANGE(0x00478, 0x00479) AM_WRITE(cop_dma_adr_w)
AM_RANGE(0x0047a, 0x0047b) AM_WRITE(cop_dma_size_w)
AM_RANGE(0x0047c, 0x0047d) AM_WRITE(cop_dma_v3_w)
@@ -954,8 +996,7 @@ static ADDRESS_MAP_START( xsedae_mem, ADDRESS_SPACE_PROGRAM, 16, raiden2_state )
AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE(raiden2_midground_w) AM_BASE(mid_data)
AM_RANGE(0x0d000, 0x0dfff) AM_RAM_WRITE(raiden2_text_w) AM_BASE(text_data)
- /* TODO: probably needs a DMA */
- AM_RANGE(0x14800, 0x157ff) AM_RAM AM_WRITE_LEGACY(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram)
+ AM_RANGE(0x0e000, 0x0efff) AM_RAM AM_WRITE_LEGACY(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x00800, 0x0ffff) AM_RAM
AM_RANGE(0x10000, 0x1ffff) AM_RAM
diff --git a/src/mame/includes/raiden2.h b/src/mame/includes/raiden2.h
index 4c492947d7c..c6d17d8aa50 100644
--- a/src/mame/includes/raiden2.h
+++ b/src/mame/includes/raiden2.h
@@ -10,6 +10,7 @@ public:
DECLARE_WRITE16_MEMBER( cop_dma_v1_w );
DECLARE_WRITE16_MEMBER( cop_dma_v2_w );
DECLARE_WRITE16_MEMBER( cop_scale_w );
+ DECLARE_WRITE16_MEMBER( cop_dma_adr_rel_w );
DECLARE_WRITE16_MEMBER( cop_dma_adr_w );
DECLARE_WRITE16_MEMBER( cop_dma_size_w );
DECLARE_WRITE16_MEMBER( cop_dma_v3_w );
@@ -71,7 +72,7 @@ public:
UINT32 cop_regs[4], cop_itoa;
UINT16 cop_status, cop_scale, cop_itoa_digit_count, cop_angle, cop_dist;
UINT8 cop_itoa_digits[10];
- UINT16 cop_dma_mode, cop_dma_adr, cop_dma_size, cop_dma_v1, cop_dma_v2, cop_dma_v3;
+ UINT16 cop_dma_mode, cop_dma_adr, cop_dma_size, cop_dma_v1, cop_dma_v2, cop_dma_v3,cop_dma_adr_rel;
UINT16 sprites[0x800], sprites_cur_start;
UINT16 cop_func_trigger[0x100/8]; /* function trigger */