Previous 199869 Revisions Next

r31825 Friday 29th August, 2014 at 01:05:44 UTC by hap
added mb8421 to taitojc.c
also removed debug_dsp_command()
[src/emu/machine]mb8421.c mb8421.h
[src/mame/drivers]taitojc.c
[src/mame/includes]taitojc.h

trunk/src/mame/drivers/taitojc.c
r31824r31825
311311      D482445 - 256k x16 Video DRAM. Compatible with Toshiba TC524165/TC52V4165 (also used on Namco System 11 CPU boards)
312312      LC321664- 64k x16 DRAM
313313      TC51832 - 32k x8 SRAM
314      MB8422  - 16k-bit (2kbytes) Dual Port SRAM
314      MB8421  - 16k-bit (2kbytes) Dual Port SRAM
315315
316316      Measurements:
317317                   HSync  - 24.639kHz / 24.690kHz (alternates between the two frequencies slowly every ~2 seconds)
r31824r31825
380380#include "cpu/mc68hc11/mc68hc11.h"
381381#include "sound/es5506.h"
382382#include "sound/okim6295.h"
383#include "machine/mb8421.h"
384#include "machine/taitoio.h"
383385#include "machine/eepromser.h"
384386#include "audio/taito_en.h"
385387#include "includes/taitojc.h"
r31824r31825
444446#define VBSTART             (400)
445447
446448
449#define DSP_IDLESKIP        1 /* dsp idle skipping speedup hack */
450
451
447452/***************************************************************************
448453
449  maincpu I/O
454  Interrupts
450455
451456***************************************************************************/
452457
453#define DEBUG_DSP               0
454#define DEBUG_BLOCK_MOVES       0
455
456READ32_MEMBER(taitojc_state::dsp_shared_r)
458WRITE_LINE_MEMBER(taitojc_state::mb8421_intl)
457459{
458   return m_dsp_shared_ram[offset] << 16;
460   m_maincpu->set_input_line(6, state ? ASSERT_LINE : CLEAR_LINE);
459461}
460462
461#if DEBUG_DSP
462
463void taitojc_state::debug_dsp_command()
463WRITE_LINE_MEMBER(taitojc_state::mb8421_intr)
464464{
465   UINT16 *cmd = &m_dsp_shared_ram[0x1fc0/2];
466
467   switch (cmd[0])
465   // this is hacky, acquiring the internal dsp romdump should allow it to be cleaned up
466   if (state)
468467   {
469      case 0x00:
468      if (m_mb8421->peek(0x7ff) & 0x08)
470469      {
471         printf("DSP: NOP\n");
472         break;
470         m_dsp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
473471      }
474      case 0x01:
472      else
475473      {
476         printf("DSP: Move to Shared RAM: %04X\n", cmd[1]);
477         break;
478      }
479      case 0x02:
480      {
481         printf("DSP: Move from Shared RAM: %04X\n", cmd[1]);
482         break;
483      }
484      case 0x03:
485      {
486         printf("DSP: Block move DM to DM: %04X, %04X, %04X\n", cmd[1], cmd[2], cmd[3]+1);
487         if (cmd[2] >= 0x7800 && cmd[2] < 0x8000)
488         {
489            int i, j;
490            int saddr = cmd[2] - 0x7800;
491            int daddr = cmd[1];
492            int length = cmd[3]+1;
493
494            for (j=0; j < length; j+=16)
495            {
496               int ll = (length - j);
497               if (ll > 16) ll = 16;
498
499#if DEBUG_BLOCK_MOVES
500               printf("   %04X: ", daddr);
501#endif
502               for (i=0; i < ll; i++)
503               {
504                  UINT16 d = m_dsp_shared_ram[saddr++];
505                  if (daddr >= 0x8000 && daddr < 0x10000)
506                  {
507                     m_debug_dsp_ram[daddr-0x8000] = d;
508                  }
509                  daddr++;
510
511#if DEBUG_BLOCK_MOVES
512                  printf("%04X ", d);
513#endif
514               }
515#if DEBUG_BLOCK_MOVES
516               printf("\n");
517#endif
518            }
519         }
520         break;
521      }
522      case 0x04:
523      {
524         printf("DSP: Block move PM to DM: %04X, %04X, %04X\n", cmd[1], cmd[2], cmd[3]+1);
525         break;
526      }
527      case 0x05:
528      {
529         printf("DSP: Block move DM to PM: %04X, %04X, %04X\n", cmd[1], cmd[2], cmd[3]+1);
530         break;
531      }
532      case 0x08:
533      {
534         printf("DSP: Jump to address: %04X, %04X, %04X\n", cmd[1], cmd[3], cmd[4]);
535         break;
536      }
537      case 0x09:
538      {
539         printf("DSP: Call Sub operation: %04X\n", cmd[1]);
540         if (cmd[1] == 0x8000)
541         {
542            int addr = 0;
543            int end = 0;
544            while (!end)
545            {
546               int i;
547               UINT16 cmd = m_debug_dsp_ram[addr++];
548               int length = cmd & 0xff;
549
550               if ((cmd >> 11) == 6)
551                  end = 1;
552
553               printf("   %04X (%02X): ", cmd, cmd >> 11);
554               for (i=0; i < length; i++)
555               {
556                  printf("%04X ", m_debug_dsp_ram[addr+i]);
557               }
558               printf("\n");
559
560               addr += length;
561            };
562         }
563         break;
564      }
565      case 0x0d:
566      {
567         printf("DSP: Calculate ROM checksum\n");
568         break;
569      }
570      case 0x10:
571      {
572         printf("DSP: Test RAM\n");
573         break;
574      }
575      case 0x11:
576      {
577         printf("DSP: Test Program Checksum: %04X, %04X\n", cmd[1], cmd[2]+1);
578         break;
579      }
580      default:
581      {
582         printf("DSP: Unknown command %04X\n", cmd[0]);
583         break;
584      }
585   }
586
587   printf("\n");
588}
589#endif // DEBUG_DSP
590
591WRITE32_MEMBER(taitojc_state::dsp_shared_w)
592{
593   //osd_printf_debug("dsp_shared: %08X, %04X at %08X\n", offset, data >> 16, space.device().safe_pc());
594   if (ACCESSING_BITS_24_31)
595   {
596      m_dsp_shared_ram[offset] &= 0x00ff;
597      m_dsp_shared_ram[offset] |= (data >> 16) & 0xff00;
598   }
599   if (ACCESSING_BITS_16_23)
600   {
601      m_dsp_shared_ram[offset] &= 0xff00;
602      m_dsp_shared_ram[offset] |= (data >> 16) & 0x00ff;
603   }
604
605#if DEBUG_DSP
606   if (offset == 0x1fc0/4)
607   {
608      debug_dsp_command(machine());
609   }
610#endif
611
612   if (offset == 0x1ffc/4)
613   {
614      if ((data & 0x80000) == 0)
615      {
616474         /*
475         regarding m_has_dsp_hack:
617476         All games minus Dangerous Curves tests if the DSP is alive with this code snippet:
618477
619478         0008C370: 4A79 1000 1FC0                                      tst.w   $10001fc0.l
r31824r31825
629488         }
630489         m_first_dsp_reset = 0;
631490      }
632      else
633      {
634         m_dsp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
635      }
636491   }
637492}
638493
494INTERRUPT_GEN_MEMBER(taitojc_state::taitojc_vblank)
495{
496   device.execute().set_input_line_and_vector(2, HOLD_LINE, 0x82); // where does it come from?
497}
639498
499WRITE8_MEMBER(taitojc_state::jc_irq_unk_w)
500{
501   // gets written to at the end of irq6 routine
502   // writes $02 or $06, depending on a value in DSP RAM, what does it mean?
503}
640504
505
506/***************************************************************************
507
508  maincpu I/O
509
510***************************************************************************/
511
512READ8_MEMBER(taitojc_state::dsp_shared_r)
513{
514   return m_dsp_shared_ram_hi[offset];
515}
516
517WRITE8_MEMBER(taitojc_state::dsp_shared_w)
518{
519   m_dsp_shared_ram_hi[offset] = data;
520}
521
522
641523READ8_MEMBER(taitojc_state::mcu_comm_r)
642524{
643525   switch (offset)
r31824r31825
714596}
715597
716598
717WRITE8_MEMBER(taitojc_state::jc_irq_ack_w)
718{
719   // gets written to at the end of irq6 routine
720   // writes $02 or $06, depending on a value in DSP RAM, what does it mean?
721   m_maincpu->set_input_line(6, CLEAR_LINE);
722}
723
724
725599/*
726600
727601Some games (Dangerous Curves, Side by Side, Side by Side 2) were released as Twin cabinets,
r31824r31825
753627   AM_RANGE(0x06400000, 0x0641ffff) AM_READWRITE(taitojc_palette_r, taitojc_palette_w) AM_SHARE("palette_ram")
754628   AM_RANGE(0x06600000, 0x0660001f) AM_DEVREADWRITE8("tc0640fio", tc0640fio_device, read, write, 0xff000000)
755629   AM_RANGE(0x0660004c, 0x0660004f) AM_WRITE_PORT("EEPROMOUT")
756   AM_RANGE(0x06800000, 0x06800003) AM_WRITE8(jc_irq_ack_w, 0x00ff0000)
630   AM_RANGE(0x06800000, 0x06800003) AM_WRITE8(jc_irq_unk_w, 0x00ff0000)
757631   AM_RANGE(0x06a00000, 0x06a01fff) AM_READWRITE(snd_share_r, snd_share_w) AM_SHARE("snd_shared")
758632   AM_RANGE(0x06c00000, 0x06c0001f) AM_READWRITE8(jc_lan_r, jc_lan_w, 0x00ff0000)
759633   AM_RANGE(0x08000000, 0x080fffff) AM_RAM AM_SHARE("main_ram")
760   AM_RANGE(0x10000000, 0x10001fff) AM_READWRITE(dsp_shared_r, dsp_shared_w)
634   AM_RANGE(0x10000000, 0x10001fff) AM_DEVREADWRITE8("mb8421", mb8421_device, left_r, left_w, 0x00ff0000)
635   AM_RANGE(0x10000000, 0x10001fff) AM_READWRITE8(dsp_shared_r, dsp_shared_w, 0xff000000) // which chip is this?
761636ADDRESS_MAP_END
762637
763638
r31824r31825
973848{
974849   int index;
975850   int x, y;
976   //osd_printf_debug("texture write %08X, %04X\n", dsp_addr1, data);
977851
978852   x = (m_dsp_tex_offset >> 0 & 0x1f) | (m_dsp_tex_offset >> 5 & 0x20);
979853   y = (m_dsp_tex_offset >> 5 & 0x1f) | (m_dsp_tex_offset >> 6 & 0x20);
r31824r31825
992866WRITE16_MEMBER(taitojc_state::dsp_texaddr_w)
993867{
994868   m_dsp_tex_address = data;
995//  osd_printf_debug("texaddr = %08X at %08X\n", data, space.device().safe_pc());
996869
997870   m_texture_x = (((data >> 0) & 0x1f) << 1) | ((data >> 12) & 0x1);
998871   m_texture_y = (((data >> 5) & 0x1f) << 1) | ((data >> 13) & 0x1);
r31824r31825
1017890   }
1018891}
1019892
1020READ16_MEMBER(taitojc_state::dsp_to_main_r)
1021{
1022   return m_dsp_shared_ram[0x7fe];
1023}
1024
1025WRITE16_MEMBER(taitojc_state::dsp_to_main_w)
1026{
1027   m_maincpu->set_input_line(6, ASSERT_LINE); // probably not correct to do it here
1028
1029   COMBINE_DATA(&m_dsp_shared_ram[0x7fe]);
1030}
1031
1032
1033893static ADDRESS_MAP_START( tms_program_map, AS_PROGRAM, 16, taitojc_state )
1034894   AM_RANGE(0x4000, 0x7fff) AM_RAM
1035895ADDRESS_MAP_END
r31824r31825
1048908   AM_RANGE(0x701d, 0x701d) AM_READ(dsp_math_projection_y_r)
1049909   AM_RANGE(0x701f, 0x701f) AM_READ(dsp_math_projection_x_r)
1050910   AM_RANGE(0x7022, 0x7022) AM_READ(dsp_math_unk_r)
1051   AM_RANGE(0x7ffe, 0x7ffe) AM_READWRITE(dsp_to_main_r, dsp_to_main_w)
1052   AM_RANGE(0x7800, 0x7fff) AM_RAM AM_SHARE("dsp_shared")
911   AM_RANGE(0x7800, 0x7fff) AM_DEVREADWRITE8("mb8421", mb8421_device, right_r, right_w, 0x00ff)
912   AM_RANGE(0x7800, 0x7fff) AM_READWRITE8(dsp_shared_r, dsp_shared_w, 0xff00) // which chip is this?
1053913   AM_RANGE(0x8000, 0xffff) AM_RAM
1054914ADDRESS_MAP_END
1055915
r31824r31825
1120980   PORT_START("EEPROMOUT")
1121981   PORT_BIT( 0x04000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, di_write)
1122982   PORT_BIT( 0x08000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, clk_write)
1123   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, cs_write)
983   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, cs_write)
1124984INPUT_PORTS_END
1125985
1126986// Mascon must always be in a defined state, Densha de Go 2 in particular returns black screen if the Mascon input is undefined
r31824r31825
12291089   m_dsp_tex_offset = 0;
12301090   m_polygon_fifo_ptr = 0;
12311091
1092   memset(m_dsp_shared_ram_hi, 0, sizeof(m_dsp_shared_ram_hi));
12321093   memset(m_viewport_data, 0, sizeof(m_viewport_data));
12331094   memset(m_projection_data, 0, sizeof(m_projection_data));
12341095   memset(m_intersection_data, 0, sizeof(m_intersection_data));
r31824r31825
12371098   m_dsp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
12381099}
12391100
1240INTERRUPT_GEN_MEMBER(taitojc_state::taitojc_vblank)
1101void taitojc_state::machine_start()
12411102{
1242   device.execute().set_input_line_and_vector(2, HOLD_LINE, 0x82); // where does it come from?
1103   // register for savestates
1104   save_item(NAME(m_texture_x));
1105   save_item(NAME(m_texture_y));
1106   save_item(NAME(m_dsp_rom_pos));
1107   save_item(NAME(m_dsp_tex_address));
1108   save_item(NAME(m_dsp_tex_offset));
1109   save_item(NAME(m_first_dsp_reset));
1110   save_item(NAME(m_dsp_shared_ram_hi));
1111   save_item(NAME(m_viewport_data));
1112   save_item(NAME(m_projection_data));
1113   save_item(NAME(m_intersection_data));
1114   save_item(NAME(m_gfx_index));
1115   save_item(NAME(m_polygon_fifo_ptr));
1116
1117   save_item(NAME(m_mcu_comm_main));
1118   save_item(NAME(m_mcu_comm_hc11));
1119   save_item(NAME(m_mcu_data_main));
1120   save_item(NAME(m_mcu_data_hc11));
1121   save_item(NAME(m_mcu_output));
1122
1123   save_item(NAME(m_speed_meter));
1124   save_item(NAME(m_brake_meter));
12431125}
12441126
12451127
r31824r31825
12631145
12641146   MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
12651147
1148   MCFG_DEVICE_ADD("mb8421", MB8421, 0)
1149   MCFG_MB8421_INTL_HANDLER(WRITELINE(taitojc_state, mb8421_intl))
1150   MCFG_MB8421_INTR_HANDLER(WRITELINE(taitojc_state, mb8421_intr))
1151
12661152   MCFG_DEVICE_ADD("tc0640fio", TC0640FIO, 0)
12671153   MCFG_TC0640FIO_READ_0_CB(IOPORT("SERVICE"))
12681154   MCFG_TC0640FIO_READ_1_CB(IOPORT("COINS"))
r31824r31825
13111197
13121198READ16_MEMBER(taitojc_state::taitojc_dsp_idle_skip_r)
13131199{
1314   if(space.device().safe_pc()==0x404c)
1200   if (space.device().safe_pc() == 0x404c)
13151201      space.device().execute().spin_until_time(attotime::from_usec(500));
13161202
1317   return m_dsp_shared_ram[0x7f0];
1203   return m_dsp_shared_ram_hi[0x7f0] << 8 | m_mb8421->peek(0x7f0);
13181204}
13191205
13201206READ16_MEMBER(taitojc_state::dendego2_dsp_idle_skip_r)
13211207{
1322   if(space.device().safe_pc()==0x402e)
1208   if (space.device().safe_pc() == 0x402e)
13231209      space.device().execute().spin_until_time(attotime::from_usec(500));
13241210
1325   return m_dsp_shared_ram[0x7f0];
1211   return m_dsp_shared_ram_hi[0x7f0] << 8 | m_mb8421->peek(0x7f0);
13261212}
13271213
1328WRITE16_MEMBER(taitojc_state::dsp_idle_skip_w)
1329{
1330   COMBINE_DATA(&m_dsp_shared_ram[0x7f0]);
1331}
13321214
1333
13341215DRIVER_INIT_MEMBER(taitojc_state,taitojc)
13351216{
13361217   m_polygon_fifo = auto_alloc_array(machine(), UINT16, TAITOJC_POLYGON_FIFO_SIZE);
13371218
13381219   m_has_dsp_hack = 1;
13391220
1340   m_dsp->space(AS_DATA).install_readwrite_handler(0x7ff0, 0x7ff0, read16_delegate(FUNC(taitojc_state::taitojc_dsp_idle_skip_r),this), write16_delegate(FUNC(taitojc_state::dsp_idle_skip_w),this));
1221   if (DSP_IDLESKIP)
1222      m_dsp->space(AS_DATA).install_read_handler(0x7ff0, 0x7ff0, read16_delegate(FUNC(taitojc_state::taitojc_dsp_idle_skip_r),this));
13411223}
13421224
13431225DRIVER_INIT_MEMBER(taitojc_state,dendego2)
13441226{
13451227   DRIVER_INIT_CALL(taitojc);
13461228
1347   m_dsp->space(AS_DATA).install_readwrite_handler(0x7ff0, 0x7ff0, read16_delegate(FUNC(taitojc_state::dendego2_dsp_idle_skip_r),this), write16_delegate(FUNC(taitojc_state::dsp_idle_skip_w),this));
1229   if (DSP_IDLESKIP)
1230      m_dsp->space(AS_DATA).install_read_handler(0x7ff0, 0x7ff0, read16_delegate(FUNC(taitojc_state::dendego2_dsp_idle_skip_r),this));
13481231}
13491232
13501233DRIVER_INIT_MEMBER(taitojc_state,dangcurv)
r31824r31825
20411924GAME( 1995, landgearj, landgear, taitojc, landgear, taitojc_state, taitojc,  ROT0, "Taito", "Landing Gear (Ver 4.2 J)",                             GAME_IMPERFECT_GRAPHICS )                 // LANDING GEAR           VER 4.2 J   Feb  8 1996  09:46:22
20421925GAME( 1995, landgeara, landgear, taitojc, landgear, taitojc_state, taitojc,  ROT0, "Taito", "Landing Gear (Ver 3.1 O)",                             GAME_IMPERFECT_GRAPHICS )                 // LANDING GEAR           VER 3.1 O   Feb  8 1996  09:46:22
20431926GAME( 1995, landgearja,landgear, taitojc, landgear, taitojc_state, taitojc,  ROT0, "Taito", "Landing Gear (Ver 3.0 J)",                             GAME_IMPERFECT_GRAPHICS )                 // LANDING GEAR           VER 3.0 J   Feb  8 1996  09:46:22
2044GAME( 1996, sidebs,    0,        taitojc, sidebs, taitojc_state,   taitojc,  ROT0, "Taito", "Side by Side (Ver 2.7 J)",                             GAME_IMPERFECT_GRAPHICS )                 // SIDE BY SIDE           VER 2.7 J   1996/10/11   14:54:10
2045GAME( 1996, sidebsja,  sidebs,   taitojc, sidebs, taitojc_state,   taitojc,  ROT0, "Taito", "Side by Side (Ver 2.5 J)",                             GAME_IMPERFECT_GRAPHICS )                 // SIDE BY SIDE           VER 2.5 J   1996/ 6/20   18:13:14
2046GAMEL(1996, dendego,   0,        dendego, dendego, taitojc_state,  taitojc,  ROT0, "Taito", "Densha de GO! (Ver 2.2 J)",                            GAME_IMPERFECT_GRAPHICS, layout_dendego ) // DENSYA DE GO           VER 2.2 J   1997/ 2/ 4   12:00:28
2047GAMEL(1996, dendegox,  dendego,  dendego, dendego, taitojc_state,  taitojc,  ROT0, "Taito", "Densha de GO! EX (Ver 2.4 J)",                         GAME_IMPERFECT_GRAPHICS, layout_dendego ) // DENSYA DE GO           VER 2.4 J   1997/ 4/18   13:38:34
2048GAME( 1997, sidebs2,   0,        taitojc, sidebs, taitojc_state,   taitojc,  ROT0, "Taito", "Side by Side 2 (Ver 2.6 A)",                           GAME_IMPERFECT_GRAPHICS )                 // SIDE BY SIDE2          VER 2.6 A   1997/ 6/19   09:39:22
2049GAME( 1997, sidebs2j,  sidebs2,  taitojc, sidebs, taitojc_state,   taitojc,  ROT0, "Taito", "Side by Side 2 Evoluzione (Ver 2.4 J)",                GAME_IMPERFECT_GRAPHICS )                 // SIDE BY SIDE2          VER 2.4 J   1997/ 5/26   13:06:37
2050GAMEL(1998, dendego2,  0,        dendego, dendego, taitojc_state,  dendego2, ROT0, "Taito", "Densha de GO! 2 Kousoku-hen (Ver 2.5 J)",              GAME_IMPERFECT_GRAPHICS, layout_dendego ) // DENSYA DE GO2          VER 2.5 J   1998/ 3/ 2   15:30:55
2051GAMEL(1998, dendego23k,dendego2, dendego, dendego, taitojc_state,  dendego2, ROT0, "Taito", "Densha de GO! 2 Kousoku-hen 3000-bandai (Ver 2.20 J)", GAME_IMPERFECT_GRAPHICS, layout_dendego ) // DENSYA DE GO! 2 3000   VER 2.20 J  1998/ 7/15   17:42:38
1927GAME( 1996, sidebs,    0,        taitojc, sidebs,   taitojc_state, taitojc,  ROT0, "Taito", "Side by Side (Ver 2.7 J)",                             GAME_IMPERFECT_GRAPHICS )                 // SIDE BY SIDE           VER 2.7 J   1996/10/11   14:54:10
1928GAME( 1996, sidebsja,  sidebs,   taitojc, sidebs,   taitojc_state, taitojc,  ROT0, "Taito", "Side by Side (Ver 2.5 J)",                             GAME_IMPERFECT_GRAPHICS )                 // SIDE BY SIDE           VER 2.5 J   1996/ 6/20   18:13:14
1929GAMEL(1996, dendego,   0,        dendego, dendego,  taitojc_state, taitojc,  ROT0, "Taito", "Densha de GO! (Ver 2.2 J)",                            GAME_IMPERFECT_GRAPHICS, layout_dendego ) // DENSYA DE GO           VER 2.2 J   1997/ 2/ 4   12:00:28
1930GAMEL(1996, dendegox,  dendego,  dendego, dendego,  taitojc_state, taitojc,  ROT0, "Taito", "Densha de GO! EX (Ver 2.4 J)",                         GAME_IMPERFECT_GRAPHICS, layout_dendego ) // DENSYA DE GO           VER 2.4 J   1997/ 4/18   13:38:34
1931GAME( 1997, sidebs2,   0,        taitojc, sidebs,   taitojc_state, taitojc,  ROT0, "Taito", "Side by Side 2 (Ver 2.6 A)",                           GAME_IMPERFECT_GRAPHICS )                 // SIDE BY SIDE2          VER 2.6 A   1997/ 6/19   09:39:22
1932GAME( 1997, sidebs2j,  sidebs2,  taitojc, sidebs,   taitojc_state, taitojc,  ROT0, "Taito", "Side by Side 2 Evoluzione (Ver 2.4 J)",                GAME_IMPERFECT_GRAPHICS )                 // SIDE BY SIDE2          VER 2.4 J   1997/ 5/26   13:06:37
1933GAMEL(1998, dendego2,  0,        dendego, dendego,  taitojc_state, dendego2, ROT0, "Taito", "Densha de GO! 2 Kousoku-hen (Ver 2.5 J)",              GAME_IMPERFECT_GRAPHICS, layout_dendego ) // DENSYA DE GO2          VER 2.5 J   1998/ 3/ 2   15:30:55
1934GAMEL(1998, dendego23k,dendego2, dendego, dendego,  taitojc_state, dendego2, ROT0, "Taito", "Densha de GO! 2 Kousoku-hen 3000-bandai (Ver 2.20 J)", GAME_IMPERFECT_GRAPHICS, layout_dendego ) // DENSYA DE GO! 2 3000   VER 2.20 J  1998/ 7/15   17:42:38
trunk/src/mame/includes/taitojc.h
r31824r31825
11#include "video/poly.h"
2#include "machine/mb8421.h"
23#include "machine/taitoio.h"
34
45#define TAITOJC_POLYGON_FIFO_SIZE       0x20000
r31824r31825
4243      m_maincpu(*this,"maincpu"),
4344      m_dsp(*this,"dsp"),
4445      m_tc0640fio(*this, "tc0640fio"),
46      m_mb8421(*this, "mb8421"),
4547      m_gfx2(*this, "gfx2"),
4648      m_vram(*this, "vram"),
4749      m_objlist(*this, "objlist"),
4850      m_snd_shared_ram(*this, "snd_shared"),
4951      m_main_ram(*this, "main_ram"),
50      m_dsp_shared_ram(*this, "dsp_shared"),
5152      m_palette_ram(*this, "palette_ram"),
5253      m_gfxdecode(*this, "gfxdecode"),
5354      m_screen(*this, "screen"),
r31824r31825
6162   // device/memory pointers
6263   required_device<cpu_device> m_maincpu;
6364   required_device<cpu_device> m_dsp;
64   optional_device<tc0640fio_device> m_tc0640fio;
65   required_device<tc0640fio_device> m_tc0640fio;
66   required_device<mb8421_device> m_mb8421;
6567   required_memory_region m_gfx2;
6668
6769   required_shared_ptr<UINT32> m_vram;
6870   required_shared_ptr<UINT32> m_objlist;
69   optional_shared_ptr<UINT32> m_snd_shared_ram;
71   required_shared_ptr<UINT32> m_snd_shared_ram;
7072   required_shared_ptr<UINT32> m_main_ram;
71   required_shared_ptr<UINT16> m_dsp_shared_ram;
7273   required_shared_ptr<UINT32> m_palette_ram;
7374
7475   required_device<gfxdecode_device> m_gfxdecode;
r31824r31825
8586   UINT16 m_dsp_tex_offset;
8687
8788   int m_first_dsp_reset;
89   UINT8 m_dsp_shared_ram_hi[0x800];
8890   INT16 m_viewport_data[3];
8991   INT16 m_projection_data[3];
9092   INT16 m_intersection_data[3];
r31824r31825
108110   UINT8 m_mcu_data_hc11;
109111   UINT8 m_mcu_output;
110112
111   UINT16 m_debug_dsp_ram[0x8000];
112
113113   UINT8 m_has_dsp_hack;
114114
115115   int m_speed_meter;
r31824r31825
117117
118118   DECLARE_READ8_MEMBER(mcu_comm_r);
119119   DECLARE_WRITE8_MEMBER(mcu_comm_w);
120   DECLARE_READ32_MEMBER(dsp_shared_r);
121   DECLARE_WRITE32_MEMBER(dsp_shared_w);
120   DECLARE_READ8_MEMBER(dsp_shared_r);
121   DECLARE_WRITE8_MEMBER(dsp_shared_w);
122122   DECLARE_READ32_MEMBER(snd_share_r);
123123   DECLARE_WRITE32_MEMBER(snd_share_w);
124124   DECLARE_READ8_MEMBER(jc_pcbid_r);
125125   DECLARE_READ8_MEMBER(jc_lan_r);
126126   DECLARE_WRITE8_MEMBER(jc_lan_w);
127   DECLARE_WRITE8_MEMBER(jc_irq_ack_w);
127   DECLARE_WRITE8_MEMBER(jc_irq_unk_w);
128128   DECLARE_WRITE8_MEMBER(dendego_speedmeter_w);
129129   DECLARE_WRITE8_MEMBER(dendego_brakemeter_w);
130130
r31824r31825
143143   DECLARE_WRITE16_MEMBER(dsp_texaddr_w);
144144   DECLARE_WRITE16_MEMBER(dsp_polygon_fifo_w);
145145   DECLARE_WRITE16_MEMBER(dsp_unk2_w);
146   DECLARE_READ16_MEMBER(dsp_to_main_r);
147   DECLARE_WRITE16_MEMBER(dsp_to_main_w);
148146
149147   DECLARE_WRITE16_MEMBER(dsp_math_viewport_w);
150148   DECLARE_WRITE16_MEMBER(dsp_math_projection_w);
r31824r31825
156154
157155   DECLARE_READ16_MEMBER(taitojc_dsp_idle_skip_r);
158156   DECLARE_READ16_MEMBER(dendego2_dsp_idle_skip_r);
159   DECLARE_WRITE16_MEMBER(dsp_idle_skip_w);
160157
161158   DECLARE_READ32_MEMBER(taitojc_palette_r);
162159   DECLARE_WRITE32_MEMBER(taitojc_palette_w);
r31824r31825
169166   DECLARE_DRIVER_INIT(taitojc);
170167   TILE_GET_INFO_MEMBER(taitojc_tile_info);
171168   virtual void machine_reset();
169   virtual void machine_start();
172170   virtual void video_start();
173171   UINT32 screen_update_taitojc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
174172   UINT32 screen_update_dendego(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
175173   INTERRUPT_GEN_MEMBER(taitojc_vblank);
174   DECLARE_WRITE_LINE_MEMBER(mb8421_intl);
175   DECLARE_WRITE_LINE_MEMBER(mb8421_intr);
176176   void draw_object(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 w1, UINT32 w2, UINT8 bank_type);
177177   void draw_object_bank(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 bank_type, UINT8 pri);
178178   void taitojc_clear_frame();
179   void debug_dsp_command();
180179};
trunk/src/emu/machine/mb8421.c
r31824r31825
55    Fujitsu MB8421/22/31/32-90/-90L/-90LL/-12/-12L/-12LL
66    CMOS 16K-bit (2KB) dual-port SRAM
77
8    TODO:
9    - retransmit (RT pin)
10    - cascaded width expansion mode (when needed)
11
128**********************************************************************/
139
1410#include "machine/mb8421.h"
r31824r31825
5854WRITE8_MEMBER(mb8421_device::left_w)
5955{
6056   offset &= 0x7ff;
57   m_ram[offset] = data;
6158
6259   if (offset == 0x7ff)
6360      m_intr_handler(1);
64
65   m_ram[offset] = data;
6661}
6762
6863READ8_MEMBER(mb8421_device::left_r)
6964{
7065   offset &= 0x7ff;
7166
72   if (offset == 0x7fe)
67   if (offset == 0x7fe && !space.debugger_access())
7368      m_intl_handler(0);
7469   
7570   return m_ram[offset];
r31824r31825
7873WRITE8_MEMBER(mb8421_device::right_w)
7974{
8075   offset &= 0x7ff;
76   m_ram[offset] = data;
8177
8278   if (offset == 0x7fe)
8379      m_intl_handler(1);
84
85   m_ram[offset] = data;
8680}
8781
8882READ8_MEMBER(mb8421_device::right_r)
8983{
9084   offset &= 0x7ff;
9185
92   if (offset == 0x7ff)
86   if (offset == 0x7ff && !space.debugger_access())
9387      m_intr_handler(0);
9488   
9589   return m_ram[offset];
trunk/src/emu/machine/mb8421.h
r31824r31825
4848   template<class _Object> static devcb_base &set_intr_handler(device_t &device, _Object object) { return downcast<mb8421_device &>(device).m_intr_handler.set_callback(object); }
4949
5050   DECLARE_READ_LINE_MEMBER( busy_r ) { return 0; } // _BUSY pin - not emulated
51   UINT8 peek(offs_t offset) { return m_ram[offset & 0x7ff]; }
5152
5253   DECLARE_WRITE8_MEMBER( left_w );
5354   DECLARE_READ8_MEMBER( left_r );

Previous 199869 Revisions Next


© 1997-2024 The MAME Team