trunk/src/mame/drivers/legionna.c
| r32337 | r32338 | |
| 93 | 93 | AM_RANGE(0x100400, 0x100401) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_sprite_dma_param_lo_w) // grainbow |
| 94 | 94 | AM_RANGE(0x100402, 0x100403) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_sprite_dma_param_hi_w) // grainbow |
| 95 | 95 | AM_RANGE(0x10040c, 0x10040d) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_sprite_dma_size_w) // grainbow |
| 96 | AM_RANGE(0x100410, 0x100411) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_sprite_dma_inc_w) // grainbow |
| 97 | AM_RANGE(0x100412, 0x100413) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_sprite_dma_src_hi_w) // grainbow |
| 98 | AM_RANGE(0x100414, 0x100415) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_sprite_dma_src_lo_w) // grainbow |
| 96 | 99 | |
| 100 | |
| 97 | 101 | // AM_RANGE(0x10041c, 0x10041d) AM_WRITE(cop_angle_target_w) // angle target (for 0x6200 COP macro) |
| 98 | 102 | // AM_RANGE(0x10041e, 0x10041f) AM_WRITE(cop_angle_step_w) // angle step (for 0x6200 COP macro) |
| 99 | 103 | AM_RANGE(0x100420, 0x100421) AM_DEVWRITE("raiden2cop", raiden2cop_device, cop_itoa_low_w) |
trunk/src/mame/machine/seicop.c
| r32337 | r32338 | |
| 1611 | 1611 | m_cop_rom_addr_lo(0), |
| 1612 | 1612 | m_cop_rom_addr_hi(0), |
| 1613 | 1613 | m_cop_rom_addr_unk(0), |
| 1614 | | m_cop_sprite_dma_src(0), |
| 1615 | 1614 | m_cop_sprite_dma_abs_x(0), |
| 1616 | 1615 | m_cop_sprite_dma_abs_y(0), |
| 1617 | 1616 | m_raiden2cop(*this, ":raiden2cop") |
| r32337 | r32338 | |
| 1651 | 1650 | save_item(NAME(m_cop_rom_addr_lo)); |
| 1652 | 1651 | save_item(NAME(m_cop_rom_addr_hi)); |
| 1653 | 1652 | save_item(NAME(m_cop_rom_addr_unk)); |
| 1654 | | save_item(NAME(m_cop_sprite_dma_src)); |
| 1655 | 1653 | save_item(NAME(m_cop_sprite_dma_abs_x)); |
| 1656 | 1654 | save_item(NAME(m_cop_sprite_dma_abs_y)); |
| 1657 | 1655 | } |
| r32337 | r32338 | |
| 2070 | 2068 | |
| 2071 | 2069 | |
| 2072 | 2070 | |
| 2073 | | case (0x010/2): |
| 2074 | | { |
| 2075 | | if(data) |
| 2076 | | printf("Warning: COP RAM 0x410 used with %04x\n",data); |
| 2077 | | else |
| 2078 | | { |
| 2079 | | /* guess */ |
| 2080 | | m_raiden2cop->cop_regs[4]+=8; |
| 2081 | | m_cop_sprite_dma_src+=6; |
| 2082 | 2071 | |
| 2083 | | m_raiden2cop->m_cop_sprite_dma_size--; |
| 2084 | 2072 | |
| 2085 | | if(m_raiden2cop->m_cop_sprite_dma_size > 0) |
| 2086 | | m_raiden2cop->cop_status &= ~2; |
| 2087 | | else |
| 2088 | | m_raiden2cop->cop_status |= 2; |
| 2089 | | } |
| 2090 | | break; |
| 2091 | | } |
| 2092 | | |
| 2093 | | case (0x012/2): |
| 2094 | | case (0x014/2): |
| 2095 | | m_cop_sprite_dma_src = (m_cop_mcu_ram[0x014/2]) | (m_cop_mcu_ram[0x012/2] << 16); |
| 2096 | | break; |
| 2097 | | |
| 2098 | 2073 | /* triggered before 0x6200 in Seibu Cup, looks like an angle value ... */ |
| 2099 | 2074 | case (0x01c/2): m_legacycop_angle_compare = UINT16(m_cop_mcu_ram[0x1c/2]); break; |
| 2100 | 2075 | case (0x01e/2): m_legacycop_angle_mod_val = UINT16(m_cop_mcu_ram[0x1e/2]); break; |
| r32337 | r32338 | |
| 2470 | 2445 | /* TODO: I really suspect that following two are actually taken from the 0xa180 macro command then internally loaded */ |
| 2471 | 2446 | abs_x = space.read_word(m_raiden2cop->cop_regs[0] + 8) - m_cop_sprite_dma_abs_x; |
| 2472 | 2447 | abs_y = space.read_word(m_raiden2cop->cop_regs[0] + 4) - m_cop_sprite_dma_abs_y; |
| 2473 | | rel_xy = space.read_word(m_cop_sprite_dma_src + 4 + offs); |
| 2448 | rel_xy = space.read_word(m_raiden2cop->m_cop_sprite_dma_src + 4 + offs); |
| 2474 | 2449 | |
| 2475 | 2450 | //if(rel_xy & 0x0706) |
| 2476 | 2451 | // printf("sprite rel_xy = %04x\n",rel_xy); |
| r32337 | r32338 | |
| 2492 | 2467 | |
| 2493 | 2468 | offs = (offset & 3) * 4; |
| 2494 | 2469 | |
| 2495 | | space.write_word(m_raiden2cop->cop_regs[4] + offs + 0,space.read_word(m_cop_sprite_dma_src + offs) + (m_raiden2cop->m_cop_sprite_dma_param & 0x3f)); |
| 2496 | | //space.write_word(m_raiden2cop->cop_regs[4] + offs + 2,space.read_word(m_cop_sprite_dma_src+2 + offs)); |
| 2470 | space.write_word(m_raiden2cop->cop_regs[4] + offs + 0,space.read_word(m_raiden2cop->m_cop_sprite_dma_src + offs) + (m_raiden2cop->m_cop_sprite_dma_param & 0x3f)); |
| 2471 | //space.write_word(m_raiden2cop->cop_regs[4] + offs + 2,space.read_word(m_raiden2cop->m_cop_sprite_dma_src+2 + offs)); |
| 2497 | 2472 | return; |
| 2498 | 2473 | } |
| 2499 | 2474 | |
trunk/src/mame/machine/raiden2cop.c
| r32337 | r32338 | |
| 44 | 44 | m_cop_rng_max_value(0), |
| 45 | 45 | |
| 46 | 46 | m_cop_sprite_dma_param(0), |
| 47 | m_cop_sprite_dma_src(0), |
| 47 | 48 | m_cop_sprite_dma_size(0), |
| 48 | 49 | |
| 49 | 50 | |
| r32337 | r32338 | |
| 136 | 137 | save_item(NAME(m_cop_sprite_dma_param)); |
| 137 | 138 | |
| 138 | 139 | save_item(NAME(m_cop_sprite_dma_size)); |
| 140 | save_item(NAME(m_cop_sprite_dma_src)); |
| 139 | 141 | |
| 140 | 142 | |
| 141 | 143 | m_videoramout_cb.resolve_safe(); |
| r32337 | r32338 | |
| 1106 | 1108 | { |
| 1107 | 1109 | m_cop_sprite_dma_size = data; |
| 1108 | 1110 | } |
| 1111 | |
| 1112 | |
| 1113 | WRITE16_MEMBER( raiden2cop_device::cop_sprite_dma_src_hi_w) |
| 1114 | { |
| 1115 | m_cop_sprite_dma_src = (m_cop_sprite_dma_src&0x0000ffff)|(data<<16); |
| 1116 | } |
| 1117 | |
| 1118 | WRITE16_MEMBER( raiden2cop_device::cop_sprite_dma_src_lo_w) |
| 1119 | { |
| 1120 | m_cop_sprite_dma_src = (m_cop_sprite_dma_src&0xffff0000)|(data&0xffff); |
| 1121 | } |
| 1122 | |
| 1123 | // guess |
| 1124 | WRITE16_MEMBER(raiden2cop_device::cop_sprite_dma_inc_w) |
| 1125 | { |
| 1126 | if (data) |
| 1127 | printf("Warning: COP RAM 0x410 used with %04x\n", data); |
| 1128 | else |
| 1129 | { |
| 1130 | /* guess */ |
| 1131 | cop_regs[4] += 8; |
| 1132 | m_cop_sprite_dma_src += 6; |
| 1133 | |
| 1134 | m_cop_sprite_dma_size--; |
| 1135 | |
| 1136 | if (m_cop_sprite_dma_size > 0) |
| 1137 | cop_status &= ~2; |
| 1138 | else |
| 1139 | cop_status |= 2; |
| 1140 | } |
| 1141 | } |
trunk/src/mame/machine/raiden2cop.h
| r32337 | r32338 | |
| 156 | 156 | |
| 157 | 157 | // misc 68k (grainbow) |
| 158 | 158 | UINT32 m_cop_sprite_dma_param; |
| 159 | UINT32 m_cop_sprite_dma_src; |
| 160 | |
| 159 | 161 | DECLARE_WRITE16_MEMBER(cop_sprite_dma_param_hi_w); |
| 160 | 162 | DECLARE_WRITE16_MEMBER(cop_sprite_dma_param_lo_w); |
| 161 | 163 | DECLARE_WRITE16_MEMBER(cop_sprite_dma_size_w); |
| 164 | DECLARE_WRITE16_MEMBER(cop_sprite_dma_src_hi_w); |
| 165 | DECLARE_WRITE16_MEMBER(cop_sprite_dma_src_lo_w); |
| 166 | DECLARE_WRITE16_MEMBER(cop_sprite_dma_inc_w); |
| 162 | 167 | int m_cop_sprite_dma_size; |
| 163 | 168 | |
| 164 | 169 | protected: |