trunk/src/mess/includes/x68k.h
| r30959 | r30960 | |
| 299 | 299 | DECLARE_WRITE16_MEMBER(x68k_scc_w); |
| 300 | 300 | DECLARE_WRITE16_MEMBER(x68k_fdc_w); |
| 301 | 301 | DECLARE_READ16_MEMBER(x68k_fdc_r); |
| 302 | | DECLARE_WRITE16_MEMBER(x68k_fm_w); |
| 303 | | DECLARE_READ16_MEMBER(x68k_fm_r); |
| 304 | 302 | DECLARE_WRITE16_MEMBER(x68k_ioc_w); |
| 305 | 303 | DECLARE_READ16_MEMBER(x68k_ioc_r); |
| 306 | 304 | DECLARE_WRITE16_MEMBER(x68k_sysport_w); |
| r30959 | r30960 | |
| 336 | 334 | |
| 337 | 335 | private: |
| 338 | 336 | 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); |
| 340 | 338 | void x68k_crtc_refresh_mode(); |
| 341 | 339 | void x68k_draw_text(bitmap_rgb32 &bitmap, int xscr, int yscr, rectangle rect); |
| 342 | 340 | bool x68k_draw_gfx_scanline(bitmap_ind16 &bitmap, rectangle cliprect, UINT8 priority); |
trunk/src/mess/video/x68k.c
| r30959 | r30960 | |
| 24 | 24 | 1 sprite layer - up to 128 16x16 sprites, 16 colours per sprite, maximum 16 sprites per scanline (not yet implemented). |
| 25 | 25 | |
| 26 | 26 | Questions: What do the other bits in m_video.reg[2] do? |
| 27 | What is "special priority mode"? |
| 27 | 28 | How is the intensity applied during blending if at all? |
| 28 | 29 | 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? |
| 30 | 30 | Are the gfx layers blended from the bottom up or all at once? |
| 31 | 31 | |
| 32 | 32 | */ |
| r30959 | r30960 | |
| 90 | 90 | return NULL; // should never reach here either. |
| 91 | 91 | } |
| 92 | 92 | */ |
| 93 | | void x68k_state::x68k_crtc_text_copy(int src, int dest) |
| 93 | void x68k_state::x68k_crtc_text_copy(int src, int dest, UINT8 planes) |
| 94 | 94 | { |
| 95 | 95 | // copys one raster in T-VRAM to another raster |
| 96 | 96 | int src_ram = src * 256; // 128 bytes per scanline |
| 97 | 97 | int dest_ram = dest * 256; |
| 98 | | int line; |
| 99 | 98 | |
| 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); |
| 115 | 108 | } |
| 116 | 109 | |
| 117 | 110 | TIMER_CALLBACK_MEMBER(x68k_state::x68k_crtc_operation_end) |
| r30959 | r30960 | |
| 188 | 181 | m_crtc.hblank = hstate; |
| 189 | 182 | m_mfpdev->i7_w(!m_crtc.hblank); |
| 190 | 183 | |
| 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)); |
| 193 | 186 | |
| 194 | 187 | if(m_crtc.vmultiple == 2) // 256-line (doublescan) |
| 195 | 188 | { |
trunk/src/mess/drivers/x68k.c
| r30959 | r30960 | |
| 107 | 107 | Dragon Buster: Text is black and unreadable. (Text layer actually covers it) |
| 108 | 108 | Tetris: Black dots over screen (text layer). |
| 109 | 109 | Parodius Da!: Black squares in areas. |
| 110 | | Akumajo Drac: no sfx starting on second stage (m68000 only, 030 is fine), simon sprite flickers |
| 111 | 110 | |
| 112 | | |
| 113 | 111 | More detailed documentation at http://x68kdev.emuvibes.com/iomap.html - if you can stand broken english :) |
| 114 | 112 | |
| 115 | 113 | */ |
| r30959 | r30960 | |
| 709 | 707 | m_maincpu->set_input_line(1, CLEAR_LINE); |
| 710 | 708 | } |
| 711 | 709 | |
| 712 | | WRITE16_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 | | |
| 723 | | READ16_MEMBER(x68k_state::x68k_fm_r) |
| 724 | | { |
| 725 | | if(offset == 0x01) |
| 726 | | return m_ym2151->read(space, 1); |
| 727 | | |
| 728 | | return 0xffff; |
| 729 | | } |
| 730 | | |
| 731 | 710 | WRITE8_MEMBER(x68k_state::x68k_ct_w) |
| 732 | 711 | { |
| 733 | 712 | // CT1 and CT2 bits from YM2151 port 0x1b |
| r30959 | r30960 | |
| 1165 | 1144 | AM_RANGE(0xe8a000, 0xe8bfff) AM_DEVREADWRITE8(RP5C15_TAG, rp5c15_device, read, write, 0x00ff) |
| 1166 | 1145 | // AM_RANGE(0xe8c000, 0xe8dfff) AM_READWRITE(x68k_printer_r, x68k_printer_w) |
| 1167 | 1146 | 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) |
| 1169 | 1148 | AM_RANGE(0xe92000, 0xe92001) AM_DEVREADWRITE8("okim6258", okim6258_device, okim6258_status_r, okim6258_ctrl_w, 0x00ff) |
| 1170 | 1149 | AM_RANGE(0xe92002, 0xe92003) AM_DEVREADWRITE8("okim6258", okim6258_device, okim6258_status_r, okim6258_data_w, 0x00ff) |
| 1171 | 1150 | AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff) |
| r30959 | r30960 | |
| 1202 | 1181 | AM_RANGE(0xe8a000, 0xe8bfff) AM_DEVREADWRITE8(RP5C15_TAG, rp5c15_device, read, write, 0x00ff) |
| 1203 | 1182 | // AM_RANGE(0xe8c000, 0xe8dfff) AM_READWRITE(x68k_printer_r, x68k_printer_w) |
| 1204 | 1183 | 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) |
| 1206 | 1185 | AM_RANGE(0xe92000, 0xe92001) AM_DEVREADWRITE8("okim6258", okim6258_device, okim6258_status_r, okim6258_ctrl_w, 0x00ff) |
| 1207 | 1186 | AM_RANGE(0xe92002, 0xe92003) AM_DEVREADWRITE8("okim6258", okim6258_device, okim6258_status_r, okim6258_data_w, 0x00ff) |
| 1208 | 1187 | AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff) |
| r30959 | r30960 | |
| 1241 | 1220 | AM_RANGE(0xe8a000, 0xe8bfff) AM_DEVREADWRITE8(RP5C15_TAG, rp5c15_device, read, write, 0x00ff00ff) |
| 1242 | 1221 | // AM_RANGE(0xe8c000, 0xe8dfff) AM_READWRITE(x68k_printer_r, x68k_printer_w) |
| 1243 | 1222 | 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) |
| 1245 | 1224 | AM_RANGE(0xe92000, 0xe92003) AM_DEVREAD8("okim6258", okim6258_device, okim6258_status_r, 0x00ff00ff) AM_WRITE8(x68030_adpcm_w, 0x00ff00ff) |
| 1246 | 1225 | AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff00ff) |
| 1247 | 1226 | AM_RANGE(0xe94004, 0xe94007) AM_READWRITE16(x68k_fdc_r, x68k_fdc_w,0xffffffff) |