Previous 199869 Revisions Next

r17826 Wednesday 12th September, 2012 at 09:44:42 UTC by Aaron Giles
More AM_BASE_LEGACY removal.
[src/mame/drivers]konamigx.c legionna.c midzeus.c mystwarr.c r2dx_v33.c
[src/mame/includes]konamigx.h midzeus.h
[src/mame/machine]seicop.c seicop.h
[src/mame/video]konamigx.c konamiic.c konamiic.h midzeus.c midzeus2.c
[src/mess/drivers]mmodular.c ng_aes.c

trunk/src/mame/machine/seicop.c
r17825r17826
14111411#define seibu_cop_log logerror
14121412#define LOG_CMDS 1
14131413
1414UINT16 *cop_mcu_ram;
1414static UINT16 *cop_mcu_ram;
14151415
14161416static UINT16 copd2_table[0x100];
14171417static UINT16 copd2_table_2[0x100/8];
r17825r17826
16641664
16651665 *******************************************************************************************/
16661666
1667// temporary hack until this is a proper device
1668inline void get_ram(running_machine &machine)
1669{
1670   if (cop_mcu_ram == NULL) cop_mcu_ram = reinterpret_cast<UINT16 *>(machine.root_device().memshare("cop_mcu_ram")->ptr());
1671}
1672
16671673READ16_HANDLER( copdxbl_0_r )
16681674{
1675   get_ram(space->machine());
16691676   UINT16 retvalue = cop_mcu_ram[offset];
16701677
16711678   switch(offset)
r17825r17826
16921699WRITE16_HANDLER( copdxbl_0_w )
16931700{
16941701   legionna_state *state = space->machine().driver_data<legionna_state>();
1702   get_ram(space->machine());
16951703   COMBINE_DATA(&cop_mcu_ram[offset]);
16961704
16971705   switch(offset)
r17825r17826
18141822static READ16_HANDLER( generic_cop_r )
18151823{
18161824   UINT16 retvalue;
1825   get_ram(space->machine());
18171826   retvalue = cop_mcu_ram[offset];
18181827
18191828
r17825r17826
18831892static WRITE16_HANDLER( generic_cop_w )
18841893{
18851894   UINT32 temp32;
1895   get_ram(space->machine());
18861896
18871897   switch (offset)
18881898   {
r17825r17826
27162726
27172727WRITE16_HANDLER( heatbrl_mcu_w )
27182728{
2729   get_ram(space->machine());
27192730   COMBINE_DATA(&cop_mcu_ram[offset]);
27202731
27212732   /* external pin register, used for banking */
r17825r17826
27712782
27722783WRITE16_HANDLER( cupsoc_mcu_w )
27732784{
2785   get_ram(space->machine());
27742786   COMBINE_DATA(&cop_mcu_ram[offset]);
27752787
27762788   if(offset == 0x280/2) //irq ack / sprite buffering?
r17825r17826
28132825
28142826WRITE16_HANDLER( cupsocs_mcu_w )
28152827{
2828   get_ram(space->machine());
28162829   COMBINE_DATA(&cop_mcu_ram[offset]);
28172830
28182831   if(offset == 0x280/2) //irq ack / sprite buffering?
r17825r17826
28602873
28612874WRITE16_HANDLER( godzilla_mcu_w )
28622875{
2876   get_ram(space->machine());
28632877   COMBINE_DATA(&cop_mcu_ram[offset]);
28642878
28652879   if(offset == 0x070/2)
r17825r17826
29122926
29132927WRITE16_HANDLER( denjinmk_mcu_w )
29142928{
2929   get_ram(space->machine());
29152930   COMBINE_DATA(&cop_mcu_ram[offset]);
29162931
29172932   if(offset == 0x280/2) //irq ack / sprite buffering?
r17825r17826
29652980
29662981WRITE16_HANDLER( grainbow_mcu_w )
29672982{
2983   get_ram(space->machine());
29682984   COMBINE_DATA(&cop_mcu_ram[offset]);
29692985
29702986   if(offset == 0x280/2) //irq ack / sprite buffering?
r17825r17826
30073023
30083024WRITE16_HANDLER( legionna_mcu_w )
30093025{
3026   get_ram(space->machine());
30103027   COMBINE_DATA(&cop_mcu_ram[offset]);
30113028
30123029   if(offset == 0x070/2) //external pin: puts bit 13 high, delay, reads 0x748, writes bit 13 low
trunk/src/mame/machine/seicop.h
r17825r17826
1extern UINT16* cop_mcu_ram;
2
31READ16_HANDLER( copdxbl_0_r );
42WRITE16_HANDLER( copdxbl_0_w );
53
trunk/src/mame/video/midzeus.c
r17825r17826
5656 *
5757 *************************************/
5858
59UINT32 *zeusbase;
60
6159static poly_manager *poly;
6260static UINT8 log_fifo;
6361
r17825r17826
341339   /* normal update case */
342340   if (!screen.machine().input().code_pressed(KEYCODE_W))
343341   {
344      const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0xcc]);
342      midzeus_state *state = screen.machine().driver_data<midzeus_state>();
343      const void *base = waveram1_ptr_from_expanded_addr(state->m_zeusbase[0xcc]);
345344      int xoffs = screen.visible_area().min_x;
346345      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
347346      {
r17825r17826
390389READ32_MEMBER(midzeus_state::zeus_r)
391390{
392391   int logit = (offset < 0xb0 || offset > 0xb7);
393   UINT32 result = zeusbase[offset & ~1];
392   UINT32 result = m_zeusbase[offset & ~1];
394393
395394   switch (offset & ~1)
396395   {
r17825r17826
414413      case 0xf6:      // status -- they wait for this & 9 == 0
415414         // value & $9600 must == $9600 to pass Zeus system test
416415         result = 0x9600;
417         if (zeusbase[0xb6] == 0x80040000)
416         if (m_zeusbase[0xb6] == 0x80040000)
418417            result |= 1;
419418         logit = 0;
420419         break;
421420   }
422421
423422   /* 32-bit mode */
424   if (zeusbase[0x80] & 0x00020000)
423   if (m_zeusbase[0x80] & 0x00020000)
425424   {
426425      if (offset & 1)
427426         result >>= 16;
r17825r17826
465464      logerror("%06X:zeus_w", space.device().safe_pc());
466465
467466   /* 32-bit mode */
468   if (zeusbase[0x80] & 0x00020000)
467   if (m_zeusbase[0x80] & 0x00020000)
469468      zeus_register32_w(machine(), offset, data, logit);
470469
471470   /* 16-bit mode */
r17825r17826
546545
547546static void zeus_register16_w(running_machine &machine, offs_t offset, UINT16 data, int logit)
548547{
548   midzeus_state *state = machine.driver_data<midzeus_state>();
549
549550   /* writes to register $CC need to force a partial update */
550551   if ((offset & ~1) == 0xcc)
551552      machine.primary_screen->update_partial(machine.primary_screen->vpos());
552553
553554   /* write to high part on odd addresses */
554555   if (offset & 1)
555      zeusbase[offset & ~1] = (zeusbase[offset & ~1] & 0x0000ffff) | (data << 16);
556      state->m_zeusbase[offset & ~1] = (state->m_zeusbase[offset & ~1] & 0x0000ffff) | (data << 16);
556557
557558   /* write to low part on event addresses */
558559   else
559      zeusbase[offset & ~1] = (zeusbase[offset & ~1] & 0xffff0000) | (data & 0xffff);
560      state->m_zeusbase[offset & ~1] = (state->m_zeusbase[offset & ~1] & 0xffff0000) | (data & 0xffff);
560561
561562   /* log appropriately */
562563   if (logit)
563      logerror("(%02X) = %04X [%08X]\n", offset, data & 0xffff, zeusbase[offset & ~1]);
564      logerror("(%02X) = %04X [%08X]\n", offset, data & 0xffff, state->m_zeusbase[offset & ~1]);
564565
565566   /* handle the update */
566567   if ((offset & 1) == 0)
r17825r17826
570571
571572static void zeus_register32_w(running_machine &machine, offs_t offset, UINT32 data, int logit)
572573{
574   midzeus_state *state = machine.driver_data<midzeus_state>();
575
573576   /* writes to register $CC need to force a partial update */
574577   if ((offset & ~1) == 0xcc)
575578      machine.primary_screen->update_partial(machine.primary_screen->vpos());
576579
577580   /* always write to low word? */
578   zeusbase[offset & ~1] = data;
581   state->m_zeusbase[offset & ~1] = data;
579582
580583   /* log appropriately */
581584   if (logit)
r17825r17826
603606
604607static void zeus_register_update(running_machine &machine, offs_t offset)
605608{
609   midzeus_state *state = machine.driver_data<midzeus_state>();
610
606611   /* handle the writes; only trigger on low accesses */
607612   switch (offset)
608613   {
609614      case 0x52:
610         zeusbase[0xb2] = zeusbase[0x52];
615         state->m_zeusbase[0xb2] = state->m_zeusbase[0x52];
611616         break;
612617
613618      case 0x60:
614619         /* invasn writes here to execute a command (?) */
615         if (zeusbase[0x60] & 1)
620         if (state->m_zeusbase[0x60] & 1)
616621         {
617            if ((zeusbase[0x80] & 0xffffff) == 0x22FCFF)
622            if ((state->m_zeusbase[0x80] & 0xffffff) == 0x22FCFF)
618623            {
619               // zeusbase[0x00] = color
620               // zeusbase[0x02] = ??? = 0x000C0000
621               // zeusbase[0x04] = ??? = 0x00000E01
622               // zeusbase[0x06] = ??? = 0xFFFF0030
623               // zeusbase[0x08] = vert[0] = (y0 << 16) | x0
624               // zeusbase[0x0a] = vert[1] = (y1 << 16) | x1
625               // zeusbase[0x0c] = vert[2] = (y2 << 16) | x2
626               // zeusbase[0x0e] = vert[3] = (y3 << 16) | x3
627               // zeusbase[0x18] = ??? = 0xFFFFFFFF
628               // zeusbase[0x1a] = ??? = 0xFFFFFFFF
629               // zeusbase[0x1c] = ??? = 0xFFFFFFFF
630               // zeusbase[0x1e] = ??? = 0xFFFFFFFF
631               // zeusbase[0x20] = ??? = 0x00000000
632               // zeusbase[0x22] = ??? = 0x00000000
633               // zeusbase[0x24] = ??? = 0x00000000
634               // zeusbase[0x26] = ??? = 0x00000000
635               // zeusbase[0x40] = ??? = 0x00000000
636               // zeusbase[0x42] = ??? = 0x00000000
637               // zeusbase[0x44] = ??? = 0x00000000
638               // zeusbase[0x46] = ??? = 0x00000000
639               // zeusbase[0x4c] = ??? = 0x00808080 (brightness?)
640               // zeusbase[0x4e] = ??? = 0x00808080 (brightness?)
624               // state->m_zeusbase[0x00] = color
625               // state->m_zeusbase[0x02] = ??? = 0x000C0000
626               // state->m_zeusbase[0x04] = ??? = 0x00000E01
627               // state->m_zeusbase[0x06] = ??? = 0xFFFF0030
628               // state->m_zeusbase[0x08] = vert[0] = (y0 << 16) | x0
629               // state->m_zeusbase[0x0a] = vert[1] = (y1 << 16) | x1
630               // state->m_zeusbase[0x0c] = vert[2] = (y2 << 16) | x2
631               // state->m_zeusbase[0x0e] = vert[3] = (y3 << 16) | x3
632               // state->m_zeusbase[0x18] = ??? = 0xFFFFFFFF
633               // state->m_zeusbase[0x1a] = ??? = 0xFFFFFFFF
634               // state->m_zeusbase[0x1c] = ??? = 0xFFFFFFFF
635               // state->m_zeusbase[0x1e] = ??? = 0xFFFFFFFF
636               // state->m_zeusbase[0x20] = ??? = 0x00000000
637               // state->m_zeusbase[0x22] = ??? = 0x00000000
638               // state->m_zeusbase[0x24] = ??? = 0x00000000
639               // state->m_zeusbase[0x26] = ??? = 0x00000000
640               // state->m_zeusbase[0x40] = ??? = 0x00000000
641               // state->m_zeusbase[0x42] = ??? = 0x00000000
642               // state->m_zeusbase[0x44] = ??? = 0x00000000
643               // state->m_zeusbase[0x46] = ??? = 0x00000000
644               // state->m_zeusbase[0x4c] = ??? = 0x00808080 (brightness?)
645               // state->m_zeusbase[0x4e] = ??? = 0x00808080 (brightness?)
641646               poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
642647               poly_vertex vert[4];
643648
644               vert[0].x = (INT16)zeusbase[0x08];
645               vert[0].y = (INT16)(zeusbase[0x08] >> 16);
646               vert[1].x = (INT16)zeusbase[0x0a];
647               vert[1].y = (INT16)(zeusbase[0x0a] >> 16);
648               vert[2].x = (INT16)zeusbase[0x0c];
649               vert[2].y = (INT16)(zeusbase[0x0c] >> 16);
650               vert[3].x = (INT16)zeusbase[0x0e];
651               vert[3].y = (INT16)(zeusbase[0x0e] >> 16);
649               vert[0].x = (INT16)state->m_zeusbase[0x08];
650               vert[0].y = (INT16)(state->m_zeusbase[0x08] >> 16);
651               vert[1].x = (INT16)state->m_zeusbase[0x0a];
652               vert[1].y = (INT16)(state->m_zeusbase[0x0a] >> 16);
653               vert[2].x = (INT16)state->m_zeusbase[0x0c];
654               vert[2].y = (INT16)(state->m_zeusbase[0x0c] >> 16);
655               vert[3].x = (INT16)state->m_zeusbase[0x0e];
656               vert[3].y = (INT16)(state->m_zeusbase[0x0e] >> 16);
652657
653               extra->solidcolor = zeusbase[0x00];
658               extra->solidcolor = state->m_zeusbase[0x00];
654659               extra->zoffset = 0x7fff;
655660
656661               poly_render_quad(poly, NULL, zeus_cliprect, render_poly_solid_fixedz, 0, &vert[0], &vert[1], &vert[2], &vert[3]);
r17825r17826
662667         break;
663668
664669      case 0x70:
665         zeus_point[0] = zeusbase[0x70] << 16;
670         zeus_point[0] = state->m_zeusbase[0x70] << 16;
666671         break;
667672
668673      case 0x72:
669         zeus_point[1] = zeusbase[0x72] << 16;
674         zeus_point[1] = state->m_zeusbase[0x72] << 16;
670675         break;
671676
672677      case 0x74:
673         zeus_point[2] = zeusbase[0x74] << 16;
678         zeus_point[2] = state->m_zeusbase[0x74] << 16;
674679         break;
675680
676681      case 0x80:
677682         /* this bit enables the "FIFO empty" IRQ; since our virtual FIFO is always empty,
678683                we simply assert immediately if this is enabled. invasn needs this for proper
679684                operations */
680         if (zeusbase[0x80] & 0x02000000)
685         if (state->m_zeusbase[0x80] & 0x02000000)
681686            machine.device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
682687         else
683688            machine.device("maincpu")->execute().set_input_line(2, CLEAR_LINE);
r17825r17826
686691      case 0x84:
687692         /* MK4: Written in tandem with 0xcc */
688693         /* MK4: Writes either 0x80 (and 0x000000 to 0xcc) or 0x00 (and 0x800000 to 0xcc) */
689         zeus_renderbase = waveram1_ptr_from_expanded_addr(zeusbase[0x84] << 16);
694         zeus_renderbase = waveram1_ptr_from_expanded_addr(state->m_zeusbase[0x84] << 16);
690695         break;
691696
692697      case 0xb0:
693698      case 0xb2:
694         if ((zeusbase[0xb6] >> 16) != 0)
699         if ((state->m_zeusbase[0xb6] >> 16) != 0)
695700         {
696            if ((offset == 0xb0 && (zeusbase[0xb6] & 0x02000000) == 0) ||
697               (offset == 0xb2 && (zeusbase[0xb6] & 0x02000000) != 0))
701            if ((offset == 0xb0 && (state->m_zeusbase[0xb6] & 0x02000000) == 0) ||
702               (offset == 0xb2 && (state->m_zeusbase[0xb6] & 0x02000000) != 0))
698703            {
699704               void *dest;
700705
701               if (zeusbase[0xb6] & 0x80000000)
702                  dest = waveram1_ptr_from_expanded_addr(zeusbase[0xb4]);
706               if (state->m_zeusbase[0xb6] & 0x80000000)
707                  dest = waveram1_ptr_from_expanded_addr(state->m_zeusbase[0xb4]);
703708               else
704                  dest = waveram0_ptr_from_expanded_addr(zeusbase[0xb4]);
709                  dest = waveram0_ptr_from_expanded_addr(state->m_zeusbase[0xb4]);
705710
706               if (zeusbase[0xb6] & 0x00100000)
707                  WAVERAM_WRITE16(dest, 0, zeusbase[0xb0]);
708               if (zeusbase[0xb6] & 0x00200000)
709                  WAVERAM_WRITE16(dest, 1, zeusbase[0xb0] >> 16);
710               if (zeusbase[0xb6] & 0x00400000)
711                  WAVERAM_WRITE16(dest, 2, zeusbase[0xb2]);
712               if (zeusbase[0xb6] & 0x00800000)
713                  WAVERAM_WRITE16(dest, 3, zeusbase[0xb2] >> 16);
714               if (zeusbase[0xb6] & 0x00020000)
715                  zeusbase[0xb4]++;
711               if (state->m_zeusbase[0xb6] & 0x00100000)
712                  WAVERAM_WRITE16(dest, 0, state->m_zeusbase[0xb0]);
713               if (state->m_zeusbase[0xb6] & 0x00200000)
714                  WAVERAM_WRITE16(dest, 1, state->m_zeusbase[0xb0] >> 16);
715               if (state->m_zeusbase[0xb6] & 0x00400000)
716                  WAVERAM_WRITE16(dest, 2, state->m_zeusbase[0xb2]);
717               if (state->m_zeusbase[0xb6] & 0x00800000)
718                  WAVERAM_WRITE16(dest, 3, state->m_zeusbase[0xb2] >> 16);
719               if (state->m_zeusbase[0xb6] & 0x00020000)
720                  state->m_zeusbase[0xb4]++;
716721            }
717722         }
718723         break;
719724
720725      case 0xb4:
721         if (zeusbase[0xb6] & 0x00010000)
726         if (state->m_zeusbase[0xb6] & 0x00010000)
722727         {
723728            const UINT32 *src;
724729
725            if (zeusbase[0xb6] & 0x80000000)
726               src = (const UINT32 *)waveram1_ptr_from_expanded_addr(zeusbase[0xb4]);
730            if (state->m_zeusbase[0xb6] & 0x80000000)
731               src = (const UINT32 *)waveram1_ptr_from_expanded_addr(state->m_zeusbase[0xb4]);
727732            else
728               src = (const UINT32 *)waveram0_ptr_from_expanded_addr(zeusbase[0xb4]);
733               src = (const UINT32 *)waveram0_ptr_from_expanded_addr(state->m_zeusbase[0xb4]);
729734
730735            poly_wait(poly, "vram_read");
731            zeusbase[0xb0] = WAVERAM_READ32(src, 0);
732            zeusbase[0xb2] = WAVERAM_READ32(src, 1);
736            state->m_zeusbase[0xb0] = WAVERAM_READ32(src, 0);
737            state->m_zeusbase[0xb2] = WAVERAM_READ32(src, 1);
733738         }
734739         break;
735740
r17825r17826
741746      case 0xca:
742747         machine.primary_screen->update_partial(machine.primary_screen->vpos());
743748         {
744            int vtotal = zeusbase[0xca] >> 16;
745            int htotal = zeusbase[0xc6] >> 16;
749            int vtotal = state->m_zeusbase[0xca] >> 16;
750            int htotal = state->m_zeusbase[0xc6] >> 16;
746751
747            rectangle visarea(zeusbase[0xc6] & 0xffff, htotal - 3, 0, zeusbase[0xc8] & 0xffff);
752            rectangle visarea(state->m_zeusbase[0xc6] & 0xffff, htotal - 3, 0, state->m_zeusbase[0xc8] & 0xffff);
748753            if (htotal > 0 && vtotal > 0 && visarea.min_x < visarea.max_x && visarea.max_y < vtotal)
749754            {
750755               machine.primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)MIDZEUS_VIDEO_CLOCK / 8.0 / (htotal * vtotal)));
r17825r17826
761766         break;
762767
763768      case 0xe0:
764         zeus_fifo[zeus_fifo_words++] = zeusbase[0xe0];
769         zeus_fifo[zeus_fifo_words++] = state->m_zeusbase[0xe0];
765770         if (zeus_fifo_process(machine, zeus_fifo, zeus_fifo_words))
766771            zeus_fifo_words = 0;
767772         break;
r17825r17826
778783
779784static int zeus_fifo_process(running_machine &machine, const UINT32 *data, int numwords)
780785{
786   midzeus_state *state = machine.driver_data<midzeus_state>();
787
781788   /* handle logging */
782789   switch (data[0] >> 24)
783790   {
r17825r17826
796803      case 0x13:   /* invasn */
797804         if (log_fifo)
798805            log_fifo_command(data, numwords, "");
799         zeus_draw_model(machine, (zeusbase[0x06] << 16), log_fifo);
806         zeus_draw_model(machine, (state->m_zeusbase[0x06] << 16), log_fifo);
800807         break;
801808
802809      /* 0x17: write 16-bit value to low registers */
r17825r17826
957964         }
958965         else
959966         {
960            UINT32 texdata = (zeusbase[0x06] << 16) | (zeusbase[0x00] >> 16);
967            UINT32 texdata = (state->m_zeusbase[0x06] << 16) | (state->m_zeusbase[0x00] >> 16);
961968            zeus_draw_quad(machine, FALSE, data, texdata, log_fifo);
962969         }
963970         break;
r17825r17826
9991006
10001007static void zeus_draw_model(running_machine &machine, UINT32 texdata, int logit)
10011008{
1009   midzeus_state *state = machine.driver_data<midzeus_state>();
10021010   UINT32 databuffer[32];
10031011   int databufcount = 0;
10041012   int model_done = FALSE;
r17825r17826
10581066                     logerror("reg16");
10591067                  zeus_register16_w(machine, (databuffer[0] >> 16) & 0x7f, databuffer[0], logit);
10601068                  if (((databuffer[0] >> 16) & 0x7f) == 0x06)
1061                     texdata = (texdata & 0xffff) | (zeusbase[0x06] << 16);
1069                     texdata = (texdata & 0xffff) | (state->m_zeusbase[0x06] << 16);
10621070                  break;
10631071
10641072               case 0x19:   /* invasn */
r17825r17826
10661074                     logerror("reg32");
10671075                  zeus_register32_w(machine, (databuffer[0] >> 16) & 0x7f, databuffer[1], logit);
10681076                  if (((databuffer[0] >> 16) & 0x7f) == 0x06)
1069                     texdata = (texdata & 0xffff) | (zeusbase[0x06] << 16);
1077                     texdata = (texdata & 0xffff) | (state->m_zeusbase[0x06] << 16);
10701078                  break;
10711079
10721080               case 0x25:   /* mk4 */
r17825r17826
10981106
10991107static void zeus_draw_quad(running_machine &machine, int long_fmt, const UINT32 *databuffer, UINT32 texdata, int logit)
11001108{
1109   midzeus_state *state = machine.driver_data<midzeus_state>();
11011110   poly_draw_scanline_func callback;
11021111   poly_extra_data *extra;
11031112   poly_vertex clipvert[8];
r17825r17826
11481157   val2 = (texdata >> 16) & 0x3ff;
11491158   texwshift = (val2 >> 6) & 7;
11501159
1151   uscale = (8 >> ((zeusbase[0x04] >> 4) & 3)) * 0.125f * 256.0f;
1152   vscale = (8 >> ((zeusbase[0x04] >> 6) & 3)) * 0.125f * 256.0f;
1160   uscale = (8 >> ((state->m_zeusbase[0x04] >> 4) & 3)) * 0.125f * 256.0f;
1161   vscale = (8 >> ((state->m_zeusbase[0x04] >> 6) & 3)) * 0.125f * 256.0f;
11531162
11541163   int xy_offset = long_fmt ? 2 : 1;
11551164
r17825r17826
12651274      printf("Unknown draw mode: %.8x\n", ctrl_word);
12661275      return;
12671276   }
1268   extra->solidcolor = zeusbase[0x00] & 0x7fff;
1269   extra->zoffset = zeusbase[0x7e] >> 16;
1270   extra->alpha = zeusbase[0x4e];
1277   extra->solidcolor = state->m_zeusbase[0x00] & 0x7fff;
1278   extra->zoffset = state->m_zeusbase[0x7e] >> 16;
1279   extra->alpha = state->m_zeusbase[0x4e];
12711280   extra->transcolor = ((ctrl_word >> 16) & 1) ? 0 : 0x100;
12721281   extra->palbase = waveram0_ptr_from_block_addr(zeus_palbase);
12731282
trunk/src/mame/video/midzeus2.c
r17825r17826
370370   /* normal update case */
371371   if (!screen.machine().input().code_pressed(KEYCODE_W))
372372   {
373      const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0x38]);
373      midzeus_state *state = screen.machine().driver_data<midzeus_state>();
374      const void *base = waveram1_ptr_from_expanded_addr(state->m_zeusbase[0x38]);
374375      int xoffs = screen.visible_area().min_x;
375376      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
376377      {
r17825r17826
419420READ32_HANDLER( zeus2_r )
420421{
421422   int logit = (offset != 0x00 && offset != 0x01 && offset != 0x54 && offset != 0x48 && offset != 0x49 && offset != 0x58 && offset != 0x59 && offset != 0x5a);
422   UINT32 result = zeusbase[offset];
423   midzeus_state *state = space->machine().driver_data<midzeus_state>();
424   UINT32 result = state->m_zeusbase[offset];
423425
424426#if TRACK_REG_USAGE
425427   regread_count[offset]++;
r17825r17826
486488
487489static void zeus_register32_w(running_machine &machine, offs_t offset, UINT32 data, int logit)
488490{
489   UINT32 oldval = zeusbase[offset];
491   midzeus_state *state = machine.driver_data<midzeus_state>();
492   UINT32 oldval = state->m_zeusbase[offset];
490493
491494#if TRACK_REG_USAGE
492495regwrite_count[offset]++;
r17825r17826
512515//      machine.primary_screen->update_partial(machine.primary_screen->vpos());
513516
514517   /* always write to low word? */
515   zeusbase[offset] = data;
518   state->m_zeusbase[offset] = data;
516519
517520   /* log appropriately */
518521   if (logit)
r17825r17826
533536static void zeus_register_update(running_machine &machine, offs_t offset, UINT32 oldval, int logit)
534537{
535538   /* handle the writes; only trigger on low accesses */
539   midzeus_state *state = machine.driver_data<midzeus_state>();
536540   switch (offset)
537541   {
538542      case 0x08:
539         zeus_fifo[zeus_fifo_words++] = zeusbase[0x08];
543         zeus_fifo[zeus_fifo_words++] = state->m_zeusbase[0x08];
540544         if (zeus_fifo_process(machine, zeus_fifo, zeus_fifo_words))
541545            zeus_fifo_words = 0;
542546
r17825r17826
547551      case 0x20:
548552         /* toggles between two values based on the page:
549553
550                Page #      zeusbase[0x20]      zeusbase[0x38]
554                Page #      state->m_zeusbase[0x20]      state->m_zeusbase[0x38]
551555                ------      --------------      --------------
552556                   0          $04000190           $00000000
553557                   1          $04000000           $01900000
554558            */
555            zeus_pointer_write(zeusbase[0x20] >> 24, zeusbase[0x20]);
559            zeus_pointer_write(state->m_zeusbase[0x20] >> 24, state->m_zeusbase[0x20]);
556560         break;
557561
558562      case 0x33:
r17825r17826
562566      case 0x37:
563567         machine.primary_screen->update_partial(machine.primary_screen->vpos());
564568         {
565            int vtotal = zeusbase[0x37] & 0xffff;
566            int htotal = zeusbase[0x34] >> 16;
569            int vtotal = state->m_zeusbase[0x37] & 0xffff;
570            int htotal = state->m_zeusbase[0x34] >> 16;
567571
568            rectangle visarea(zeusbase[0x33] >> 16, (zeusbase[0x34] & 0xffff) - 1, 0, zeusbase[0x35] & 0xffff);
572            rectangle visarea(state->m_zeusbase[0x33] >> 16, (state->m_zeusbase[0x34] & 0xffff) - 1, 0, state->m_zeusbase[0x35] & 0xffff);
569573            if (htotal > 0 && vtotal > 0 && visarea.min_x < visarea.max_x && visarea.max_y < vtotal)
570574            {
571575               machine.primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)MIDZEUS_VIDEO_CLOCK / 4.0 / (htotal * vtotal)));
r17825r17826
578582
579583      case 0x38:
580584         {
581            UINT32 temp = zeusbase[0x38];
582            zeusbase[0x38] = oldval;
585            UINT32 temp = state->m_zeusbase[0x38];
586            state->m_zeusbase[0x38] = oldval;
583587            machine.primary_screen->update_partial(machine.primary_screen->vpos());
584588            log_fifo = machine.input().code_pressed(KEYCODE_L);
585            zeusbase[0x38] = temp;
589            state->m_zeusbase[0x38] = temp;
586590         }
587591         break;
588592
589593      case 0x41:
590594         /* this is the address, except in read mode, where it latches values */
591         if (zeusbase[0x4e] & 0x10)
595         if (state->m_zeusbase[0x4e] & 0x10)
592596         {
593597            const void *src = waveram0_ptr_from_expanded_addr(oldval);
594            zeusbase[0x41] = oldval;
595            zeusbase[0x48] = WAVERAM_READ32(src, 0);
596            zeusbase[0x49] = WAVERAM_READ32(src, 1);
598            state->m_zeusbase[0x41] = oldval;
599            state->m_zeusbase[0x48] = WAVERAM_READ32(src, 0);
600            state->m_zeusbase[0x49] = WAVERAM_READ32(src, 1);
597601
598            if (zeusbase[0x4e] & 0x40)
602            if (state->m_zeusbase[0x4e] & 0x40)
599603            {
600               zeusbase[0x41]++;
601               zeusbase[0x41] += (zeusbase[0x41] & 0x400) << 6;
602               zeusbase[0x41] &= ~0xfc00;
604               state->m_zeusbase[0x41]++;
605               state->m_zeusbase[0x41] += (state->m_zeusbase[0x41] & 0x400) << 6;
606               state->m_zeusbase[0x41] &= ~0xfc00;
603607            }
604608         }
605609         break;
r17825r17826
607611      case 0x48:
608612      case 0x49:
609613         /* if we're in write mode, process it */
610         if (zeusbase[0x40] == 0x00890000)
614         if (state->m_zeusbase[0x40] == 0x00890000)
611615         {
612616            /*
613                    zeusbase[0x4e]:
617                    state->m_zeusbase[0x4e]:
614618                        bit 0-1: which register triggers write through
615619                        bit 3:   enable write through via these registers
616620                        bit 4:   seems to be set during reads, when 0x41 is used for latching
617621                        bit 6:   enable autoincrement on write through
618622                */
619            if ((zeusbase[0x4e] & 0x08) && (offset & 3) == (zeusbase[0x4e] & 3))
623            if ((state->m_zeusbase[0x4e] & 0x08) && (offset & 3) == (state->m_zeusbase[0x4e] & 3))
620624            {
621               void *dest = waveram0_ptr_from_expanded_addr(zeusbase[0x41]);
622               WAVERAM_WRITE32(dest, 0, zeusbase[0x48]);
623               WAVERAM_WRITE32(dest, 1, zeusbase[0x49]);
625               void *dest = waveram0_ptr_from_expanded_addr(state->m_zeusbase[0x41]);
626               WAVERAM_WRITE32(dest, 0, state->m_zeusbase[0x48]);
627               WAVERAM_WRITE32(dest, 1, state->m_zeusbase[0x49]);
624628
625               if (zeusbase[0x4e] & 0x40)
629               if (state->m_zeusbase[0x4e] & 0x40)
626630               {
627                  zeusbase[0x41]++;
628                  zeusbase[0x41] += (zeusbase[0x41] & 0x400) << 6;
629                  zeusbase[0x41] &= ~0xfc00;
631                  state->m_zeusbase[0x41]++;
632                  state->m_zeusbase[0x41] += (state->m_zeusbase[0x41] & 0x400) << 6;
633                  state->m_zeusbase[0x41] &= ~0xfc00;
630634               }
631635            }
632636         }
633637
634638         /* make sure we log anything else */
635639         else if (logit)
636            logerror("\t[40]=%08X [4E]=%08X\n", zeusbase[0x40], zeusbase[0x4e]);
640            logerror("\t[40]=%08X [4E]=%08X\n", state->m_zeusbase[0x40], state->m_zeusbase[0x4e]);
637641         break;
638642
639643      case 0x51:
640644
641645         /* in this mode, crusnexo expects the reads to immediately latch */
642         if (zeusbase[0x50] == 0x00a20000)
643            oldval = zeusbase[0x51];
646         if (state->m_zeusbase[0x50] == 0x00a20000)
647            oldval = state->m_zeusbase[0x51];
644648
645649         /* this is the address, except in read mode, where it latches values */
646         if ((zeusbase[0x5e] & 0x10) || (zeusbase[0x50] == 0x00a20000))
650         if ((state->m_zeusbase[0x5e] & 0x10) || (state->m_zeusbase[0x50] == 0x00a20000))
647651         {
648652            const void *src = waveram1_ptr_from_expanded_addr(oldval);
649            zeusbase[0x51] = oldval;
650            zeusbase[0x58] = WAVERAM_READ32(src, 0);
651            zeusbase[0x59] = WAVERAM_READ32(src, 1);
652            zeusbase[0x5a] = WAVERAM_READ32(src, 2);
653            state->m_zeusbase[0x51] = oldval;
654            state->m_zeusbase[0x58] = WAVERAM_READ32(src, 0);
655            state->m_zeusbase[0x59] = WAVERAM_READ32(src, 1);
656            state->m_zeusbase[0x5a] = WAVERAM_READ32(src, 2);
653657
654            if (zeusbase[0x5e] & 0x40)
658            if (state->m_zeusbase[0x5e] & 0x40)
655659            {
656               zeusbase[0x51]++;
657               zeusbase[0x51] += (zeusbase[0x51] & 0x200) << 7;
658               zeusbase[0x51] &= ~0xfe00;
660               state->m_zeusbase[0x51]++;
661               state->m_zeusbase[0x51] += (state->m_zeusbase[0x51] & 0x200) << 7;
662               state->m_zeusbase[0x51] &= ~0xfe00;
659663            }
660664         }
661665         break;
662666
663667      case 0x57:
664668         /* thegrid uses this to write either left or right halves of pixels */
665         if (zeusbase[0x50] == 0x00e90000)
669         if (state->m_zeusbase[0x50] == 0x00e90000)
666670         {
667            void *dest = waveram1_ptr_from_expanded_addr(zeusbase[0x51]);
668            if (zeusbase[0x57] & 1)
669               WAVERAM_WRITE32(dest, 0, zeusbase[0x58]);
670            if (zeusbase[0x57] & 4)
671               WAVERAM_WRITE32(dest, 1, zeusbase[0x59]);
671            void *dest = waveram1_ptr_from_expanded_addr(state->m_zeusbase[0x51]);
672            if (state->m_zeusbase[0x57] & 1)
673               WAVERAM_WRITE32(dest, 0, state->m_zeusbase[0x58]);
674            if (state->m_zeusbase[0x57] & 4)
675               WAVERAM_WRITE32(dest, 1, state->m_zeusbase[0x59]);
672676         }
673677
674678         /* make sure we log anything else */
675679         else if (logit)
676            logerror("\t[50]=%08X [5E]=%08X\n", zeusbase[0x50], zeusbase[0x5e]);
680            logerror("\t[50]=%08X [5E]=%08X\n", state->m_zeusbase[0x50], state->m_zeusbase[0x5e]);
677681         break;
678682
679683      case 0x58:
680684      case 0x59:
681685      case 0x5a:
682686         /* if we're in write mode, process it */
683         if (zeusbase[0x50] == 0x00890000)
687         if (state->m_zeusbase[0x50] == 0x00890000)
684688         {
685689            /*
686                    zeusbase[0x5e]:
690                    state->m_zeusbase[0x5e]:
687691                        bit 0-1: which register triggers write through
688692                        bit 3:   enable write through via these registers
689693                        bit 4:   seems to be set during reads, when 0x51 is used for latching
690694                        bit 5:   unknown, currently used to specify ordering, but this is suspect
691695                        bit 6:   enable autoincrement on write through
692696                */
693            if ((zeusbase[0x5e] & 0x08) && (offset & 3) == (zeusbase[0x5e] & 3))
697            if ((state->m_zeusbase[0x5e] & 0x08) && (offset & 3) == (state->m_zeusbase[0x5e] & 3))
694698            {
695               void *dest = waveram1_ptr_from_expanded_addr(zeusbase[0x51]);
696               WAVERAM_WRITE32(dest, 0, zeusbase[0x58]);
697               if (zeusbase[0x5e] & 0x20)
698                  WAVERAM_WRITE32(dest, 1, zeusbase[0x5a]);
699               void *dest = waveram1_ptr_from_expanded_addr(state->m_zeusbase[0x51]);
700               WAVERAM_WRITE32(dest, 0, state->m_zeusbase[0x58]);
701               if (state->m_zeusbase[0x5e] & 0x20)
702                  WAVERAM_WRITE32(dest, 1, state->m_zeusbase[0x5a]);
699703               else
700704               {
701                  WAVERAM_WRITE32(dest, 1, zeusbase[0x59]);
702                  WAVERAM_WRITE32(dest, 2, zeusbase[0x5a]);
705                  WAVERAM_WRITE32(dest, 1, state->m_zeusbase[0x59]);
706                  WAVERAM_WRITE32(dest, 2, state->m_zeusbase[0x5a]);
703707               }
704708
705               if (zeusbase[0x5e] & 0x40)
709               if (state->m_zeusbase[0x5e] & 0x40)
706710               {
707                  zeusbase[0x51]++;
708                  zeusbase[0x51] += (zeusbase[0x51] & 0x200) << 7;
709                  zeusbase[0x51] &= ~0xfe00;
711                  state->m_zeusbase[0x51]++;
712                  state->m_zeusbase[0x51] += (state->m_zeusbase[0x51] & 0x200) << 7;
713                  state->m_zeusbase[0x51] &= ~0xfe00;
710714               }
711715            }
712716         }
713717
714718         /* make sure we log anything else */
715719         else if (logit)
716            logerror("\t[50]=%08X [5E]=%08X\n", zeusbase[0x50], zeusbase[0x5e]);
720            logerror("\t[50]=%08X [5E]=%08X\n", state->m_zeusbase[0x50], state->m_zeusbase[0x5e]);
717721         break;
718722   }
719723}
r17825r17826
10381042
10391043static void zeus_draw_quad(running_machine &machine, const UINT32 *databuffer, UINT32 texoffs, int logit)
10401044{
1045   midzeus_state *state = machine.driver_data<midzeus_state>();
10411046   poly_draw_scanline_func callback;
10421047   poly_extra_data *extra;
10431048   poly_vertex clipvert[8];
r17825r17826
12491254      }
12501255   }
12511256
1252   extra->solidcolor = 0;//zeusbase[0x00] & 0x7fff;
1253   extra->zoffset = 0;//zeusbase[0x7e] >> 16;
1254   extra->alpha = 0;//zeusbase[0x4e];
1257   extra->solidcolor = 0;//state->m_zeusbase[0x00] & 0x7fff;
1258   extra->zoffset = 0;//state->m_zeusbase[0x7e] >> 16;
1259   extra->alpha = 0;//state->m_zeusbase[0x4e];
12551260   extra->transcolor = 0x100;//((databuffer[1] >> 16) & 1) ? 0 : 0x100;
12561261   extra->texbase = WAVERAM_BLOCK0(zeus_texbase);
1257   extra->palbase = waveram0_ptr_from_expanded_addr(zeusbase[0x41]);
1262   extra->palbase = waveram0_ptr_from_expanded_addr(state->m_zeusbase[0x41]);
12581263
12591264   poly_render_quad_fan(poly, NULL, zeus_cliprect, callback, 4, numverts, &clipvert[0]);
12601265}
trunk/src/mame/video/konamiic.c
r17825r17826
15101510
15111511#define K053936_MAX_CHIPS 2
15121512
1513UINT16 *K053936_0_ctrl,*K053936_0_linectrl;
1514UINT16 *K053936_1_ctrl,*K053936_1_linectrl;
15151513static int K053936_offset[K053936_MAX_CHIPS][2];
15161514static int K053936_wraparound[K053936_MAX_CHIPS];
15171515
r17825r17826
16411639
16421640void K053936_0_zoom_draw(bitmap_ind16 &bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack)
16431641{
1644   K053936_zoom_draw(0,K053936_0_ctrl,K053936_0_linectrl,bitmap,cliprect,tmap,flags,priority, glfgreat_hack);
1642   UINT16 *ctrl = reinterpret_cast<UINT16 *>(tmap->machine().root_device().memshare("k053936_0_ctrl")->ptr());
1643   UINT16 *linectrl = reinterpret_cast<UINT16 *>(tmap->machine().root_device().memshare("k053936_0_line")->ptr());
1644   K053936_zoom_draw(0,ctrl,linectrl,bitmap,cliprect,tmap,flags,priority, glfgreat_hack);
16451645}
16461646
16471647void K053936_wraparound_enable(int chip, int status)
trunk/src/mame/video/konamiic.h
r17825r17826
3636int K053246_read_register(int regnum);
3737
3838extern UINT16 *K053936_0_ctrl,*K053936_0_linectrl;
39extern UINT16 *K053936_1_ctrl,*K053936_1_linectrl;
39//extern UINT16 *K053936_1_ctrl,*K053936_1_linectrl;
4040void K053936_0_zoom_draw(bitmap_ind16 &bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack);
4141void K053936_wraparound_enable(int chip, int status);
4242void K053936_set_offset(int chip, int xoffs, int yoffs);
trunk/src/mame/video/konamigx.c
r17825r17826
348348static void K053936GP_0_zoom_draw(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect,
349349      tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output)
350350{
351   K053936GP_zoom_draw(machine, 0,K053936_0_ctrl,K053936_0_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output);
351   konamigx_state *state = machine.driver_data<konamigx_state>();
352   K053936GP_zoom_draw(machine, 0,state->m_k053936_0_ctrl,state->m_k053936_0_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output);
352353}
353354
354355static void K053936GP_1_zoom_draw(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect,
355356      tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output)
356357{
357   K053936GP_zoom_draw(machine, 1,K053936_1_ctrl,K053936_1_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output);
358//   konamigx_state *state = machine.driver_data<konamigx_state>();
359//   K053936GP_zoom_draw(machine, 1,K053936_1_ctrl,K053936_1_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output);
358360}
359361
360362
trunk/src/mame/includes/midzeus.h
r17825r17826
1111public:
1212   midzeus_state(const machine_config &mconfig, device_type type, const char *tag)
1313      : driver_device(mconfig, type, tag),
14        m_nvram(*this, "nvram") { }
14        m_nvram(*this, "nvram"),
15        m_ram_base(*this, "ram_base"),
16        m_linkram(*this, "linkram"),
17        m_tms32031_control(*this, "tms32031_ctl"),
18        m_zeusbase(*this, "zeusbase") { }
1519
1620   required_shared_ptr<UINT32>   m_nvram;
21   required_shared_ptr<UINT32>   m_ram_base;
22   optional_shared_ptr<UINT32>   m_linkram;
23   required_shared_ptr<UINT32>   m_tms32031_control;
24   required_shared_ptr<UINT32>   m_zeusbase;
25
1726   DECLARE_WRITE32_MEMBER(cmos_w);
1827   DECLARE_READ32_MEMBER(cmos_r);
1928   DECLARE_WRITE32_MEMBER(cmos_protect_w);
r17825r17826
4857
4958/*----------- defined in video/midzeus.c -----------*/
5059
51extern UINT32 *zeusbase;
52
5360VIDEO_START( midzeus );
5461SCREEN_UPDATE_IND16( midzeus );
5562
trunk/src/mame/includes/konamigx.h
r17825r17826
66      m_maincpu(*this,"maincpu"),
77      m_workram(*this,"workram"),
88      m_psacram(*this,"psacram"),
9      m_subpaletteram32(*this,"subpaletteram")
9      m_subpaletteram32(*this,"subpaletteram"),
10      m_k053936_0_ctrl(*this,"k053936_0_ctrl",32),
11      m_k053936_0_linectrl(*this,"k053936_0_line",32)
1012      { }
1113
1214   required_device<cpu_device> m_maincpu;
13   required_shared_ptr<UINT32> m_workram;
15   optional_shared_ptr<UINT32> m_workram;
1416   optional_shared_ptr<UINT32> m_psacram;
1517   optional_shared_ptr<UINT32> m_subpaletteram32;
18   optional_shared_ptr<UINT16> m_k053936_0_ctrl;
19   optional_shared_ptr<UINT16> m_k053936_0_linectrl;
1620   DECLARE_WRITE32_MEMBER(esc_w);
1721   DECLARE_WRITE32_MEMBER(eeprom_w);
1822   DECLARE_WRITE32_MEMBER(control_w);
trunk/src/mame/drivers/midzeus.c
r17825r17826
5656static UINT8         keypad_select;
5757static UINT8         bitlatch[10];
5858
59static UINT32 *ram_base;
6059static UINT8 cmos_protected;
6160
62static UINT32 *linkram;
6361
6462static emu_timer *timer[2];
6563
66static UINT32 *tms32031_control;
67
68
6964static TIMER_CALLBACK( invasn_gun_callback );
7065
7166
r17825r17826
9590
9691static MACHINE_RESET( midzeus )
9792{
98   memcpy(ram_base, machine.root_device().memregion("user1")->base(), 0x40000*4);
99   *ram_base <<= 1;
93   midzeus_state *state = machine.driver_data<midzeus_state>();
94
95   memcpy(state->m_ram_base, machine.root_device().memregion("user1")->base(), 0x40000*4);
96   *state->m_ram_base <<= 1;
10097   machine.device("maincpu")->reset();
10198
10299   cmos_protected = TRUE;
r17825r17826
362359      return 0x30313042;
363360   else if (offset == 0x3c)
364361      return 0xffffffff;
365   return linkram[offset];
362   return m_linkram[offset];
366363}
367364
368365WRITE32_MEMBER(midzeus_state::linkram_w)
369366{
370367   logerror("%06X:unknown_8a000_w(%02X) = %08X\n", space.device().safe_pc(),  offset, data);
371   COMBINE_DATA(&linkram[offset]);
368   COMBINE_DATA(&m_linkram[offset]);
372369}
373370
374371
r17825r17826
394391   if (offset != 0x64)
395392      logerror("%06X:tms32031_control_r(%02X)\n", space.device().safe_pc(), offset);
396393
397   return tms32031_control[offset];
394   return m_tms32031_control[offset];
398395}
399396
400397
401398WRITE32_MEMBER(midzeus_state::tms32031_control_w)
402399{
403   COMBINE_DATA(&tms32031_control[offset]);
400   COMBINE_DATA(&m_tms32031_control[offset]);
404401
405402   /* ignore changes to the memory control register */
406403   if (offset == 0x64)
r17825r17826
567564
568565static ADDRESS_MAP_START( zeus_map, AS_PROGRAM, 32, midzeus_state )
569566   ADDRESS_MAP_UNMAP_HIGH
570   AM_RANGE(0x000000, 0x03ffff) AM_RAM AM_BASE_LEGACY(&ram_base)
567   AM_RANGE(0x000000, 0x03ffff) AM_RAM AM_SHARE("ram_base")
571568   AM_RANGE(0x400000, 0x41ffff) AM_RAM
572   AM_RANGE(0x808000, 0x80807f) AM_READWRITE(tms32031_control_r, tms32031_control_w) AM_BASE_LEGACY(&tms32031_control)
573   AM_RANGE(0x880000, 0x8803ff) AM_READWRITE(zeus_r, zeus_w) AM_BASE_LEGACY(&zeusbase)
569   AM_RANGE(0x808000, 0x80807f) AM_READWRITE(tms32031_control_r, tms32031_control_w) AM_SHARE("tms32031_ctl")
570   AM_RANGE(0x880000, 0x8803ff) AM_READWRITE(zeus_r, zeus_w) AM_SHARE("zeusbase")
574571   AM_RANGE(0x8d0000, 0x8d0004) AM_READWRITE(bitlatches_r, bitlatches_w)
575572   AM_RANGE(0x990000, 0x99000f) AM_READWRITE_LEGACY(midway_ioasic_r, midway_ioasic_w)
576573   AM_RANGE(0x9e0000, 0x9e0000) AM_WRITENOP      // watchdog?
r17825r17826
582579
583580static ADDRESS_MAP_START( zeus2_map, AS_PROGRAM, 32, midzeus_state )
584581   ADDRESS_MAP_UNMAP_HIGH
585   AM_RANGE(0x000000, 0x03ffff) AM_RAM AM_BASE_LEGACY(&ram_base)
582   AM_RANGE(0x000000, 0x03ffff) AM_RAM AM_SHARE("ram_base")
586583   AM_RANGE(0x400000, 0x43ffff) AM_RAM
587   AM_RANGE(0x808000, 0x80807f) AM_READWRITE(tms32031_control_r, tms32031_control_w) AM_BASE_LEGACY(&tms32031_control)
588   AM_RANGE(0x880000, 0x88007f) AM_READWRITE_LEGACY(zeus2_r, zeus2_w) AM_BASE_LEGACY(&zeusbase)
589   AM_RANGE(0x8a0000, 0x8a003f) AM_READWRITE(linkram_r, linkram_w) AM_BASE_LEGACY(&linkram)
584   AM_RANGE(0x808000, 0x80807f) AM_READWRITE(tms32031_control_r, tms32031_control_w) AM_SHARE("tms32031_ctl")
585   AM_RANGE(0x880000, 0x88007f) AM_READWRITE_LEGACY(zeus2_r, zeus2_w) AM_SHARE("zeusbase")
586   AM_RANGE(0x8a0000, 0x8a003f) AM_READWRITE(linkram_r, linkram_w) AM_SHARE("linkram")
590587   AM_RANGE(0x8d0000, 0x8d000a) AM_READWRITE(bitlatches_r, bitlatches_w)
591588   AM_RANGE(0x900000, 0x91ffff) AM_READWRITE(zpram_r, zpram_w) AM_SHARE("nvram") AM_MIRROR(0x020000)
592589   AM_RANGE(0x990000, 0x99000f) AM_READWRITE_LEGACY(midway_ioasic_r, midway_ioasic_w)
trunk/src/mame/drivers/legionna.c
r17825r17826
8282static ADDRESS_MAP_START( legionna_map, AS_PROGRAM, 16, legionna_state )
8383   AM_RANGE(0x000000, 0x07ffff) AM_ROM
8484   AM_RANGE(0x100000, 0x1003ff) AM_RAM
85   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(legionna_mcu_r, legionna_mcu_w) AM_BASE_LEGACY(&cop_mcu_ram)   /* COP mcu */
85   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(legionna_mcu_r, legionna_mcu_w) AM_SHARE("cop_mcu_ram")   /* COP mcu */
8686   AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_background_w) AM_SHARE("back_data")
8787   AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_foreground_w) AM_SHARE("fore_data")
8888   AM_RANGE(0x102000, 0x1027ff) AM_RAM_WRITE(legionna_midground_w) AM_SHARE("mid_data")
r17825r17826
9797static ADDRESS_MAP_START( heatbrl_map, AS_PROGRAM, 16, legionna_state )
9898   AM_RANGE(0x000000, 0x07ffff) AM_ROM
9999   AM_RANGE(0x100000, 0x1003ff) AM_RAM
100   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(heatbrl_mcu_r, heatbrl_mcu_w) AM_BASE_LEGACY(&cop_mcu_ram)   /* COP mcu */
100   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(heatbrl_mcu_r, heatbrl_mcu_w) AM_SHARE("cop_mcu_ram")   /* COP mcu */
101101   AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(legionna_background_w) AM_SHARE("back_data")
102102   AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_SHARE("fore_data")
103103   AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_SHARE("mid_data")
r17825r17826
110110static ADDRESS_MAP_START( godzilla_map, AS_PROGRAM, 16, legionna_state )
111111   AM_RANGE(0x000000, 0x07ffff) AM_ROM
112112   AM_RANGE(0x100000, 0x1003ff) AM_RAM
113   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(godzilla_mcu_r, godzilla_mcu_w) AM_BASE_LEGACY(&cop_mcu_ram)   /* COP mcu */
113   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(godzilla_mcu_r, godzilla_mcu_w) AM_SHARE("cop_mcu_ram")   /* COP mcu */
114114   AM_RANGE(0x100800, 0x100fff) AM_RAM
115115   AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(legionna_background_w) AM_SHARE("back_data")
116116   AM_RANGE(0x102000, 0x1027ff) AM_RAM_WRITE(legionna_midground_w) AM_SHARE("mid_data")
r17825r17826
135135static ADDRESS_MAP_START( denjinmk_map, AS_PROGRAM, 16, legionna_state )
136136   AM_RANGE(0x000000, 0x0fffff) AM_ROM
137137   AM_RANGE(0x100000, 0x1003ff) AM_RAM
138   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(denjinmk_mcu_r, denjinmk_mcu_w) AM_BASE_LEGACY(&cop_mcu_ram)   /* COP mcu */
138   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(denjinmk_mcu_r, denjinmk_mcu_w) AM_SHARE("cop_mcu_ram")   /* COP mcu */
139139   AM_RANGE(0x100800, 0x100fff) AM_RAM
140140   AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_background_w) AM_SHARE("back_data")
141141   AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_foreground_w) AM_SHARE("fore_data")
r17825r17826
152152static ADDRESS_MAP_START( grainbow_map, AS_PROGRAM, 16, legionna_state )
153153   AM_RANGE(0x000000, 0x0fffff) AM_ROM
154154   AM_RANGE(0x100000, 0x1003ff) AM_RAM
155   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(grainbow_mcu_r, grainbow_mcu_w) AM_BASE_LEGACY(&cop_mcu_ram)   /* COP mcu */
155   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(grainbow_mcu_r, grainbow_mcu_w) AM_SHARE("cop_mcu_ram")   /* COP mcu */
156156   AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(legionna_background_w) AM_SHARE("back_data")
157157   AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_SHARE("fore_data")
158158   AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_SHARE("mid_data")
r17825r17826
168168static ADDRESS_MAP_START( cupsoc_mem, AS_PROGRAM, 16, legionna_state )
169169   AM_RANGE(0x000000, 0x0fffff) AM_ROM
170170   AM_RANGE(0x100000, 0x1003ff) AM_RAM
171   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(cupsoc_mcu_r,cupsoc_mcu_w) AM_BASE_LEGACY(&cop_mcu_ram)
171   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(cupsoc_mcu_r,cupsoc_mcu_w) AM_SHARE("cop_mcu_ram")
172172   AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(legionna_background_w) AM_SHARE("back_data")
173173   AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_SHARE("fore_data")
174174   AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_SHARE("mid_data")
r17825r17826
187187static ADDRESS_MAP_START( cupsocs_mem, AS_PROGRAM, 16, legionna_state )
188188   AM_RANGE(0x000000, 0x0fffff) AM_ROM
189189   AM_RANGE(0x100000, 0x1003ff) AM_RAM
190   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(cupsocs_mcu_r,cupsocs_mcu_w) AM_BASE_LEGACY(&cop_mcu_ram)
190   AM_RANGE(0x100400, 0x1007ff) AM_READWRITE_LEGACY(cupsocs_mcu_r,cupsocs_mcu_w) AM_SHARE("cop_mcu_ram")
191191   AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(legionna_background_w) AM_SHARE("back_data")
192192   AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_SHARE("fore_data")
193193   AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_SHARE("mid_data")
r17825r17826
206206static ADDRESS_MAP_START( cupsocbl_mem, AS_PROGRAM, 16, legionna_state )
207207   AM_RANGE(0x000000, 0x0fffff) AM_ROM
208208   //AM_RANGE(0x100000, 0x1003ff) AM_RAM
209   AM_RANGE(0x100000, 0x1007ff) AM_READWRITE_LEGACY(copdxbl_0_r,copdxbl_0_w) AM_BASE_LEGACY(&cop_mcu_ram)
209   AM_RANGE(0x100000, 0x1007ff) AM_READWRITE_LEGACY(copdxbl_0_r,copdxbl_0_w) AM_SHARE("cop_mcu_ram")
210210   AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(legionna_background_w) AM_SHARE("back_data")
211211   AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_SHARE("fore_data")
212212   AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_SHARE("mid_data")
trunk/src/mame/drivers/r2dx_v33.c
r17825r17826
3030public:
3131   r2dx_v33_state(const machine_config &mconfig, device_type type, const char *tag)
3232      : driver_device(mconfig, type, tag) ,
33      m_spriteram(*this, "spriteram"){ }
33      m_spriteram(*this, "spriteram"),
34      m_bg_vram(*this, "bg_vram"),
35      m_md_vram(*this, "md_vram"),
36      m_fg_vram(*this, "fg_vram"),
37      m_tx_vram(*this, "tx_vram")
38      { }
3439
3540   required_shared_ptr<UINT16> m_spriteram;
3641   DECLARE_WRITE16_MEMBER(rdx_bg_vram_w);
r17825r17826
5560   TILE_GET_INFO_MEMBER(get_md_tile_info);
5661   TILE_GET_INFO_MEMBER(get_fg_tile_info);
5762   TILE_GET_INFO_MEMBER(get_tx_tile_info);
63
64   required_shared_ptr<UINT16> m_bg_vram;
65   required_shared_ptr<UINT16> m_md_vram;
66   required_shared_ptr<UINT16> m_fg_vram;
67   required_shared_ptr<UINT16> m_tx_vram;
68   tilemap_t *m_bg_tilemap;
69   tilemap_t *m_md_tilemap;
70   tilemap_t *m_fg_tilemap;
71   tilemap_t *m_tx_tilemap;
5872};
5973
6074
61static UINT16 *seibu_crtc_regs;
62static UINT16 *bg_vram,*md_vram,*fg_vram,*tx_vram;
63static tilemap_t *bg_tilemap,*md_tilemap,*fg_tilemap,*tx_tilemap;
64
6575TILE_GET_INFO_MEMBER(r2dx_v33_state::get_bg_tile_info)
6676{
67   int tile = bg_vram[tile_index];
77   int tile = m_bg_vram[tile_index];
6878   int color = (tile>>12)&0xf;
6979
7080   tile &= 0xfff;
r17825r17826
7484
7585TILE_GET_INFO_MEMBER(r2dx_v33_state::get_md_tile_info)
7686{
77   int tile = md_vram[tile_index];
87   int tile = m_md_vram[tile_index];
7888   int color = (tile>>12)&0xf;
7989
8090   tile &= 0xfff;
r17825r17826
8494
8595TILE_GET_INFO_MEMBER(r2dx_v33_state::get_fg_tile_info)
8696{
87   int tile = fg_vram[tile_index];
97   int tile = m_fg_vram[tile_index];
8898   int color = (tile>>12)&0xf;
8999
90100   tile &= 0xfff;
r17825r17826
94104
95105TILE_GET_INFO_MEMBER(r2dx_v33_state::get_tx_tile_info)
96106{
97   int tile = tx_vram[tile_index];
107   int tile = m_tx_vram[tile_index];
98108   int color = (tile>>12)&0xf;
99109
100110   tile &= 0xfff;
r17825r17826
192202static VIDEO_START( rdx_v33 )
193203{
194204   r2dx_v33_state *state = machine.driver_data<r2dx_v33_state>();
195   bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(r2dx_v33_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,16,16,32,32);
196   md_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(r2dx_v33_state::get_md_tile_info),state), TILEMAP_SCAN_ROWS,16,16,32,32);
197   fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(r2dx_v33_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS,16,16,32,32);
198   tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(r2dx_v33_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS,8, 8, 64,32);
205   state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(r2dx_v33_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,16,16,32,32);
206   state->m_md_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(r2dx_v33_state::get_md_tile_info),state), TILEMAP_SCAN_ROWS,16,16,32,32);
207   state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(r2dx_v33_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS,16,16,32,32);
208   state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(r2dx_v33_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS,8, 8, 64,32);
199209
200   bg_tilemap->set_transparent_pen(15);
201   md_tilemap->set_transparent_pen(15);
202   fg_tilemap->set_transparent_pen(15);
203   tx_tilemap->set_transparent_pen(15);
210   state->m_bg_tilemap->set_transparent_pen(15);
211   state->m_md_tilemap->set_transparent_pen(15);
212   state->m_fg_tilemap->set_transparent_pen(15);
213   state->m_tx_tilemap->set_transparent_pen(15);
204214}
205215
206216static SCREEN_UPDATE_IND16( rdx_v33 )
207217{
218   r2dx_v33_state *state = screen.machine().driver_data<r2dx_v33_state>();
208219   bitmap.fill(get_black_pen(screen.machine()), cliprect);
209220
210   bg_tilemap->draw(bitmap, cliprect, 0, 0);
211   md_tilemap->draw(bitmap, cliprect, 0, 0);
212   fg_tilemap->draw(bitmap, cliprect, 0, 0);
221   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
222   state->m_md_tilemap->draw(bitmap, cliprect, 0, 0);
223   state->m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
213224
214225   draw_sprites(screen.machine(),bitmap,cliprect,0);
215226
216   tx_tilemap->draw(bitmap, cliprect, 0, 0);
227   state->m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
217228
218229   /* debug DMA processing */
219230   if(0)
r17825r17826
247258         }
248259
249260         popmessage("%08x 1",src_addr);
250         bg_tilemap->mark_all_dirty();
261         state->m_bg_tilemap->mark_all_dirty();
251262         frame = 0;
252263         src_addr+=0x800;
253264      }
r17825r17826
312323
313324WRITE16_MEMBER(r2dx_v33_state::rdx_bg_vram_w)
314325{
315   COMBINE_DATA(&bg_vram[offset]);
316   bg_tilemap->mark_tile_dirty(offset);
326   COMBINE_DATA(&m_bg_vram[offset]);
327   m_bg_tilemap->mark_tile_dirty(offset);
317328}
318329
319330WRITE16_MEMBER(r2dx_v33_state::rdx_md_vram_w)
320331{
321   COMBINE_DATA(&md_vram[offset]);
322   md_tilemap->mark_tile_dirty(offset);
332   COMBINE_DATA(&m_md_vram[offset]);
333   m_md_tilemap->mark_tile_dirty(offset);
323334}
324335
325336WRITE16_MEMBER(r2dx_v33_state::rdx_fg_vram_w)
326337{
327   COMBINE_DATA(&fg_vram[offset]);
328   fg_tilemap->mark_tile_dirty(offset);
338   COMBINE_DATA(&m_fg_vram[offset]);
339   m_fg_tilemap->mark_tile_dirty(offset);
329340}
330341
331342WRITE16_MEMBER(r2dx_v33_state::rdx_tx_vram_w)
332343{
333   COMBINE_DATA(&tx_vram[offset]);
334   tx_tilemap->mark_tile_dirty(offset);
344   COMBINE_DATA(&m_tx_vram[offset]);
345   m_tx_tilemap->mark_tile_dirty(offset);
335346}
336347
337348READ16_MEMBER(r2dx_v33_state::rdx_v33_unknown_r)
r17825r17826
385396   AM_RANGE(0x00434, 0x00435) AM_READ(rdx_v33_unknown_r)
386397   AM_RANGE(0x00436, 0x00437) AM_READ(rdx_v33_unknown_r)
387398
388   AM_RANGE(0x00600, 0x0064f) AM_RAM AM_BASE_LEGACY(&seibu_crtc_regs)
399   AM_RANGE(0x00600, 0x0064f) AM_RAM AM_SHARE("crtc_regs")
389400   AM_RANGE(0x00650, 0x0068f) AM_RAM //???
390401
391402   AM_RANGE(0x0068e, 0x0068f) AM_WRITENOP // synch for the MCU?
r17825r17826
413424
414425   AM_RANGE(0x0c000, 0x0c7ff) AM_RAM AM_SHARE("spriteram")
415426   AM_RANGE(0x0c800, 0x0cfff) AM_RAM
416   AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(rdx_bg_vram_w) AM_BASE_LEGACY(&bg_vram)
417   AM_RANGE(0x0d800, 0x0dfff) AM_RAM_WRITE(rdx_md_vram_w) AM_BASE_LEGACY(&md_vram)
418   AM_RANGE(0x0e000, 0x0e7ff) AM_RAM_WRITE(rdx_fg_vram_w) AM_BASE_LEGACY(&fg_vram)
419   AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(rdx_tx_vram_w) AM_BASE_LEGACY(&tx_vram)
427   AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(rdx_bg_vram_w) AM_SHARE("bg_vram")
428   AM_RANGE(0x0d800, 0x0dfff) AM_RAM_WRITE(rdx_md_vram_w) AM_SHARE("md_vram")
429   AM_RANGE(0x0e000, 0x0e7ff) AM_RAM_WRITE(rdx_fg_vram_w) AM_SHARE("fg_vram")
430   AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(rdx_tx_vram_w) AM_SHARE("tx_vram")
420431   AM_RANGE(0x0f800, 0x0ffff) AM_RAM /* Stack area */
421432   AM_RANGE(0x10000, 0x1efff) AM_RAM
422433   AM_RANGE(0x1f000, 0x1ffff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
r17825r17826
462473   AM_RANGE(0x00400, 0x00407) AM_WRITE(mcu_table_w)
463474   AM_RANGE(0x00420, 0x00427) AM_WRITE(mcu_table2_w)
464475
465   AM_RANGE(0x00600, 0x0064f) AM_RAM AM_BASE_LEGACY(&seibu_crtc_regs)
476   AM_RANGE(0x00600, 0x0064f) AM_RAM AM_SHARE("crtc_regs")
466477
467478   AM_RANGE(0x0068e, 0x0068f) AM_WRITENOP // synch for the MCU?
468479   AM_RANGE(0x006b0, 0x006b1) AM_WRITE(mcu_prog_w)
r17825r17826
486497
487498   AM_RANGE(0x0c000, 0x0c7ff) AM_RAM AM_SHARE("spriteram")
488499   AM_RANGE(0x0c800, 0x0cfff) AM_RAM
489   AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(rdx_bg_vram_w) AM_BASE_LEGACY(&bg_vram)
490   AM_RANGE(0x0d800, 0x0dfff) AM_RAM_WRITE(rdx_md_vram_w) AM_BASE_LEGACY(&md_vram)
491   AM_RANGE(0x0e000, 0x0e7ff) AM_RAM_WRITE(rdx_fg_vram_w) AM_BASE_LEGACY(&fg_vram)
492   AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(rdx_tx_vram_w) AM_BASE_LEGACY(&tx_vram)
500   AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(rdx_bg_vram_w) AM_SHARE("bg_vram")
501   AM_RANGE(0x0d800, 0x0dfff) AM_RAM_WRITE(rdx_md_vram_w) AM_SHARE("md_vram")
502   AM_RANGE(0x0e000, 0x0e7ff) AM_RAM_WRITE(rdx_fg_vram_w) AM_SHARE("fg_vram")
503   AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(rdx_tx_vram_w) AM_SHARE("tx_vram")
493504   AM_RANGE(0x0f800, 0x0ffff) AM_RAM /* Stack area */
494505   AM_RANGE(0x10000, 0x1efff) AM_RAM
495506   AM_RANGE(0x1f000, 0x1ffff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
trunk/src/mame/drivers/mystwarr.c
r17825r17826
471471   AM_RANGE(0x440000, 0x443fff) AM_READ_LEGACY(K056832_mw_rom_word_r)
472472   AM_RANGE(0x450000, 0x45000f) AM_READ_LEGACY(K055673_rom_word_r)
473473   AM_RANGE(0x450010, 0x45001f) AM_WRITE_LEGACY(K053247_reg_word_w)
474   AM_RANGE(0x460000, 0x46001f) AM_WRITEONLY AM_BASE_LEGACY(&K053936_0_ctrl)
475   AM_RANGE(0x470000, 0x470fff) AM_RAM AM_BASE_LEGACY(&K053936_0_linectrl)
474   AM_RANGE(0x460000, 0x46001f) AM_WRITEONLY AM_SHARE("k053936_0_ctrl")
475   AM_RANGE(0x470000, 0x470fff) AM_RAM AM_SHARE("k053936_0_line")
476476   AM_RANGE(0x480000, 0x48003f) AM_WRITE_LEGACY(K056832_word_w)      // VACSET
477477   AM_RANGE(0x482000, 0x482007) AM_WRITE_LEGACY(K056832_b_word_w)   // VSCCS
478478   AM_RANGE(0x484000, 0x484003) AM_WRITE(ddd_053936_clip_w)
r17825r17826
518518   AM_RANGE(0x440000, 0x441fff) AM_READ_LEGACY(K056832_mw_rom_word_r)
519519   AM_RANGE(0x450000, 0x45000f) AM_READ_LEGACY(K055673_rom_word_r)
520520   AM_RANGE(0x450010, 0x45001f) AM_WRITE_LEGACY(K053247_reg_word_w)
521   AM_RANGE(0x460000, 0x46001f) AM_WRITEONLY AM_BASE_LEGACY(&K053936_0_ctrl)
522   AM_RANGE(0x470000, 0x470fff) AM_RAM AM_BASE_LEGACY(&K053936_0_linectrl)
521   AM_RANGE(0x460000, 0x46001f) AM_WRITEONLY AM_SHARE("k053936_0_ctrl")
522   AM_RANGE(0x470000, 0x470fff) AM_RAM AM_SHARE("k053936_0_line")
523523   AM_RANGE(0x480000, 0x48003f) AM_WRITE_LEGACY(K056832_word_w)         // VACSET
524524   AM_RANGE(0x482000, 0x482007) AM_WRITE_LEGACY(K056832_b_word_w)         // VSCCS
525525   AM_RANGE(0x484000, 0x484003) AM_WRITE(ddd_053936_clip_w)
trunk/src/mame/drivers/konamigx.c
r17825r17826
11901190   AM_RANGE(0xdda000, 0xddafff) AM_WRITE_PORT("ADC-WRPORT")
11911191   AM_RANGE(0xddc000, 0xddcfff) AM_READ_PORT("ADC-RDPORT")
11921192   AM_RANGE(0xdde000, 0xdde003) AM_WRITE(type1_cablamps_w)
1193   AM_RANGE(0xe00000, 0xe0001f) AM_RAM AM_BASE_LEGACY((UINT32**)&K053936_0_ctrl)
1193   AM_RANGE(0xe00000, 0xe0001f) AM_RAM AM_SHARE("k053936_0_ctrl")
11941194   AM_RANGE(0xe20000, 0xe2000f) AM_WRITENOP
11951195   AM_RANGE(0xe40000, 0xe40003) AM_WRITENOP
1196   AM_RANGE(0xe80000, 0xe81fff) AM_RAM AM_BASE_LEGACY((UINT32**)&K053936_0_linectrl)   // chips 21L+19L / S
1196   AM_RANGE(0xe80000, 0xe81fff) AM_RAM AM_SHARE("k053936_0_line")   // chips 21L+19L / S
11971197   AM_RANGE(0xec0000, 0xedffff) AM_RAM_WRITE(konamigx_t1_psacmap_w) AM_SHARE("psacram")  // chips 20J+23J+18J / S
11981198   AM_RANGE(0xf00000, 0xf3ffff) AM_READ(type1_roz_r1)   // ROM readback
11991199   AM_RANGE(0xf40000, 0xf7ffff) AM_READ(type1_roz_r2)   // ROM readback
r17825r17826
12111211static ADDRESS_MAP_START( gx_type3_map, AS_PROGRAM, 32, konamigx_state )
12121212   AM_RANGE(0xd90000, 0xd97fff) AM_RAM
12131213   //AM_RANGE(0xcc0000, 0xcc0007) AM_WRITE(type4_prot_w)
1214   AM_RANGE(0xe00000, 0xe0001f) AM_RAM AM_BASE_LEGACY((UINT32**)&K053936_0_ctrl)
1214   AM_RANGE(0xe00000, 0xe0001f) AM_RAM AM_SHARE("k053936_0_ctrl")
12151215   //AM_RANGE(0xe20000, 0xe20003) AM_WRITENOP
12161216   AM_RANGE(0xe40000, 0xe40003) AM_WRITE(konamigx_type3_psac2_bank_w) AM_BASE_LEGACY(&konamigx_type3_psac2_bank)
1217   AM_RANGE(0xe60000, 0xe60fff) AM_RAM AM_BASE_LEGACY((UINT32**)&K053936_0_linectrl)
1217   AM_RANGE(0xe60000, 0xe60fff) AM_RAM AM_SHARE("k053936_0_line")
12181218   AM_RANGE(0xe80000, 0xe83fff) AM_RAM AM_SHARE("paletteram")   // main monitor palette
12191219   AM_RANGE(0xea0000, 0xea3fff) AM_RAM AM_SHARE("subpaletteram")
12201220   AM_RANGE(0xec0000, 0xec0003) AM_READ(type3_sync_r)
r17825r17826
12251225static ADDRESS_MAP_START( gx_type4_map, AS_PROGRAM, 32, konamigx_state )
12261226   AM_RANGE(0xcc0000, 0xcc0007) AM_WRITE(type4_prot_w)
12271227   AM_RANGE(0xd90000, 0xd97fff) AM_RAM
1228   AM_RANGE(0xe00000, 0xe0001f) AM_RAM AM_BASE_LEGACY((UINT32**)&K053936_0_ctrl)
1228   AM_RANGE(0xe00000, 0xe0001f) AM_RAM AM_SHARE("k053936_0_ctrl")
12291229   AM_RANGE(0xe20000, 0xe20003) AM_WRITENOP
12301230   AM_RANGE(0xe40000, 0xe40003) AM_WRITENOP
1231   AM_RANGE(0xe60000, 0xe60fff) AM_RAM AM_BASE_LEGACY((UINT32**)&K053936_0_linectrl)  // 29C & 29G (PSAC2 line control)
1231   AM_RANGE(0xe60000, 0xe60fff) AM_RAM AM_SHARE("k053936_0_line")  // 29C & 29G (PSAC2 line control)
12321232   AM_RANGE(0xe80000, 0xe87fff) AM_RAM AM_SHARE("paletteram") // 11G/13G/15G (main screen palette RAM)
12331233   AM_RANGE(0xea0000, 0xea7fff) AM_RAM AM_SHARE("subpaletteram") // 5G/7G/9G (sub screen palette RAM)
12341234   AM_RANGE(0xec0000, 0xec0003) AM_READ(type3_sync_r)      // type 4 polls this too
trunk/src/mess/drivers/ng_aes.c
r17825r17826
13031303   AM_RANGE(0x400000, 0x401fff) AM_MIRROR(0x3fe000) AM_READWRITE(neogeo_paletteram_r, neogeo_paletteram_w)
13041304   AM_RANGE(0x800000, 0x800fff) AM_READWRITE(memcard_r, memcard_w)
13051305   AM_RANGE(0xc00000, 0xc1ffff) AM_MIRROR(0x0e0000) AM_ROMBANK(NEOGEO_BANK_BIOS)
1306   AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_READ(neogeo_unmapped_r) //AM_RAM_WRITE(save_ram_w) AM_BASE_LEGACY(&save_ram)
1306   AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_READ(neogeo_unmapped_r) //AM_RAM_WRITE(save_ram_w) AM_SHARE("save_ram")
13071307   AM_RANGE(0xe00000, 0xffffff) AM_READ(neogeo_unmapped_r)
13081308ADDRESS_MAP_END
13091309
r17825r17826
13291329   AM_RANGE(0x400000, 0x401fff) AM_MIRROR(0x3fe000) AM_READWRITE(neogeo_paletteram_r, neogeo_paletteram_w)
13301330   AM_RANGE(0x800000, 0x803fff) AM_READWRITE(neocd_memcard_r, neocd_memcard_w)
13311331   AM_RANGE(0xc00000, 0xcfffff) AM_ROMBANK(NEOGEO_BANK_BIOS)
1332   AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_READ(neogeo_unmapped_r) //AM_RAM_WRITE(save_ram_w) AM_BASE_LEGACY(&save_ram)
1332   AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_READ(neogeo_unmapped_r) //AM_RAM_WRITE(save_ram_w) AM_SHARE("save_ram")
13331333   AM_RANGE(0xe00000, 0xefffff) AM_READWRITE(neocd_transfer_r,neocd_transfer_w)
13341334   AM_RANGE(0xf00000, 0xfeffff) AM_READ(neogeo_unmapped_r)
13351335   AM_RANGE(0xff0000, 0xff01ff) AM_READWRITE(neocd_control_r, neocd_control_w) // CDROM / DMA
trunk/src/mess/drivers/mmodular.c
r17825r17826
9999#include "machine/nvram.h"
100100
101101//static UINT16 unknown2_data = 0;
102static UINT16 *save_ram;
103static UINT32 *save_ram32;
104
105102// Berlin Pro 68020
106103static UINT32 BPL32latch_data = 0;
107104
r17825r17826
10051002         rom[0x870] = 0x38;
10061003      }
10071004   }
1008
1009   machine.device<nvram_device>("nvram")->set_base(save_ram32, 0x8000);
1010
10111005}
10121006
10131007
r17825r17826
10461040{
10471041
10481042   mboard_savestate_register(machine);
1049   machine.device<nvram_device>("nvram")->set_base(save_ram, 0x4000);
10501043
10511044}
10521045
r17825r17826
11481141
11491142   AM_RANGE( 0x40000000, 0x4007ffff )  AM_RAM      /* 512KB */
11501143   AM_RANGE( 0x80000000, 0x8003ffff )  AM_RAM      /* 256KB */
1151   AM_RANGE( 0xe8000000, 0xe8007fff )  AM_RAM AM_BASE_LEGACY(&save_ram32) AM_SHARE("nvram")
1144   AM_RANGE( 0xe8000000, 0xe8007fff )  AM_RAM AM_SHARE("nvram")
11521145
11531146 ADDRESS_MAP_END
11541147
r17825r17826
11611154   AM_RANGE( 0xc00000 , 0xc00003 )  AM_WRITE(write_LCD_data_32 )
11621155   AM_RANGE( 0xb00000 , 0xb00003 )  AM_WRITE(write_IOenables_32 )
11631156   AM_RANGE( 0x400000 , 0x4fffff )  AM_RAM      /* 1024KB */
1164   AM_RANGE( 0xd00000 , 0xd07fff )  AM_RAM AM_BASE_LEGACY(&save_ram32) AM_SHARE("nvram")
1157   AM_RANGE( 0xd00000 , 0xd07fff )  AM_RAM AM_SHARE("nvram")
11651158
11661159 ADDRESS_MAP_END
11671160
r17825r17826
11801173   AM_RANGE( 0x9800000c , 0x9800000f )  AM_READ(read_unknown3_32 )
11811174
11821175   AM_RANGE( 0x40000000, 0x400fffff )  AM_RAM      /* 1024KB */
1183   AM_RANGE( 0xa8000000, 0xa8007fff )  AM_RAM AM_BASE_LEGACY(&save_ram32) AM_SHARE("nvram")
1176   AM_RANGE( 0xa8000000, 0xa8007fff )  AM_RAM AM_SHARE("nvram")
11841177
11851178 ADDRESS_MAP_END
11861179
r17825r17826
12001193   AM_RANGE( 0x9800000c , 0x9800000f )  AM_READ(read_unknown3_32 )
12011194
12021195   AM_RANGE( 0x40000000, 0x400fffff )  AM_RAM
1203   AM_RANGE( 0xa8000000, 0xa8007fff )  AM_RAM AM_BASE_LEGACY(&save_ram32) AM_SHARE("nvram")
1196   AM_RANGE( 0xa8000000, 0xa8007fff )  AM_RAM AM_SHARE("nvram")
12041197
12051198 ADDRESS_MAP_END
12061199
r17825r17826
12281221   AM_RANGE( 0xe80006 , 0xe80007 )  AM_READ(read_unknown3 )
12291222
12301223   AM_RANGE( 0x400000, 0x47ffff )  AM_RAM      /* 512KB */
1231   AM_RANGE( 0x800000, 0x803fff )  AM_RAM AM_BASE_LEGACY(&save_ram) AM_SHARE("nvram")
1224   AM_RANGE( 0x800000, 0x803fff )  AM_RAM AM_SHARE("nvram")
12321225
12331226 ADDRESS_MAP_END
12341227
r17825r17826
12481241
12491242
12501243   AM_RANGE( 0x400000, 0x47ffff )  AM_RAM      /* 512KB */
1251   AM_RANGE( 0x800000, 0x803fff )  AM_RAM  AM_BASE_LEGACY(&save_ram) AM_SHARE("nvram")
1244   AM_RANGE( 0x800000, 0x803fff )  AM_RAM  AM_SHARE("nvram")
12521245ADDRESS_MAP_END
12531246
12541247

Previous 199869 Revisions Next


© 1997-2024 The MAME Team