Previous 199869 Revisions Next

r17402 Wednesday 22nd August, 2012 at 17:17:11 UTC by Ville Linde
cobra.c: Added K001604 for racjamdx
[src/mame/drivers]cobra.c

trunk/src/mame/drivers/cobra.c
r17401r17402
280280#include "machine/timekpr.h"
281281#include "machine/jvshost.h"
282282#include "machine/jvsdev.h"
283#include "video/konicdev.h"
283284#include "video/polynew.h"
284285#include "sound/rf5c400.h"
285286
286287#define GFXFIFO_IN_VERBOSE      0
287288#define GFXFIFO_OUT_VERBOSE      0
288#define M2SFIFO_VERBOSE         0
289#define S2MFIFO_VERBOSE         0
289#define M2SFIFO_VERBOSE         1
290#define S2MFIFO_VERBOSE         1
290291
291292
292293/* Cobra Renderer class */
r17401r17402
564565   DECLARE_WRITE32_MEMBER(sub_ata1_w);
565566   DECLARE_READ32_MEMBER(sub_psac2_r);
566567   DECLARE_WRITE32_MEMBER(sub_psac2_w);
568   DECLARE_WRITE32_MEMBER(sub_psac_palette_w);
567569
568570   DECLARE_WRITE64_MEMBER(gfx_fifo0_w);
569571   DECLARE_WRITE64_MEMBER(gfx_fifo1_w);
r17401r17402
631633   int m_gfx_unknown_v1;
632634   int m_gfx_status_byte;
633635
636   bool m_has_psac;
637
634638   DECLARE_DRIVER_INIT(racjamdx);
635639   DECLARE_DRIVER_INIT(bujutsu);
636640   DECLARE_DRIVER_INIT(cobra);
r17401r17402
766770{
767771   cobra_state *cobra = screen.machine().driver_data<cobra_state>();
768772
773   if (cobra->m_has_psac)
774   {
775      device_t *k001604 = screen.machine().device("k001604");
776
777      k001604_draw_back_layer(k001604, bitmap, cliprect);
778      k001604_draw_front_layer(k001604, bitmap, cliprect);
779   }
780
769781   cobra->m_renderer->display(&bitmap, cliprect);
770782   return 0;
771783}
r17401r17402
16521664   COMBINE_DATA(m_comram[page] + offset);
16531665}
16541666
1667WRITE32_MEMBER(cobra_state::sub_psac_palette_w)
1668{
1669   COMBINE_DATA(&m_generic_paletteram_32[offset]);
1670   data = m_generic_paletteram_32[offset];
1671   palette_set_color_rgb(machine(), offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
1672}
1673
16551674READ32_MEMBER(cobra_state::sub_psac2_r)
16561675{
16571676   m_sub_psac_count++;
r17401r17402
16911710
16921711   if (rec_size > 0)
16931712   {
1713      /*
16941714      printf("jvs reply ");
16951715      for (int i=0; i < rec_size; i++)
16961716      {
16971717         printf("%02X ", rec_data[i]);
16981718      }
16991719      printf("\n");
1720      */
1721
1722      for (int i=0; i < rec_size; i++)
1723      {
1724         ppc4xx_spu_receive_byte(device, rec_data[i]);
1725      }
17001726   }
17011727}
17021728
r17401r17402
17071733   AM_RANGE(0x78040000, 0x7804ffff) AM_MIRROR(0x80000000) AM_DEVREADWRITE16_LEGACY("rfsnd", rf5c400_r, rf5c400_w, 0xffffffff)
17081734   AM_RANGE(0x78080000, 0x7808000f) AM_MIRROR(0x80000000) AM_READWRITE(sub_ata0_r, sub_ata0_w)
17091735   AM_RANGE(0x780c0010, 0x780c001f) AM_MIRROR(0x80000000) AM_READWRITE(sub_ata1_r, sub_ata1_w)
1710   AM_RANGE(0x78220000, 0x7823ffff) AM_MIRROR(0x80000000) AM_RAM                                 // PSAC RAM
1711   AM_RANGE(0x78240000, 0x78241fff) AM_MIRROR(0x80000000) AM_RAM                                 // PSAC unknown
1736   AM_RANGE(0x78200000, 0x782000ff) AM_MIRROR(0x80000000) AM_DEVREADWRITE_LEGACY("k001604", k001604_reg_r, k001604_reg_w)            // PSAC registers
1737   AM_RANGE(0x78210000, 0x78217fff) AM_MIRROR(0x80000000) AM_RAM_WRITE(sub_psac_palette_w) AM_SHARE("paletteram")                  // PSAC palette RAM
1738   AM_RANGE(0x78220000, 0x7823ffff) AM_MIRROR(0x80000000) AM_DEVREADWRITE_LEGACY("k001604", k001604_tile_r, k001604_tile_w)         // PSAC tile RAM
1739   AM_RANGE(0x78240000, 0x7827ffff) AM_MIRROR(0x80000000) AM_DEVREADWRITE_LEGACY("k001604", k001604_char_r, k001604_char_w)         // PSAC character RAM
17121740   AM_RANGE(0x78300000, 0x7830000f) AM_MIRROR(0x80000000) AM_READWRITE(sub_psac2_r, sub_psac2_w)         // PSAC
17131741   AM_RANGE(0x7e000000, 0x7e000003) AM_MIRROR(0x80000000) AM_READWRITE(sub_unk7e_r, sub_debug_w)
17141742   AM_RANGE(0x7e040000, 0x7e041fff) AM_MIRROR(0x80000000) AM_DEVREADWRITE8_LEGACY("m48t58", timekeeper_r, timekeeper_w, 0xffffffff)   /* M48T58Y RTC/NVRAM */
17151743   AM_RANGE(0x7e180000, 0x7e180003) AM_MIRROR(0x80000000) AM_READWRITE(sub_unk1_r, sub_unk1_w)            // TMS57002?
17161744   AM_RANGE(0x7e200000, 0x7e200003) AM_MIRROR(0x80000000) AM_READWRITE(sub_config_r, sub_config_w)
1717//  AM_RANGE(0x7e240000, 0x7e27ffff) AM_MIRROR(0x80000000) AM_RAM                                           // PSAC (ROZ) in Racing Jam.
17181745//  AM_RANGE(0x7e280000, 0x7e28ffff) AM_MIRROR(0x80000000) AM_RAM                                           // LANC
17191746//  AM_RANGE(0x7e300000, 0x7e30ffff) AM_MIRROR(0x80000000) AM_RAM                                           // LANC
17201747   AM_RANGE(0x7e380000, 0x7e380003) AM_MIRROR(0x80000000) AM_READWRITE(sub_mainbd_r, sub_mainbd_w)
r17401r17402
27452772};
27462773
27472774
2775static const k001604_interface cobra_k001604_intf =
2776{
2777   0, 1,   /* gfx index 1 & 2 */
2778   0, 1,   /* layer_size, roz_size */
2779   0      /* slrasslt hack */
2780};
2781
2782
27482783static void ide_interrupt(device_t *device, int state)
27492784{
27502785   cobra_state *cobra = device->machine().driver_data<cobra_state>();
r17401r17402
28312866
28322867   MCFG_M48T58_ADD("m48t58")
28332868
2869   MCFG_K001604_ADD("k001604", cobra_k001604_intf)      // on the LAN board in Racing Jam DX
2870
28342871   MCFG_DEVICE_ADD("cobra_jvs_host", COBRA_JVS_HOST, 4000000)
28352872   MCFG_JVS_DEVICE_ADD("cobra_jvs", COBRA_JVS, "cobra_jvs_host")
28362873
r17401r17402
29572994
29582995   // hd patches
29592996   // 0x18932c = 0x38600000            skips check_one_scene()
2997
2998   m_has_psac = false;
29602999}
29613000
29623001DRIVER_INIT_MEMBER(cobra_state,racjamdx)
r17401r17402
29673006   {
29683007      UINT32 *rom = (UINT32*)machine().root_device().memregion("user2")->base();
29693008
2970      rom[0x62094 / 4] = 0x60000000;         // skip hardcheck()...
3009      //rom[0x62094 / 4] = 0x60000000;         // skip hardcheck()...
29713010      rom[0x62ddc / 4] = 0x60000000;         // skip lanc_hardcheck()
29723011
29733012
r17401r17402
30343073      rom[0x0e] = (UINT8)(sum >> 8);
30353074      rom[0x0f] = (UINT8)(sum);
30363075   }
3076
3077   m_has_psac = true;
30373078}
30383079
30393080/*****************************************************************************/

Previous 199869 Revisions Next


© 1997-2024 The MAME Team