Previous 199869 Revisions Next

r30762 Sunday 1st June, 2014 at 19:19:37 UTC by Carl
x68k: compose the gfx and sprite/bg layers individually before drawing to the screen [Carl]
[src/mess/drivers]x68k.c
[src/mess/includes]x68k.h
[src/mess/video]x68k.c

trunk/src/mess/includes/x68k.h
r30761r30762
6060         m_scc(*this, "scc"),
6161         m_ym2151(*this, "ym2151"),
6262         m_ppi(*this, "ppi8255"),
63         m_screen(*this, "screen"),
6364         m_options(*this, "options"),
6465         m_mouse1(*this, "mouse1"),
6566         m_mouse2(*this, "mouse2"),
r30761r30762
8990   required_device<scc8530_t> m_scc;
9091   required_device<ym2151_device> m_ym2151;
9192   required_device<i8255_device> m_ppi;
93   required_device<screen_device> m_screen;
9294
9395   required_ioport m_options;
9496   required_ioport m_mouse1;
r30761r30762
107109   dynamic_array<UINT16> m_gvram;
108110   dynamic_array<UINT16> m_spritereg;
109111
112   bitmap_ind16 *m_pcgbitmap;
113   bitmap_ind16 *m_gfxbitmap;
114
110115   void floppy_load_unload();
111116   int floppy_load(floppy_image_device *dev);
112117   void floppy_unload(floppy_image_device *dev);
r30761r30762
178183   } m_crtc;  // CRTC
179184   struct
180185   {   // video controller at 0xe82000
181      unsigned short text_pal[0x100];
182      unsigned short gfx_pal[0x100];
183186      unsigned short reg[3];
184187      int text_pri;
185188      int sprite_pri;
r30761r30762
336339   void x68k_crtc_text_copy(int src, int dest);
337340   void x68k_crtc_refresh_mode();
338341   void x68k_draw_text(bitmap_rgb32 &bitmap, int xscr, int yscr, rectangle rect);
339   void x68k_draw_gfx_scanline(bitmap_rgb32 &bitmap, rectangle cliprect, UINT8 priority);
342   void x68k_draw_gfx_scanline(bitmap_ind16 &bitmap, rectangle cliprect, UINT8 priority);
340343   void x68k_draw_gfx(bitmap_rgb32 &bitmap,rectangle cliprect);
341   void x68k_draw_sprites(bitmap_rgb32 &bitmap, int priority, rectangle cliprect);
344   void x68k_draw_sprites(bitmap_ind16 &bitmap, int priority, rectangle cliprect);
342345
343346public:
344347   bitmap_rgb32* x68k_get_gfx_page(int pri,int type);
trunk/src/mess/video/x68k.c
r30761r30762
125125   m_crtc.hend = (m_crtc.reg[3] * 8);
126126   m_crtc.vbegin = (m_crtc.reg[6]) / m_crtc.vmultiple;
127127   m_crtc.vend = (m_crtc.reg[7] - 1) / m_crtc.vmultiple;
128   if((m_crtc.vmultiple == 2) && !(m_crtc.reg[7] & 1)) // otherwise if the raster irq line == vblank line, the raster irq fires too late
129      m_crtc.vend++;
128130   m_crtc.hsync_end = (m_crtc.reg[1]) * 8;
129131   m_crtc.vsync_end = (m_crtc.reg[5]) / m_crtc.vmultiple;
130132   m_crtc.hsyncadjust = m_crtc.reg[8];
r30761r30762
161163//  logerror("CRTC regs - %i %i %i %i  - %i %i %i %i - %i - %i\n",m_crtc.reg[0],m_crtc.reg[1],m_crtc.reg[2],m_crtc.reg[3],
162164//      m_crtc.reg[4],m_crtc.reg[5],m_crtc.reg[6],m_crtc.reg[7],m_crtc.reg[8],m_crtc.reg[9]);
163165   logerror("video_screen_configure(machine.first_screen(),%i,%i,[%i,%i,%i,%i],55.45)\n",scr.max_x,scr.max_y,visiblescr.min_x,visiblescr.min_y,visiblescr.max_x,visiblescr.max_y);
164   machine().first_screen()->configure(scr.max_x,scr.max_y,visiblescr,HZ_TO_ATTOSECONDS(55.45));
166   m_screen->configure(scr.max_x,scr.max_y,visiblescr,HZ_TO_ATTOSECONDS(55.45));
165167}
166168
167169TIMER_CALLBACK_MEMBER(x68k_state::x68k_hsync)
r30761r30762
177179      {
178180         if(m_oddscanline == 1)
179181         {
180            int scan = machine().first_screen()->vpos();
182            int scan = m_screen->vpos();
181183            if(scan > m_crtc.vend)
182184               scan = m_crtc.vbegin;
183            hsync_time = machine().first_screen()->time_until_pos(scan,(m_crtc.htotal + m_crtc.hend) / 2);
185            hsync_time = m_screen->time_until_pos(scan,(m_crtc.htotal + m_crtc.hend) / 2);
184186            m_scanline_timer->adjust(hsync_time);
185187            if(scan != 0)
186188            {
187189               if((ioport("options")->read() & 0x04))
188190               {
189                  machine().first_screen()->update_partial(scan);
191                  m_screen->update_partial(scan);
190192               }
191193            }
192194         }
193195         else
194196         {
195            int scan = machine().first_screen()->vpos();
197            int scan = m_screen->vpos();
196198            if(scan > m_crtc.vend)
197199               scan = m_crtc.vbegin;
198            hsync_time = machine().first_screen()->time_until_pos(scan,m_crtc.hend / 2);
200            hsync_time = m_screen->time_until_pos(scan,m_crtc.hend / 2);
199201            m_scanline_timer->adjust(hsync_time);
200202            if(scan != 0)
201203            {
202204               if((ioport("options")->read() & 0x04))
203205               {
204                  machine().first_screen()->update_partial(scan);
206                  m_screen->update_partial(scan);
205207               }
206208            }
207209         }
r30761r30762
210212      {
211213         if(m_oddscanline == 1)
212214         {
213            int scan = machine().first_screen()->vpos();
215            int scan = m_screen->vpos();
214216            if(scan > m_crtc.vend)
215217               scan = m_crtc.vbegin;
216218            else
217219               scan++;
218            hsync_time = machine().first_screen()->time_until_pos(scan,m_crtc.hbegin / 2);
220            hsync_time = m_screen->time_until_pos(scan,m_crtc.hbegin / 2);
219221            m_scanline_timer->adjust(hsync_time, 1);
220222            m_oddscanline = 0;
221223         }
222224         else
223225         {
224            hsync_time = machine().first_screen()->time_until_pos(machine().first_screen()->vpos(),(m_crtc.htotal + m_crtc.hbegin) / 2);
226            hsync_time = m_screen->time_until_pos(m_screen->vpos(),(m_crtc.htotal + m_crtc.hbegin) / 2);
225227            m_scanline_timer->adjust(hsync_time, 1);
226228            m_oddscanline = 1;
227229         }
r30761r30762
231233   {
232234      if(hstate == 1)
233235      {
234         int scan = machine().first_screen()->vpos();
236         int scan = m_screen->vpos();
235237         if(scan > m_crtc.vend)
236238            scan = 0;
237         hsync_time = machine().first_screen()->time_until_pos(scan,m_crtc.hend);
239         hsync_time = m_screen->time_until_pos(scan,m_crtc.hend);
238240         m_scanline_timer->adjust(hsync_time);
239241         if(scan != 0)
240242         {
241243            if((ioport("options")->read() & 0x04))
242244            {
243               machine().first_screen()->update_partial(scan);
245               m_screen->update_partial(scan);
244246            }
245247         }
246248      }
247249      if(hstate == 0)
248250      {
249         hsync_time = machine().first_screen()->time_until_pos(machine().first_screen()->vpos()+1,m_crtc.hbegin);
251         hsync_time = m_screen->time_until_pos(m_screen->vpos()+1,m_crtc.hbegin);
250252         m_scanline_timer->adjust(hsync_time, 1);
251253      }
252254   }
r30761r30762
266268   if(scan <= m_crtc.vtotal)
267269   {
268270      m_mfpdev->i6_w(0);
269      machine().first_screen()->update_partial(scan);
270      irq_time = machine().first_screen()->time_until_pos(scan,m_crtc.hbegin);
271      m_screen->update_partial(scan);
272      irq_time = m_screen->time_until_pos(scan,m_crtc.hbegin);
271273      // end of HBlank period clears GPIP6 also?
272      end_time = machine().first_screen()->time_until_pos(scan,m_crtc.hend);
274      end_time = m_screen->time_until_pos(scan,m_crtc.hend);
273275      m_raster_irq->adjust(irq_time, scan);
274276      timer_set(end_time, TIMER_X68K_CRTC_RASTER_END);
275      logerror("GPIP6: Raster triggered at line %i (%i)\n",scan,machine().first_screen()->vpos());
277      logerror("GPIP6: Raster triggered at line %i (%i)\n",scan,m_screen->vpos());
276278   }
277279}
278280
r30761r30762
286288   {
287289      m_crtc.vblank = 1;
288290      vblank_line = m_crtc.vbegin;
289      irq_time = machine().first_screen()->time_until_pos(vblank_line,2);
291      irq_time = m_screen->time_until_pos(vblank_line,2);
290292      m_vblank_irq->adjust(irq_time);
291293      logerror("CRTC: VBlank on\n");
292294   }
r30761r30762
296298      vblank_line = m_crtc.vend;
297299      if(vblank_line > m_crtc.vtotal)
298300         vblank_line = m_crtc.vtotal;
299      irq_time = machine().first_screen()->time_until_pos(vblank_line,2);
301      irq_time = m_screen->time_until_pos(vblank_line,2);
300302      m_vblank_irq->adjust(irq_time, 1);
301303      logerror("CRTC: VBlank off\n");
302304   }
r30761r30762
373375   case 9:  // CRTC raster IRQ (GPIP6)
374376      {
375377         attotime irq_time;
376         irq_time = machine().first_screen()->time_until_pos((data) / m_crtc.vmultiple,2);
378         data = m_crtc.reg[9];
379         irq_time = m_screen->time_until_pos((data) / m_crtc.vmultiple,2);
377380
378381         if(irq_time.as_double() > 0)
379382            m_raster_irq->adjust(irq_time, (data) / m_crtc.vmultiple);
r30761r30762
716719            + (((m_tvram[loc+0x10000] >> bit) & 0x01) ? 2 : 0)
717720            + (((m_tvram[loc+0x20000] >> bit) & 0x01) ? 4 : 0)
718721            + (((m_tvram[loc+0x30000] >> bit) & 0x01) ? 8 : 0);
719         if(m_video.text_pal[colour] != 0x0000)  // any colour but black
720         {
721            // Colour 0 is displayable if the text layer is at the priority level 2
722            if(colour == 0 && (m_video.reg[1] & 0x0c00) == 0x0800)
723               bitmap.pix32(line, pixel) = m_pcgpalette->pen(colour);
724            else
725               if(colour != 0)
726                  bitmap.pix32(line, pixel) = m_pcgpalette->pen(colour);
727         }
722         // Colour 0 is displayable if the text layer is at the priority level 2
723         if((colour && (m_pcgpalette->pen(colour) & 0xffffff)) || (m_video.text_pri == 2))
724            bitmap.pix32(line, pixel) = m_pcgpalette->pen(colour);
728725         bit--;
729726         if(bit < 0)
730727         {
r30761r30762
736733   }
737734}
738735
739void x68k_state::x68k_draw_gfx_scanline( bitmap_rgb32 &bitmap, rectangle cliprect, UINT8 priority)
736void x68k_state::x68k_draw_gfx_scanline( bitmap_ind16 &bitmap, rectangle cliprect, UINT8 priority)
740737{
741738   int pixel;
742739   int page;
r30761r30762
775772                  colour = (m_gvram[(lineoffset - 0xc0000) + (loc & 0x3ff)] & 0xf000) >> 12;
776773                  break;
777774               }
778               if(colour != 0)
779               {
780                  bitmap.pix32(scanline, pixel) = m_gfxpalette->pen(colour);
781               }
775               if(colour || (priority == 3))
776                  bitmap.pix16(scanline, pixel) = colour;
782777               loc++;
783778               loc &= 0x3ff;
784779            }
r30761r30762
801796               for(pixel=m_crtc.hbegin;pixel<=m_crtc.hend;pixel++)
802797               {
803798                  colour = ((m_gvram[lineoffset + loc] >> page*shift) & 0x000f);
804                  if(colour != 0)
805                  {
806                     bitmap.pix32(scanline, pixel) = m_gfxpalette->pen(colour);
807                  }
799                  if(colour || (priority == 3))
800                     bitmap.pix16(scanline, pixel) = colour;
808801                  loc++;
809802                  loc &= 0x1ff;
810803               }
r30761r30762
820813                  for(pixel=m_crtc.hbegin;pixel<=m_crtc.hend;pixel++)
821814                  {
822815                     colour = ((m_gvram[lineoffset + loc] >> page*shift) & 0x00ff);
823                     if(colour != 0)
824                     {
825                        bitmap.pix32(scanline, pixel) = m_gfxpalette->pen(colour);
826                     }
816                     if(colour || (priority == 3))
817                        bitmap.pix16(scanline, pixel) = colour;
827818                     loc++;
828819                     loc &= 0x1ff;
829820                  }
r30761r30762
837828               for(pixel=m_crtc.hbegin;pixel<=m_crtc.hend;pixel++)
838829               {
839830                  colour = m_gvram[lineoffset + loc];
840                  if(colour != 0)
841                  {
842                     bitmap.pix32(scanline, pixel) = pal555(colour, 6, 11, 1);
843                  }
831                  if(colour || (priority == 3))
832                     bitmap.pix16(scanline, pixel) = colour;
844833                  loc++;
845834                  loc &= 0x1ff;
846835               }
r30761r30762
853842
854843void x68k_state::x68k_draw_gfx(bitmap_rgb32 &bitmap,rectangle cliprect)
855844{
856   int priority;
845   int priority, scanline, pixel;
857846   //rectangle rect;
858847   //int xscr,yscr;
859848   //int gpage;
r30761r30762
861850   if(m_crtc.reg[20] & 0x0800)  // if graphic layers are set to buffer, then they aren't visible
862851      return;
863852
853   m_gfxbitmap->fill(0, cliprect);
854
864855   for(priority=3;priority>=0;priority--)
865856   {
866      x68k_draw_gfx_scanline(bitmap,cliprect,priority);
857      x68k_draw_gfx_scanline(*m_gfxbitmap,cliprect,priority);
867858   }
859
860   for(scanline=cliprect.min_y;scanline<=cliprect.max_y;scanline++)
861   {
862      UINT16 colour;
863      for(pixel=m_crtc.hbegin;pixel<=m_crtc.hend;pixel++)
864      {
865         if((m_video.reg[0] & 0x03) == 3)
866         {
867            colour = m_gfxbitmap->pix16(scanline, pixel);
868            if(colour || (m_video.gfx_pri == 2))
869               bitmap.pix32(scanline, pixel) = pal555(colour, 6, 11, 1);
870         }
871         else
872         {
873            colour = m_gfxbitmap->pix16(scanline, pixel) & 0xff;
874            if((colour && (m_gfxpalette->pen(colour) & 0xffffff)) || (m_video.gfx_pri == 2))
875               bitmap.pix32(scanline, pixel) = m_gfxpalette->pen(colour);
876         }
877      }
878   }
868879}
869880
870881// Sprite controller "Cynthia" at 0xeb0000
871void x68k_state::x68k_draw_sprites(bitmap_rgb32 &bitmap, int priority, rectangle cliprect)
882void x68k_state::x68k_draw_sprites(bitmap_ind16 &bitmap, int priority, rectangle cliprect)
872883{
873884   /*
874885      0xeb0000 - 0xeb07ff - Sprite registers (up to 128)
r30761r30762
10121023   m_bg0_16->set_transparent_pen(0);
10131024   m_bg1_16->set_transparent_pen(0);
10141025
1026   m_pcgbitmap = auto_bitmap_ind16_alloc(machine(), 1024, 1024);
1027   m_pcgbitmap->fill(0);
1028
1029   m_gfxbitmap = auto_bitmap_ind16_alloc(machine(), 1024, 1024);
1030   m_gfxbitmap->fill(0);
1031
10151032//  m_scanline_timer->adjust(attotime::zero, 0, attotime::from_hz(55.45)/568);
10161033}
10171034
r30761r30762
10231040   int x;
10241041   tilemap_t* x68k_bg0;
10251042   tilemap_t* x68k_bg1;
1043   int pixel, scanline;
10261044   //UINT8 *rom;
10271045
10281046   if((m_spritereg[0x408] & 0x03) == 0x00)  // Sprite/BG H-Res 0=8x8, 1=16x16, 2 or 3 = undefined.
r30761r30762
10701088      }
10711089   }
10721090
1073   for(priority=3;priority>=0;priority--)
1091
1092   for(priority=2;priority>=0;priority--)
10741093   {
10751094      // Graphics screen(s)
10761095      if(priority == m_video.gfx_pri)
r30761r30762
10791098      // Sprite / BG Tiles
10801099      if(priority == m_video.sprite_pri /*&& (m_spritereg[0x404] & 0x0200)*/ && (m_video.reg[2] & 0x0040))
10811100      {
1082         x68k_draw_sprites(bitmap,1,rect);
1101         m_pcgbitmap->fill(0, rect);
1102         x68k_draw_sprites(*m_pcgbitmap,1,rect);
10831103         if((m_spritereg[0x404] & 0x0008))
10841104         {
10851105            if((m_spritereg[0x404] & 0x0030) == 0x10)  // BG1 TXSEL
10861106            {
10871107               x68k_bg0->set_scrollx(0,(m_spritereg[0x402] - m_crtc.hbegin - m_crtc.bg_hshift) & 0x3ff);
10881108               x68k_bg0->set_scrolly(0,(m_spritereg[0x403] - m_crtc.vbegin) & 0x3ff);
1089               x68k_bg0->draw(screen, bitmap,rect,0,0);
1109               x68k_bg0->draw(screen, *m_pcgbitmap,rect,0,0);
10901110            }
10911111            else
10921112            {
10931113               x68k_bg1->set_scrollx(0,(m_spritereg[0x402] - m_crtc.hbegin - m_crtc.bg_hshift) & 0x3ff);
10941114               x68k_bg1->set_scrolly(0,(m_spritereg[0x403] - m_crtc.vbegin) & 0x3ff);
1095               x68k_bg1->draw(screen, bitmap,rect,0,0);
1115               x68k_bg1->draw(screen, *m_pcgbitmap,rect,0,0);
10961116            }
10971117         }
1098         x68k_draw_sprites(bitmap,2,rect);
1118         x68k_draw_sprites(*m_pcgbitmap,2,rect);
10991119         if((m_spritereg[0x404] & 0x0001))
11001120         {
11011121            if((m_spritereg[0x404] & 0x0006) == 0x02)  // BG0 TXSEL
11021122            {
11031123               x68k_bg0->set_scrollx(0,(m_spritereg[0x400] - m_crtc.hbegin - m_crtc.bg_hshift) & 0x3ff);
11041124               x68k_bg0->set_scrolly(0,(m_spritereg[0x401] - m_crtc.vbegin) & 0x3ff);
1105               x68k_bg0->draw(screen, bitmap,rect,0,0);
1125               x68k_bg0->draw(screen, *m_pcgbitmap,rect,0,0);
11061126            }
11071127            else
11081128            {
11091129               x68k_bg1->set_scrollx(0,(m_spritereg[0x400] - m_crtc.hbegin - m_crtc.bg_hshift) & 0x3ff);
11101130               x68k_bg1->set_scrolly(0,(m_spritereg[0x401] - m_crtc.vbegin) & 0x3ff);
1111               x68k_bg1->draw(screen, bitmap,rect,0,0);
1131               x68k_bg1->draw(screen, *m_pcgbitmap,rect,0,0);
11121132            }
11131133         }
1114         x68k_draw_sprites(bitmap,3,rect);
1134         x68k_draw_sprites(*m_pcgbitmap,3,rect);
1135
1136         for(scanline=rect.min_y;scanline<=rect.max_y;scanline++)
1137         {
1138            for(pixel=m_crtc.hbegin;pixel<=m_crtc.hend;pixel++)
1139            {
1140               UINT8 colour = m_pcgbitmap->pix16(scanline, pixel) & 0xff;
1141               if((colour && (m_pcgpalette->pen(colour) & 0xffffff)) || (priority == 2))
1142                  bitmap.pix32(scanline, pixel) = m_pcgpalette->pen(colour);
1143            }
1144         }
11151145      }
11161146
11171147      // Text screen
trunk/src/mess/drivers/x68k.c
r30761r30762
101101      Keyboard doesn't work properly (MFP USART).
102102      Supervisor area set isn't implemented.
103103
104    Some minor game-specific issues (at 28/12/08):
105      Pacmania:      Black squares on the maze (transparency?).
104    Some minor game-specific issues:
106105      Salamander:    System error when using keys in-game.  No error if a joystick is used.
107106                     Some text is drawn incorrectly.
108107      Dragon Buster: Text is black and unreadable. (Text layer actually covers it)
109108      Tetris:        Black dots over screen (text layer).
110109      Parodius Da!:  Black squares in areas.
110      PacLand:       Leftover garbage on title screen
111      Akumajo Drac:  Missing transparency, no sfx starting on second stage (m68000 only, 030 is fine), text layer not being cleared properly
111112
112113
113114    More detailed documentation at http://x68kdev.emuvibes.com/iomap.html - if you can stand broken english :)
r30761r30762
916917
917918WRITE16_MEMBER(x68k_state::x68k_vid_w)
918919{
919   int val;
920   if(offset < 0x100)  // Graphic layer palette
921   {
922      COMBINE_DATA(m_video.gfx_pal+offset);
923      val = m_video.gfx_pal[offset];
924      m_gfxpalette->set_pen_color(offset, pal555(val, 6, 11, 1));
925      return;
926   }
927
928   if(offset >= 0x100 && offset < 0x200)  // Text / Sprites / Tilemap palette
929   {
930      offset -= 0x100;
931      COMBINE_DATA(m_video.text_pal + offset);
932      val = m_video.text_pal[offset];
933      m_pcgpalette->set_pen_color(offset, pal555(val, 6, 11, 1));
934      return;
935   }
936
937920   switch(offset)
938921   {
939   case 0x200:
922   case 0x000:
940923      COMBINE_DATA(m_video.reg);
941924      break;
942   case 0x280:  // priority levels
925   case 0x080:  // priority levels
943926      COMBINE_DATA(m_video.reg+1);
944927      if(ACCESSING_BITS_0_7)
945928      {
r30761r30762
961944            m_video.sprite_pri--;
962945      }
963946      break;
964   case 0x300:
947   case 0x100:
965948      COMBINE_DATA(m_video.reg+2);
966949      break;
967950   default:
r30761r30762
971954
972955READ16_MEMBER(x68k_state::x68k_vid_r)
973956{
974   if(offset < 0x100)
975      return m_video.gfx_pal[offset];
976
977   if(offset >= 0x100 && offset < 0x200)
978      return m_video.text_pal[offset-0x100];
979
980957   switch(offset)
981958   {
982   case 0x200:
959   case 0x000:
983960      return m_video.reg[0];
984   case 0x280:
961   case 0x080:
985962      return m_video.reg[1];
986   case 0x300:
963   case 0x100:
987964      return m_video.reg[2];
988965   default:
989966      logerror("VC: Invalid video controller read (offset = 0x%04x)\n",offset);
r30761r30762
11961173   AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE(x68k_gvram_r, x68k_gvram_w)
11971174   AM_RANGE(0xe00000, 0xe7ffff) AM_READWRITE(x68k_tvram_r, x68k_tvram_w)
11981175   AM_RANGE(0xe80000, 0xe81fff) AM_READWRITE(x68k_crtc_r, x68k_crtc_w)
1199   AM_RANGE(0xe82000, 0xe83fff) AM_READWRITE(x68k_vid_r, x68k_vid_w)
1176   AM_RANGE(0xe82000, 0xe821ff) AM_DEVREADWRITE("gfxpalette", palette_device, read, write) AM_SHARE("gfxpalette")
1177   AM_RANGE(0xe82200, 0xe823ff) AM_DEVREADWRITE("pcgpalette", palette_device, read, write) AM_SHARE("pcgpalette")
1178   AM_RANGE(0xe82400, 0xe83fff) AM_READWRITE(x68k_vid_r, x68k_vid_w)
12001179   AM_RANGE(0xe84000, 0xe85fff) AM_DEVREADWRITE("hd63450", hd63450_device, read, write)
12011180   AM_RANGE(0xe86000, 0xe87fff) AM_READWRITE(x68k_areaset_r, x68k_areaset_w)
12021181   AM_RANGE(0xe88000, 0xe89fff) AM_DEVREADWRITE8(MC68901_TAG, mc68901_device, read, write, 0x00ff)
r30761r30762
12311210   AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE(x68k_gvram_r, x68k_gvram_w)
12321211   AM_RANGE(0xe00000, 0xe7ffff) AM_READWRITE(x68k_tvram_r, x68k_tvram_w)
12331212   AM_RANGE(0xe80000, 0xe81fff) AM_READWRITE(x68k_crtc_r, x68k_crtc_w)
1234   AM_RANGE(0xe82000, 0xe83fff) AM_READWRITE(x68k_vid_r, x68k_vid_w)
1213   AM_RANGE(0xe82000, 0xe821ff) AM_DEVREADWRITE("gfxpalette", palette_device, read, write) AM_SHARE("gfxpalette")
1214   AM_RANGE(0xe82200, 0xe823ff) AM_DEVREADWRITE("pcgpalette", palette_device, read, write) AM_SHARE("pcgpalette")
1215   AM_RANGE(0xe82400, 0xe83fff) AM_READWRITE(x68k_vid_r, x68k_vid_w)
12351216   AM_RANGE(0xe84000, 0xe85fff) AM_DEVREADWRITE("hd63450", hd63450_device, read, write)
12361217   AM_RANGE(0xe86000, 0xe87fff) AM_READWRITE(x68k_areaset_r, x68k_areaset_w)
12371218   AM_RANGE(0xe88000, 0xe89fff) AM_DEVREADWRITE8(MC68901_TAG, mc68901_device, read, write, 0x00ff)
r30761r30762
12681249   AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE16(x68k_gvram_r, x68k_gvram_w, 0xffffffff)
12691250   AM_RANGE(0xe00000, 0xe7ffff) AM_READWRITE16(x68k_tvram_r, x68k_tvram_w, 0xffffffff)
12701251   AM_RANGE(0xe80000, 0xe81fff) AM_READWRITE16(x68k_crtc_r, x68k_crtc_w,0xffffffff)
1271   AM_RANGE(0xe82000, 0xe83fff) AM_READWRITE16(x68k_vid_r, x68k_vid_w,0xffffffff)
1252   AM_RANGE(0xe82000, 0xe821ff) AM_DEVREADWRITE("gfxpalette", palette_device, read, write) AM_SHARE("gfxpalette")
1253   AM_RANGE(0xe82200, 0xe823ff) AM_DEVREADWRITE("pcgpalette", palette_device, read, write) AM_SHARE("pcgpalette")
1254   AM_RANGE(0xe82400, 0xe83fff) AM_READWRITE16(x68k_vid_r, x68k_vid_w,0xffffffff)
12721255   AM_RANGE(0xe84000, 0xe85fff) AM_DEVREADWRITE16("hd63450", hd63450_device, read, write, 0xffffffff)
12731256   AM_RANGE(0xe86000, 0xe87fff) AM_READWRITE16(x68k_areaset_r, x68k_areaset_w,0xffffffff)
12741257   AM_RANGE(0xe88000, 0xe89fff) AM_DEVREADWRITE8(MC68901_TAG, mc68901_device, read, write, 0x00ff00ff)
r30761r30762
15521535
15531536   // start VBlank timer
15541537   m_crtc.vblank = 1;
1555   irq_time = machine().first_screen()->time_until_pos(m_crtc.reg[6],2);
1538   irq_time = m_screen->time_until_pos(m_crtc.reg[6],2);
15561539   m_vblank_irq->adjust(irq_time);
15571540
15581541   // start HBlank timer
1559   m_scanline_timer->adjust(machine().first_screen()->scan_period(), 1);
1542   m_scanline_timer->adjust(m_screen->scan_period(), 1);
15601543
15611544   /// TODO: get callbacks to trigger these
15621545   m_mfpdev->i0_w(1); // alarm

Previous 199869 Revisions Next


© 1997-2024 The MAME Team