Previous 199869 Revisions Next

r31828 Friday 29th August, 2014 at 13:21:14 UTC by O. Galibert
raiden2: Add 6200 (nw)
[src/mame/drivers]raiden2.c
[src/mame/includes]raiden2.h

trunk/src/mame/drivers/raiden2.c
r31827r31828
480480   cop_scale &= 3;
481481}
482482
483WRITE16_MEMBER(raiden2_state::cop_angle_target_w)
484{
485   COMBINE_DATA(&cop_angle_target);
486}
487
488WRITE16_MEMBER(raiden2_state::cop_angle_step_w)
489{
490   COMBINE_DATA(&cop_angle_step);
491}
492
483493READ16_MEMBER(raiden2_state::cop_reg_high_r)
484494{
485495   return cop_regs[offset] >> 16;
r31827r31828
625635      break;
626636   }
627637
638   case 0x6200: {
639      UINT8 angle = space.read_byte(cop_regs[0]+0x34);
640      UINT16 flags = space.read_word(cop_regs[0]);
641      cop_angle_target &= 0xff;
642      cop_angle_step &= 0xff;
643      flags &= ~0x0004;
644      int delta = angle - cop_angle_target;
645      if(delta >= 128)
646         delta -= 256;
647      else if(delta < -128)
648         delta += 256;
649      if(delta < 0) {
650         if(delta >= -cop_angle_step) {
651            angle = cop_angle_target;
652            flags |= 0x0004;
653         } else
654            angle += cop_angle_step;
655      } else {
656         if(delta <= cop_angle_step) {
657            angle = cop_angle_target;
658            flags |= 0x0004;
659         } else
660            angle -= cop_angle_step;
661      }
662      space.write_word(cop_regs[0], flags);
663      space.write_byte(cop_regs[0]+0x34, angle);
664      break;
665   }
666
628667   case 0x8100: { // 8100 0007 fdfb 0080 - 0b9a 0b88 0888 0000 0000 0000 0000 0000
629668      int raw_angle = (space.read_word(cop_regs[0]+(0x34)) & 0xff);
630669      double angle = raw_angle * M_PI / 128;
r31827r31828
13961435
13971436/* MEMORY MAPS */
13981437static ADDRESS_MAP_START( raiden2_cop_mem, AS_PROGRAM, 16, raiden2_state )
1399//  AM_RANGE(0x0041c, 0x0041d) AM_WRITENOP // angle compare (for 0x6200 COP macro)
1400//  AM_RANGE(0x0041e, 0x0041f) AM_WRITENOP // angle mod value (for 0x6200 COP macro)
1438   AM_RANGE(0x0041c, 0x0041d) AM_WRITE(cop_angle_target_w) // angle target (for 0x6200 COP macro)
1439   AM_RANGE(0x0041e, 0x0041f) AM_WRITE(cop_angle_step_w)   // angle step   (for 0x6200 COP macro)
14011440   AM_RANGE(0x00420, 0x00421) AM_WRITE(cop_itoa_low_w)
14021441   AM_RANGE(0x00422, 0x00423) AM_WRITE(cop_itoa_high_w)
14031442   AM_RANGE(0x00424, 0x00425) AM_WRITE(cop_itoa_digit_count_w)
trunk/src/mame/includes/raiden2.h
r31827r31828
2727   DECLARE_WRITE16_MEMBER( cop_dma_v1_w );
2828   DECLARE_WRITE16_MEMBER( cop_dma_v2_w );
2929   DECLARE_WRITE16_MEMBER( cop_scale_w );
30   DECLARE_WRITE16_MEMBER( cop_angle_target_w );
31   DECLARE_WRITE16_MEMBER( cop_angle_step_w );
3032   DECLARE_WRITE16_MEMBER( cop_dma_adr_rel_w );
3133   DECLARE_WRITE16_MEMBER( cop_dma_src_w );
3234   DECLARE_WRITE16_MEMBER( cop_dma_size_w );
r31827r31828
108110   UINT16 cop_func_mask[0x100/8];          /* function mask (?) */
109111   UINT16 cop_program[0x100];              /* program "code" */
110112   UINT16 cop_latch_addr, cop_latch_trigger, cop_latch_value, cop_latch_mask;
111   INT8 cop_angle_compare;
112   UINT8 cop_angle_mod_val;
113   UINT16 cop_angle_target;
114   UINT16 cop_angle_step;
113115
114116   DECLARE_WRITE16_MEMBER( sprite_prot_x_w );
115117   DECLARE_WRITE16_MEMBER( sprite_prot_y_w );

Previous 199869 Revisions Next


© 1997-2024 The MAME Team