Previous 15994 Revisions Next

r15029 Tuesday 24th April, 2012 at 23:51:11 UTC by Barry Rodewald
x68k: merged driver state classes back together. Fixes x68030 assert.
[src/mess/drivers]x68k.c
[src/mess/includes]x68k.h
[src/mess/video]x68k.c

src/mess/includes/x68k.h
r15028r15029
3838   MFP_IRQ_GPIP7
3939};  // MC68901 IRQ priority levels
4040
41class x68k_base_state : public driver_device
41class x68k_state : public driver_device
4242{
4343public:
44   x68k_base_state(const machine_config &mconfig, device_type type, const char *tag)
44   x68k_state(const machine_config &mconfig, device_type type, const char *tag)
4545      : driver_device(mconfig, type, tag),
4646        m_mfpdev(*this, MC68901_TAG),
47        m_rtc(*this, RP5C15_TAG)
47        m_rtc(*this, RP5C15_TAG),
48        m_nvram16(*this, "nvram16"),
49        m_nvram32(*this, "nvram32"),
50        m_gvram16(*this, "gvram16"),
51        m_tvram16(*this, "tvram16"),
52        m_gvram32(*this, "gvram32"),
53        m_tvram32(*this, "tvram32")
4854   { }
4955
5056   required_device<mc68901_device> m_mfpdev;
5157   required_device<rp5c15_device> m_rtc;
5258
59   optional_shared_ptr<UINT16>   m_nvram16;
60   optional_shared_ptr<UINT32>   m_nvram32;
61
62   optional_shared_ptr<UINT16> m_gvram16;
63   optional_shared_ptr<UINT16> m_tvram16;
64   optional_shared_ptr<UINT32> m_gvram32;
65   optional_shared_ptr<UINT32> m_tvram32;
66
67   DECLARE_WRITE_LINE_MEMBER( mfp_tdo_w );
68   DECLARE_READ8_MEMBER( mfp_gpio_r );
69
5370   struct
5471   {
5572      int sram_writeprotect;
r15028r15029
234251   tilemap_t* m_bg1_16;
235252   int m_sprite_shift;
236253   int m_oddscanline;
254   bool m_is_32bit;
237255};
238256
239class x68k_state : public x68k_base_state
240{
241public:
242   x68k_state(const machine_config &mconfig, device_type type, const char *tag)
243      : x68k_base_state(mconfig,type,tag),
244        m_nvram(*this, "nvram"),
245        m_gvram(*this, "gvram"),
246        m_tvram(*this, "tvram")
247   { }
248257
249   required_shared_ptr<UINT16>   m_nvram;
250   required_shared_ptr<UINT16> m_gvram;
251   required_shared_ptr<UINT16> m_tvram;
252
253   DECLARE_WRITE_LINE_MEMBER( mfp_tdo_w );
254   DECLARE_READ8_MEMBER( mfp_gpio_r );
255};
256
257class x68030_state : public x68k_base_state
258{
259public:
260   x68030_state(const machine_config &mconfig, device_type type, const char *tag)
261      : x68k_base_state(mconfig,type,tag),
262        m_nvram(*this, "nvram"),
263        m_gvram(*this, "gvram"),
264        m_tvram(*this, "tvram")
265   { }
266
267   required_shared_ptr<UINT32>   m_nvram;
268   required_shared_ptr<UINT32> m_gvram;
269   required_shared_ptr<UINT32> m_tvram;
270
271   DECLARE_WRITE_LINE_MEMBER( mfp_tdo_w );
272   DECLARE_READ8_MEMBER( mfp_gpio_r );
273};
274
275258/*----------- defined in drivers/x68k.c -----------*/
276259
277260#ifdef UNUSED_FUNCTION
src/mess/video/x68k.c
r15028r15029
8181static void x68k_crtc_text_copy(x68k_state *state, int src, int dest)
8282{
8383   // copys one raster in T-VRAM to another raster
84   UINT16* tvram;
8485   int src_ram = src * 256;  // 128 bytes per scanline
8586   int dest_ram = dest * 256;
8687   int line;
8788
89   if(state->m_is_32bit)
90      tvram = (UINT16*)state->m_tvram32.target();
91   else
92      tvram = (UINT16*)state->m_tvram16.target();
93
8894   if(dest > 250)
8995      return;  // for some reason, Salamander causes a SIGSEGV in a debug build in this function.
9096
9197   for(line=0;line<8;line++)
9298   {
9399      // update RAM in each plane
94      memcpy(state->m_tvram+dest_ram,state->m_tvram+src_ram,128);
95      memcpy(state->m_tvram+dest_ram+0x10000,state->m_tvram+src_ram+0x10000,128);
96      memcpy(state->m_tvram+dest_ram+0x20000,state->m_tvram+src_ram+0x20000,128);
97      memcpy(state->m_tvram+dest_ram+0x30000,state->m_tvram+src_ram+0x30000,128);
100      memcpy(tvram+dest_ram,tvram+src_ram,128);
101      memcpy(tvram+dest_ram+0x10000,tvram+src_ram+0x10000,128);
102      memcpy(tvram+dest_ram+0x20000,tvram+src_ram+0x20000,128);
103      memcpy(tvram+dest_ram+0x30000,tvram+src_ram+0x30000,128);
98104
99105      src_ram+=64;
100106      dest_ram+=64;
r15028r15029
447453      }
448454      if(data & 0x02)  // high-speed graphic screen clear
449455      {
450         memset(state->m_gvram,0,0x40000);
456         if(state->m_is_32bit)
457            memset(state->m_gvram32,0,0x40000);
458         else
459            memset(state->m_gvram16,0,0x40000);
451460         space->machine().scheduler().timer_set(attotime::from_msec(10), FUNC(x68k_crtc_operation_end), 0x02);  // time taken to do operation is a complete guess.
452461      }
453462      break;
r15028r15029
499508WRITE16_HANDLER( x68k_gvram_w )
500509{
501510   x68k_state *state = space->machine().driver_data<x68k_state>();
511   UINT16* gvram;
502512//  int xloc,yloc,pageoffset;
503513   /*
504514       G-VRAM usage is determined by colour depth and "real" screen size.
r15028r15029
515525       Page 3 - 0xd00000-0xd7ffff    Page 4 - 0xd80000-0xdfffff
516526    */
517527
528   if(state->m_is_32bit)
529      gvram = (UINT16*)state->m_gvram32.target();
530   else
531      gvram = (UINT16*)state->m_gvram16.target();
532
518533   // handle different G-VRAM page setups
519534   if(state->m_crtc.reg[20] & 0x08)  // G-VRAM set to buffer
520535   {
521536      if(offset < 0x40000)
522         COMBINE_DATA(state->m_gvram+offset);
537         COMBINE_DATA(gvram+offset);
523538   }
524539   else
525540   {
r15028r15029
527542      {
528543         case 0x0300:
529544            if(offset < 0x40000)
530               COMBINE_DATA(state->m_gvram+offset);
545               COMBINE_DATA(gvram+offset);
531546            break;
532547         case 0x0100:
533548            if(offset < 0x40000)
534549            {
535               state->m_gvram[offset] = (state->m_gvram[offset] & 0xff00) | (data & 0x00ff);
550               gvram[offset] = (gvram[offset] & 0xff00) | (data & 0x00ff);
536551            }
537552            if(offset >= 0x40000 && offset < 0x80000)
538553            {
539               state->m_gvram[offset-0x40000] = (state->m_gvram[offset-0x40000] & 0x00ff) | ((data & 0x00ff) << 8);
554               gvram[offset-0x40000] = (gvram[offset-0x40000] & 0x00ff) | ((data & 0x00ff) << 8);
540555            }
541556            break;
542557         case 0x0000:
543558            if(offset < 0x40000)
544559            {
545               state->m_gvram[offset] = (state->m_gvram[offset] & 0xfff0) | (data & 0x000f);
560               gvram[offset] = (gvram[offset] & 0xfff0) | (data & 0x000f);
546561            }
547562            if(offset >= 0x40000 && offset < 0x80000)
548563            {
549               state->m_gvram[offset-0x40000] = (state->m_gvram[offset-0x40000] & 0xff0f) | ((data & 0x000f) << 4);
564               gvram[offset-0x40000] = (gvram[offset-0x40000] & 0xff0f) | ((data & 0x000f) << 4);
550565            }
551566            if(offset >= 0x80000 && offset < 0xc0000)
552567            {
553               state->m_gvram[offset-0x80000] = (state->m_gvram[offset-0x80000] & 0xf0ff) | ((data & 0x000f) << 8);
568               gvram[offset-0x80000] = (gvram[offset-0x80000] & 0xf0ff) | ((data & 0x000f) << 8);
554569            }
555570            if(offset >= 0xc0000 && offset < 0x100000)
556571            {
557               state->m_gvram[offset-0xc0000] = (state->m_gvram[offset-0xc0000] & 0x0fff) | ((data & 0x000f) << 12);
572               gvram[offset-0xc0000] = (gvram[offset-0xc0000] & 0x0fff) | ((data & 0x000f) << 12);
558573            }
559574            break;
560575         default:
r15028r15029
566581WRITE16_HANDLER( x68k_tvram_w )
567582{
568583   x68k_state *state = space->machine().driver_data<x68k_state>();
584   UINT16* tvram;
569585   UINT16 text_mask;
570586
587   if(state->m_is_32bit)
588      tvram = (UINT16*)state->m_tvram32.target();
589   else
590      tvram = (UINT16*)state->m_tvram16.target();
591
571592   text_mask = ~(state->m_crtc.reg[23]) & mem_mask;
572593
573594   if(!(state->m_crtc.reg[21] & 0x0200)) // text access mask enable
r15028r15029
584605      {
585606         if(wr & (1 << plane))
586607         {
587            COMBINE_DATA(state->m_tvram+offset+(0x10000*plane));
608            COMBINE_DATA(tvram+offset+(0x10000*plane));
588609         }
589610      }
590611   }
591612   else
592613   {
593      COMBINE_DATA(state->m_tvram+offset);
614      COMBINE_DATA(tvram+offset);
594615   }
595616}
596617
597618READ16_HANDLER( x68k_gvram_r )
598619{
599620   x68k_state *state = space->machine().driver_data<x68k_state>();
621   const UINT16* gvram;
600622   UINT16 ret = 0;
601623
624   if(state->m_is_32bit)
625      gvram = (const UINT16*)state->m_gvram32.target();
626   else
627      gvram = (const UINT16*)state->m_gvram16.target();
628
602629   if(state->m_crtc.reg[20] & 0x08)  // G-VRAM set to buffer
603      return state->m_gvram[offset];
630      return gvram[offset];
604631
605632   switch(state->m_crtc.reg[20] & 0x0300)  // colour setup determines G-VRAM use
606633   {
607634      case 0x0300: // 65,536 colour (RGB) - 16-bits per word
608635         if(offset < 0x40000)
609            ret = state->m_gvram[offset];
636            ret = gvram[offset];
610637         else
611638            ret = 0xffff;
612639         break;
613640      case 0x0100:  // 256 colour (paletted) - 8 bits per word
614641         if(offset < 0x40000)
615            ret = state->m_gvram[offset] & 0x00ff;
642            ret = gvram[offset] & 0x00ff;
616643         if(offset >= 0x40000 && offset < 0x80000)
617            ret = (state->m_gvram[offset-0x40000] & 0xff00) >> 8;
644            ret = (gvram[offset-0x40000] & 0xff00) >> 8;
618645         if(offset >= 0x80000)
619646            ret = 0xffff;
620647         break;
621648      case 0x0000:  // 16 colour (paletted) - 4 bits per word
622649         if(offset < 0x40000)
623            ret = state->m_gvram[offset] & 0x000f;
650            ret = gvram[offset] & 0x000f;
624651         if(offset >= 0x40000 && offset < 0x80000)
625            ret = (state->m_gvram[offset-0x40000] & 0x00f0) >> 4;
652            ret = (gvram[offset-0x40000] & 0x00f0) >> 4;
626653         if(offset >= 0x80000 && offset < 0xc0000)
627            ret = (state->m_gvram[offset-0x80000] & 0x0f00) >> 8;
654            ret = (gvram[offset-0x80000] & 0x0f00) >> 8;
628655         if(offset >= 0xc0000 && offset < 0x100000)
629            ret = (state->m_gvram[offset-0xc0000] & 0xf000) >> 12;
656            ret = (gvram[offset-0xc0000] & 0xf000) >> 12;
630657         break;
631658      default:
632659         logerror("G-VRAM read while layer setup is undefined.\n");
r15028r15029
639666READ16_HANDLER( x68k_tvram_r )
640667{
641668   x68k_state *state = space->machine().driver_data<x68k_state>();
642   return state->m_tvram[offset];
669   const UINT16* tvram;
670
671   if(state->m_is_32bit)
672      tvram = (const UINT16*)state->m_tvram32.target();
673   else
674      tvram = (const UINT16*)state->m_tvram16.target();
675
676   return tvram[offset];
643677}
644678
645679READ32_HANDLER( x68k_tvram32_r )
r15028r15029
769803static void x68k_draw_text(running_machine &machine,bitmap_ind16 &bitmap, int xscr, int yscr, rectangle rect)
770804{
771805   x68k_state *state = machine.driver_data<x68k_state>();
806   const UINT16* tvram;
772807   unsigned int line,pixel; // location on screen
773808   UINT32 loc;  // location in TVRAM
774809   UINT32 colour;
775810   int bit;
776811
812   if(state->m_is_32bit)
813      tvram = (const UINT16*)state->m_tvram32.target();
814   else
815      tvram = (const UINT16*)state->m_tvram16.target();
816
777817   for(line=rect.min_y;line<=rect.max_y;line++)  // per scanline
778818   {
779819      // adjust for scroll registers
r15028r15029
783823      bit = 15 - (xscr & 0x0f);
784824      for(pixel=rect.min_x;pixel<=rect.max_x;pixel++)  // per pixel
785825      {
786         colour = (((state->m_tvram[loc] >> bit) & 0x01) ? 1 : 0)
787            + (((state->m_tvram[loc+0x10000] >> bit) & 0x01) ? 2 : 0)
788            + (((state->m_tvram[loc+0x20000] >> bit) & 0x01) ? 4 : 0)
789            + (((state->m_tvram[loc+0x30000] >> bit) & 0x01) ? 8 : 0);
826         colour = (((tvram[loc] >> bit) & 0x01) ? 1 : 0)
827            + (((tvram[loc+0x10000] >> bit) & 0x01) ? 2 : 0)
828            + (((tvram[loc+0x20000] >> bit) & 0x01) ? 4 : 0)
829            + (((tvram[loc+0x30000] >> bit) & 0x01) ? 8 : 0);
790830         if(state->m_video.text_pal[colour] != 0x0000)  // any colour but black
791831         {
792832            // Colour 0 is displayable if the text layer is at the priority level 2
r15028r15029
810850static void x68k_draw_gfx_scanline(running_machine &machine, bitmap_ind16 &bitmap, rectangle cliprect, UINT8 priority)
811851{
812852   x68k_state *state = machine.driver_data<x68k_state>();
853   const UINT16* gvram;
813854   int pixel;
814855   int page;
815856   UINT32 loc;  // location in GVRAM
r15028r15029
819860   int shift;
820861   int scanline;
821862
863   if(state->m_is_32bit)
864      gvram = (const UINT16*)state->m_gvram32.target();
865   else
866      gvram = (const UINT16*)state->m_gvram16.target();
867
822868   for(scanline=cliprect.min_y;scanline<=cliprect.max_y;scanline++)  // per scanline
823869   {
824870      if(state->m_crtc.reg[20] & 0x0400)  // 1024x1024 "real" screen size - use 1024x1024 16-colour gfx layer
r15028r15029
835881               switch(lineoffset & 0xc0000)
836882               {
837883               case 0x00000:
838                  colour = state->m_gvram[lineoffset + (loc & 0x3ff)] & 0x000f;
884                  colour = gvram[lineoffset + (loc & 0x3ff)] & 0x000f;
839885                  break;
840886               case 0x40000:
841                  colour = (state->m_gvram[(lineoffset - 0x40000) + (loc & 0x3ff)] & 0x00f0) >> 4;
887                  colour = (gvram[(lineoffset - 0x40000) + (loc & 0x3ff)] & 0x00f0) >> 4;
842888                  break;
843889               case 0x80000:
844                  colour = (state->m_gvram[(lineoffset - 0x80000) + (loc & 0x3ff)] & 0x0f00) >> 8;
890                  colour = (gvram[(lineoffset - 0x80000) + (loc & 0x3ff)] & 0x0f00) >> 8;
845891                  break;
846892               case 0xc0000:
847                  colour = (state->m_gvram[(lineoffset - 0xc0000) + (loc & 0x3ff)] & 0xf000) >> 12;
893                  colour = (gvram[(lineoffset - 0xc0000) + (loc & 0x3ff)] & 0xf000) >> 12;
848894                  break;
849895               }
850896               if(colour != 0)
r15028r15029
870916               shift = 4;
871917               for(pixel=state->m_crtc.hbegin;pixel<=state->m_crtc.hend;pixel++)
872918               {
873                  colour = ((state->m_gvram[lineoffset + loc] >> page*shift) & 0x000f);
919                  colour = ((gvram[lineoffset + loc] >> page*shift) & 0x000f);
874920                  if(colour != 0)
875921                     bitmap.pix16(scanline, pixel) = 512 + (state->m_video.gfx_pal[colour & 0x0f] >> 1);
876922                  loc++;
r15028r15029
887933                  shift = 4;
888934                  for(pixel=state->m_crtc.hbegin;pixel<=state->m_crtc.hend;pixel++)
889935                  {
890                     colour = ((state->m_gvram[lineoffset + loc] >> page*shift) & 0x00ff);
936                     colour = ((gvram[lineoffset + loc] >> page*shift) & 0x00ff);
891937                     if(colour != 0)
892938                        bitmap.pix16(scanline, pixel) = 512 + (state->m_video.gfx_pal[colour & 0xff] >> 1);
893939                     loc++;
r15028r15029
902948               loc = xscr & 0x1ff;
903949               for(pixel=state->m_crtc.hbegin;pixel<=state->m_crtc.hend;pixel++)
904950               {
905                  colour = state->m_gvram[lineoffset + loc];
951                  colour = gvram[lineoffset + loc];
906952                  if(colour != 0)
907953                     bitmap.pix16(scanline, pixel) = 512 + (colour >> 1);
908954                  loc++;
src/mess/drivers/x68k.c
r15028r15029
15441544
15451545   if(state->m_sysport.sram_writeprotect == 0x31)
15461546   {
1547      state->m_nvram[offset] = data;
1547      COMBINE_DATA(state->m_nvram16 + offset);
15481548   }
15491549}
15501550
r15028r15029
15641564   if(offset == 0x70/2)
15651565      return 0x0700;
15661566#endif
1567   return state->m_nvram[offset];
1567   return state->m_nvram16[offset];
15681568}
15691569
15701570static READ32_HANDLER( x68k_sram32_r )
15711571{
1572   x68030_state *state = space->machine().driver_data<x68030_state>();
1572   x68k_state *state = space->machine().driver_data<x68k_state>();
15731573   if(offset == 0x08/4)
15741574      return (space->machine().device<ram_device>(RAM_TAG)->size() & 0xffff0000);  // RAM size
15751575#if 0
r15028r15029
15801580   if(offset == 0x70/2)
15811581      return 0x0700;
15821582#endif
1583   return state->m_nvram[offset];
1583   return state->m_nvram32[offset];
15841584}
15851585
15861586static WRITE32_HANDLER( x68k_sram32_w )
15871587{
1588   x68030_state *state = space->machine().driver_data<x68030_state>();
1588   x68k_state *state = space->machine().driver_data<x68k_state>();
15891589   if(state->m_sysport.sram_writeprotect == 0x31)
15901590   {
1591      COMBINE_DATA(state->m_nvram + offset);
1591      COMBINE_DATA(state->m_nvram32 + offset);
15921592   }
15931593}
15941594
r15028r15029
19651965   AM_RANGE(0xbffffc, 0xbfffff) AM_READWRITE_LEGACY(x68k_rom0_r, x68k_rom0_w)
19661966//  AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE_LEGACY(x68k_gvram_r, x68k_gvram_w) AM_SHARE("gvram")
19671967//  AM_RANGE(0xe00000, 0xe7ffff) AM_READWRITE_LEGACY(x68k_tvram_r, x68k_tvram_w) AM_SHARE("tvram")
1968   AM_RANGE(0xc00000, 0xdfffff) AM_RAMBANK("bank2") AM_SHARE("gvram")
1969   AM_RANGE(0xe00000, 0xe7ffff) AM_RAMBANK("bank3") AM_SHARE("tvram")
1968   AM_RANGE(0xc00000, 0xdfffff) AM_RAMBANK("bank2") AM_SHARE("gvram16")
1969   AM_RANGE(0xe00000, 0xe7ffff) AM_RAMBANK("bank3") AM_SHARE("tvram16")
19701970   AM_RANGE(0xe80000, 0xe81fff) AM_READWRITE_LEGACY(x68k_crtc_r, x68k_crtc_w)
19711971   AM_RANGE(0xe82000, 0xe83fff) AM_READWRITE_LEGACY(x68k_vid_r, x68k_vid_w)
19721972   AM_RANGE(0xe84000, 0xe85fff) AM_READWRITE_LEGACY(x68k_dmac_r, x68k_dmac_w)
r15028r15029
19901990   AM_RANGE(0xeb8000, 0xebffff) AM_READWRITE_LEGACY(x68k_spriteram_r, x68k_spriteram_w)
19911991   AM_RANGE(0xece000, 0xece3ff) AM_READWRITE_LEGACY(x68k_exp_r, x68k_exp_w)  // User I/O
19921992//  AM_RANGE(0xed0000, 0xed3fff) AM_READWRITE_LEGACY(sram_r, sram_w) AM_BASE_LEGACY(&generic_nvram16) AM_SIZE_LEGACY(&generic_nvram_size)
1993   AM_RANGE(0xed0000, 0xed3fff) AM_RAMBANK("bank4") AM_SHARE("nvram")
1993   AM_RANGE(0xed0000, 0xed3fff) AM_RAMBANK("bank4") AM_SHARE("nvram16")
19941994   AM_RANGE(0xed4000, 0xefffff) AM_NOP
19951995   AM_RANGE(0xf00000, 0xfbffff) AM_ROM
19961996   AM_RANGE(0xfc0000, 0xfdffff) AM_READWRITE_LEGACY(x68k_exp_r, x68k_exp_w)  // internal SCSI ROM
r15028r15029
20022002   AM_RANGE(0xbffffc, 0xbfffff) AM_READWRITE_LEGACY(x68k_rom0_r, x68k_rom0_w)
20032003//  AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE_LEGACY(x68k_gvram_r, x68k_gvram_w) AM_SHARE("gvram")
20042004//  AM_RANGE(0xe00000, 0xe7ffff) AM_READWRITE_LEGACY(x68k_tvram_r, x68k_tvram_w) AM_SHARE("tvram")
2005   AM_RANGE(0xc00000, 0xdfffff) AM_RAMBANK("bank2") AM_SHARE("gvram")
2006   AM_RANGE(0xe00000, 0xe7ffff) AM_RAMBANK("bank3") AM_SHARE("tvram")
2005   AM_RANGE(0xc00000, 0xdfffff) AM_RAMBANK("bank2") AM_SHARE("gvram16")
2006   AM_RANGE(0xe00000, 0xe7ffff) AM_RAMBANK("bank3") AM_SHARE("tvram16")
20072007   AM_RANGE(0xe80000, 0xe81fff) AM_READWRITE_LEGACY(x68k_crtc_r, x68k_crtc_w)
20082008   AM_RANGE(0xe82000, 0xe83fff) AM_READWRITE_LEGACY(x68k_vid_r, x68k_vid_w)
20092009   AM_RANGE(0xe84000, 0xe85fff) AM_READWRITE_LEGACY(x68k_dmac_r, x68k_dmac_w)
r15028r15029
20282028   AM_RANGE(0xeb8000, 0xebffff) AM_READWRITE_LEGACY(x68k_spriteram_r, x68k_spriteram_w)
20292029   AM_RANGE(0xece000, 0xece3ff) AM_READWRITE_LEGACY(x68k_exp_r, x68k_exp_w)  // User I/O
20302030//  AM_RANGE(0xed0000, 0xed3fff) AM_READWRITE_LEGACY(sram_r, sram_w) AM_BASE_LEGACY(&generic_nvram16) AM_SIZE_LEGACY(&generic_nvram_size)
2031   AM_RANGE(0xed0000, 0xed3fff) AM_RAMBANK("bank4") AM_SHARE("nvram")
2031   AM_RANGE(0xed0000, 0xed3fff) AM_RAMBANK("bank4") AM_SHARE("nvram16")
20322032   AM_RANGE(0xed4000, 0xefffff) AM_NOP
20332033   AM_RANGE(0xf00000, 0xfbffff) AM_ROM
20342034   AM_RANGE(0xfc0000, 0xfdffff) AM_ROM  // internal SCSI ROM
r15028r15029
20412041   AM_RANGE(0xbffffc, 0xbfffff) AM_READWRITE16_LEGACY(x68k_rom0_r, x68k_rom0_w,0xffffffff)
20422042//  AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE_LEGACY(x68k_gvram_r, x68k_gvram_w) AM_SHARE("gvram")
20432043//  AM_RANGE(0xe00000, 0xe7ffff) AM_READWRITE_LEGACY(x68k_tvram_r, x68k_tvram_w) AM_SHARE("tvram")
2044   AM_RANGE(0xc00000, 0xdfffff) AM_RAMBANK("bank2") AM_SHARE("gvram")
2045   AM_RANGE(0xe00000, 0xe7ffff) AM_RAMBANK("bank3") AM_SHARE("tvram")
2044   AM_RANGE(0xc00000, 0xdfffff) AM_RAMBANK("bank2") AM_SHARE("gvram32")
2045   AM_RANGE(0xe00000, 0xe7ffff) AM_RAMBANK("bank3") AM_SHARE("tvram32")
20462046   AM_RANGE(0xe80000, 0xe81fff) AM_READWRITE16_LEGACY(x68k_crtc_r, x68k_crtc_w,0xffffffff)
20472047   AM_RANGE(0xe82000, 0xe83fff) AM_READWRITE16_LEGACY(x68k_vid_r, x68k_vid_w,0xffffffff)
20482048   AM_RANGE(0xe84000, 0xe85fff) AM_READWRITE16_LEGACY(x68k_dmac_r, x68k_dmac_w,0xffffffff)
r15028r15029
20662066   AM_RANGE(0xeb8000, 0xebffff) AM_READWRITE16_LEGACY(x68k_spriteram_r, x68k_spriteram_w,0xffffffff)
20672067   AM_RANGE(0xece000, 0xece3ff) AM_READWRITE16_LEGACY(x68k_exp_r, x68k_exp_w,0xffffffff)  // User I/O
20682068//  AM_RANGE(0xed0000, 0xed3fff) AM_READWRITE_LEGACY(sram_r, sram_w) AM_BASE_LEGACY(&generic_nvram16) AM_SIZE_LEGACY(&generic_nvram_size)
2069   AM_RANGE(0xed0000, 0xed3fff) AM_RAMBANK("bank4") AM_SHARE("nvram")
2069   AM_RANGE(0xed0000, 0xed3fff) AM_RAMBANK("bank4") AM_SHARE("nvram32")
20702070   AM_RANGE(0xed4000, 0xefffff) AM_NOP
20712071   AM_RANGE(0xf00000, 0xfbffff) AM_ROM
20722072   AM_RANGE(0xfc0000, 0xfdffff) AM_ROM  // internal SCSI ROM
r15028r15029
26472647   state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer());
26482648   space->install_legacy_read_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram_r));
26492649   space->install_legacy_write_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram_w));
2650   state->membank("bank2")->set_base(state->m_gvram);  // so that code in VRAM is executable - needed for Terra Cresta
2650   state->membank("bank2")->set_base(state->m_gvram16);  // so that code in VRAM is executable - needed for Terra Cresta
26512651   space->install_legacy_read_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram_r));
26522652   space->install_legacy_write_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram_w));
2653   state->membank("bank3")->set_base(state->m_tvram);  // so that code in VRAM is executable - needed for Terra Cresta
2653   state->membank("bank3")->set_base(state->m_tvram16);  // so that code in VRAM is executable - needed for Terra Cresta
26542654   space->install_legacy_read_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram_r));
26552655   space->install_legacy_write_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram_w));
2656   state->membank("bank4")->set_base(state->m_nvram);  // so that code in SRAM is executable, there is an option for booting from SRAM
2656   state->membank("bank4")->set_base(state->m_nvram16);  // so that code in SRAM is executable, there is an option for booting from SRAM
26572657
26582658   // start keyboard timer
26592659   state->m_kb_timer->adjust(attotime::zero, 0, attotime::from_msec(5));  // every 5ms
r15028r15029
26692669static MACHINE_START( x68030 )
26702670{
26712671   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
2672   x68030_state *state = machine.driver_data<x68030_state>();
2672   x68k_state *state = machine.driver_data<x68k_state>();
26732673   /*  Install RAM handlers  */
26742674   state->m_spriteram = (UINT16*)(*state->memregion("user1"));
26752675   space->install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_rom0_r),0xffffffff);
r15028r15029
26782678   state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer());
26792679   space->install_legacy_read_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram32_r));
26802680   space->install_legacy_write_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram32_w));
2681   state->membank("bank2")->set_base(state->m_gvram);  // so that code in VRAM is executable - needed for Terra Cresta
2681   state->membank("bank2")->set_base(state->m_gvram32);  // so that code in VRAM is executable - needed for Terra Cresta
26822682   space->install_legacy_read_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram32_r));
26832683   space->install_legacy_write_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram32_w));
2684   state->membank("bank3")->set_base(state->m_tvram);  // so that code in VRAM is executable - needed for Terra Cresta
2684   state->membank("bank3")->set_base(state->m_tvram32);  // so that code in VRAM is executable - needed for Terra Cresta
26852685   space->install_legacy_read_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram32_r));
26862686   space->install_legacy_write_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram32_w));
2687   state->membank("bank4")->set_base(state->m_nvram);  // so that code in SRAM is executable, there is an option for booting from SRAM
2687   state->membank("bank4")->set_base(state->m_nvram32);  // so that code in SRAM is executable, there is an option for booting from SRAM
26882688
26892689   // start keyboard timer
26902690   state->m_kb_timer->adjust(attotime::zero, 0, attotime::from_msec(5));  // every 5ms
r15028r15029
27382738   md_6button_init(machine);
27392739
27402740   state->m_sysport.cputype = 0xff;  // 68000, 10MHz
2741   state->m_is_32bit = false;
27412742}
27422743
27432744static DRIVER_INIT( x68kxvi )
r15028r15029
27452746   x68k_state *state = machine.driver_data<x68k_state>();
27462747   DRIVER_INIT_CALL( x68000 );
27472748   state->m_sysport.cputype = 0xfe; // 68000, 16MHz
2749   state->m_is_32bit = false;
27482750}
27492751
27502752static DRIVER_INIT( x68030 )
r15028r15029
27522754   x68k_state *state = machine.driver_data<x68k_state>();
27532755   DRIVER_INIT_CALL( x68000 );
27542756   state->m_sysport.cputype = 0xdc; // 68030, 25MHz
2757   state->m_is_32bit = true;
27552758}
27562759
27572760static MACHINE_CONFIG_FRAGMENT( x68000_base )
r15028r15029
28172820static MACHINE_CONFIG_START( x68000, x68k_state )
28182821   MCFG_FRAGMENT_ADD(x68000_base)
28192822
2820   MCFG_NVRAM_ADD_0FILL("nvram")
2823   MCFG_NVRAM_ADD_0FILL("nvram16")
28212824
28222825   MCFG_X68KHDC_ADD( "x68k_hdc" )
28232826
r15028r15029
28392842   MCFG_HARDDISK_ADD("harddisk6")
28402843MACHINE_CONFIG_END
28412844
2842static MACHINE_CONFIG_START( x68030, x68030_state )
2845static MACHINE_CONFIG_START( x68030, x68k_state )
28432846   MCFG_FRAGMENT_ADD(x68000_base)
28442847
28452848   MCFG_CPU_REPLACE("maincpu", M68030, 25000000)  /* 25 MHz 68EC030 */
r15028r15029
28482851   MCFG_MACHINE_START( x68030 )
28492852   MCFG_MACHINE_RESET( x68000 )
28502853
2851   MCFG_NVRAM_ADD_0FILL("nvram")
2854   MCFG_NVRAM_ADD_0FILL("nvram32")
28522855
28532856   MCFG_MB89352A_ADD("mb89352_int",x68k_scsi_intf)
28542857   MCFG_HARDDISK_ADD("harddisk0")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team