Previous 199869 Revisions Next

r30960 Friday 13th June, 2014 at 15:34:24 UTC by Carl
(mess) x68k: don't copy so much with the crtc text copy op (nw)
[src/mess/drivers]x68k.c
[src/mess/includes]x68k.h
[src/mess/video]x68k.c

trunk/src/mess/includes/x68k.h
r30959r30960
299299   DECLARE_WRITE16_MEMBER(x68k_scc_w);
300300   DECLARE_WRITE16_MEMBER(x68k_fdc_w);
301301   DECLARE_READ16_MEMBER(x68k_fdc_r);
302   DECLARE_WRITE16_MEMBER(x68k_fm_w);
303   DECLARE_READ16_MEMBER(x68k_fm_r);
304302   DECLARE_WRITE16_MEMBER(x68k_ioc_w);
305303   DECLARE_READ16_MEMBER(x68k_ioc_r);
306304   DECLARE_WRITE16_MEMBER(x68k_sysport_w);
r30959r30960
336334
337335private:
338336   inline void x68k_plot_pixel(bitmap_rgb32 &bitmap, int x, int y, UINT32 color);
339   void x68k_crtc_text_copy(int src, int dest);
337   void x68k_crtc_text_copy(int src, int dest, UINT8 planes);
340338   void x68k_crtc_refresh_mode();
341339   void x68k_draw_text(bitmap_rgb32 &bitmap, int xscr, int yscr, rectangle rect);
342340   bool x68k_draw_gfx_scanline(bitmap_ind16 &bitmap, rectangle cliprect, UINT8 priority);
trunk/src/mess/video/x68k.c
r30959r30960
2424         1 sprite layer - up to 128 16x16 sprites, 16 colours per sprite, maximum 16 sprites per scanline (not yet implemented).
2525
2626         Questions: What do the other bits in m_video.reg[2] do?
27                    What is "special priority mode"?
2728                    How is the intensity applied during blending if at all?
2829                    Black appears to be opaque only at priority 2 but not 3, is that right?
29                    How is the gfx layer cleared in pacland and text layer in akumajo?
3030                    Are the gfx layers blended from the bottom up or all at once?
3131
3232*/
r30959r30960
9090    return NULL;  // should never reach here either.
9191}
9292*/
93void x68k_state::x68k_crtc_text_copy(int src, int dest)
93void x68k_state::x68k_crtc_text_copy(int src, int dest, UINT8 planes)
9494{
9595   // copys one raster in T-VRAM to another raster
9696   int src_ram = src * 256;  // 128 bytes per scanline
9797   int dest_ram = dest * 256;
98   int line;
9998
100   if(dest > 250)
101      return;  // for some reason, Salamander causes a SIGSEGV in a debug build in this function.
102
103   for(line=0;line<8;line++)
104   {
105      // update RAM in each plane
106      memcpy(m_tvram+dest_ram,m_tvram+src_ram,128);
107      memcpy(m_tvram+dest_ram+0x10000,m_tvram+src_ram+0x10000,128);
108      memcpy(m_tvram+dest_ram+0x20000,m_tvram+src_ram+0x20000,128);
109      memcpy(m_tvram+dest_ram+0x30000,m_tvram+src_ram+0x30000,128);
110
111      src_ram+=64;
112      dest_ram+=64;
113   }
114
99   // update RAM in each plane
100   if(planes & 1)
101      memcpy(m_tvram+dest_ram,m_tvram+src_ram,512);
102   if(planes & 2)
103      memcpy(m_tvram+dest_ram+0x10000,m_tvram+src_ram+0x10000,512);
104   if(planes & 4)
105      memcpy(m_tvram+dest_ram+0x20000,m_tvram+src_ram+0x20000,512);
106   if(planes & 8)
107      memcpy(m_tvram+dest_ram+0x30000,m_tvram+src_ram+0x30000,512);
115108}
116109
117110TIMER_CALLBACK_MEMBER(x68k_state::x68k_crtc_operation_end)
r30959r30960
188181   m_crtc.hblank = hstate;
189182   m_mfpdev->i7_w(!m_crtc.hblank);
190183
191   if(m_crtc.operation & 8) // is this supposed to happen when the src or dest line is scanned?
192      x68k_crtc_text_copy((m_crtc.reg[22] & 0xff00) >> 8,(m_crtc.reg[22] & 0x00ff));
184   if(m_crtc.operation & 8)
185      x68k_crtc_text_copy((m_crtc.reg[22] & 0xff00) >> 8,(m_crtc.reg[22] & 0x00ff),(m_crtc.reg[21] & 0xf));
193186
194187   if(m_crtc.vmultiple == 2) // 256-line (doublescan)
195188   {
trunk/src/mess/drivers/x68k.c
r30959r30960
107107      Dragon Buster: Text is black and unreadable. (Text layer actually covers it)
108108      Tetris:        Black dots over screen (text layer).
109109      Parodius Da!:  Black squares in areas.
110      Akumajo Drac:  no sfx starting on second stage (m68000 only, 030 is fine), simon sprite flickers
111110
112
113111    More detailed documentation at http://x68kdev.emuvibes.com/iomap.html - if you can stand broken english :)
114112
115113*/
r30959r30960
709707      m_maincpu->set_input_line(1, CLEAR_LINE);
710708}
711709
712WRITE16_MEMBER(x68k_state::x68k_fm_w)
713{
714   switch(offset)
715   {
716   case 0x00:
717   case 0x01:
718      m_ym2151->write(space, offset, data);
719      break;
720   }
721}
722
723READ16_MEMBER(x68k_state::x68k_fm_r)
724{
725   if(offset == 0x01)
726      return m_ym2151->read(space, 1);
727
728   return 0xffff;
729}
730
731710WRITE8_MEMBER(x68k_state::x68k_ct_w)
732711{
733712   // CT1 and CT2 bits from YM2151 port 0x1b
r30959r30960
11651144   AM_RANGE(0xe8a000, 0xe8bfff) AM_DEVREADWRITE8(RP5C15_TAG, rp5c15_device, read, write, 0x00ff)
11661145//  AM_RANGE(0xe8c000, 0xe8dfff) AM_READWRITE(x68k_printer_r, x68k_printer_w)
11671146   AM_RANGE(0xe8e000, 0xe8ffff) AM_READWRITE(x68k_sysport_r, x68k_sysport_w)
1168   AM_RANGE(0xe90000, 0xe91fff) AM_READWRITE(x68k_fm_r, x68k_fm_w)
1147   AM_RANGE(0xe90000, 0xe91fff) AM_DEVREADWRITE8("ym2151", ym2151_device, read, write, 0x00ff)
11691148   AM_RANGE(0xe92000, 0xe92001) AM_DEVREADWRITE8("okim6258", okim6258_device, okim6258_status_r, okim6258_ctrl_w, 0x00ff)
11701149   AM_RANGE(0xe92002, 0xe92003) AM_DEVREADWRITE8("okim6258", okim6258_device, okim6258_status_r, okim6258_data_w, 0x00ff)
11711150   AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff)
r30959r30960
12021181   AM_RANGE(0xe8a000, 0xe8bfff) AM_DEVREADWRITE8(RP5C15_TAG, rp5c15_device, read, write, 0x00ff)
12031182//  AM_RANGE(0xe8c000, 0xe8dfff) AM_READWRITE(x68k_printer_r, x68k_printer_w)
12041183   AM_RANGE(0xe8e000, 0xe8ffff) AM_READWRITE(x68k_sysport_r, x68k_sysport_w)
1205   AM_RANGE(0xe90000, 0xe91fff) AM_READWRITE(x68k_fm_r, x68k_fm_w)
1184   AM_RANGE(0xe90000, 0xe91fff) AM_DEVREADWRITE8("ym2151", ym2151_device, read, write, 0x00ff)
12061185   AM_RANGE(0xe92000, 0xe92001) AM_DEVREADWRITE8("okim6258", okim6258_device, okim6258_status_r, okim6258_ctrl_w, 0x00ff)
12071186   AM_RANGE(0xe92002, 0xe92003) AM_DEVREADWRITE8("okim6258", okim6258_device, okim6258_status_r, okim6258_data_w, 0x00ff)
12081187   AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff)
r30959r30960
12411220   AM_RANGE(0xe8a000, 0xe8bfff) AM_DEVREADWRITE8(RP5C15_TAG, rp5c15_device, read, write, 0x00ff00ff)
12421221//  AM_RANGE(0xe8c000, 0xe8dfff) AM_READWRITE(x68k_printer_r, x68k_printer_w)
12431222   AM_RANGE(0xe8e000, 0xe8ffff) AM_READWRITE16(x68k_sysport_r, x68k_sysport_w,0xffffffff)
1244   AM_RANGE(0xe90000, 0xe91fff) AM_READWRITE16(x68k_fm_r, x68k_fm_w,0xffffffff)
1223   AM_RANGE(0xe90000, 0xe91fff) AM_DEVREADWRITE8("ym2151", ym2151_device, read, write, 0x00ff00ff)
12451224   AM_RANGE(0xe92000, 0xe92003) AM_DEVREAD8("okim6258", okim6258_device, okim6258_status_r, 0x00ff00ff) AM_WRITE8(x68030_adpcm_w, 0x00ff00ff)
12461225   AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff00ff)
12471226   AM_RANGE(0xe94004, 0xe94007) AM_READWRITE16(x68k_fdc_r, x68k_fdc_w,0xffffffff)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team