diff options
Diffstat (limited to 'src/devices/bus/ecbbus/grip.cpp')
-rw-r--r-- | src/devices/bus/ecbbus/grip.cpp | 93 |
1 files changed, 47 insertions, 46 deletions
diff --git a/src/devices/bus/ecbbus/grip.cpp b/src/devices/bus/ecbbus/grip.cpp index 3dea8a6b486..6ec37c878fd 100644 --- a/src/devices/bus/ecbbus/grip.cpp +++ b/src/devices/bus/ecbbus/grip.cpp @@ -35,7 +35,7 @@ // DEVICE DEFINITIONS //************************************************************************** -const device_type ECB_GRIP21 = device_creator<grip_device>; +DEFINE_DEVICE_TYPE(ECB_GRIP21, ecb_grip21_device, "ecb_grip21", "Conitec Datensysteme GRIP-2.1") @@ -109,7 +109,7 @@ ROM_END // rom_region - device-specific ROM region //------------------------------------------------- -const tiny_rom_entry *grip_device::device_rom_region() const +const tiny_rom_entry *ecb_grip21_device::device_rom_region() const { return ROM_NAME( grip21 ); } @@ -124,7 +124,7 @@ const tiny_rom_entry *grip_device::device_rom_region() const // ADDRESS_MAP( grip_mem ) //------------------------------------------------- -static ADDRESS_MAP_START( grip_mem, AS_PROGRAM, 8, grip_device ) +static ADDRESS_MAP_START( grip_mem, AS_PROGRAM, 8, ecb_grip21_device ) AM_RANGE(0x0000, 0x3fff) AM_ROM AM_RANGE(0x4000, 0x47ff) AM_RAM AM_RANGE(0x8000, 0xffff) AM_RAMBANK("videoram") @@ -135,7 +135,7 @@ ADDRESS_MAP_END // ADDRESS_MAP( grip_io ) //------------------------------------------------- -static ADDRESS_MAP_START( grip_io, AS_IO, 8, grip_device ) +static ADDRESS_MAP_START( grip_io, AS_IO, 8, ecb_grip21_device ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_READWRITE(cxstb_r, cxstb_w) // AM_RANGE(0x10, 0x10) AM_WRITE(ccon_w) @@ -227,7 +227,7 @@ ADDRESS_MAP_END // mc6845 //------------------------------------------------- -MC6845_UPDATE_ROW( grip_device::crtc_update_row ) +MC6845_UPDATE_ROW( ecb_grip21_device::crtc_update_row ) { for (int column = 0; column < x_count; column++) { @@ -244,7 +244,7 @@ MC6845_UPDATE_ROW( grip_device::crtc_update_row ) } } /* -MC6845_UPDATE_ROW( grip_device::grip5_update_row ) +MC6845_UPDATE_ROW( ecb_grip21_device::grip5_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); int column, bit; @@ -264,7 +264,7 @@ MC6845_UPDATE_ROW( grip_device::grip5_update_row ) } } -MC6845_ON_UPDATE_ADDR_CHANGED( grip_device::grip5_addr_changed ) +MC6845_ON_UPDATE_ADDR_CHANGED( ecb_grip21_device::grip5_addr_changed ) { } */ @@ -275,7 +275,7 @@ static const int16_t speaker_levels[] = { -32768, 0, 32767, 0 }; // I8255A interface //------------------------------------------------- -READ8_MEMBER( grip_device::ppi_pa_r ) +READ8_MEMBER( ecb_grip21_device::ppi_pa_r ) { /* @@ -295,7 +295,7 @@ READ8_MEMBER( grip_device::ppi_pa_r ) return m_ppi_pa; } -WRITE8_MEMBER( grip_device::ppi_pa_w ) +WRITE8_MEMBER( ecb_grip21_device::ppi_pa_w ) { /* @@ -315,7 +315,7 @@ WRITE8_MEMBER( grip_device::ppi_pa_w ) m_ppi_pa = data; } -READ8_MEMBER( grip_device::ppi_pb_r ) +READ8_MEMBER( ecb_grip21_device::ppi_pb_r ) { /* @@ -335,7 +335,7 @@ READ8_MEMBER( grip_device::ppi_pb_r ) return m_keydata; } -WRITE8_MEMBER( grip_device::ppi_pc_w ) +WRITE8_MEMBER( ecb_grip21_device::ppi_pc_w ) { /* @@ -371,12 +371,12 @@ WRITE8_MEMBER( grip_device::ppi_pc_w ) // Z80STI_INTERFACE( sti_intf ) //------------------------------------------------- -WRITE_LINE_MEMBER(grip_device::write_centronics_busy) +WRITE_LINE_MEMBER(ecb_grip21_device::write_centronics_busy) { m_centronics_busy = state; } -READ8_MEMBER( grip_device::sti_gpio_r ) +READ8_MEMBER( ecb_grip21_device::sti_gpio_r ) { /* @@ -413,7 +413,7 @@ READ8_MEMBER( grip_device::sti_gpio_r ) return data; } -WRITE_LINE_MEMBER( grip_device::speaker_w ) +WRITE_LINE_MEMBER( ecb_grip21_device::speaker_w ) { int level = state && ((m_vol1 << 1) | m_vol0); @@ -435,7 +435,7 @@ static const z80_daisy_config grip_daisy_chain[] = // ASCII_KEYBOARD_INTERFACE( kb_intf ) //------------------------------------------------- -WRITE8_MEMBER( grip_device::kb_w ) +void ecb_grip21_device::kb_w(uint8_t data) { if (!m_kbf) { @@ -482,33 +482,33 @@ static MACHINE_CONFIG_FRAGMENT( grip ) MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/4) MCFG_MC6845_SHOW_BORDER_AREA(true) MCFG_MC6845_CHAR_WIDTH(8) - MCFG_MC6845_UPDATE_ROW_CB(grip_device, crtc_update_row) + MCFG_MC6845_UPDATE_ROW_CB(ecb_grip21_device, crtc_update_row) MCFG_MC6845_OUT_DE_CB(DEVWRITELINE(Z80STI_TAG, z80sti_device, i1_w)) MCFG_MC6845_OUT_CUR_CB(DEVWRITELINE(Z80STI_TAG, z80sti_device, i1_w)) // MCFG_MC6845_ADD(HD6345_TAG, HD6345, SCREEN_TAG, XTAL_16MHz/4) MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0) - MCFG_I8255_IN_PORTA_CB(READ8(grip_device, ppi_pa_r)) - MCFG_I8255_OUT_PORTA_CB(WRITE8(grip_device, ppi_pa_w)) - MCFG_I8255_IN_PORTB_CB(READ8(grip_device, ppi_pb_r)) - MCFG_I8255_OUT_PORTC_CB(WRITE8(grip_device, ppi_pc_w)) + MCFG_I8255_IN_PORTA_CB(READ8(ecb_grip21_device, ppi_pa_r)) + MCFG_I8255_OUT_PORTA_CB(WRITE8(ecb_grip21_device, ppi_pa_w)) + MCFG_I8255_IN_PORTB_CB(READ8(ecb_grip21_device, ppi_pb_r)) + MCFG_I8255_OUT_PORTC_CB(WRITE8(ecb_grip21_device, ppi_pc_w)) MCFG_DEVICE_ADD(Z80STI_TAG, Z80STI, XTAL_16MHz/4) MCFG_Z80STI_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0)) - MCFG_Z80STI_IN_GPIO_CB(READ8(grip_device, sti_gpio_r)) - MCFG_Z80STI_OUT_TBO_CB(WRITELINE(grip_device, speaker_w)) + MCFG_Z80STI_IN_GPIO_CB(READ8(ecb_grip21_device, sti_gpio_r)) + MCFG_Z80STI_OUT_TBO_CB(WRITELINE(ecb_grip21_device, speaker_w)) MCFG_Z80STI_OUT_TCO_CB(DEVWRITELINE(Z80STI_TAG, z80sti_device, tc_w)) MCFG_Z80STI_OUT_TDO_CB(DEVWRITELINE(Z80STI_TAG, z80sti_device, tc_w)) MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_devices, "printer") - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(grip_device, write_centronics_busy)) - MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(grip_device, write_centronics_fault)) + MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(ecb_grip21_device, write_centronics_busy)) + MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(ecb_grip21_device, write_centronics_fault)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0) - MCFG_GENERIC_KEYBOARD_CB(WRITE8(grip_device, kb_w)) + MCFG_GENERIC_KEYBOARD_CB(PUT(ecb_grip21_device, kb_w)) MACHINE_CONFIG_END @@ -517,7 +517,7 @@ MACHINE_CONFIG_END // machine configurations //------------------------------------------------- -machine_config_constructor grip_device::device_mconfig_additions() const +machine_config_constructor ecb_grip21_device::device_mconfig_additions() const { return MACHINE_CONFIG_NAME( grip ); } @@ -602,7 +602,7 @@ INPUT_PORTS_END // input_ports - device-specific input ports //------------------------------------------------- -ioport_constructor grip_device::device_input_ports() const +ioport_constructor ecb_grip21_device::device_input_ports() const { return INPUT_PORTS_NAME( grip ); } @@ -614,11 +614,11 @@ ioport_constructor grip_device::device_input_ports() const //************************************************************************** //------------------------------------------------- -// grip_device - constructor +// ecb_grip21_device - constructor //------------------------------------------------- -grip_device::grip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, ECB_GRIP21, "GRIP-2.1", tag, owner, clock, "grip", __FILE__), +ecb_grip21_device::ecb_grip21_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, ECB_GRIP21, tag, owner, clock), device_ecbbus_card_interface(mconfig, *this), m_ppi(*this, I8255A_TAG), m_sti(*this, Z80STI_TAG), @@ -629,7 +629,8 @@ grip_device::grip_device(const machine_config &mconfig, const char *tag, device_ m_video_ram(*this, "video_ram"), m_j3a(*this, "J3A"), m_j3b(*this, "J3B"), - m_j7(*this, "J7"), m_centronics_busy(0), m_centronics_fault(0), m_vol0(0), m_vol1(0), m_ia(0), m_ib(0), m_keydata(0), m_kbf(0), m_lps(0), m_page(0), m_flash(0), m_base(0), m_ppi_pa(0), m_ppi_pc(0), m_kb_timer(nullptr) + m_j7(*this, "J7"), + m_centronics_busy(0), m_centronics_fault(0), m_vol0(0), m_vol1(0), m_ia(0), m_ib(0), m_keydata(0), m_kbf(0), m_lps(0), m_page(0), m_flash(0), m_base(0), m_ppi_pa(0), m_ppi_pc(0), m_kb_timer(nullptr) { } @@ -637,7 +638,7 @@ grip_device::grip_device(const machine_config &mconfig, const char *tag, device_ // device_start - device-specific startup //------------------------------------------------- -void grip_device::device_start() +void ecb_grip21_device::device_start() { // allocate video RAM m_video_ram.allocate(VIDEORAM_SIZE); @@ -663,7 +664,7 @@ void grip_device::device_start() /* void grip5_state::machine_start() { - grip_device::machine_start(); + ecb_grip21_device::machine_start(); // setup ROM banking membank("eprom")->configure_entries(0, 2, memregion(Z80_TAG)->base(), 0x4000); @@ -678,7 +679,7 @@ void grip5_state::machine_start() // device_reset - device-specific reset //------------------------------------------------- -void grip_device::device_reset() +void ecb_grip21_device::device_reset() { m_base = m_j7->read(); m_page = 0; @@ -690,7 +691,7 @@ void grip_device::device_reset() // vol0_w - volume 0 //------------------------------------------------- -WRITE8_MEMBER( grip_device::vol0_w ) +WRITE8_MEMBER( ecb_grip21_device::vol0_w ) { m_vol0 = BIT(data, 7); } @@ -700,7 +701,7 @@ WRITE8_MEMBER( grip_device::vol0_w ) // vol1_w - volume 1 //------------------------------------------------- -WRITE8_MEMBER( grip_device::vol1_w ) +WRITE8_MEMBER( ecb_grip21_device::vol1_w ) { m_vol1 = BIT(data, 7); } @@ -710,7 +711,7 @@ WRITE8_MEMBER( grip_device::vol1_w ) // flash_w - //------------------------------------------------- -WRITE8_MEMBER( grip_device::flash_w ) +WRITE8_MEMBER( ecb_grip21_device::flash_w ) { m_flash = BIT(data, 7); } @@ -720,7 +721,7 @@ WRITE8_MEMBER( grip_device::flash_w ) // page_w - video page select //------------------------------------------------- -WRITE8_MEMBER( grip_device::page_w ) +WRITE8_MEMBER( ecb_grip21_device::page_w ) { m_page = BIT(data, 7); @@ -732,12 +733,12 @@ WRITE8_MEMBER( grip_device::page_w ) // stat_r - //------------------------------------------------- -WRITE_LINE_MEMBER(grip_device::write_centronics_fault) +WRITE_LINE_MEMBER(ecb_grip21_device::write_centronics_fault) { m_centronics_fault = state; } -READ8_MEMBER( grip_device::stat_r ) +READ8_MEMBER( ecb_grip21_device::stat_r ) { /* @@ -795,7 +796,7 @@ READ8_MEMBER( grip_device::stat_r ) // lrs_r - //------------------------------------------------- -READ8_MEMBER( grip_device::lrs_r ) +READ8_MEMBER( ecb_grip21_device::lrs_r ) { m_lps = 0; @@ -807,7 +808,7 @@ READ8_MEMBER( grip_device::lrs_r ) // lrs_w - //------------------------------------------------- -WRITE8_MEMBER( grip_device::lrs_w ) +WRITE8_MEMBER( ecb_grip21_device::lrs_w ) { m_lps = 0; } @@ -817,7 +818,7 @@ WRITE8_MEMBER( grip_device::lrs_w ) // cxstb_r - centronics strobe //------------------------------------------------- -READ8_MEMBER( grip_device::cxstb_r ) +READ8_MEMBER( ecb_grip21_device::cxstb_r ) { m_centronics->write_strobe(0); m_centronics->write_strobe(1); @@ -830,7 +831,7 @@ READ8_MEMBER( grip_device::cxstb_r ) // cxstb_w - centronics strobe //------------------------------------------------- -WRITE8_MEMBER( grip_device::cxstb_w ) +WRITE8_MEMBER( ecb_grip21_device::cxstb_w ) { m_centronics->write_strobe(0); m_centronics->write_strobe(1); @@ -862,7 +863,7 @@ WRITE8_MEMBER( grip5_state::dpage_w ) // ecbbus_io_r - I/O read //------------------------------------------------- -uint8_t grip_device::ecbbus_io_r(offs_t offset) +uint8_t ecb_grip21_device::ecbbus_io_r(offs_t offset) { uint8_t data = 0; @@ -890,7 +891,7 @@ uint8_t grip_device::ecbbus_io_r(offs_t offset) // ecbbus_io_w - I/O write //------------------------------------------------- -void grip_device::ecbbus_io_w(offs_t offset, uint8_t data) +void ecb_grip21_device::ecbbus_io_w(offs_t offset, uint8_t data) { if ((offset & 0xfe) == m_base) { |