Previous 199869 Revisions Next

r22565 Friday 26th April, 2013 at 19:07:57 UTC by hap
small update
[src/mame/drivers]taitojc.c
[src/mame/includes]taitojc.h

trunk/src/mame/includes/taitojc.h
r22564r22565
105105   int m_speed_meter;
106106   int m_brake_meter;
107107
108   DECLARE_READ32_MEMBER(mcu_comm_r);
109   DECLARE_WRITE32_MEMBER(mcu_comm_w);
108   DECLARE_READ8_MEMBER(mcu_comm_r);
109   DECLARE_WRITE8_MEMBER(mcu_comm_w);
110110   DECLARE_READ32_MEMBER(dsp_shared_r);
111111   DECLARE_WRITE32_MEMBER(dsp_shared_w);
112112   DECLARE_READ32_MEMBER(snd_share_r);
r22564r22565
114114   DECLARE_READ8_MEMBER(jc_pcbid_r);
115115   DECLARE_READ8_MEMBER(jc_lan_r);
116116   DECLARE_WRITE8_MEMBER(jc_lan_w);
117   DECLARE_WRITE8_MEMBER(jc_irq_ack_w);
117118   DECLARE_WRITE8_MEMBER(dendego_speedmeter_w);
118119   DECLARE_WRITE8_MEMBER(dendego_brakemeter_w);
119120
r22564r22565
166167   void draw_object_bank(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 bank_type, UINT8 pri);
167168   void taitojc_clear_frame();
168169   void debug_dsp_command();
169   UINT8 mcu_comm_reg_r(address_space &space, int reg);
170   void mcu_comm_reg_w(address_space &space, int reg, UINT8 data);
171170};
172171
173172
trunk/src/mame/drivers/taitojc.c
r22564r22565
1212- TC0870HVP      : Vertex processor?
1313
1414TODO:
15- games are running too slow compared to pcb recordings, easily noticeable on sidebs/sidebs2
15- games are running at wrong speed(unthrottled?) compared to pcb recordings, easily noticeable on sidebs/sidebs2,
16  for example the selection screens are too fast, and the driving is almost twice as slow
1617- dendego intro object RAM usage has various gfx bugs (check video file)
1718- dendego title screen builds up and it shouldn't
18- dendego attract mode train doesn't ride
19- dendego attract mode train doesn't ride, demo mode doesn't set the throttle, but it does set the brake pressure
1920- landgear has some weird crashes (after playing one round, after a couple of loops in attract mode) (needs testing -AS)
2021- landgear has huge 3d problems on gameplay (CPU comms?)
2122- dangcurv DSP program crashes very soon due to undumped rom, so no 3d is currently shown.
r22564r22565
567568   }
568569#endif
569570
570   if (offset == 0x1ff8/4)
571      m_maincpu->set_input_line(6, CLEAR_LINE);
572
573571   if (offset == 0x1ffc/4)
574572   {
575573      if ((data & 0x80000) == 0)
r22564r22565
599597
600598
601599
602UINT8 taitojc_state::mcu_comm_reg_r(address_space &space, int reg)
600READ8_MEMBER(taitojc_state::mcu_comm_r)
603601{
604   UINT8 r = 0;
605
606   switch (reg)
602   switch (offset)
607603   {
608604      case 0x03:
609      {
610         r = m_mcu_data_main;
611         break;
612      }
605         return m_mcu_data_main;
606
613607      case 0x04:
614      {
615         r = m_mcu_comm_main | 0x14;
616         break;
617      }
608         return m_mcu_comm_main | 0x14;
609
618610      default:
619      {
620         //mame_printf_debug("hc11_reg_r: %02X at %08X\n", reg, space.device().safe_pc());
611         logerror("mcu_comm_r: %02X at %08X\n", offset, space.device().safe_pc());
621612         break;
622      }
623613   }
624614
625   return r;
615   return 0;
626616}
627617
628void taitojc_state::mcu_comm_reg_w(address_space &space, int reg, UINT8 data)
618WRITE8_MEMBER(taitojc_state::mcu_comm_w)
629619{
630   switch (reg)
620   switch (offset)
631621   {
632622      case 0x00:
633      {
634623         m_mcu_data_hc11 = data;
635624         m_mcu_comm_hc11 &= ~0x04;
636625         m_mcu_comm_main &= ~0x20;
637626         break;
638      }
627
639628      case 0x04:
640      {
641629         break;
642      }
630
643631      default:
644      {
645         //mame_printf_debug("hc11_reg_w: %02X, %02X at %08X\n", reg, data, space.device().safe_pc());
632         logerror("mcu_comm_w: %02X, %02X at %08X\n", offset, data, space.device().safe_pc());
646633         break;
647      }
648634   }
649635}
650636
651READ32_MEMBER(taitojc_state::mcu_comm_r)
652{
653   UINT32 r = 0;
654   int reg = offset * 4;
655
656   if (ACCESSING_BITS_24_31)
657   {
658      r |= mcu_comm_reg_r(space, reg + 0) << 24;
659   }
660   if (ACCESSING_BITS_16_23)
661   {
662      r |= mcu_comm_reg_r(space, reg + 1) << 16;
663   }
664   if (ACCESSING_BITS_8_15)
665   {
666      r |= mcu_comm_reg_r(space, reg + 2) << 8;
667   }
668   if (ACCESSING_BITS_0_7)
669   {
670      r |= mcu_comm_reg_r(space, reg + 3) << 0;
671   }
672
673   return r;
674}
675
676WRITE32_MEMBER(taitojc_state::mcu_comm_w)
677{
678   int reg = offset * 4;
679
680   if (ACCESSING_BITS_24_31)
681   {
682      mcu_comm_reg_w(space, reg + 0, (data >> 24) & 0xff);
683   }
684   if (ACCESSING_BITS_16_23)
685   {
686      mcu_comm_reg_w(space, reg + 1, (data >> 16) & 0xff);
687   }
688   if (ACCESSING_BITS_8_15)
689   {
690      mcu_comm_reg_w(space, reg + 2, (data >> 8) & 0xff);
691   }
692   if (ACCESSING_BITS_0_7)
693   {
694      mcu_comm_reg_w(space, reg + 3, (data >> 0) & 0xff);
695   }
696}
697
698637READ32_MEMBER(taitojc_state::snd_share_r)
699638{
700639   switch (offset & 3)
r22564r22565
734673}
735674
736675
676WRITE8_MEMBER(taitojc_state::jc_irq_ack_w)
677{
678   // gets written to at the end of irq6 routine
679   // writes $02 or $06, depending on a value in DSP RAM, what does it mean?
680   m_maincpu->set_input_line(6, CLEAR_LINE);
681}
682
683
737684/*
738685
739686Some games (Dangerous Curves, Side by Side, Side by Side 2) were released as Twin cabinets,
r22564r22565
761708   AM_RANGE(0x040fc000, 0x040fefff) AM_READWRITE(taitojc_char_r, taitojc_char_w)
762709   AM_RANGE(0x040ff000, 0x040fffff) AM_RAM AM_SHARE("objlist")
763710   AM_RANGE(0x05800000, 0x0580003f) AM_READ8(jc_pcbid_r, 0xffffffff)
764   AM_RANGE(0x05900000, 0x05900007) AM_READWRITE(mcu_comm_r, mcu_comm_w)
711   AM_RANGE(0x05900000, 0x05900007) AM_READWRITE8(mcu_comm_r, mcu_comm_w, 0xffffffff)
765712   AM_RANGE(0x06400000, 0x0641ffff) AM_READWRITE(taitojc_palette_r, taitojc_palette_w) AM_SHARE("palette_ram")
766713   AM_RANGE(0x06600000, 0x0660001f) AM_DEVREADWRITE8_LEGACY("tc0640fio", tc0640fio_r, tc0640fio_w, 0xff000000)
767714   AM_RANGE(0x0660004c, 0x0660004f) AM_WRITE_PORT("EEPROMOUT")
768   AM_RANGE(0x06800000, 0x06800003) AM_WRITENOP // irq mask/ack? a watchdog?
715   AM_RANGE(0x06800000, 0x06800003) AM_WRITE8(jc_irq_ack_w, 0x00ff0000)
769716   AM_RANGE(0x06a00000, 0x06a01fff) AM_READWRITE(snd_share_r, snd_share_w) AM_SHARE("snd_shared")
770717   AM_RANGE(0x06c00000, 0x06c0001f) AM_READWRITE8(jc_lan_r, jc_lan_w, 0x00ff0000)
771718   AM_RANGE(0x08000000, 0x080fffff) AM_RAM AM_SHARE("main_ram")
r22564r22565
987934   int x, y;
988935   //mame_printf_debug("texture write %08X, %04X\n", dsp_addr1, data);
989936
990   x = (m_dsp_tex_offset >> 0) & 0x1f;
991   y = (m_dsp_tex_offset >> 5) & 0x1f;
937   x = (m_dsp_tex_offset >> 0 & 0x1f) | (m_dsp_tex_offset >> 5 & 0x20);
938   y = (m_dsp_tex_offset >> 5 & 0x1f) | (m_dsp_tex_offset >> 6 & 0x20);
992939
993   x += (m_dsp_tex_offset & 0x400) ? 0x20 : 0;
994   y += (m_dsp_tex_offset & 0x800) ? 0x20 : 0;
995
996940   index = (((m_texture_y * 32) + y) * 2048) + ((m_texture_x * 32) + x);
997941   m_texture[index] = data & 0xff;
998942
r22564r22565
1039983
1040984WRITE16_MEMBER(taitojc_state::dsp_to_main_w)
1041985{
1042   m_maincpu->set_input_line(6, ASSERT_LINE);
986   m_maincpu->set_input_line(6, ASSERT_LINE); // probably not correct to do it here
1043987
1044988   COMBINE_DATA(&m_dsp_shared_ram[0x7fe]);
1045989}
r22564r22565
10901034
10911035   PORT_START("COINS")
10921036   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
1093   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1037   PORT_DIPNAME( 0x02, 0x02, "Dev Skip RAM Test" ) // skips mainram test on page 1 of POST
1038   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1039   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10941040   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
10951041   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
10961042   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
r22564r22565
11151061   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
11161062   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
11171063   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1118   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // debug related in dendego/sidebs
1064   PORT_DIPNAME( 0x40, 0x40, "Dev Debug" ) // debug related in dendego/sidebs
1065   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1066   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11191067   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
11201068
11211069   PORT_START("BUTTONS")
r22564r22565
12471195
12481196INTERRUPT_GEN_MEMBER(taitojc_state::taitojc_vblank)
12491197{
1250   device.execute().set_input_line_and_vector(2, HOLD_LINE, 130);
1198   device.execute().set_input_line_and_vector(2, HOLD_LINE, 0x82); // where does it come from?
12511199}
12521200
12531201static const tc0640fio_interface taitojc_io_intf =
r22564r22565
12681216   /* basic machine hardware */
12691217   MCFG_CPU_ADD("maincpu", M68040, XTAL_10MHz*2) // 20MHz, clock source = CY7C991
12701218   MCFG_CPU_PROGRAM_MAP(taitojc_map)
1271   MCFG_CPU_VBLANK_INT_DRIVER("screen", taitojc_state, taitojc_vblank)
1219   MCFG_CPU_VBLANK_INT_DRIVER("screen", taitojc_state, taitojc_vblank)
12721220
12731221   MCFG_CPU_ADD("sub", MC68HC11, XTAL_16MHz/2) // 8MHz, MC68HC11M0
12741222   MCFG_CPU_PROGRAM_MAP(hc11_pgm_map)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team