diff --git a/.gitattributes b/.gitattributes index 54ee26f8513..eb924a5a0ec 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7076,6 +7076,8 @@ src/mess/machine/a2zipdrive.h svneol=native#text/plain src/mess/machine/a7800.c svneol=native#text/plain src/mess/machine/abc1600_bus.c svneol=native#text/plain src/mess/machine/abc1600_bus.h svneol=native#text/plain +src/mess/machine/abc1600mac.c svneol=native#text/plain +src/mess/machine/abc1600mac.h svneol=native#text/plain src/mess/machine/abc77.c svneol=native#text/plain src/mess/machine/abc77.h svneol=native#text/plain src/mess/machine/abc800kb.c svneol=native#text/plain @@ -8275,6 +8277,7 @@ src/mess/video/911_vdt.c svneol=native#text/plain src/mess/video/911_vdt.h svneol=native#text/plain src/mess/video/a7800.c svneol=native#text/plain src/mess/video/abc1600.c svneol=native#text/plain +src/mess/video/abc1600.h svneol=native#text/plain src/mess/video/abc80.c svneol=native#text/plain src/mess/video/abc800.c svneol=native#text/plain src/mess/video/abc802.c svneol=native#text/plain diff --git a/src/mess/drivers/abc1600.c b/src/mess/drivers/abc1600.c index ad2791e1982..6d9bc684dd7 100644 --- a/src/mess/drivers/abc1600.c +++ b/src/mess/drivers/abc1600.c @@ -32,11 +32,6 @@ TODO: - - segment/page RAM addresses are not correctly decoded, "sas/format/format" can't find the SASI interface because of this - forcetask0 1 t0 0 t1 0 t2 0 t3 0 - sega19 0 task 0 - sega 000 segd 00 pga 008 pgd 4058 virtual 02c730 (should be 004730) - - short/long reset (RSTBUT) - CIO - optimize timers! @@ -59,82 +54,13 @@ #define LOG 0 -// MAC -#define A0 BIT(offset, 0) #define A1 BIT(offset, 1) #define A2 BIT(offset, 2) #define A4 BIT(offset, 4) -#define A7 BIT(offset, 7) -#define A8 BIT(offset, 8) #define X11 BIT(offset, 11) -#define X12 BIT(offset, 12) -#define A17 BIT(offset, 17) -#define A18 BIT(offset, 18) -#define A19 BIT(offset, 19) - -#define A10_A9_A8 ((offset >> 8) & 0x07) -#define A2_A1_A0 (offset & 0x07) #define A1_A2 ((A1 << 1) | A2) #define A2_A1 ((offset >> 1) & 0x03) -#define FC0 BIT(fc, 0) -#define FC1 BIT(fc, 1) -#define FC2 BIT(fc, 2) - -#define PAGE_WP BIT(page_data, 14) -#define PAGE_NONX BIT(page_data, 15) - - -// task register -#define BOOTE BIT(m_task, 6) -#define MAGIC BIT(m_task, 7) -#define READ_MAGIC !MAGIC - - -// DMA map -enum -{ - DMAMAP_R2_LO = 0, - DMAMAP_R2_HI, - DMAMAP_R1_LO = 4, - DMAMAP_R1_HI, - DMAMAP_R0_LO, - DMAMAP_R0_HI -}; - - -// internal I/O registers -enum -{ - FLP = 0, - CRT, - DRT, - DMA0, - DMA1, - DMA2, - SCC, - CIO -}; - - -// internal I/O registers -enum -{ - IORD0 = 0 -}; - - -// internal I/O registers -enum -{ - IOWR0 = 0, - IOWR1, - IOWR2, - FW, - DMAMAP = 5, - SPEC_CONTR_REG -}; - // external I/O enum @@ -155,152 +81,16 @@ enum + //************************************************************************** -// MEMORY ACCESS CONTROLLER +// READ/WRITE HANDLERS //************************************************************************** //------------------------------------------------- -// read_ram - +// bus_r - //------------------------------------------------- -UINT8 abc1600_state::read_ram(offs_t offset) -{ - UINT8 data = 0; - - if (offset < 0x100000) - { - // main RAM - UINT8 *ram = m_ram->pointer(); - data = ram[offset]; - } - else if (offset < 0x180000) - { - // video RAM - address_space &program = m_maincpu->space(AS_PROGRAM); - data = video_ram_r(program, offset); - } - else - { - logerror("%s Unmapped read from virtual memory %06x\n", machine().describe_context(), offset); - } - - return data; -} - - -//------------------------------------------------- -// write_ram - -//------------------------------------------------- - -void abc1600_state::write_ram(offs_t offset, UINT8 data) -{ - if (offset < 0x100000) - { - // main RAM - UINT8 *ram = m_ram->pointer(); - ram[offset] = data; - } - else if (offset < 0x180000) - { - // video RAM - address_space &program = m_maincpu->space(AS_PROGRAM); - video_ram_w(program, offset, data); - } - else - { - logerror("%s Unmapped write to virtual memory %06x : %02x\n", machine().describe_context(), offset, data); - } -} - - -//------------------------------------------------- -// read_io - -//------------------------------------------------- - -UINT8 abc1600_state::read_io(offs_t offset) -{ - if (X12) - { - return read_internal_io(offset); - } - else - { - return read_external_io(offset); - } -} - - -//------------------------------------------------- -// read_internal_io - -//------------------------------------------------- - -UINT8 abc1600_state::read_internal_io(offs_t offset) -{ - address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 data = 0; - - if (X11) - { - switch (A10_A9_A8) - { - case IORD0: - data = iord0_r(program, offset); - break; - - default: - logerror("%s Unmapped read from virtual I/O %06x\n", machine().describe_context(), offset); - } - } - else - { - switch (A10_A9_A8) - { - case FLP: - data = m_fdc->gen_r(A2_A1); - break; - - case CRT: - if (A0) - data = m_crtc->register_r(program, offset); - else - data = m_crtc->status_r(program, offset); - break; - - case DRT: - data = m_dart->ba_cd_r(program, A2_A1 ^ 0x03); - break; - - case DMA0: - data = m_dma0->read(); - break; - - case DMA1: - data = m_dma1->read(); - break; - - case DMA2: - data = m_dma2->read(); - break; - - case SCC: - data = m_scc->reg_r(program, A1_A2); - break; - - case CIO: - data = m_cio->read(program, A2_A1); - break; - } - } - - return data; -} - - -//------------------------------------------------- -// read_external_io - -//------------------------------------------------- - -UINT8 abc1600_state::read_external_io(offs_t offset) +READ8_MEMBER( abc1600_state::bus_r ) { UINT8 data = 0; @@ -439,120 +229,10 @@ UINT8 abc1600_state::read_external_io(offs_t offset) //------------------------------------------------- -// write_io - +// bus_w - //------------------------------------------------- -void abc1600_state::write_io(offs_t offset, UINT8 data) -{ - if (X12) - { - write_internal_io(offset, data); - } - else - { - write_external_io(offset, data); - } -} - - -//------------------------------------------------- -// write_internal_io - -//------------------------------------------------- - -void abc1600_state::write_internal_io(offs_t offset, UINT8 data) -{ - address_space &program = m_maincpu->space(AS_PROGRAM); - - if (X11) - { - switch (A10_A9_A8) - { - case IOWR0: - iowr0_w(program, offset, data); - break; - - case IOWR1: - iowr1_w(program, offset, data); - break; - - case IOWR2: - iowr2_w(program, offset, data); - break; - - case FW: - if (!A7) - { - if (A0) - fw1_w(program, offset, data); - else - fw0_w(program, offset, data); - } - else - { - logerror("%s Unmapped write to virtual I/O %06x : %02x\n", machine().describe_context(), offset, data); - } - break; - - case DMAMAP: - dmamap_w(program, offset, data); - break; - - case SPEC_CONTR_REG: - spec_contr_reg_w(program, offset, data); - break; - - default: - logerror("%s Unmapped write to virtual I/O %06x : %02x\n", machine().describe_context(), offset, data); - } - } - else - { - switch (A10_A9_A8) - { - case FLP: - m_fdc->gen_w(A2_A1, data); - break; - - case CRT: - if (A0) - m_crtc->register_w(program, offset, data); - else - m_crtc->address_w(program, offset, data); - break; - - case DRT: - m_dart->ba_cd_w(program, A2_A1 ^ 0x03, data); - break; - - case DMA0: - m_dma0->write(data); - break; - - case DMA1: - m_dma1->write(data); - break; - - case DMA2: - m_dma2->write(data); - break; - - case SCC: - m_scc->reg_w(program, A1_A2, data); - break; - - case CIO: - m_cio->write(program, A2_A1, data); - break; - } - } -} - - -//------------------------------------------------- -// write_external_io - -//------------------------------------------------- - -void abc1600_state::write_external_io(offs_t offset, UINT8 data) +WRITE8_MEMBER( abc1600_state::bus_w ) { UINT8 cs = (m_cs7 << 7) | ((offset >> 5) & 0x3f); @@ -644,609 +324,6 @@ void abc1600_state::write_external_io(offs_t offset, UINT8 data) } -//------------------------------------------------- -// get_current_task - -//------------------------------------------------- - -int abc1600_state::get_current_task(offs_t offset) -{ - int force_task0 = !(m_ifc2 || A19); - int t0 = !(BIT(m_task, 0) || force_task0); - int t1 = !(BIT(m_task, 1) || force_task0); - int t2 = !(BIT(m_task, 2) || force_task0); - int t3 = !(BIT(m_task, 3) || force_task0); - - return (t3 << 3) | (t2 << 2) | (t1 << 1) | t0; -} - - -//------------------------------------------------- -// get_segment_address - -//------------------------------------------------- - -offs_t abc1600_state::get_segment_address(offs_t offset) -{ - int sega19 = !(!(A8 || m_ifc2) || !A19); - int task = get_current_task(offset); - - return (task << 5) | (sega19 << 4) | ((offset >> 15) & 0x0f); -} - - -//------------------------------------------------- -// get_page_address - -//------------------------------------------------- - -offs_t abc1600_state::get_page_address(offs_t offset, UINT8 segd) -{ - return ((segd & 0x3f) << 4) | ((offset >> 11) & 0x0f); -} - - -//------------------------------------------------- -// translate_address - -//------------------------------------------------- - -offs_t abc1600_state::translate_address(offs_t offset, int *nonx, int *wp) -{ - // segment - offs_t sega = get_segment_address(offset); - UINT8 segd = m_segment_ram[sega]; - - // page - offs_t pga = get_page_address(offset, segd); - UINT16 page_data = m_page_ram[pga]; - - offs_t virtual_offset = ((page_data & 0x3ff) << 11) | (offset & 0x7ff); - - if (PAGE_NONX) - { - //logerror("Bus error %06x : %06x\n", offset, virtual_offset); - //m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE); - //m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE); - } - - *nonx = PAGE_NONX; - *wp = PAGE_WP; - - return virtual_offset; -} - - -//------------------------------------------------- -// read_user_memory - -//------------------------------------------------- - -UINT8 abc1600_state::read_user_memory(offs_t offset) -{ - int nonx = 0, wp = 0; - offs_t virtual_offset = translate_address(offset, &nonx, &wp); - UINT8 data = 0; - - if (virtual_offset < 0x1fe000) - { - data = read_ram(virtual_offset); - } - else - { - data = read_io(virtual_offset); - } - - return data; -} - - -//------------------------------------------------- -// write_user_memory - -//------------------------------------------------- - -void abc1600_state::write_user_memory(offs_t offset, UINT8 data) -{ - int nonx = 0, wp = 0; - offs_t virtual_offset = translate_address(offset, &nonx, &wp); - - //if (nonx || !wp) return; - - if (virtual_offset < 0x1fe000) - { - write_ram(virtual_offset, data); - } - else - { - write_io(virtual_offset, data); - } -} - - -//------------------------------------------------- -// read_supervisor_memory - -//------------------------------------------------- - -UINT8 abc1600_state::read_supervisor_memory(offs_t offset) -{ - address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 data = 0; - - if (!A2 && !A1) - { - // _EP - data = page_r(program, offset); - } - else if (!A2 && A1 && A0) - { - // _ES - data = segment_r(program, offset); - } - else if (A2 && A1 && A0) - { - // _CAUSE - data = cause_r(program, offset); - } - - return data; -} - - -//------------------------------------------------- -// write_supervisor_memory - -//------------------------------------------------- - -void abc1600_state::write_supervisor_memory(offs_t offset, UINT8 data) -{ - address_space &program = m_maincpu->space(AS_PROGRAM); - - if (!A2 && !A1) - { - // _WEP - page_w(program, offset, data); - } - else if (!A2 && A1 && A0) - { - // _WES - segment_w(program, offset, data); - } - else if (A2 && !A1 && A0) - { - // W(C) - task_w(program, offset, data); - } -} - - -//------------------------------------------------- -// get_fc - -//------------------------------------------------- - -int abc1600_state::get_fc() -{ - UINT16 fc = m68k_get_fc(m_maincpu); - - m_ifc2 = !(!(MAGIC || FC0) || FC2); - - return fc; -} - - -//------------------------------------------------- -// mac_r - -//------------------------------------------------- - -READ8_MEMBER( abc1600_state::mac_r ) -{ - int fc = get_fc(); - - UINT8 data = 0; - - if (!BOOTE && !A19 && !A18 && !A17) - { - // _BOOTCE - data = m_rom->base()[offset & 0x3fff]; - } - else if (A19 && !m_ifc2 && !FC1) - { - data = read_supervisor_memory(offset); - } - else - { - data = read_user_memory(offset); - } - - return data; -} - - -//------------------------------------------------- -// mac_w - -//------------------------------------------------- - -WRITE8_MEMBER( abc1600_state::mac_w ) -{ - int fc = get_fc(); - - if (A19 && !m_ifc2 && !FC1) - { - write_supervisor_memory(offset, data); - } - else - { - write_user_memory(offset, data); - } -} - - -//------------------------------------------------- -// cause_r - -//------------------------------------------------- - -READ8_MEMBER( abc1600_state::cause_r ) -{ - /* - - bit description - - 0 RSTBUT - 1 1 - 2 DMAOK - 3 X16 - 4 X17 - 5 X18 - 6 X19 - 7 X20 - - */ - - UINT8 data = 0x02; - - // DMA status - data |= m_cause; - - machine().watchdog_reset(); - - return data; -} - - -//------------------------------------------------- -// task_w - -//------------------------------------------------- - -WRITE8_MEMBER( abc1600_state::task_w ) -{ - /* - - bit description - - 0 TASKD0* (inverted SEGA5) - 1 TASKD1* (inverted SEGA6) - 2 TASKD2* (inverted SEGA7) - 3 TASKD3* (inverted SEGA8) - 4 - 5 - 6 BOOTE* - 7 MAGIC* - - */ - - m_task = data ^ 0xff; - - if (LOG) logerror("%s: %06x Task %u BOOTE %u MAGIC %u\n", machine().describe_context(), offset, get_current_task(offset), BOOTE, MAGIC); -} - - -//------------------------------------------------- -// segment_r - -//------------------------------------------------- - -READ8_MEMBER( abc1600_state::segment_r ) -{ - /* - - bit description - - 0 SEGD0 - 1 SEGD1 - 2 SEGD2 - 3 SEGD3 - 4 SEGD4 - 5 SEGD5 - 6 SEGD6 - 7 READ_MAGIC - - */ - - offs_t sega = get_segment_address(offset); - UINT8 segd = m_segment_ram[sega]; - - return (READ_MAGIC << 7) | (segd & 0x7f); -} - - -//------------------------------------------------- -// segment_w - -//------------------------------------------------- - -WRITE8_MEMBER( abc1600_state::segment_w ) -{ - /* - - bit description - - 0 SEGD0 - 1 SEGD1 - 2 SEGD2 - 3 SEGD3 - 4 SEGD4 - 5 SEGD5 - 6 SEGD6 - 7 0 - - */ - - offs_t sega = get_segment_address(offset); - - m_segment_ram[sega] = data & 0x7f; - - if (LOG) logerror("%s: %06x Task %u Segment %03x : %02x\n", machine().describe_context(), offset, get_current_task(offset), sega, data); -} - - -//------------------------------------------------- -// page_r - -//------------------------------------------------- - -READ8_MEMBER( abc1600_state::page_r ) -{ - /* - - bit description - - 0 X11 - 1 X12 - 2 X13 - 3 X14 - 4 X15 - 5 X16 - 6 X17 - 7 X18 - - 8 X19 - 9 X20 - 10 X20 - 11 X20 - 12 X20 - 13 X20 - 14 _WP - 15 NONX - - */ - - // segment - offs_t sega = get_segment_address(offset); - UINT8 segd = m_segment_ram[sega]; - - // page - offs_t pga = get_page_address(offset, segd); - UINT16 pgd = m_page_ram[pga]; - - UINT8 data = 0; - - if (A0) - { - data = pgd & 0xff; - } - else - { - int x20 = BIT(pgd, 9); - - data = (pgd >> 8) | (x20 << 2) | (x20 << 3) | (x20 << 4) | (x20 << 5); - } - - return data; -} - - -//------------------------------------------------- -// page_w - -//------------------------------------------------- - -WRITE8_MEMBER( abc1600_state::page_w ) -{ - /* - - bit description - - 0 X11 - 1 X12 - 2 X13 - 3 X14 - 4 X15 - 5 X16 - 6 X17 - 7 X18 - - 8 X19 - 9 X20 - 10 - 11 - 12 - 13 - 14 _WP - 15 NONX - - */ - - // segment - offs_t sega = get_segment_address(offset); - UINT8 segd = m_segment_ram[sega]; - - // page - offs_t pga = get_page_address(offset, segd); - - if (A0) - { - m_page_ram[pga] = (m_page_ram[pga] & 0xff00) | data; - } - else - { - m_page_ram[pga] = ((data & 0xc3) << 8) | (m_page_ram[pga] & 0xff); - } - - if (LOG) logerror("%s: %06x Task %u Segment %03x Page %03x : %02x -> %04x\n", machine().describe_context(), offset, get_current_task(offset), sega, pga, data, m_page_ram[pga]); -} - - - -//************************************************************************** -// DMA -//************************************************************************** - -//------------------------------------------------- -// update_drdy0 - -//------------------------------------------------- - -inline void abc1600_state::update_drdy0() -{ - if (m_sysfs) - { - // floppy - m_dma0->rdy_w(!m_fdc->drq_r()); - } - else - { - // BUS0I/BUS0X - int trrq0 = m_bus0i->trrq_r() && m_bus0x->trrq_r(); - - m_dma0->rdy_w(trrq0); - } -} - - -//------------------------------------------------- -// update_drdy1 - -//------------------------------------------------- - -inline void abc1600_state::update_drdy1() -{ - if (m_sysscc) - { - // SCC - m_dma1->rdy_w(1); - } - else - { - // BUS1 - m_dma1->rdy_w(m_bus1->trrq_r()); - } -} - - -//------------------------------------------------- -// update_drdy2 - -//------------------------------------------------- - -inline void abc1600_state::update_drdy2() -{ - // Winchester - m_dma2->rdy_w(1); -} - - -//------------------------------------------------- -// get_dma_address - -//------------------------------------------------- - -inline offs_t abc1600_state::get_dma_address(int index, UINT16 offset) -{ - // A0 = DMA15, A1 = BA1, A2 = BA2 - UINT8 dmamap_addr = index | BIT(offset, 15); - UINT8 dmamap = m_dmamap[dmamap_addr]; - - m_cause = (dmamap & 0x1f) << 3; - - return ((dmamap & 0x1f) << 16) | offset; -} - - -//------------------------------------------------- -// dma_mreq_r - DMA memory read -//------------------------------------------------- - -inline UINT8 abc1600_state::dma_mreq_r(int index, UINT16 offset) -{ - offs_t virtual_offset = get_dma_address(index, offset); - - return read_ram(virtual_offset); -} - - -//------------------------------------------------- -// dma_mreq_w - DMA memory write -//------------------------------------------------- - -inline void abc1600_state::dma_mreq_w(int index, UINT16 offset, UINT8 data) -{ - offs_t virtual_offset = get_dma_address(index, offset); - - write_ram(virtual_offset, data); -} - - -//------------------------------------------------- -// dma_iorq_r - DMA I/O read -//------------------------------------------------- - -inline UINT8 abc1600_state::dma_iorq_r(int index, UINT16 offset) -{ - offs_t virtual_offset = get_dma_address(index, offset); - - return read_io(virtual_offset); -} - - -//------------------------------------------------- -// dma_iorq_w - DMA I/O write -//------------------------------------------------- - -inline void abc1600_state::dma_iorq_w(int index, UINT16 offset, UINT8 data) -{ - offs_t virtual_offset = get_dma_address(index, offset); - - write_io(virtual_offset, data); -} - - -//------------------------------------------------- -// dmamap_w - DMA map write -//------------------------------------------------- - -WRITE8_MEMBER( abc1600_state::dmamap_w ) -{ - /* - - bit description - - 0 X16 - 1 X17 - 2 X18 - 3 X19 - 4 X20 - 5 - 6 - 7 _R/W - - */ - - if (LOG) logerror("DMAMAP %u %02x\n", offset & 7, data); - - m_dmamap[offset & 7] = data; -} - - - -//************************************************************************** -// READ/WRITE HANDLERS -//************************************************************************** - //------------------------------------------------- // fw0_w - //------------------------------------------------- @@ -1380,7 +457,34 @@ WRITE8_MEMBER( abc1600_state::spec_contr_reg_w ) //------------------------------------------------- static ADDRESS_MAP_START( abc1600_mem, AS_PROGRAM, 8, abc1600_state ) - AM_RANGE(0x00000, 0xfffff) AM_READWRITE(mac_r, mac_w) + AM_RANGE(0x00000, 0xfffff) AM_DEVICE(ABC1600_MAC_TAG, abc1600_mac_device, map) +ADDRESS_MAP_END + + +//------------------------------------------------- +// ADDRESS_MAP( mac_mem ) +//------------------------------------------------- + +static ADDRESS_MAP_START( mac_mem, AS_PROGRAM, 8, abc1600_state ) + AM_RANGE(0x000000, 0x0fffff) AM_RAM + AM_RANGE(0x100000, 0x17ffff) AM_DEVICE(ABC1600_MOVER_TAG, abc1600_mover_device, vram_map)//AM_READWRITE(video_ram_r, video_ram_w) + AM_RANGE(0x1fe000, 0x1fefff) AM_READWRITE(bus_r, bus_w) + AM_RANGE(0x1ff000, 0x1ff000) AM_MIRROR(0xf9) AM_DEVREADWRITE(SAB1797_02P_TAG, fd1797_t, status_r, cmd_w) + AM_RANGE(0x1ff002, 0x1ff002) AM_MIRROR(0xf9) AM_DEVREADWRITE(SAB1797_02P_TAG, fd1797_t, track_r, track_w) + AM_RANGE(0x1ff004, 0x1ff004) AM_MIRROR(0xf9) AM_DEVREADWRITE(SAB1797_02P_TAG, fd1797_t, sector_r, sector_w) + AM_RANGE(0x1ff006, 0x1ff006) AM_MIRROR(0xf9) AM_DEVREADWRITE(SAB1797_02P_TAG, fd1797_t, data_r, data_w) + AM_RANGE(0x1ff100, 0x1ff101) AM_MIRROR(0xfe) AM_DEVICE(ABC1600_MOVER_TAG, abc1600_mover_device, crtc_map) + AM_RANGE(0x1ff200, 0x1ff207) AM_MIRROR(0xf8) AM_READWRITE(dart_r, dart_w) + AM_RANGE(0x1ff300, 0x1ff300) AM_MIRROR(0xff) AM_DEVREADWRITE_LEGACY(Z8410AB1_0_TAG, z80dma_r, z80dma_w) + AM_RANGE(0x1ff400, 0x1ff400) AM_MIRROR(0xff) AM_DEVREADWRITE_LEGACY(Z8410AB1_1_TAG, z80dma_r, z80dma_w) + AM_RANGE(0x1ff500, 0x1ff500) AM_MIRROR(0xff) AM_DEVREADWRITE_LEGACY(Z8410AB1_2_TAG, z80dma_r, z80dma_w) + AM_RANGE(0x1ff600, 0x1ff607) AM_MIRROR(0xf8) AM_READWRITE(scc_r, scc_w) + AM_RANGE(0x1ff700, 0x1ff707) AM_MIRROR(0xf8) AM_READWRITE(cio_r, cio_w) + AM_RANGE(0x1ff800, 0x1ffaff) AM_DEVICE(ABC1600_MOVER_TAG, abc1600_mover_device, io_map) + AM_RANGE(0x1ffb00, 0x1ffb00) AM_MIRROR(0x7e) AM_WRITE(fw0_w) + AM_RANGE(0x1ffb01, 0x1ffb01) AM_MIRROR(0x7e) AM_WRITE(fw1_w) + AM_RANGE(0x1ffd00, 0x1ffd07) AM_MIRROR(0xf8) AM_DEVWRITE(ABC1600_MAC_TAG, abc1600_mac_device, dmamap_w) + AM_RANGE(0x1ffe00, 0x1ffe00) AM_MIRROR(0xff) AM_WRITE(spec_contr_reg_w) ADDRESS_MAP_END @@ -1407,40 +511,36 @@ INPUT_PORTS_END // Z80DMA_INTERFACE( dma0_intf ) //------------------------------------------------- +void abc1600_state::update_drdy0() +{ + if (m_sysfs) + { + // floppy + m_dma0->rdy_w(!m_fdc->drq_r()); + } + else + { + // BUS0I/BUS0X + int trrq0 = m_bus0i->trrq_r() && m_bus0x->trrq_r(); + + m_dma0->rdy_w(trrq0); + } +} + WRITE_LINE_MEMBER( abc1600_state::dbrq_w ) { m_maincpu->set_input_line(INPUT_LINE_HALT, state && m_dmadis); } -READ8_MEMBER( abc1600_state::dma0_mreq_r ) -{ - return dma_mreq_r(DMAMAP_R0_LO, offset); -} - -WRITE8_MEMBER( abc1600_state::dma0_mreq_w ) -{ - dma_mreq_w(DMAMAP_R0_LO, offset, data); -} - -READ8_MEMBER( abc1600_state::dma0_iorq_r ) -{ - return dma_iorq_r(DMAMAP_R0_LO, offset); -} - -WRITE8_MEMBER( abc1600_state::dma0_iorq_w ) -{ - dma_iorq_w(DMAMAP_R0_LO, offset, data); -} - static Z80DMA_INTERFACE( dma0_intf ) { DEVCB_DRIVER_LINE_MEMBER(abc1600_state, dbrq_w), DEVCB_NULL, DEVCB_DEVICE_LINE(Z8410AB1_1_TAG, z80dma_bai_w), - DEVCB_DRIVER_MEMBER(abc1600_state, dma0_mreq_r), - DEVCB_DRIVER_MEMBER(abc1600_state, dma0_mreq_w), - DEVCB_DRIVER_MEMBER(abc1600_state, dma0_iorq_r), - DEVCB_DRIVER_MEMBER(abc1600_state, dma0_iorq_w) + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma0_mreq_r), + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma0_mreq_w), + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma0_iorq_r), + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma0_iorq_w) }; @@ -1448,24 +548,18 @@ static Z80DMA_INTERFACE( dma0_intf ) // Z80DMA_INTERFACE( dma1_intf ) //------------------------------------------------- -READ8_MEMBER( abc1600_state::dma1_mreq_r ) +void abc1600_state::update_drdy1() { - return dma_mreq_r(DMAMAP_R1_LO, offset); -} - -WRITE8_MEMBER( abc1600_state::dma1_mreq_w ) -{ - dma_mreq_w(DMAMAP_R1_LO, offset, data); -} - -READ8_MEMBER( abc1600_state::dma1_iorq_r ) -{ - return dma_iorq_r(DMAMAP_R1_LO, offset); -} - -WRITE8_MEMBER( abc1600_state::dma1_iorq_w ) -{ - dma_iorq_w(DMAMAP_R1_LO, offset, data); + if (m_sysscc) + { + // SCC + m_dma1->rdy_w(1); + } + else + { + // BUS1 + m_dma1->rdy_w(m_bus1->trrq_r()); + } } static Z80DMA_INTERFACE( dma1_intf ) @@ -1473,10 +567,10 @@ static Z80DMA_INTERFACE( dma1_intf ) DEVCB_DRIVER_LINE_MEMBER(abc1600_state, dbrq_w), DEVCB_NULL, DEVCB_DEVICE_LINE(Z8410AB1_2_TAG, z80dma_bai_w), - DEVCB_DRIVER_MEMBER(abc1600_state, dma1_mreq_r), - DEVCB_DRIVER_MEMBER(abc1600_state, dma1_mreq_w), - DEVCB_DRIVER_MEMBER(abc1600_state, dma1_iorq_r), - DEVCB_DRIVER_MEMBER(abc1600_state, dma1_iorq_w) + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma1_mreq_r), + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma1_mreq_w), + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma1_iorq_r), + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma1_iorq_w) }; @@ -1484,24 +578,10 @@ static Z80DMA_INTERFACE( dma1_intf ) // Z80DMA_INTERFACE( dma2_intf ) //------------------------------------------------- -READ8_MEMBER( abc1600_state::dma2_mreq_r ) +void abc1600_state::update_drdy2() { - return dma_mreq_r(DMAMAP_R2_LO, offset); -} - -WRITE8_MEMBER( abc1600_state::dma2_mreq_w ) -{ - dma_mreq_w(DMAMAP_R2_LO, offset, data); -} - -READ8_MEMBER( abc1600_state::dma2_iorq_r ) -{ - return dma_iorq_r(DMAMAP_R2_LO, offset); -} - -WRITE8_MEMBER( abc1600_state::dma2_iorq_w ) -{ - dma_iorq_w(DMAMAP_R2_LO, offset, data); + // Winchester + m_dma2->rdy_w(1); } static Z80DMA_INTERFACE( dma2_intf ) @@ -1509,10 +589,10 @@ static Z80DMA_INTERFACE( dma2_intf ) DEVCB_DRIVER_LINE_MEMBER(abc1600_state, dbrq_w), DEVCB_NULL, DEVCB_NULL, - DEVCB_DRIVER_MEMBER(abc1600_state, dma2_mreq_r), - DEVCB_DRIVER_MEMBER(abc1600_state, dma2_mreq_w), - DEVCB_DRIVER_MEMBER(abc1600_state, dma2_iorq_r), - DEVCB_DRIVER_MEMBER(abc1600_state, dma2_iorq_w) + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma2_mreq_r), + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma2_mreq_w), + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma2_iorq_r), + DEVCB_DEVICE_MEMBER(ABC1600_MAC_TAG, abc1600_mac_device, dma2_iorq_w) }; @@ -1520,6 +600,16 @@ static Z80DMA_INTERFACE( dma2_intf ) // Z80DART_INTERFACE( dart_intf ) //------------------------------------------------- +READ8_MEMBER( abc1600_state::dart_r ) +{ + return m_dart->ba_cd_r(space, A2_A1 ^ 0x03); +} + +WRITE8_MEMBER( abc1600_state::dart_w ) +{ + m_dart->ba_cd_w(space, A2_A1 ^ 0x03, data); +} + static Z80DART_INTERFACE( dart_intf ) { 0, 0, 0, 0, @@ -1546,6 +636,16 @@ static Z80DART_INTERFACE( dart_intf ) // SCC8530_INTERFACE( sc_intf ) //------------------------------------------------- +READ8_MEMBER( abc1600_state::scc_r ) +{ + return m_scc->reg_r(space, A1_A2); +} + +WRITE8_MEMBER( abc1600_state::scc_w ) +{ + m_scc->reg_w(space, A1_A2, data); +} + void abc1600_state::scc_irq(bool status) { m_maincpu->set_input_line(M68K_IRQ_5, status ? ASSERT_LINE : CLEAR_LINE); @@ -1556,6 +656,16 @@ void abc1600_state::scc_irq(bool status) // Z8536_INTERFACE( cio_intf ) //------------------------------------------------- +READ8_MEMBER( abc1600_state::cio_r ) +{ + return m_cio->read(space, A2_A1); +} + +WRITE8_MEMBER( abc1600_state::cio_w ) +{ + m_cio->write(space, A2_A1, data); +} + READ8_MEMBER( abc1600_state::cio_pa_r ) { /* @@ -1704,16 +814,6 @@ static Z8536_INTERFACE( cio_intf ) //------------------------------------------------- // wd17xx_interface fdc_intf //------------------------------------------------- -/* -static LEGACY_FLOPPY_OPTIONS_START( abc1600 ) - LEGACY_FLOPPY_OPTION(abc1600, "dsk", "Luxor ABC 1600", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([80]) - SECTORS([16]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END -*/ static SLOT_INTERFACE_START( abc1600_floppies ) SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) @@ -1844,10 +944,6 @@ IRQ_CALLBACK_MEMBER( abc1600_state::abc1600_int_ack ) } -//------------------------------------------------- -// MACHINE_START( abc1600 ) -//------------------------------------------------- - void abc1600_state::machine_start() { // interrupt callback @@ -1857,21 +953,10 @@ void abc1600_state::machine_start() m_fdc->setup_intrq_cb(wd_fdc_t::line_cb(FUNC(abc1600_state::fdc_intrq_w), this)); m_fdc->setup_drq_cb(wd_fdc_t::line_cb(FUNC(abc1600_state::fdc_drq_w), this)); - // allocate memory - m_segment_ram.allocate(0x400); - m_page_ram.allocate(0x400); - - // HACK fill segment RAM with non-zero values or no boot - memset(m_segment_ram, 0xcd, 0x400); - // state saving - save_item(NAME(m_ifc2)); - save_item(NAME(m_task)); - save_item(NAME(m_dmamap)); save_item(NAME(m_dmadis)); save_item(NAME(m_sysscc)); save_item(NAME(m_sysfs)); - save_item(NAME(m_cause)); save_item(NAME(m_partst)); save_item(NAME(m_cs7)); save_item(NAME(m_bus0)); @@ -1895,13 +980,6 @@ void abc1600_state::machine_reset() fw0_w(program, 0, 0); fw1_w(program, 0, 0); - // clear task register - m_task = 0; - - // disable display - m_clocks_disabled = 1; - m_endisp = 0; - // clear NMI m_maincpu->set_input_line(M68K_IRQ_7, CLEAR_LINE); } @@ -1923,9 +1001,10 @@ static MACHINE_CONFIG_START( abc1600, abc1600_state ) MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1600)) // XTAL_64MHz/8/10/20000/8/8 // video hardware - MCFG_FRAGMENT_ADD(abc1600_video) + MCFG_ABC1600_MOVER_ADD() // devices + MCFG_ABC1600_MAC_ADD(MC68008P8_TAG, mac_mem) MCFG_Z80DMA_ADD(Z8410AB1_0_TAG, XTAL_64MHz/16, dma0_intf) MCFG_Z80DMA_ADD(Z8410AB1_1_TAG, XTAL_64MHz/16, dma1_intf) MCFG_Z80DMA_ADD(Z8410AB1_2_TAG, XTAL_64MHz/16, dma2_intf) @@ -1941,7 +1020,6 @@ static MACHINE_CONFIG_START( abc1600, abc1600_state ) MCFG_RS232_PORT_ADD(RS232_A_TAG, rs232a_intf, default_rs232_devices, NULL) MCFG_RS232_PORT_ADD(RS232_B_TAG, rs232b_intf, default_rs232_devices, NULL) MCFG_ABC_KEYBOARD_PORT_ADD("abc99", DEVWRITELINE(Z8470AB1_TAG, z80dart_device, rxtxcb_w), DEVWRITELINE(Z8470AB1_TAG, z80dart_device, dcdb_w)) - MCFG_ABC1600BUS_SLOT_ADD("bus0i", bus0i_intf, abc1600bus_cards, NULL) MCFG_ABC1600BUS_SLOT_ADD("bus0x", bus0x_intf, abc1600bus_cards, NULL) MCFG_ABC1600BUS_SLOT_ADD("bus1", bus1_intf, abc1600bus_cards, NULL) @@ -1966,25 +1044,9 @@ MACHINE_CONFIG_END //------------------------------------------------- ROM_START( abc1600 ) - ROM_REGION( 0x4000, MC68008P8_TAG, 0 ) - ROM_LOAD( "boot 6490356-04.1f", 0x0000, 0x4000, CRC(9372f6f2) SHA1(86f0681f7ef8dd190b49eda5e781881582e0c2a4) ) - - ROM_REGION( 0x2000, "wrmsk", 0 ) - ROM_LOAD( "wrmskl 6490362-01.1g", 0x0000, 0x1000, CRC(bc737538) SHA1(80e2c3757eb7f713018808d6e41ebef612425028) ) - ROM_LOAD( "wrmskh 6490363-01.1j", 0x1000, 0x1000, CRC(6b7c9f0b) SHA1(7155a993adcf08a5a8a2f22becf9fd66fda698be) ) - - ROM_REGION( 0x200, "shinf", 0 ) - ROM_LOAD( "shinf 6490361-01.1f", 0x000, 0x200, CRC(20260f8f) SHA1(29bf49c64e7cc7592e88cde2768ac57c7ce5e085) ) - - ROM_REGION( 0x40, "drmsk", 0 ) - ROM_LOAD( "drmskl 6490359-01.1k", 0x00, 0x20, CRC(6e71087c) SHA1(0acf67700d6227f4b315cf8fb0fb31c0e7fb9496) ) - ROM_LOAD( "drmskh 6490358-01.1l", 0x20, 0x20, CRC(a4a9a9dc) SHA1(d8575c0335d6021cbb5f7bcd298b41c35294a80a) ) - ROM_REGION( 0x71c, "plds", 0 ) - ROM_LOAD( "drmsk 6490360-01.1m", 0x000, 0x104, CRC(5f7143c1) SHA1(1129917845f8e505998b15288f02bf907487e4ac) ) // mover word mixer @ 1m,1n,1t,2t ROM_LOAD( "1020 6490349-01.8b", 0x104, 0x104, CRC(1fa065eb) SHA1(20a95940e39fa98e97e59ea1e548ac2e0c9a3444) ) // expansion bus strobes ROM_LOAD( "1021 6490350-01.5d", 0x208, 0x104, CRC(96f6f44b) SHA1(12d1cd153dcc99d1c4a6c834122f370d49723674) ) // interrupt encoder and ROM/RAM control - ROM_LOAD( "1022 6490351-01.17e", 0x30c, 0x104, CRC(5dd00d43) SHA1(a3871f0d796bea9df8f25d41b3169dd4b8ef65ab) ) // MAC register address decoder ROM_LOAD( "1023 6490352-01.11e", 0x410, 0x104, CRC(a2f350ac) SHA1(77e08654a197080fa2111bc3031cd2c7699bf82b) ) // interrupt acknowledge ROM_LOAD( "1024 6490353-01.12e", 0x514, 0x104, CRC(67f1328a) SHA1(b585495fe14a7ae2fbb29f722dca106d59325002) ) // expansion bus timing and control ROM_LOAD( "1025 6490354-01.6e", 0x618, 0x104, CRC(9bda0468) SHA1(ad373995dcc18532274efad76fa80bd13c23df25) ) // DMA transfer diff --git a/src/mess/includes/abc1600.h b/src/mess/includes/abc1600.h index aa7d3b4ede8..ea51e7ce748 100644 --- a/src/mess/includes/abc1600.h +++ b/src/mess/includes/abc1600.h @@ -8,6 +8,7 @@ #include "machine/8530scc.h" #include "machine/abckb.h" #include "machine/abc1600_bus.h" +#include "machine/abc1600mac.h" #include "machine/e0516.h" #include "machine/lux4105.h" #include "machine/nmc9306.h" @@ -17,7 +18,7 @@ #include "machine/z80dart.h" #include "machine/z80dma.h" #include "machine/z8536.h" -#include "video/mc6845.h" +#include "video/abc1600.h" @@ -36,7 +37,6 @@ #define FDC9229BT_TAG "7a" #define E050_C16PC_TAG "13b" #define NMC9306_TAG "14c" -#define SY6845E_TAG "sy6845e" #define SCREEN_TAG "screen" #define BUS0I_TAG "bus0i" #define BUS0X_TAG "bus0x" @@ -52,6 +52,7 @@ //************************************************************************** // ======================> abc1600_state + class abc1600_state : public driver_device { public: @@ -67,7 +68,6 @@ public: m_fdc(*this, SAB1797_02P_TAG), m_rtc(*this, E050_C16PC_TAG), m_nvram(*this, NMC9306_TAG), - m_crtc(*this, SY6845E_TAG), m_ram(*this, RAM_TAG), m_floppy0(*this, SAB1797_02P_TAG":0"), m_floppy1(*this, SAB1797_02P_TAG":1"), @@ -75,14 +75,7 @@ public: m_bus0i(*this, BUS0I_TAG), m_bus0x(*this, BUS0X_TAG), m_bus1(*this, BUS1_TAG), - m_bus2(*this, BUS2_TAG), - m_rom(*this, MC68008P8_TAG), - m_wrmsk_rom(*this, "wrmsk"), - m_shinf_rom(*this, "shinf"), - m_drmsk_rom(*this, "drmsk"), - m_segment_ram(*this, "segment_ram"), - m_page_ram(*this, "page_ram"), - m_video_ram(*this, "video_ram") + m_bus2(*this, BUS2_TAG) { } required_device m_maincpu; @@ -95,7 +88,6 @@ public: required_device m_fdc; required_device m_rtc; required_device m_nvram; - required_device m_crtc; required_device m_ram; required_device m_floppy0; required_device m_floppy1; @@ -104,53 +96,23 @@ public: required_device m_bus0x; required_device m_bus1; required_device m_bus2; - required_memory_region m_rom; - required_memory_region m_wrmsk_rom; - required_memory_region m_shinf_rom; - required_memory_region m_drmsk_rom; - optional_shared_ptr m_segment_ram; - optional_shared_ptr m_page_ram; - optional_shared_ptr m_video_ram; virtual void machine_start(); virtual void machine_reset(); - virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - - DECLARE_READ8_MEMBER( mac_r ); - DECLARE_WRITE8_MEMBER( mac_w ); - DECLARE_READ8_MEMBER( cause_r ); - DECLARE_WRITE8_MEMBER( task_w ); - DECLARE_READ8_MEMBER( segment_r ); - DECLARE_WRITE8_MEMBER( segment_w ); - DECLARE_READ8_MEMBER( page_r ); - DECLARE_WRITE8_MEMBER( page_w ); + DECLARE_READ8_MEMBER( bus_r ); + DECLARE_WRITE8_MEMBER( bus_w ); + DECLARE_READ8_MEMBER( dart_r ); + DECLARE_WRITE8_MEMBER( dart_w ); + DECLARE_READ8_MEMBER( scc_r ); + DECLARE_WRITE8_MEMBER( scc_w ); + DECLARE_READ8_MEMBER( cio_r ); + DECLARE_WRITE8_MEMBER( cio_w ); DECLARE_WRITE8_MEMBER( fw0_w ); DECLARE_WRITE8_MEMBER( fw1_w ); DECLARE_WRITE8_MEMBER( spec_contr_reg_w ); - DECLARE_WRITE8_MEMBER( dmamap_w ); DECLARE_WRITE_LINE_MEMBER( dbrq_w ); - DECLARE_READ8_MEMBER( dma0_mreq_r ); - DECLARE_WRITE8_MEMBER( dma0_mreq_w ); - DECLARE_READ8_MEMBER( dma0_iorq_r ); - DECLARE_WRITE8_MEMBER( dma0_iorq_w ); - DECLARE_READ8_MEMBER( dma1_mreq_r ); - DECLARE_WRITE8_MEMBER( dma1_mreq_w ); - DECLARE_READ8_MEMBER( dma1_iorq_r ); - DECLARE_WRITE8_MEMBER( dma1_iorq_w ); - DECLARE_READ8_MEMBER( dma2_mreq_r ); - DECLARE_WRITE8_MEMBER( dma2_mreq_w ); - DECLARE_READ8_MEMBER( dma2_iorq_r ); - DECLARE_WRITE8_MEMBER( dma2_iorq_w ); - - DECLARE_READ8_MEMBER( video_ram_r ); - DECLARE_WRITE8_MEMBER( video_ram_w ); - DECLARE_READ8_MEMBER( iord0_r ); - DECLARE_WRITE8_MEMBER( iowr0_w ); - DECLARE_WRITE8_MEMBER( iowr1_w ); - DECLARE_WRITE8_MEMBER( iowr2_w ); DECLARE_READ8_MEMBER( cio_pa_r ); DECLARE_READ8_MEMBER( cio_pb_r ); @@ -165,62 +127,20 @@ public: void fdc_intrq_w(bool state); void fdc_drq_w(bool state); - int get_current_task(offs_t offset); - offs_t get_segment_address(offs_t offset); - offs_t get_page_address(offs_t offset, UINT8 segd); - offs_t translate_address(offs_t offset, int *nonx, int *wp); - UINT8 read_ram(offs_t offset); - void write_ram(offs_t offset, UINT8 data); UINT8 read_io(offs_t offset); void write_io(offs_t offset, UINT8 data); UINT8 read_internal_io(offs_t offset); void write_internal_io(offs_t offset, UINT8 data); UINT8 read_external_io(offs_t offset); void write_external_io(offs_t offset, UINT8 data); - UINT8 read_user_memory(offs_t offset); - void write_user_memory(offs_t offset, UINT8 data); - int get_fc(); - UINT8 read_supervisor_memory(offs_t offset); - void write_supervisor_memory(offs_t offset, UINT8 data); - inline void update_drdy0(); - inline void update_drdy1(); - inline void update_drdy2(); - inline offs_t get_dma_address(int index, UINT16 offset); - inline UINT8 dma_mreq_r(int index, UINT16 offset); - inline void dma_mreq_w(int index, UINT16 offset, UINT8 data); - inline UINT8 dma_iorq_r(int index, UINT16 offset); - inline void dma_iorq_w(int index, UINT16 offset, UINT8 data); - - inline UINT16 get_drmsk(); - inline void get_shinf(); - inline UINT16 get_wrmsk(); - inline UINT16 barrel_shift(UINT16 gmdr); - inline UINT16 word_mixer(UINT16 rot); - inline void clock_mfa_x(); - inline void clock_mfa_y(); - inline void clock_mta_x(); - inline void clock_mta_y(); - inline void load_mfa_x(); - inline void load_mta_x(); - inline void compare_mta_x(); - inline void compare_mta_y(); - inline void load_xy_reg(); - void mover(); - - inline UINT16 read_videoram(UINT32 offset); - inline void write_videoram(UINT32 offset, UINT16 data, UINT16 mask); - inline UINT16 get_crtca(UINT16 ma, UINT8 ra, UINT8 column); - void crtc_update_row(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); + void update_drdy0(); + void update_drdy1(); + void update_drdy2(); void scc_irq(bool status); - // memory access controller - int m_ifc2; - UINT8 m_task; - // DMA - UINT8 m_dmamap[8]; int m_dmadis; int m_sysscc; int m_sysfs; @@ -233,44 +153,8 @@ public: UINT8 m_csb; // card select int m_atce; // V.24 channel A external clock enable int m_btce; // V.24 channel B external clock enable - - // video - int m_endisp; // enable display - int m_clocks_disabled; // clocks disabled - UINT16 m_gmdi; // video RAM data latch - UINT16 m_wrm; // write mask latch - UINT8 m_ms[16]; // mover sequence control - UINT8 m_ds[16]; // display sequence control - UINT8 m_flag; // flags - UINT16 m_xsize; // X size - UINT16 m_ysize; // Y size - int m_udx; // up/down X - int m_udy; // up/down Y - UINT16 m_xfrom; // X from - UINT16 m_xto; // X to - UINT16 m_yto; // Y to - UINT16 m_ty; // to Y - UINT32 m_mfa; // mover from address - UINT32 m_mta; // mover to address - UINT8 m_sh; // - UINT16 m_mdor; // - int m_hold_1w_cyk; // - int m_wrms0; // - int m_wrms1; // - int m_rmc; // row match count - int m_cmc; // column match count - int m_amm; // active mover mask }; -//************************************************************************** -// MACHINE CONFIGURATION -//************************************************************************** - -/*----------- defined in video/abc1600.c -----------*/ - -MACHINE_CONFIG_EXTERN( abc1600_video ); - - #endif diff --git a/src/mess/machine/abc1600mac.c b/src/mess/machine/abc1600mac.c new file mode 100644 index 00000000000..0a5512f3138 --- /dev/null +++ b/src/mess/machine/abc1600mac.c @@ -0,0 +1,686 @@ +/********************************************************************** + + Luxor ABC 1600 Memory Access Controller emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +/* + + TODO: + + - segment/page RAM addresses are not correctly decoded, "sas/format/format" can't find the SASI interface because of this + forcetask0 1 t0 0 t1 0 t2 0 t3 0 + sega19 0 task 0 + sega 000 segd 00 pga 008 pgd 4058 virtual 02c730 (should be 004730) +*/ + +#include "abc1600mac.h" + + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define LOG 0 + + +#define A0 BIT(offset, 0) +#define A1 BIT(offset, 1) +#define A2 BIT(offset, 2) +#define A4 BIT(offset, 4) +#define A7 BIT(offset, 7) +#define A8 BIT(offset, 8) +#define X11 BIT(offset, 11) +#define X12 BIT(offset, 12) +#define A17 BIT(offset, 17) +#define A18 BIT(offset, 18) +#define A19 BIT(offset, 19) + +#define A10_A9_A8 ((offset >> 8) & 0x07) +#define A2_A1_A0 (offset & 0x07) +#define A1_A2 ((A1 << 1) | A2) +#define A2_A1 ((offset >> 1) & 0x03) + +#define FC0 BIT(fc, 0) +#define FC1 BIT(fc, 1) +#define FC2 BIT(fc, 2) + +#define PAGE_WP BIT(page_data, 14) +#define PAGE_NONX BIT(page_data, 15) + +#define BOOTE BIT(m_task, 6) +#define MAGIC BIT(m_task, 7) +#define READ_MAGIC !MAGIC + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type ABC1600_MAC = &device_creator; + + +DEVICE_ADDRESS_MAP_START( map, 8, abc1600_mac_device ) + AM_RANGE(0x00000, 0xfffff) AM_READWRITE(read, write) +ADDRESS_MAP_END + + +static ADDRESS_MAP_START( program_map, AS_PROGRAM, 8, abc1600_mac_device ) +ADDRESS_MAP_END + + +//------------------------------------------------- +// ROM( abc1600_mac ) +//------------------------------------------------- + +ROM_START( abc1600_mac ) + ROM_REGION( 0x4000, "boot", 0 ) + ROM_LOAD( "boot 6490356-04.1f", 0x0000, 0x4000, CRC(9372f6f2) SHA1(86f0681f7ef8dd190b49eda5e781881582e0c2a4) ) + + ROM_REGION( 0x104, "plds", 0 ) + ROM_LOAD( "1022 6490351-01.17e", 0x000, 0x104, CRC(5dd00d43) SHA1(a3871f0d796bea9df8f25d41b3169dd4b8ef65ab) ) // MAC register address decoder +ROM_END + + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +const rom_entry *abc1600_mac_device::device_rom_region() const +{ + return ROM_NAME( abc1600_mac ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// abc1600_mac_device - constructor +//------------------------------------------------- + +abc1600_mac_device::abc1600_mac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, ABC1600_MAC, "ABC 1600 MAC", tag, owner, clock, "abc1600mac", __FILE__), + device_memory_interface(mconfig, *this), + m_space_config("program", ENDIANNESS_LITTLE, 8, 22, 0, *ADDRESS_MAP_NAME(program_map)), + m_rom(*this, "boot"), + m_segment_ram(*this, "segment_ram"), + m_page_ram(*this, "page_ram") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void abc1600_mac_device::device_start() +{ + // get the CPU device + m_cpu = machine().device(m_cpu_tag); + assert(m_cpu != NULL); + + // allocate memory + m_segment_ram.allocate(0x400); + m_page_ram.allocate(0x400); + + // HACK fill segment RAM or abcenix won't boot + memset(m_segment_ram, 0xcd, 0x400); + + // state saving + save_item(NAME(m_ifc2)); + save_item(NAME(m_task)); + save_item(NAME(m_dmamap)); + save_item(NAME(m_cause)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void abc1600_mac_device::device_reset() +{ + // clear task register + m_task = 0; +} + + +//------------------------------------------------- +// memory_space_config - return a description of +// any address spaces owned by this device +//------------------------------------------------- + +const address_space_config *abc1600_mac_device::memory_space_config(address_spacenum spacenum) const +{ + return (spacenum == AS_PROGRAM) ? &m_space_config : NULL; +} + + +//------------------------------------------------- +// get_current_task - +//------------------------------------------------- + +int abc1600_mac_device::get_current_task(offs_t offset) +{ + int force_task0 = !(m_ifc2 || A19); + int t0 = !(BIT(m_task, 0) || force_task0); + int t1 = !(BIT(m_task, 1) || force_task0); + int t2 = !(BIT(m_task, 2) || force_task0); + int t3 = !(BIT(m_task, 3) || force_task0); + + return (t3 << 3) | (t2 << 2) | (t1 << 1) | t0; +} + + +//------------------------------------------------- +// get_segment_address - +//------------------------------------------------- + +offs_t abc1600_mac_device::get_segment_address(offs_t offset) +{ + int sega19 = !(!(A8 || m_ifc2) || !A19); + int task = get_current_task(offset); + + return (task << 5) | (sega19 << 4) | ((offset >> 15) & 0x0f); +} + + +//------------------------------------------------- +// get_page_address - +//------------------------------------------------- + +offs_t abc1600_mac_device::get_page_address(offs_t offset, UINT8 segd) +{ + return ((segd & 0x3f) << 4) | ((offset >> 11) & 0x0f); +} + + +//------------------------------------------------- +// translate_address - +//------------------------------------------------- + +offs_t abc1600_mac_device::translate_address(offs_t offset, int *nonx, int *wp) +{ + // segment + offs_t sega = get_segment_address(offset); + UINT8 segd = m_segment_ram[sega]; + + // page + offs_t pga = get_page_address(offset, segd); + UINT16 page_data = m_page_ram[pga]; + + offs_t virtual_offset = ((page_data & 0x3ff) << 11) | (offset & 0x7ff); + + if (PAGE_NONX) + { + //logerror("Bus error %06x : %06x\n", offset, virtual_offset); + //m_cpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE); + //m_cpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE); + } + + *nonx = PAGE_NONX; + *wp = PAGE_WP; + + return virtual_offset; +} + + +//------------------------------------------------- +// read_user_memory - +//------------------------------------------------- + +UINT8 abc1600_mac_device::read_user_memory(offs_t offset) +{ + int nonx = 0, wp = 0; + offs_t virtual_offset = translate_address(offset, &nonx, &wp); + + return space().read_byte(virtual_offset); +} + + +//------------------------------------------------- +// write_user_memory - +//------------------------------------------------- + +void abc1600_mac_device::write_user_memory(offs_t offset, UINT8 data) +{ + int nonx = 0, wp = 0; + offs_t virtual_offset = translate_address(offset, &nonx, &wp); + + //if (nonx || !wp) return; + + space().write_byte(virtual_offset, data); +} + + +//------------------------------------------------- +// read_supervisor_memory - +//------------------------------------------------- + +UINT8 abc1600_mac_device::read_supervisor_memory(address_space &space, offs_t offset) +{ + UINT8 data = 0; + + if (!A2 && !A1) + { + // _EP + data = page_r(space, offset); + } + else if (!A2 && A1 && A0) + { + // _ES + data = segment_r(space, offset); + } + else if (A2 && A1 && A0) + { + // _CAUSE + data = cause_r(space, offset); + } + + return data; +} + + +//------------------------------------------------- +// write_supervisor_memory - +//------------------------------------------------- + +void abc1600_mac_device::write_supervisor_memory(address_space &space, offs_t offset, UINT8 data) +{ + if (!A2 && !A1) + { + // _WEP + page_w(space, offset, data); + } + else if (!A2 && A1 && A0) + { + // _WES + segment_w(space, offset, data); + } + else if (A2 && !A1 && A0) + { + // W(C) + task_w(space, offset, data); + } +} + + +//------------------------------------------------- +// get_fc - +//------------------------------------------------- + +int abc1600_mac_device::get_fc() +{ + UINT16 fc = m68k_get_fc(m_cpu); + + m_ifc2 = !(!(MAGIC || FC0) || FC2); + + return fc; +} + + +//------------------------------------------------- +// read - +//------------------------------------------------- + +READ8_MEMBER( abc1600_mac_device::read ) +{ + int fc = get_fc(); + + UINT8 data = 0; + + if (!BOOTE && !A19 && !A18 && !A17) + { + // _BOOTCE + data = m_rom->base()[offset & 0x3fff]; + } + else if (A19 && !m_ifc2 && !FC1) + { + data = read_supervisor_memory(space, offset); + } + else + { + data = read_user_memory(offset); + } + + return data; +} + + +//------------------------------------------------- +// write - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mac_device::write ) +{ + int fc = get_fc(); + + if (A19 && !m_ifc2 && !FC1) + { + write_supervisor_memory(space, offset, data); + } + else + { + write_user_memory(offset, data); + } +} + + +//------------------------------------------------- +// cause_r - +//------------------------------------------------- + +READ8_MEMBER( abc1600_mac_device::cause_r ) +{ + /* + + bit description + + 0 RSTBUT + 1 1 + 2 DMAOK + 3 X16 + 4 X17 + 5 X18 + 6 X19 + 7 X20 + + */ + + UINT8 data = 0x02; + + // DMA status + data |= m_cause; + + machine().watchdog_reset(); + + return data; +} + + +//------------------------------------------------- +// task_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mac_device::task_w ) +{ + /* + + bit description + + 0 TASKD0* (inverted SEGA5) + 1 TASKD1* (inverted SEGA6) + 2 TASKD2* (inverted SEGA7) + 3 TASKD3* (inverted SEGA8) + 4 + 5 + 6 BOOTE* + 7 MAGIC* + + */ + + m_task = data ^ 0xff; + + if (LOG) logerror("%s: %06x Task %u BOOTE %u MAGIC %u\n", machine().describe_context(), offset, get_current_task(offset), BOOTE, MAGIC); +} + + +//------------------------------------------------- +// segment_r - +//------------------------------------------------- + +READ8_MEMBER( abc1600_mac_device::segment_r ) +{ + /* + + bit description + + 0 SEGD0 + 1 SEGD1 + 2 SEGD2 + 3 SEGD3 + 4 SEGD4 + 5 SEGD5 + 6 SEGD6 + 7 READ_MAGIC + + */ + + offs_t sega = get_segment_address(offset); + UINT8 segd = m_segment_ram[sega]; + + return (READ_MAGIC << 7) | (segd & 0x7f); +} + + +//------------------------------------------------- +// segment_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mac_device::segment_w ) +{ + /* + + bit description + + 0 SEGD0 + 1 SEGD1 + 2 SEGD2 + 3 SEGD3 + 4 SEGD4 + 5 SEGD5 + 6 SEGD6 + 7 0 + + */ + + offs_t sega = get_segment_address(offset); + + m_segment_ram[sega] = data & 0x7f; + + if (LOG) logerror("%s: %06x Task %u Segment %03x : %02x\n", machine().describe_context(), offset, get_current_task(offset), sega, data); +} + + +//------------------------------------------------- +// page_r - +//------------------------------------------------- + +READ8_MEMBER( abc1600_mac_device::page_r ) +{ + /* + + bit description + + 0 X11 + 1 X12 + 2 X13 + 3 X14 + 4 X15 + 5 X16 + 6 X17 + 7 X18 + + 8 X19 + 9 X20 + 10 X20 + 11 X20 + 12 X20 + 13 X20 + 14 _WP + 15 NONX + + */ + + // segment + offs_t sega = get_segment_address(offset); + UINT8 segd = m_segment_ram[sega]; + + // page + offs_t pga = get_page_address(offset, segd); + UINT16 pgd = m_page_ram[pga]; + + UINT8 data = 0; + + if (A0) + { + data = pgd & 0xff; + } + else + { + int x20 = BIT(pgd, 9); + + data = (pgd >> 8) | (x20 << 2) | (x20 << 3) | (x20 << 4) | (x20 << 5); + } + + return data; +} + + +//------------------------------------------------- +// page_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mac_device::page_w ) +{ + /* + + bit description + + 0 X11 + 1 X12 + 2 X13 + 3 X14 + 4 X15 + 5 X16 + 6 X17 + 7 X18 + + 8 X19 + 9 X20 + 10 + 11 + 12 + 13 + 14 _WP + 15 NONX + + */ + + // segment + offs_t sega = get_segment_address(offset); + UINT8 segd = m_segment_ram[sega]; + + // page + offs_t pga = get_page_address(offset, segd); + + if (A0) + { + m_page_ram[pga] = (m_page_ram[pga] & 0xff00) | data; + } + else + { + m_page_ram[pga] = ((data & 0xc3) << 8) | (m_page_ram[pga] & 0xff); + } + + if (LOG) logerror("%s: %06x Task %u Segment %03x Page %03x : %02x -> %04x\n", machine().describe_context(), offset, get_current_task(offset), sega, pga, data, m_page_ram[pga]); +} + + +//------------------------------------------------- +// get_dma_address - +//------------------------------------------------- + +offs_t abc1600_mac_device::get_dma_address(int index, UINT16 offset) +{ + // A0 = DMA15, A1 = BA1, A2 = BA2 + UINT8 dmamap_addr = index | BIT(offset, 15); + UINT8 dmamap = m_dmamap[dmamap_addr]; + + m_cause = (dmamap & 0x1f) << 3; + + return ((dmamap & 0x1f) << 16) | offset; +} + + +//------------------------------------------------- +// dma_mreq_r - DMA memory read +//------------------------------------------------- + +UINT8 abc1600_mac_device::dma_mreq_r(int index, UINT16 offset) +{ + offs_t virtual_offset = get_dma_address(index, offset); + + return space().read_byte(virtual_offset); +} + + +//------------------------------------------------- +// dma_mreq_w - DMA memory write +//------------------------------------------------- + +void abc1600_mac_device::dma_mreq_w(int index, UINT16 offset, UINT8 data) +{ + offs_t virtual_offset = get_dma_address(index, offset); + + space().write_byte(virtual_offset, data); +} + + +//------------------------------------------------- +// dma_iorq_r - DMA I/O read +//------------------------------------------------- + +UINT8 abc1600_mac_device::dma_iorq_r(int index, UINT16 offset) +{ + offs_t virtual_offset = 0x1fe000 | get_dma_address(index, offset); + + return space().read_byte(virtual_offset); +} + + +//------------------------------------------------- +// dma_iorq_w - DMA I/O write +//------------------------------------------------- + +void abc1600_mac_device::dma_iorq_w(int index, UINT16 offset, UINT8 data) +{ + offs_t virtual_offset = 0x1fe000 | get_dma_address(index, offset); + + space().write_byte(virtual_offset, data); +} + + +//------------------------------------------------- +// dmamap_w - DMA map write +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mac_device::dmamap_w ) +{ + /* + + bit description + + 0 X16 + 1 X17 + 2 X18 + 3 X19 + 4 X20 + 5 + 6 + 7 _R/W + + */ + + if (LOG) logerror("DMAMAP %u %02x\n", offset & 7, data); + + m_dmamap[offset & 7] = data; +} diff --git a/src/mess/machine/abc1600mac.h b/src/mess/machine/abc1600mac.h new file mode 100644 index 00000000000..0acc6377510 --- /dev/null +++ b/src/mess/machine/abc1600mac.h @@ -0,0 +1,137 @@ +/********************************************************************** + + Luxor ABC 1600 Memory Access Controller emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __ABC1600_MAC__ +#define __ABC1600_MAC__ + +#include "emu.h" +#include "cpu/m68000/m68000.h" + + + +///************************************************************************* +// MACROS / CONSTANTS +///************************************************************************* + +#define ABC1600_MAC_TAG "mac" + + + +///************************************************************************* +// INTERFACE CONFIGURATION MACROS +///************************************************************************* + +#define MCFG_ABC1600_MAC_ADD(_cpu_tag, _program_map) \ + MCFG_DEVICE_ADD(ABC1600_MAC_TAG, ABC1600_MAC, 0) \ + MCFG_DEVICE_ADDRESS_MAP(AS_PROGRAM, _program_map) \ + downcast(device)->set_cpu_tag(_cpu_tag); + + + +///************************************************************************* +// TYPE DEFINITIONS +///************************************************************************* + +// ======================> abc1600_mac_device + +class abc1600_mac_device : public device_t, + public device_memory_interface +{ +public: + abc1600_mac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual const rom_entry *device_rom_region() const; + + void set_cpu_tag(const char *cpu_tag) { m_cpu_tag = cpu_tag; } + + virtual DECLARE_ADDRESS_MAP(map, 8); + + DECLARE_READ8_MEMBER( cause_r ); + DECLARE_WRITE8_MEMBER( task_w ); + DECLARE_READ8_MEMBER( segment_r ); + DECLARE_WRITE8_MEMBER( segment_w ); + DECLARE_READ8_MEMBER( page_r ); + DECLARE_WRITE8_MEMBER( page_w ); + DECLARE_WRITE8_MEMBER( dmamap_w ); + + DECLARE_READ8_MEMBER( dma0_mreq_r ) { return dma_mreq_r(DMAMAP_R0_LO, offset); } + DECLARE_WRITE8_MEMBER( dma0_mreq_w ) { dma_mreq_w(DMAMAP_R0_LO, offset, data); } + DECLARE_READ8_MEMBER( dma0_iorq_r ) { return dma_iorq_r(DMAMAP_R0_LO, offset); } + DECLARE_WRITE8_MEMBER( dma0_iorq_w ) { dma_iorq_w(DMAMAP_R0_LO, offset, data); } + DECLARE_READ8_MEMBER( dma1_mreq_r ) { return dma_mreq_r(DMAMAP_R1_LO, offset); } + DECLARE_WRITE8_MEMBER( dma1_mreq_w ) { dma_mreq_w(DMAMAP_R1_LO, offset, data); } + DECLARE_READ8_MEMBER( dma1_iorq_r ) { return dma_iorq_r(DMAMAP_R1_LO, offset); } + DECLARE_WRITE8_MEMBER( dma1_iorq_w ) { dma_iorq_w(DMAMAP_R1_LO, offset, data); } + DECLARE_READ8_MEMBER( dma2_mreq_r ) { return dma_mreq_r(DMAMAP_R2_LO, offset); } + DECLARE_WRITE8_MEMBER( dma2_mreq_w ) { dma_mreq_w(DMAMAP_R2_LO, offset, data); } + DECLARE_READ8_MEMBER( dma2_iorq_r ) { return dma_iorq_r(DMAMAP_R2_LO, offset); } + DECLARE_WRITE8_MEMBER( dma2_iorq_w ) { dma_iorq_w(DMAMAP_R2_LO, offset, data); } + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + + // device_memory_interface overrides + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_PROGRAM) const; + +private: + enum + { + DMAMAP_R2_LO = 0, + DMAMAP_R2_HI, + DMAMAP_R1_LO = 4, + DMAMAP_R1_HI, + DMAMAP_R0_LO, + DMAMAP_R0_HI + }; + + DECLARE_READ8_MEMBER( read ); + DECLARE_WRITE8_MEMBER( write ); + + int get_current_task(offs_t offset); + offs_t get_segment_address(offs_t offset); + offs_t get_page_address(offs_t offset, UINT8 segd); + offs_t translate_address(offs_t offset, int *nonx, int *wp); + UINT8 read_user_memory(offs_t offset); + void write_user_memory(offs_t offset, UINT8 data); + int get_fc(); + UINT8 read_supervisor_memory(address_space &space, offs_t offset); + void write_supervisor_memory(address_space &space, offs_t offset, UINT8 data); + offs_t get_dma_address(int index, UINT16 offset); + UINT8 dma_mreq_r(int index, UINT16 offset); + void dma_mreq_w(int index, UINT16 offset, UINT8 data); + UINT8 dma_iorq_r(int index, UINT16 offset); + void dma_iorq_w(int index, UINT16 offset, UINT8 data); + + const address_space_config m_space_config; + + required_memory_region m_rom; + optional_shared_ptr m_segment_ram; + optional_shared_ptr m_page_ram; + + const char *m_cpu_tag; + m68000_base_device *m_cpu; + + int m_ifc2; + UINT8 m_task; + UINT8 m_dmamap[8]; + UINT8 m_cause; +}; + + +// device type definition +extern const device_type ABC1600_MAC; + + + +#endif diff --git a/src/mess/mess.mak b/src/mess/mess.mak index c7d22109722..f50083aabab 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -1570,6 +1570,7 @@ $(MESSOBJ)/luxor.a: \ $(MESS_MACHINE)/abc890.o \ $(MESS_DRIVERS)/abc1600.o \ $(MESS_MACHINE)/abc1600_bus.o \ + $(MESS_MACHINE)/abc1600mac.o \ $(MESS_MACHINE)/lux4105.o \ $(MESS_VIDEO)/abc1600.o \ $(MESS_MACHINE)/s1410.o \ diff --git a/src/mess/video/abc1600.c b/src/mess/video/abc1600.c index 30806fc3405..117219c4426 100644 --- a/src/mess/video/abc1600.c +++ b/src/mess/video/abc1600.c @@ -1,3 +1,21 @@ +/********************************************************************** + + Luxor ABC 1600 Mover emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +/* + + TODO: + + - portrait/landscape detection is broken + - bottom border is not respected + +*/ + #include "includes/abc1600.h" #include "abc1600.lh" @@ -10,6 +28,9 @@ #define LOG 0 +#define SY6845E_TAG "sy6845e" + + // video RAM #define VIDEORAM_SIZE 0x40000 #define VIDEORAM16_MASK 0x3ffff @@ -32,55 +53,284 @@ #define VFP 23 -// IOWR0 registers -enum + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type ABC1600_MOVER = &device_creator; + + +DEVICE_ADDRESS_MAP_START( vram_map, 8, abc1600_mover_device ) + AM_RANGE(0x00000, 0x7ffff) AM_READWRITE(video_ram_r, video_ram_w) +ADDRESS_MAP_END + +DEVICE_ADDRESS_MAP_START( crtc_map, 8, abc1600_mover_device ) + AM_RANGE(0x00, 0x00) AM_MIRROR(0xfe) AM_DEVREADWRITE(SY6845E_TAG, mc6845_device, status_r, address_w) + AM_RANGE(0x01, 0x01) AM_MIRROR(0xfe) AM_DEVREADWRITE(SY6845E_TAG, mc6845_device, register_r, register_w) +ADDRESS_MAP_END + +DEVICE_ADDRESS_MAP_START( io_map, 8, abc1600_mover_device ) + AM_RANGE(0x000, 0x000) AM_MIRROR(0xff) AM_READ(iord0_r) + AM_RANGE(0x000, 0x000) AM_MIRROR(0xf8) AM_WRITE(ldsx_hb_w) + AM_RANGE(0x001, 0x001) AM_MIRROR(0xf8) AM_WRITE(ldsx_lb_w) + AM_RANGE(0x002, 0x002) AM_MIRROR(0xf8) AM_WRITE(ldsy_hb_w) + AM_RANGE(0x003, 0x003) AM_MIRROR(0xf8) AM_WRITE(ldsy_lb_w) + AM_RANGE(0x004, 0x004) AM_MIRROR(0xf8) AM_WRITE(ldtx_hb_w) + AM_RANGE(0x005, 0x005) AM_MIRROR(0xf8) AM_WRITE(ldtx_lb_w) + AM_RANGE(0x006, 0x006) AM_MIRROR(0xf8) AM_WRITE(ldty_hb_w) + AM_RANGE(0x007, 0x007) AM_MIRROR(0xf8) AM_WRITE(ldty_lb_w) + AM_RANGE(0x100, 0x100) AM_MIRROR(0xf8) AM_WRITE(ldfx_hb_w) + AM_RANGE(0x101, 0x101) AM_MIRROR(0xf8) AM_WRITE(ldfx_lb_w) + AM_RANGE(0x102, 0x102) AM_MIRROR(0xf8) AM_WRITE(ldfy_hb_w) + AM_RANGE(0x103, 0x103) AM_MIRROR(0xf8) AM_WRITE(ldfy_lb_w) + AM_RANGE(0x105, 0x105) AM_MIRROR(0xf8) AM_WRITE(wrml_w) + AM_RANGE(0x107, 0x107) AM_MIRROR(0xf8) AM_WRITE(wrdl_w) + AM_RANGE(0x200, 0x200) AM_MIRROR(0xf8) AM_WRITE(wrmask_strobe_hb_w) + AM_RANGE(0x201, 0x201) AM_MIRROR(0xf8) AM_WRITE(wrmask_strobe_lb_w) + AM_RANGE(0x202, 0x202) AM_MIRROR(0xf8) AM_WRITE(enable_clocks_w) + AM_RANGE(0x203, 0x203) AM_MIRROR(0xf8) AM_WRITE(flag_strobe_w) + AM_RANGE(0x204, 0x204) AM_MIRROR(0xf8) AM_WRITE(endisp_w) +ADDRESS_MAP_END + + +static ADDRESS_MAP_START( mover_map, AS_0, 16, abc1600_mover_device ) + AM_RANGE(0x00000, 0x7ffff) AM_RAM +ADDRESS_MAP_END + + +//------------------------------------------------- +// ROM( abc1600_mover ) +//------------------------------------------------- + +ROM_START( abc1600_mover ) + ROM_REGION( 0x2000, "wrmsk", 0 ) + ROM_LOAD( "wrmskl 6490362-01.1g", 0x0000, 0x1000, CRC(bc737538) SHA1(80e2c3757eb7f713018808d6e41ebef612425028) ) + ROM_LOAD( "wrmskh 6490363-01.1j", 0x1000, 0x1000, CRC(6b7c9f0b) SHA1(7155a993adcf08a5a8a2f22becf9fd66fda698be) ) + + ROM_REGION( 0x200, "shinf", 0 ) + ROM_LOAD( "shinf 6490361-01.1f", 0x000, 0x200, CRC(20260f8f) SHA1(29bf49c64e7cc7592e88cde2768ac57c7ce5e085) ) + + ROM_REGION( 0x40, "drmsk", 0 ) + ROM_LOAD( "drmskl 6490359-01.1k", 0x00, 0x20, CRC(6e71087c) SHA1(0acf67700d6227f4b315cf8fb0fb31c0e7fb9496) ) + ROM_LOAD( "drmskh 6490358-01.1l", 0x20, 0x20, CRC(a4a9a9dc) SHA1(d8575c0335d6021cbb5f7bcd298b41c35294a80a) ) + + ROM_REGION( 0x104, "plds", 0 ) + ROM_LOAD( "drmsk 6490360-01.1m", 0x000, 0x104, CRC(5f7143c1) SHA1(1129917845f8e505998b15288f02bf907487e4ac) ) // mover word mixer @ 1m,1n,1t,2t +ROM_END + + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +const rom_entry *abc1600_mover_device::device_rom_region() const { - LDSX_HB = 0, - LDSX_LB, - LDSY_HB, - LDSY_LB, - LDTX_HB, - LDTX_LB, - LDTY_HB, - LDTY_LB + return ROM_NAME( abc1600_mover ); +} + + +//------------------------------------------------- +// mc6845_interface crtc_intf +//------------------------------------------------- + +inline UINT16 abc1600_mover_device::get_crtca(UINT16 ma, UINT8 ra, UINT8 column) +{ + /* + + bit description + + CRTCA0 0 + CRTCA1 0 + CRTCA2 CC1/MA1 + CRTCA3 CC2/MA2 + CRTCA4 CC3/MA3 + CRTCA5 CC4/MA4 + CRTCA6 RA0 + CRTCA7 RA1 + CRTCA8 RA2 + CRTCA9 RA3 + CRTCA10 CR0/MA8 + CRTCA11 CR1/MA9 + CRTCA12 CR2/MA10 + CRTCA13 CR3/MA11 + CRTCA14 CR4/MA12 + CRTCA15 CR5/MA13 + + */ + + UINT8 cc = (ma & 0xff) + column; + UINT8 cr = ma >> 8; + + return (cr << 10) | ((ra & 0x0f) << 6) | ((cc << 1) & 0x3c); +} + +void abc1600_mover_device::crtc_update_row(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) +{ + if (y > 0x3ff) return; + + int x = HFP; + + for (int column = 0; column < x_count; column += 2) + { + UINT16 dma = get_crtca(ma, ra, column); + + // data is read out of video RAM in nibble mode by strobing CAS 4 times + for (int cas = 0; cas < 4; cas++) + { + UINT16 data = read_videoram(dma + cas); + + for (int bit = 0; bit < 16; bit++) + { + int color = (BIT(data, 15) ^ PIX_POL) && !BLANK; + + bitmap.pix32(y + VFP, x++) = RGB_MONOCHROME_GREEN[color]; + + data <<= 1; + } + } + } +} + +static MC6845_UPDATE_ROW( abc1600_update_row ) +{ + abc1600_mover_device *mover = downcast(device->owner()); + mover->crtc_update_row(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); +} + +static MC6845_ON_UPDATE_ADDR_CHANGED( crtc_update ) +{ +} + +static MC6845_INTERFACE( crtc_intf ) +{ + true, + 32, + NULL, + abc1600_update_row, + NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + crtc_update }; -// IOWR1 registers -enum -{ - LDFX_HB = 0, - LDFX_LB, - LDFY_HB, - LDFY_LB, - WRML = 5, - WRDL = 7 -}; +//------------------------------------------------- +// MACHINE_CONFIG_FRAGMENT( abc1600_mover ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( abc1600_mover ) + MCFG_DEFAULT_LAYOUT(layout_abc1600) + + MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) + MCFG_SCREEN_REFRESH_RATE(60) + MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate + MCFG_SCREEN_UPDATE_DRIVER(abc1600_mover_device, screen_update) + MCFG_SCREEN_SIZE(958, 1067) + MCFG_SCREEN_VISIBLE_AREA(0, 958-1, 0, 1067-1) + + MCFG_MC6845_ADD(SY6845E_TAG, SY6845E, SCREEN_TAG, XTAL_64MHz/32, crtc_intf) +MACHINE_CONFIG_END -// IOWR2 registers -enum +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor abc1600_mover_device::device_mconfig_additions() const { - WRMASK_STROBE_HB = 0, - WRMASK_STROBE_LB, - ENABLE_CLOCKS, - FLAG_STROBE, - ENDISP -}; + return MACHINE_CONFIG_NAME( abc1600_mover ); +} //************************************************************************** -// READ/WRITE HANDLERS +// LIVE DEVICE //************************************************************************** +//------------------------------------------------- +// abc1600_mover_device - constructor +//------------------------------------------------- + +abc1600_mover_device::abc1600_mover_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, ABC1600_MOVER, "ABC 1600 Mover", tag, owner, clock, "abc1600mover", __FILE__), + device_memory_interface(mconfig, *this), + m_space_config("vram", ENDIANNESS_BIG, 16, 18, -1, *ADDRESS_MAP_NAME(mover_map)), + m_crtc(*this, SY6845E_TAG), + m_wrmsk_rom(*this, "wrmsk"), + m_shinf_rom(*this, "shinf"), + m_drmsk_rom(*this, "drmsk") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void abc1600_mover_device::device_start() +{ + // state saving + save_item(NAME(m_endisp)); + save_item(NAME(m_clocks_disabled)); + save_item(NAME(m_gmdi)); + save_item(NAME(m_wrm)); + save_item(NAME(m_ms)); + save_item(NAME(m_ds)); + save_item(NAME(m_flag)); + save_item(NAME(m_xsize)); + save_item(NAME(m_ysize)); + save_item(NAME(m_udx)); + save_item(NAME(m_udy)); + save_item(NAME(m_xfrom)); + save_item(NAME(m_xto)); + save_item(NAME(m_yto)); + save_item(NAME(m_ty)); + save_item(NAME(m_mfa)); + save_item(NAME(m_mta)); + save_item(NAME(m_sh)); + save_item(NAME(m_mdor)); + save_item(NAME(m_hold_1w_cyk)); + save_item(NAME(m_wrms0)); + save_item(NAME(m_wrms1)); + save_item(NAME(m_rmc)); + save_item(NAME(m_cmc)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void abc1600_mover_device::device_reset() +{ + // disable display + m_clocks_disabled = 1; + m_endisp = 0; +} + + +//------------------------------------------------- +// memory_space_config - return a description of +// any address spaces owned by this device +//------------------------------------------------- + +const address_space_config *abc1600_mover_device::memory_space_config(address_spacenum spacenum) const +{ + return (spacenum == AS_0) ? &m_space_config : NULL; +} + + //------------------------------------------------- // read_videoram - //------------------------------------------------- -inline UINT16 abc1600_state::read_videoram(UINT32 offset) +inline UINT16 abc1600_mover_device::read_videoram(offs_t offset) { - return m_video_ram[offset & VIDEORAM16_MASK]; + return space().read_word((offset & VIDEORAM16_MASK) << 1); } @@ -88,11 +338,11 @@ inline UINT16 abc1600_state::read_videoram(UINT32 offset) // write_videoram - //------------------------------------------------- -inline void abc1600_state::write_videoram(UINT32 offset, UINT16 data, UINT16 mask) +inline void abc1600_mover_device::write_videoram(offs_t offset, UINT16 data, UINT16 mask) { - UINT16 old_data = m_video_ram[offset & VIDEORAM16_MASK]; + UINT16 old_data = read_videoram(offset); - m_video_ram[offset & VIDEORAM16_MASK] = (data & mask) | (old_data & (mask ^ 0xffff)); + space().write_word((offset & VIDEORAM16_MASK) << 1, (data & mask) | (old_data & (mask ^ 0xffff))); } @@ -100,18 +350,18 @@ inline void abc1600_state::write_videoram(UINT32 offset, UINT16 data, UINT16 mas // video_ram_r - //------------------------------------------------- -READ8_MEMBER( abc1600_state::video_ram_r ) +READ8_MEMBER( abc1600_mover_device::video_ram_r ) { - UINT32 addr = (offset & VIDEORAM8_MASK) >> 1; + offs_t addr = (offset & VIDEORAM8_MASK) >> 1; UINT8 data = 0; if (offset & 0x01) { - data = m_video_ram[addr] & 0xff; + data = read_videoram(addr) & 0xff; } else { - data = m_video_ram[addr] >> 8; + data = read_videoram(addr) >> 8; } return data; @@ -122,9 +372,9 @@ READ8_MEMBER( abc1600_state::video_ram_r ) // video_ram_w - //------------------------------------------------- -WRITE8_MEMBER( abc1600_state::video_ram_w ) +WRITE8_MEMBER( abc1600_mover_device::video_ram_w ) { - UINT32 addr = (offset & VIDEORAM8_MASK) >> 1; + offs_t addr = (offset & VIDEORAM8_MASK) >> 1; if (offset & 0x01) { @@ -143,7 +393,7 @@ WRITE8_MEMBER( abc1600_state::video_ram_w ) write_videoram(addr, m_gmdi, m_wrm & 0x00ff); - if (LOG) logerror("Video RAM write LB to %05x : %04x\n", addr, m_video_ram[addr]); + if (LOG) logerror("Video RAM write LB to %05x : %04x\n", addr, read_videoram(addr)); } else { @@ -162,7 +412,7 @@ WRITE8_MEMBER( abc1600_state::video_ram_w ) write_videoram(addr, m_gmdi, m_wrm & 0xff00); - if (LOG) logerror("Video RAM write HB to %05x : %04x\n", addr, m_video_ram[addr]); + if (LOG) logerror("Video RAM write HB to %05x : %04x\n", addr, read_videoram(addr)); } } @@ -171,7 +421,7 @@ WRITE8_MEMBER( abc1600_state::video_ram_w ) // iord0_r - //------------------------------------------------- -READ8_MEMBER( abc1600_state::iord0_r ) +READ8_MEMBER( abc1600_mover_device::iord0_r ) { /* @@ -201,407 +451,488 @@ READ8_MEMBER( abc1600_state::iord0_r ) //------------------------------------------------- -// iowr0_w - +// ldsx_hb_w - //------------------------------------------------- -WRITE8_MEMBER( abc1600_state::iowr0_w ) +WRITE8_MEMBER( abc1600_mover_device::ldsx_hb_w ) { - switch (offset & 0x07) + /* + + bit description + + 0 XSIZE8 + 1 XSIZE9 + 2 U/D* Y + 3 U/D* X + 4 + 5 + 6 + 7 + + */ + + if (LOG) logerror("%s LDSX HB: %02x\n", machine().describe_context(), data); + + m_xsize = ((data & 0x03) << 8) | (m_xsize & 0xff); + m_udy = BIT(data, 2); + m_udx = BIT(data, 3); +} + + +//------------------------------------------------- +// ldsx_lb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldsx_lb_w ) +{ + /* + + bit description + + 0 XSIZE0 + 1 XSIZE1 + 2 XSIZE2 + 3 XSIZE3 + 4 XSIZE4 + 5 XSIZE5 + 6 XSIZE6 + 7 XSIZE7 + + */ + + if (LOG) logerror("%s LDSX LB: %02x\n", machine().describe_context(), data); + + m_xsize = (m_xsize & 0x300) | data; +} + + +//------------------------------------------------- +// ldsy_hb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldsy_hb_w ) +{ + /* + + bit description + + 0 YSIZE8 + 1 YSIZE9 + 2 YSIZE10 + 3 YSIZE11 + 4 + 5 + 6 + 7 + + */ + + if (LOG) logerror("%s LDSY HB: %02x\n", machine().describe_context(), data); + + m_ysize = ((data & 0x0f) << 8) | (m_ysize & 0xff); +} + + +//------------------------------------------------- +// ldsy_lb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldsy_lb_w ) +{ + /* + + bit description + + 0 YSIZE0 + 1 YSIZE1 + 2 YSIZE2 + 3 YSIZE3 + 4 YSIZE4 + 5 YSIZE5 + 6 YSIZE6 + 7 YSIZE7 + + */ + + if (LOG) logerror("%s LDSY LB: %02x\n", machine().describe_context(), data); + + m_ysize = (m_ysize & 0xf00) | data; +} + + +//------------------------------------------------- +// ldtx_hb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldtx_hb_w ) +{ + /* + + bit description + + 0 XTO8, MTA4 + 1 XTO9, MTA5 + 2 + 3 + 4 + 5 + 6 + 7 + + */ + + if (LOG) logerror("%s LDTX HB: %02x\n", machine().describe_context(), data); + + m_xto = ((data & 0x03) << 8) | (m_xto & 0xff); + m_mta = (m_mta & 0x3ffcf) | ((data & 0x03) << 4); +} + + +//------------------------------------------------- +// ldtx_lb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldtx_lb_w ) +{ + /* + + bit description + + 0 XTO0 + 1 XTO1 + 2 XTO2 + 3 XTO3 + 4 XTO4, MTA0 + 5 XTO5, MTA1 + 6 XTO6, MTA2 + 7 XTO7, MTA3 + + */ + + if (LOG) logerror("%s LDTX LB: %02x\n", machine().describe_context(), data); + + m_xto = (m_xto & 0x300) | data; + m_mta = (m_mta & 0x3fff0) | (data >> 4); +} + + +//------------------------------------------------- +// ldty_hb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldty_hb_w ) +{ + /* + + bit description + + 0 YTO8, MTA14 + 1 YTO9, MTA15 + 2 YTO10, MTA16 + 3 YTO11, MTA17 + 4 + 5 + 6 + 7 + + */ + + if (LOG) logerror("%s LDTY HB: %02x\n", machine().describe_context(), data); + + m_ty = ((data & 0x0f) << 8) | (m_yto & 0xff); + m_yto = ((data & 0x0f) << 8) | (m_yto & 0xff); + m_mta = ((data & 0x0f) << 14) | (m_mta & 0x3fff); +} + + +//------------------------------------------------- +// ldty_lb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldty_lb_w ) +{ + /* + + bit description + + 0 YTO0, MTA6 + 1 YTO1, MTA7 + 2 YTO2, MTA8 + 3 YTO3, MTA9 + 4 YTO4, MTA10 + 5 YTO5, MTA11 + 6 YTO6, MTA12 + 7 YTO7, MTA13 + + */ + + if (LOG) logerror("%s LDTY LB: %02x\n", machine().describe_context(), data); + + m_ty = (m_ty & 0xf00) | data; + m_yto = (m_yto & 0xf00) | data; + m_mta = (m_mta & 0x3c03f) | (data << 6); +} + + +//------------------------------------------------- +// ldfx_hb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldfx_hb_w ) +{ + /* + + bit description + + 0 XFROM8, MFA4 + 1 XFROM9, MFA5 + 2 + 3 + 4 + 5 + 6 + 7 + + */ + + if (LOG) logerror("%s LDFX HB: %02x\n", machine().describe_context(), data); + + m_xfrom = ((data & 0x03) << 8) | (m_xfrom & 0xff); + m_mfa = (m_mfa & 0x3ffcf) | ((data & 0x03) << 4); +} + + +//------------------------------------------------- +// ldfx_lb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldfx_lb_w ) +{ + /* + + bit description + + 0 XFROM0 + 1 XFROM1 + 2 XFROM2 + 3 XFROM3 + 4 XFROM4, MFA0 + 5 XFROM5, MFA1 + 6 XFROM6, MFA2 + 7 XFROM7, MFA3 + + */ + + if (LOG) logerror("%s LDFX LB: %02x\n", machine().describe_context(), data); + + m_xfrom = (m_xfrom & 0x300) | data; + m_mfa = (m_mfa & 0x3fff0) | (data >> 4); +} + + +//------------------------------------------------- +// ldfy_hb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldfy_hb_w ) +{ + /* + + bit description + + 0 MFA14 + 1 MFA15 + 2 MFA16 + 3 MFA17 + 4 + 5 + 6 + 7 + + */ + + if (LOG) logerror("%s LDFY HB: %02x\n", machine().describe_context(), data); + + m_mfa = ((data & 0x0f) << 14) | (m_mfa & 0x3fff); +} + + +//------------------------------------------------- +// ldfy_lb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::ldfy_lb_w ) +{ + /* + + bit description + + 0 MFA6 + 1 MFA7 + 2 MFA8 + 3 MFA9 + 4 MFA10 + 5 MFA11 + 6 MFA12 + 7 MFA13 + + */ + + if (LOG) logerror("%s LDFY LB: %02x\n", machine().describe_context(), data); + + m_mfa = (m_mfa & 0x3c03f) | (data << 6); + + mover(); +} + + +//------------------------------------------------- +// wrml_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::wrml_w ) +{ + /* + + bit description + + 0 MOVE CYK CLK + 1 DISP CYC SEL / DISP CYK PRE FETCH (+1 PIXCLK) + 2 DATA CLK + 3 _DISP MEM WE + 4 _CAS HB + 5 DTACK CLK / BLANK TEST (+2 PIXCLK) + 6 DISPREC CLK + 7 _RAS HB + + */ + + if (LOG) logerror("MS %u : %02x\n", (offset >> 4) & 0x0f, data); + + if (m_clocks_disabled) { - case LDSX_HB: - /* - - bit description - - 0 XSIZE8 - 1 XSIZE9 - 2 U/D* Y - 3 U/D* X - 4 - 5 - 6 - 7 - - */ - - if (LOG) logerror("%s LDSX HB: %02x\n", machine().describe_context(), data); - - m_xsize = ((data & 0x03) << 8) | (m_xsize & 0xff); - m_udy = BIT(data, 2); - m_udx = BIT(data, 3); - break; - - case LDSX_LB: - /* - - bit description - - 0 XSIZE0 - 1 XSIZE1 - 2 XSIZE2 - 3 XSIZE3 - 4 XSIZE4 - 5 XSIZE5 - 6 XSIZE6 - 7 XSIZE7 - - */ - - if (LOG) logerror("%s LDSX LB: %02x\n", machine().describe_context(), data); - - m_xsize = (m_xsize & 0x300) | data; - break; - - case LDSY_HB: - /* - - bit description - - 0 YSIZE8 - 1 YSIZE9 - 2 YSIZE10 - 3 YSIZE11 - 4 - 5 - 6 - 7 - - */ - - if (LOG) logerror("%s LDSY HB: %02x\n", machine().describe_context(), data); - - m_ysize = ((data & 0x0f) << 8) | (m_ysize & 0xff); - break; - - case LDSY_LB: - /* - - bit description - - 0 YSIZE0 - 1 YSIZE1 - 2 YSIZE2 - 3 YSIZE3 - 4 YSIZE4 - 5 YSIZE5 - 6 YSIZE6 - 7 YSIZE7 - - */ - - if (LOG) logerror("%s LDSX LB: %02x\n", machine().describe_context(), data); - - m_ysize = (m_ysize & 0xf00) | data; - break; - - case LDTX_HB: - /* - - bit description - - 0 XTO8, MTA4 - 1 XTO9, MTA5 - 2 - 3 - 4 - 5 - 6 - 7 - - */ - - if (LOG) logerror("%s LDTX HB: %02x\n", machine().describe_context(), data); - - m_xto = ((data & 0x03) << 8) | (m_xto & 0xff); - m_mta = (m_mta & 0x3ffcf) | ((data & 0x03) << 4); - break; - - case LDTX_LB: - /* - - bit description - - 0 XTO0 - 1 XTO1 - 2 XTO2 - 3 XTO3 - 4 XTO4, MTA0 - 5 XTO5, MTA1 - 6 XTO6, MTA2 - 7 XTO7, MTA3 - - */ - - if (LOG) logerror("%s LDTX LB: %02x\n", machine().describe_context(), data); - - m_xto = (m_xto & 0x300) | data; - m_mta = (m_mta & 0x3fff0) | (data >> 4); - break; - - case LDTY_HB: - /* - - bit description - - 0 YTO8, MTA14 - 1 YTO9, MTA15 - 2 YTO10, MTA16 - 3 YTO11, MTA17 - 4 - 5 - 6 - 7 - - */ - - if (LOG) logerror("%s LDTY HB: %02x\n", machine().describe_context(), data); - - m_ty = ((data & 0x0f) << 8) | (m_yto & 0xff); - m_yto = ((data & 0x0f) << 8) | (m_yto & 0xff); - m_mta = ((data & 0x0f) << 14) | (m_mta & 0x3fff); - break; - - case LDTY_LB: - /* - - bit description - - 0 YTO0, MTA6 - 1 YTO1, MTA7 - 2 YTO2, MTA8 - 3 YTO3, MTA9 - 4 YTO4, MTA10 - 5 YTO5, MTA11 - 6 YTO6, MTA12 - 7 YTO7, MTA13 - - */ - - if (LOG) logerror("%s LDTY LB: %02x\n", machine().describe_context(), data); - - m_ty = (m_ty & 0xf00) | data; - m_yto = (m_yto & 0xf00) | data; - m_mta = (m_mta & 0x3c03f) | (data << 6); - break; + m_ms[(offset >> 4) & 0x0f] = data; } } //------------------------------------------------- -// iowr1_w - +// wrdl_w - //------------------------------------------------- -WRITE8_MEMBER( abc1600_state::iowr1_w ) +WRITE8_MEMBER( abc1600_mover_device::wrdl_w ) { - switch (offset & 0x07) + /* + + bit description + + 0 MOVE CYK CLK + 1 DISP CYC SEL / DISP CYK PRE FETCH (+1 PIXCLK) + 2 DATA CLK + 3 _DISP MEM WE + 4 _CAS HB + 5 DTACK CLK / BLANK TEST (+2 PIXCLK) + 6 DISPREC CLK + 7 _RAS HB + + */ + + if (LOG) logerror("WS %u : %02x\n", (offset >> 4) & 0x0f, data); + + if (m_clocks_disabled) { - case LDFX_HB: - /* - - bit description - - 0 XFROM8, MFA4 - 1 XFROM9, MFA5 - 2 - 3 - 4 - 5 - 6 - 7 - - */ - - if (LOG) logerror("%s LDFX HB: %02x\n", machine().describe_context(), data); - - m_xfrom = ((data & 0x03) << 8) | (m_xfrom & 0xff); - m_mfa = (m_mfa & 0x3ffcf) | ((data & 0x03) << 4); - break; - - case LDFX_LB: - /* - - bit description - - 0 XFROM0 - 1 XFROM1 - 2 XFROM2 - 3 XFROM3 - 4 XFROM4, MFA0 - 5 XFROM5, MFA1 - 6 XFROM6, MFA2 - 7 XFROM7, MFA3 - - */ - - if (LOG) logerror("%s LDFX LB: %02x\n", machine().describe_context(), data); - - m_xfrom = (m_xfrom & 0x300) | data; - m_mfa = (m_mfa & 0x3fff0) | (data >> 4); - break; - - case LDFY_HB: - /* - - bit description - - 0 MFA14 - 1 MFA15 - 2 MFA16 - 3 MFA17 - 4 - 5 - 6 - 7 - - */ - - if (LOG) logerror("%s LDFY HB: %02x\n", machine().describe_context(), data); - - m_mfa = ((data & 0x0f) << 14) | (m_mfa & 0x3fff); - break; - - case LDFY_LB: - /* - - bit description - - 0 MFA6 - 1 MFA7 - 2 MFA8 - 3 MFA9 - 4 MFA10 - 5 MFA11 - 6 MFA12 - 7 MFA13 - - */ - - if (LOG) logerror("%s LDFY LB: %02x\n", machine().describe_context(), data); - - m_mfa = (m_mfa & 0x3c03f) | (data << 6); - - mover(); - break; - - case WRML: - /* - - bit description - - 0 MOVE CYK CLK - 1 DISP CYC SEL / DISP CYK PRE FETCH (+1 PIXCLK) - 2 DATA CLK - 3 _DISP MEM WE - 4 _CAS HB - 5 DTACK CLK / BLANK TEST (+2 PIXCLK) - 6 DISPREC CLK - 7 _RAS HB - - */ - - if (LOG) logerror("MS %u : %02x\n", (offset >> 4) & 0x0f, data); - - if (m_clocks_disabled) - { - m_ms[(offset >> 4) & 0x0f] = data; - } - break; - - case WRDL: - /* - - bit description - - 0 MOVE CYK CLK - 1 DISP CYC SEL / DISP CYK PRE FETCH (+1 PIXCLK) - 2 DATA CLK - 3 _DISP MEM WE - 4 _CAS HB - 5 DTACK CLK / BLANK TEST (+2 PIXCLK) - 6 DISPREC CLK - 7 _RAS HB - - */ - - if (LOG) logerror("WS %u : %02x\n", (offset >> 4) & 0x0f, data); - - if (m_clocks_disabled) - { - m_ds[(offset >> 4) & 0x0f] = data; - } - break; + m_ds[(offset >> 4) & 0x0f] = data; } } //------------------------------------------------- -// iowr2_w - +// wrmask_strobe_hb_w - //------------------------------------------------- -WRITE8_MEMBER( abc1600_state::iowr2_w ) +WRITE8_MEMBER( abc1600_mover_device::wrmask_strobe_hb_w ) { - switch (offset & 0x07) + if (REPLACE) { - case WRMASK_STROBE_HB: - if (REPLACE) - { - // DATAPORT_HB - m_gmdi = (data << 8) | (m_gmdi & 0xff); - if (LOG) logerror("GMDI HB %04x\n", m_gmdi); - } - else - { - // WRPORT_HB - m_wrm = (data << 8) | (m_wrm & 0xff); - if (LOG) logerror("WRM HB %04x\n", m_gmdi); - } - break; - - case WRMASK_STROBE_LB: - if (REPLACE) - { - // DATAPORT_LB - m_gmdi = (m_gmdi & 0xff00) | data; - if (LOG) logerror("GMDI LB %04x\n", m_gmdi); - } - else - { - // WRPORT_LB - m_wrm = (m_wrm & 0xff00) | data; - if (LOG) logerror("WRM LB %04x\n", m_gmdi); - } - break; - - case ENABLE_CLOCKS: - if (LOG) logerror("ENABLE CLOCKS\n"); - m_clocks_disabled = 0; - break; - - case FLAG_STROBE: - /* - - bit description - - 0 L/_P FLAG - 1 BLANK FLAG - 2 PIX POL - 3 FRAME POL - 4 HOLD FY - 5 HOLD FX - 6 COMP MOVE FLAG - 7 REPLACE/SET & RESET - - */ - - m_flag = data; - if (LOG) logerror("FLAG %02x\n", m_flag); - break; - - case ENDISP: - if (LOG) logerror("ENDISP\n"); - m_endisp = 1; - break; + // DATAPORT_HB + m_gmdi = (data << 8) | (m_gmdi & 0xff); + if (LOG) logerror("GMDI HB %04x\n", m_gmdi); } + else + { + // WRPORT_HB + m_wrm = (data << 8) | (m_wrm & 0xff); + if (LOG) logerror("WRM HB %04x\n", m_gmdi); + } +} + + +//------------------------------------------------- +// wrmask_strobe_lb_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::wrmask_strobe_lb_w ) +{ + if (REPLACE) + { + // DATAPORT_LB + m_gmdi = (m_gmdi & 0xff00) | data; + if (LOG) logerror("GMDI LB %04x\n", m_gmdi); + } + else + { + // WRPORT_LB + m_wrm = (m_wrm & 0xff00) | data; + if (LOG) logerror("WRM LB %04x\n", m_gmdi); + } +} + + +//------------------------------------------------- +// enable_clocks_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::enable_clocks_w ) +{ + if (LOG) logerror("ENABLE CLOCKS\n"); + m_clocks_disabled = 0; +} + + +//------------------------------------------------- +// flag_strobe_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::flag_strobe_w ) +{ + /* + + bit description + + 0 L/_P FLAG + 1 BLANK FLAG + 2 PIX POL + 3 FRAME POL + 4 HOLD FY + 5 HOLD FX + 6 COMP MOVE FLAG + 7 REPLACE/SET & RESET + + */ + + m_flag = data; + if (LOG) logerror("FLAG %02x\n", m_flag); +} + + +//------------------------------------------------- +// endisp_w - +//------------------------------------------------- + +WRITE8_MEMBER( abc1600_mover_device::endisp_w ) +{ + m_endisp = 1; + if (LOG) logerror("ENDISP\n"); } @@ -614,7 +945,7 @@ WRITE8_MEMBER( abc1600_state::iowr2_w ) // clock_mfa_x - //------------------------------------------------- -inline void abc1600_state::clock_mfa_x() +inline void abc1600_mover_device::clock_mfa_x() { UINT16 mfa_y = m_mfa >> 6; UINT8 mfa_x = m_mfa & 0x3f; @@ -633,7 +964,7 @@ inline void abc1600_state::clock_mfa_x() // clock_mfa_y - //------------------------------------------------- -inline void abc1600_state::clock_mfa_y() +inline void abc1600_mover_device::clock_mfa_y() { UINT16 mfa_y = m_mfa >> 6; UINT8 mfa_x = m_mfa & 0x3f; @@ -652,7 +983,7 @@ inline void abc1600_state::clock_mfa_y() // clock_mta_x - //------------------------------------------------- -inline void abc1600_state::clock_mta_x() +inline void abc1600_mover_device::clock_mta_x() { UINT16 mta_y = m_mta >> 6; UINT8 mta_x = m_mta & 0x3f; @@ -668,7 +999,7 @@ inline void abc1600_state::clock_mta_x() // clock_mta_y - //------------------------------------------------- -inline void abc1600_state::clock_mta_y() +inline void abc1600_mover_device::clock_mta_y() { UINT16 mta_y = m_mta >> 6; UINT8 mta_x = m_mta & 0x3f; @@ -684,7 +1015,7 @@ inline void abc1600_state::clock_mta_y() // load_mfa_x - //------------------------------------------------- -inline void abc1600_state::load_mfa_x() +inline void abc1600_mover_device::load_mfa_x() { UINT16 mfa_y = m_mfa >> 6; UINT8 mfa_x = m_xfrom >> 4; @@ -697,7 +1028,7 @@ inline void abc1600_state::load_mfa_x() // load_mta_x - //------------------------------------------------- -inline void abc1600_state::load_mta_x() +inline void abc1600_mover_device::load_mta_x() { UINT16 mta_y = m_mta >> 6; UINT8 mta_x = m_xto >> 4; @@ -710,7 +1041,7 @@ inline void abc1600_state::load_mta_x() // load_xy_reg - //------------------------------------------------- -inline void abc1600_state::load_xy_reg() +inline void abc1600_mover_device::load_xy_reg() { if (L_P) return; @@ -726,7 +1057,7 @@ inline void abc1600_state::load_xy_reg() // compare_mta_x - //------------------------------------------------- -inline void abc1600_state::compare_mta_x() +inline void abc1600_mover_device::compare_mta_x() { UINT8 mta_x_end = ((m_xto + m_xsize) >> 4) & 0x3f; UINT8 mta_x = m_mta & 0x3f; @@ -744,7 +1075,7 @@ inline void abc1600_state::compare_mta_x() // compare_mta_y - //------------------------------------------------- -inline void abc1600_state::compare_mta_y() +inline void abc1600_mover_device::compare_mta_y() { int mta_y_end = (m_yto + m_ysize) & 0xfff; UINT16 mta_y = m_mta >> 6; @@ -760,7 +1091,7 @@ inline void abc1600_state::compare_mta_y() // get_shinf - //------------------------------------------------- -inline void abc1600_state::get_shinf() +inline void abc1600_mover_device::get_shinf() { /* @@ -790,7 +1121,7 @@ inline void abc1600_state::get_shinf() // get_drmsk - //------------------------------------------------- -inline UINT16 abc1600_state::get_drmsk() +inline UINT16 abc1600_mover_device::get_drmsk() { /* @@ -817,7 +1148,7 @@ inline UINT16 abc1600_state::get_drmsk() // get_wrmsk - get mover write mask //------------------------------------------------- -inline UINT16 abc1600_state::get_wrmsk() +inline UINT16 abc1600_mover_device::get_wrmsk() { /* @@ -851,7 +1182,7 @@ inline UINT16 abc1600_state::get_wrmsk() // barrel_shift - //------------------------------------------------- -inline UINT16 abc1600_state::barrel_shift(UINT16 gmdr) +inline UINT16 abc1600_mover_device::barrel_shift(UINT16 gmdr) { UINT16 rot = gmdr; @@ -870,7 +1201,7 @@ inline UINT16 abc1600_state::barrel_shift(UINT16 gmdr) // word_mixer - //------------------------------------------------- -inline UINT16 abc1600_state::word_mixer(UINT16 rot) +inline UINT16 abc1600_mover_device::word_mixer(UINT16 rot) { UINT16 drmsk = get_drmsk(); UINT16 gmdi = (rot & drmsk) | (m_mdor & (drmsk ^ 0xffff)); @@ -890,7 +1221,7 @@ inline UINT16 abc1600_state::word_mixer(UINT16 rot) // mover - //------------------------------------------------- -void abc1600_state::mover() +void abc1600_mover_device::mover() { if (LOG) logerror("XFROM %u XSIZE %u YSIZE %u XTO %u YTO %u MFA %05x MTA %05x U/D*X %u U/D*Y %u\n", m_xfrom, m_xsize, m_ysize, m_xto, m_yto, m_mfa, m_mta, m_udx, m_udy); @@ -946,169 +1277,17 @@ void abc1600_state::mover() m_amm = 0; } - - -//************************************************************************** -// CRT CONTROLLER -//************************************************************************** - -//------------------------------------------------- -// mc6845_interface crtc_intf -//------------------------------------------------- - -inline UINT16 abc1600_state::get_crtca(UINT16 ma, UINT8 ra, UINT8 column) +UINT32 abc1600_mover_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - /* - - bit description - - CRTCA0 0 - CRTCA1 0 - CRTCA2 CC1/MA1 - CRTCA3 CC2/MA2 - CRTCA4 CC3/MA3 - CRTCA5 CC4/MA4 - CRTCA6 RA0 - CRTCA7 RA1 - CRTCA8 RA2 - CRTCA9 RA3 - CRTCA10 CR0/MA8 - CRTCA11 CR1/MA9 - CRTCA12 CR2/MA10 - CRTCA13 CR3/MA11 - CRTCA14 CR4/MA12 - CRTCA15 CR5/MA13 - - */ - - UINT8 cc = (ma & 0xff) + column; - UINT8 cr = ma >> 8; - - return (cr << 10) | ((ra & 0x0f) << 6) | ((cc << 1) & 0x3c); -} - -void abc1600_state::crtc_update_row(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) -{ - if (y > 0x3ff) return; - - int x = HFP; - - for (int column = 0; column < x_count; column += 2) - { - UINT16 dma = get_crtca(ma, ra, column); - - // data is read out of video RAM in nibble mode by strobing CAS 4 times - for (int cas = 0; cas < 4; cas++) - { - UINT16 data = m_video_ram[dma + cas]; - - for (int bit = 0; bit < 16; bit++) - { - int color = (BIT(data, 15) ^ PIX_POL) & !BLANK; - - bitmap.pix32(y + VFP, x++) = RGB_MONOCHROME_GREEN[color]; - - data <<= 1; - } - } - } -} - -static MC6845_UPDATE_ROW( abc1600_update_row ) -{ - abc1600_state *state = device->machine().driver_data(); - state->crtc_update_row(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); -} - -static MC6845_ON_UPDATE_ADDR_CHANGED( crtc_update ) -{ -} - -static MC6845_INTERFACE( crtc_intf ) -{ - false, - 32, - NULL, - abc1600_update_row, - NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - crtc_update -}; - - - -//************************************************************************** -// VIDEO -//************************************************************************** - -void abc1600_state::video_start() -{ - // allocate video RAM - m_video_ram.allocate(VIDEORAM_SIZE); - - // state saving - save_item(NAME(m_endisp)); - save_item(NAME(m_clocks_disabled)); - save_item(NAME(m_gmdi)); - save_item(NAME(m_wrm)); - save_item(NAME(m_ms)); - save_item(NAME(m_ds)); - save_item(NAME(m_flag)); - save_item(NAME(m_xsize)); - save_item(NAME(m_ysize)); - save_item(NAME(m_udx)); - save_item(NAME(m_udy)); - save_item(NAME(m_xfrom)); - save_item(NAME(m_xto)); - save_item(NAME(m_yto)); - save_item(NAME(m_ty)); - save_item(NAME(m_mfa)); - save_item(NAME(m_mta)); - save_item(NAME(m_sh)); - save_item(NAME(m_mdor)); - save_item(NAME(m_hold_1w_cyk)); - save_item(NAME(m_wrms0)); - save_item(NAME(m_wrms1)); - save_item(NAME(m_rmc)); - save_item(NAME(m_cmc)); -} - - -UINT32 abc1600_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - // HACK expand visible area to workaround MC6845 - screen.set_visible_area(0, 958-1, 0, 1067-1); - if (m_endisp) { - bitmap.fill(FRAME_POL, cliprect); + bitmap.fill(RGB_MONOCHROME_GREEN[FRAME_POL], cliprect); m_crtc->screen_update(screen, bitmap, cliprect); } else { - bitmap.fill(get_black_pen(machine()), cliprect); + bitmap.fill(RGB_BLACK, cliprect); } return 0; } - - -//------------------------------------------------- -// MACHINE_CONFIG_FRAGMENT( abc1600_video ) -//------------------------------------------------- - -MACHINE_CONFIG_FRAGMENT( abc1600_video ) - MCFG_DEFAULT_LAYOUT(layout_abc1600) - - MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate - MCFG_SCREEN_UPDATE_DRIVER(abc1600_state, screen_update) - MCFG_SCREEN_SIZE(958, 1067) - MCFG_SCREEN_VISIBLE_AREA(0, 958-1, 0, 1067-1) - - MCFG_MC6845_ADD(SY6845E_TAG, SY6845E, SCREEN_TAG, XTAL_64MHz/32, crtc_intf) -MACHINE_CONFIG_END diff --git a/src/mess/video/abc1600.h b/src/mess/video/abc1600.h new file mode 100644 index 00000000000..3b5b9158439 --- /dev/null +++ b/src/mess/video/abc1600.h @@ -0,0 +1,150 @@ +/********************************************************************** + + Luxor ABC 1600 Mover emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __ABC1600_MOVER__ +#define __ABC1600_MOVER__ + +#include "emu.h" +#include "video/mc6845.h" + + + +///************************************************************************* +// INTERFACE CONFIGURATION MACROS +///************************************************************************* + +#define ABC1600_MOVER_TAG "mover" + + +#define MCFG_ABC1600_MOVER_ADD() \ + MCFG_DEVICE_ADD(ABC1600_MOVER_TAG, ABC1600_MOVER, 0) + + + +///************************************************************************* +// TYPE DEFINITIONS +///************************************************************************* + +// ======================> abc1600_mover_device + +class abc1600_mover_device : public device_t, + public device_memory_interface +{ +public: + // construction/destruction + abc1600_mover_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual const rom_entry *device_rom_region() const; + virtual machine_config_constructor device_mconfig_additions() const; + + virtual DECLARE_ADDRESS_MAP(vram_map, 8); + virtual DECLARE_ADDRESS_MAP(crtc_map, 8); + virtual DECLARE_ADDRESS_MAP(io_map, 8); + + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void crtc_update_row(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + + // device_memory_interface overrides + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; + +private: + inline UINT16 get_drmsk(); + inline void get_shinf(); + inline UINT16 get_wrmsk(); + inline UINT16 barrel_shift(UINT16 gmdr); + inline UINT16 word_mixer(UINT16 rot); + inline void clock_mfa_x(); + inline void clock_mfa_y(); + inline void clock_mta_x(); + inline void clock_mta_y(); + inline void load_mfa_x(); + inline void load_mta_x(); + inline void compare_mta_x(); + inline void compare_mta_y(); + inline void load_xy_reg(); + void mover(); + + DECLARE_READ8_MEMBER( video_ram_r ); + DECLARE_WRITE8_MEMBER( video_ram_w ); + + DECLARE_READ8_MEMBER( iord0_r ); + DECLARE_WRITE8_MEMBER( ldsx_hb_w ); + DECLARE_WRITE8_MEMBER( ldsx_lb_w ); + DECLARE_WRITE8_MEMBER( ldsy_hb_w ); + DECLARE_WRITE8_MEMBER( ldsy_lb_w ); + DECLARE_WRITE8_MEMBER( ldtx_hb_w ); + DECLARE_WRITE8_MEMBER( ldtx_lb_w ); + DECLARE_WRITE8_MEMBER( ldty_hb_w ); + DECLARE_WRITE8_MEMBER( ldty_lb_w ); + DECLARE_WRITE8_MEMBER( ldfx_hb_w ); + DECLARE_WRITE8_MEMBER( ldfx_lb_w ); + DECLARE_WRITE8_MEMBER( ldfy_hb_w ); + DECLARE_WRITE8_MEMBER( ldfy_lb_w ); + DECLARE_WRITE8_MEMBER( wrml_w ); + DECLARE_WRITE8_MEMBER( wrdl_w ); + DECLARE_WRITE8_MEMBER( wrmask_strobe_hb_w ); + DECLARE_WRITE8_MEMBER( wrmask_strobe_lb_w ); + DECLARE_WRITE8_MEMBER( enable_clocks_w ); + DECLARE_WRITE8_MEMBER( flag_strobe_w ); + DECLARE_WRITE8_MEMBER( endisp_w ); + + inline UINT16 read_videoram(offs_t offset); + inline void write_videoram(offs_t offset, UINT16 data, UINT16 mask); + inline UINT16 get_crtca(UINT16 ma, UINT8 ra, UINT8 column); + + const address_space_config m_space_config; + + required_device m_crtc; + required_memory_region m_wrmsk_rom; + required_memory_region m_shinf_rom; + required_memory_region m_drmsk_rom; + + int m_endisp; // enable display + int m_clocks_disabled; // clocks disabled + UINT16 m_gmdi; // video RAM data latch + UINT16 m_wrm; // write mask latch + UINT8 m_ms[16]; // mover sequence control + UINT8 m_ds[16]; // display sequence control + UINT8 m_flag; // flags + UINT16 m_xsize; // X size + UINT16 m_ysize; // Y size + int m_udx; // up/down X + int m_udy; // up/down Y + UINT16 m_xfrom; // X from + UINT16 m_xto; // X to + UINT16 m_yto; // Y to + UINT16 m_ty; // to Y + UINT32 m_mfa; // mover from address + UINT32 m_mta; // mover to address + UINT8 m_sh; // + UINT16 m_mdor; // + int m_hold_1w_cyk; // + int m_wrms0; // + int m_wrms1; // + int m_rmc; // row match count + int m_cmc; // column match count + int m_amm; // active mover mask +}; + + +// device type definition +extern const device_type ABC1600_MOVER; + + + +#endif