diff options
Diffstat (limited to 'src/mame/drivers/alphatro.cpp')
-rw-r--r-- | src/mame/drivers/alphatro.cpp | 335 |
1 files changed, 230 insertions, 105 deletions
diff --git a/src/mame/drivers/alphatro.cpp b/src/mame/drivers/alphatro.cpp index d1bf54cc73a..e07c89a1f3f 100644 --- a/src/mame/drivers/alphatro.cpp +++ b/src/mame/drivers/alphatro.cpp @@ -6,7 +6,7 @@ Driver by Barry Rodewald, Robbbert, R. Belmont and Carl - z80 + HD46505SP as a CRTC + Z80 + HD46505SP as a CRTC Other chips: 8251, 8257, 8259 Crystals: 16MHz, 17.73447MHz @@ -20,8 +20,8 @@ Natural keyboard is set up for bios 1. - ToDo: - - Newer ROM set from Team Europe and try to work out the graphics expansion + TODO: + - UKC romset should boot to a blue screen ***************************************************************************/ @@ -38,8 +38,11 @@ #include "machine/bankdev.h" #include "machine/upd765.h" #include "machine/i8257.h" +#include "machine/pic8259.h" +#include "bus/centronics/ctronics.h" #include "bus/generic/carts.h" #include "bus/generic/slot.h" +#include "bus/rs232/rs232.h" #include "sound/beep.h" #include "video/mc6845.h" #include "emupal.h" @@ -51,9 +54,10 @@ class alphatro_state : public driver_device { public: - alphatro_state(const machine_config &mconfig, device_type type, const char *tag, bool is_ntsc) + alphatro_state(const machine_config &mconfig, device_type type, const char *tag, bool is_ntsc, bool is_bicom) : driver_device(mconfig, type, tag) , m_is_ntsc(is_ntsc) + , m_is_bicom(is_bicom) , m_ram(*this, RAM_TAG) , m_p_videoram(*this, "videoram") , m_p_chargen(*this, "chargen") @@ -69,8 +73,12 @@ public: , m_fdc(*this, "fdc") , m_floppy(*this, "fdc:%u", 0U) , m_dmac(*this, "dmac") + , m_pic(*this, "pic") + , m_centronics(*this, "centronics") , m_config(*this, "CONFIG") , m_cart(*this, "cartslot") + , m_centronics_ack(0) + , m_centronics_busy(0) { } void alphatro(machine_config &config); @@ -82,23 +90,15 @@ protected: virtual void machine_reset() override; private: - uint8_t ram0000_r(offs_t offset); - void ram0000_w(offs_t offset, uint8_t data); - uint8_t ram6000_r(offs_t offset); - void ram6000_w(offs_t offset, uint8_t data); - uint8_t rama000_r(offs_t offset); - void rama000_w(offs_t offset, uint8_t data); - uint8_t rame000_r(offs_t offset); - void rame000_w(offs_t offset, uint8_t data); + uint8_t bicom_r(offs_t offset); + void bicom_w(offs_t offset, uint8_t data); uint8_t port10_r(); void port10_w(uint8_t data); void port20_w(uint8_t data); uint8_t port30_r(); - void port30_w(uint8_t data); uint8_t portf0_r(); void portf0_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER(hrq_w); - DECLARE_WRITE_LINE_MEMBER(fdc_irq_w); void alphatro_palette(palette_device &palette) const; DECLARE_WRITE_LINE_MEMBER(kansas_r); DECLARE_WRITE_LINE_MEMBER(kansas_w); @@ -115,12 +115,13 @@ private: void update_banking(); const bool m_is_ntsc; + const bool m_is_bicom; uint8_t *m_ram_ptr; required_device<ram_device> m_ram; required_shared_ptr<u8> m_p_videoram; u8 m_flashcnt; u8 m_cass_data[4]; - u8 m_port_10, m_port_20, m_port_30, m_port_f0; + u8 m_port_10, m_port_20, m_port_f0; bool m_cassbit; bool m_cassold, m_fdc_irq; required_region_ptr<u8> m_p_chargen; @@ -134,15 +135,24 @@ private: required_device<upd765a_device> m_fdc; required_device_array<floppy_connector, 2> m_floppy; required_device<i8257_device> m_dmac; + required_device<pic8259_device> m_pic; + required_device<centronics_device> m_centronics; required_ioport m_config; required_device<generic_slot_device> m_cart; + + int m_centronics_ack; + int m_centronics_busy; + + std::unique_ptr<uint8_t[]> m_bicom_ram; + uint16_t m_bicom_addr; + uint8_t m_bicom_en; }; class alphatro_pal_state : public alphatro_state { public: alphatro_pal_state(const machine_config &mconfig, device_type type, const char *tag) - : alphatro_state(mconfig, type, tag, false) + : alphatro_state(mconfig, type, tag, false, false) { } }; @@ -150,13 +160,21 @@ class alphatro_ntsc_state : public alphatro_state { public: alphatro_ntsc_state(const machine_config &mconfig, device_type type, const char *tag) - : alphatro_state(mconfig, type, tag, true) + : alphatro_state(mconfig, type, tag, true, false) + { } +}; + +class alphatro_bicom_state : public alphatro_state +{ +public: + alphatro_bicom_state(const machine_config &mconfig, device_type type, const char *tag) + : alphatro_state(mconfig, type, tag, false, true) { } }; void alphatro_state::update_banking() { - if (m_port_10 & 0x80) // RAM at 0000? + if (BIT(m_port_10, 7)) // ROM access enable at 0000 { m_lowbank->set_bank(1); } @@ -165,7 +183,7 @@ void alphatro_state::update_banking() m_lowbank->set_bank(0); } - if (m_port_10 & 0x40) // ROM cartridge at A000 + if (BIT(m_port_10, 6)) // ROM pack enable at A000 { m_cartbank->set_bank(0); } @@ -174,13 +192,13 @@ void alphatro_state::update_banking() m_cartbank->set_bank(1); } - if (m_port_20 & 0x08) // VRAM at F000? + if (BIT(m_port_20, 3)) // select V-RAM at F000 { m_monbank->set_bank(0); } else { - if (m_port_20 & 0x40) // IPL or Monitor at F000? + if (BIT(m_port_20, 6)) // Monitor ROM address select { m_monbank->set_bank(2); } @@ -191,36 +209,56 @@ void alphatro_state::update_banking() } } -uint8_t alphatro_state::ram0000_r(offs_t offset) +uint8_t alphatro_state::bicom_r(offs_t offset) { - if (offset < 0xf000) + u8 retval = 0x00; + + switch (offset & 0x03) { - return m_ram_ptr[offset]; + case 0: + // color code + retval = m_bicom_ram[m_bicom_addr]; + break; + case 1: + // address low + retval = m_bicom_addr & 0x00ff; + break; + case 2: + // address high + retval = (m_bicom_addr & 0xff00) >> 8; + break; + case 3: + // graphic enable + retval = m_bicom_en; + break; } - return m_p_videoram[offset & 0xfff]; + return retval; } -void alphatro_state::ram0000_w(offs_t offset, uint8_t data) +void alphatro_state::bicom_w(offs_t offset, uint8_t data) { - - if (offset < 0xf000) + switch (offset & 0x03) { - m_ram_ptr[offset] = data; - } - else - { - m_p_videoram[offset & 0xfff] = data; + case 0: + // color code + m_bicom_ram[m_bicom_addr] = data; + break; + case 1: + // address low + m_bicom_addr = (m_bicom_addr & 0xff00) | data; + break; + case 2: + // address high + m_bicom_addr = (m_bicom_addr & 0x00ff) | (data << 8); + break; + case 3: + // graphic enable + m_bicom_en = data; + break; } } -uint8_t alphatro_state::ram6000_r(offs_t offset) { return m_ram_ptr[offset+0x6000]; } -void alphatro_state::ram6000_w(offs_t offset, uint8_t data) { m_ram_ptr[offset+0x6000] = data; } -uint8_t alphatro_state::rama000_r(offs_t offset) { return m_ram_ptr[offset+0xa000]; } -void alphatro_state::rama000_w(offs_t offset, uint8_t data) { m_ram_ptr[offset+0xa000] = data; } -uint8_t alphatro_state::rame000_r(offs_t offset) { return m_ram_ptr[offset+0xe000]; } -void alphatro_state::rame000_w(offs_t offset, uint8_t data) { m_ram_ptr[offset+0xe000] = data; } - uint8_t alphatro_state::port10_r() { // Bit 0 -> 1 = FDC is installed, 0 = not @@ -232,8 +270,9 @@ uint8_t alphatro_state::port10_r() u8 retval = m_is_ntsc ? 0x40 : 0x00; - // we'll get "FDC present" and "graphics expansion present" from the config switches - retval |= (m_config->read() & 3); + // we'll get "FDC present" from the config switches + retval |= (m_config->read() & 0x3d); + retval |= m_is_bicom ? 0x02 : 0x00; if (!m_crtc->de_r()) { @@ -257,11 +296,20 @@ void alphatro_state::port10_w(uint8_t data) if (BIT(data ^ m_port_10, 0)) { if (BIT(data, 0)) - m_crtc->set_unscaled_clock(16_MHz_XTAL / 8); - else if (m_is_ntsc || system_bios() == 3) // kludge for bios 2, which expects a NTSC clock even for ~50 Hz video + { + if (m_is_bicom) + m_crtc->set_unscaled_clock(14.318181_MHz_XTAL / 8); + else + m_crtc->set_unscaled_clock(16_MHz_XTAL / 8); + } + else if (m_is_ntsc || m_is_bicom) + { m_crtc->set_unscaled_clock(14.318181_MHz_XTAL / 16); + } else + { m_crtc->set_unscaled_clock(17.73447_MHz_XTAL / 16); + } } m_port_10 = data; @@ -287,6 +335,8 @@ void alphatro_state::port20_w(uint8_t data) // Bit 6 -> 0 = Lower 4K of Monitor at F000, 1 = Upper 4K of Monitor at F000 // Bit 7 -> N/A + m_centronics->write_strobe(BIT(data, 2)); + m_port_20 = data; update_banking(); @@ -302,15 +352,12 @@ uint8_t alphatro_state::port30_r() u8 retval = 0; if (m_crtc->vsync_r()) retval |= 0x02; + if (m_centronics_ack) retval |= 0x04; + if (m_centronics_busy) retval |= 0x08; return retval; } -void alphatro_state::port30_w(uint8_t data) -{ - m_port_30 = data; -} - uint8_t alphatro_state::portf0_r() { return m_fdc_irq << 6; @@ -340,18 +387,19 @@ void alphatro_state::portf0_w(uint8_t data) MC6845_UPDATE_ROW( alphatro_state::crtc_update_row ) { rgb_t const *const pens = m_palette->palette()->entry_list_raw(); - bool palette = BIT(m_config->read(), 5); + bool palette = BIT(m_config->read(), 7); if (y==0) m_flashcnt++; u32 *p = &bitmap.pix(y); + u16 gfx_mem = 0x1d92 + (y * 228); // address of graphics pixel at (0,y) for (u16 x = 0; x < x_count; x++) { bool inv = (x == cursor_x); - u16 mem = (ma + x) & 0x7ff; - u8 chr = m_p_videoram[mem]; - u8 attr = m_p_videoram[mem | 0x800]; - u8 bg = (palette) ? 8 : attr & 7; // amber or RGB - u8 fg = (palette) ? 0 : (attr & 0x38) >> 3; + u16 chr_mem = (ma + x) & 0x7ff; + u8 chr = m_p_videoram[chr_mem]; + u8 attr = m_p_videoram[chr_mem | 0x800]; + u8 fg = (palette) ? 8 : BIT(attr, 0, 3); // amber or RGB + u8 bg = (palette) ? 0 : BIT(attr, 3, 3); if (BIT(attr, 7)) // reverse video { @@ -375,14 +423,29 @@ MC6845_UPDATE_ROW( alphatro_state::crtc_update_row ) } /* Display a scanline of a character (8 pixels) */ - *p++ = pens[BIT(gfx, 7) ? fg : bg]; - *p++ = pens[BIT(gfx, 6) ? fg : bg]; - *p++ = pens[BIT(gfx, 5) ? fg : bg]; - *p++ = pens[BIT(gfx, 4) ? fg : bg]; - *p++ = pens[BIT(gfx, 3) ? fg : bg]; - *p++ = pens[BIT(gfx, 2) ? fg : bg]; - *p++ = pens[BIT(gfx, 1) ? fg : bg]; - *p++ = pens[BIT(gfx, 0) ? fg : bg]; + for (int pixel = 0; pixel < 8; pixel++) + { + u8 chr_col = BIT(gfx, pixel ^ 7) ? fg : bg; + u8 gfx_col = 0; + + /* BiCom graphics installed and enabled */ + if (m_is_bicom && m_bicom_en) + { + u8 data = m_bicom_ram[gfx_mem & 0xffff]; + /* odd pixels = high nibble, even pixels = low nibble (accounting for double width pixels in 80 column mode) */ + int gfx_nibble = !BIT(pixel >> BIT(m_port_10, 0), 0); + gfx_col = BIT(data, gfx_nibble << 2, 3); + if (palette && gfx_col != 0) gfx_col = 8; // amber + + /* increment graphics pixel every pixel in 40 column mode, or every other pixel in 80 column mode */ + if (!BIT(m_port_10, 0) || (pixel & 1)) + { + if (gfx_nibble & 1) gfx_mem++; + } + } + + *p++ = pens[chr_col ^ gfx_col]; + } } } @@ -393,24 +456,22 @@ INPUT_CHANGED_MEMBER( alphatro_state::alphatro_break ) void alphatro_state::alphatro_map(address_map &map) { - map(0x0000, 0x5fff).m(m_lowbank, FUNC(address_map_bank_device::amap8)); - map(0x6000, 0x9fff).rw(FUNC(alphatro_state::ram6000_r), FUNC(alphatro_state::ram6000_w)); + map(0x0000, 0xffff).lrw8(NAME([this](offs_t offset) { return m_ram_ptr[offset]; }), NAME([this](offs_t offset, u8 data) { m_ram_ptr[offset] = data; })); + map(0x0000, 0x5fff).m("lowbank", FUNC(address_map_bank_device::amap8)); map(0xa000, 0xdfff).m("cartbank", FUNC(address_map_bank_device::amap8)); - map(0xe000, 0xefff).rw(FUNC(alphatro_state::rame000_r), FUNC(alphatro_state::rame000_w)); map(0xf000, 0xffff).m("monbank", FUNC(address_map_bank_device::amap8)); - } void alphatro_state::rombank_map(address_map &map) { - map(0x0000, 0x5fff).rom().region("roms", 0x0000).w(FUNC(alphatro_state::ram0000_w)); - map(0x6000, 0xbfff).rw(FUNC(alphatro_state::ram0000_r), FUNC(alphatro_state::ram0000_w)); + map(0x0000, 0x5fff).rom().region("roms", 0x0000).lw8(NAME([this](offs_t offset, u8 data) { m_ram_ptr[offset] = data; })); + map(0x6000, 0xbfff).lrw8(NAME([this](offs_t offset) { return m_ram_ptr[offset]; }), NAME([this](offs_t offset, u8 data) { m_ram_ptr[offset] = data; })); } void alphatro_state::cartbank_map(address_map &map) { - map(0x0000, 0x3fff).r(m_cart, FUNC(generic_slot_device::read_rom)).w(FUNC(alphatro_state::rama000_w)); - map(0x4000, 0x7fff).rw(FUNC(alphatro_state::rama000_r), FUNC(alphatro_state::rama000_w)); + map(0x0000, 0x3fff).r(m_cart, FUNC(generic_slot_device::read_rom)).lw8(NAME([this](offs_t offset, u8 data) { m_ram_ptr[offset + 0xa000] = data; })); + map(0x4000, 0x7fff).lrw8(NAME([this](offs_t offset) { return m_ram_ptr[offset + 0xa000]; }), NAME([this](offs_t offset, u8 data) { m_ram_ptr[offset + 0xa000] = data; })); } void alphatro_state::monbank_map(address_map &map) @@ -424,6 +485,7 @@ void alphatro_state::alphatro_io(address_map &map) { map.global_mask(0xff); map.unmap_value_high(); + map(0x00, 0x03).rw(FUNC(alphatro_state::bicom_r), FUNC(alphatro_state::bicom_w)); map(0x10, 0x10).rw(FUNC(alphatro_state::port10_r), FUNC(alphatro_state::port10_w)); map(0x20, 0x20).portr("X0").w(FUNC(alphatro_state::port20_w)); map(0x21, 0x21).portr("X1"); @@ -437,7 +499,7 @@ void alphatro_state::alphatro_io(address_map &map) map(0x29, 0x29).portr("X9"); map(0x2a, 0x2a).portr("XA"); map(0x2b, 0x2b).portr("XB"); - map(0x30, 0x30).rw(FUNC(alphatro_state::port30_r), FUNC(alphatro_state::port30_w)); + map(0x30, 0x30).r(FUNC(alphatro_state::port30_r)).w("cent_data_out", FUNC(output_latch_device::write)); // USART for cassette reading and writing map(0x40, 0x41).rw(m_usart, FUNC(i8251_device::read), FUNC(i8251_device::write)); // CRTC - HD46505 / HD6845SP @@ -446,8 +508,8 @@ void alphatro_state::alphatro_io(address_map &map) // 8257 DMAC map(0x60, 0x68).rw(m_dmac, FUNC(i8257_device::read), FUNC(i8257_device::write)); // 8259 PIT - //map(0x70, 0x72).r(FUNC(alphatro_state::)).w(FUNC(alphatro_state::)); - map(0xf0, 0xf0).r(FUNC(alphatro_state::portf0_r)).w(FUNC(alphatro_state::portf0_w)); + map(0x70, 0x71).rw(m_pic, FUNC(pic8259_device::read), FUNC(pic8259_device::write)); + map(0xf0, 0xf0).rw(FUNC(alphatro_state::portf0_r), FUNC(alphatro_state::portf0_w)); map(0xf8, 0xf8).rw(m_fdc, FUNC(upd765a_device::fifo_r), FUNC(upd765a_device::fifo_w)); map(0xf9, 0xf9).r(m_fdc, FUNC(upd765a_device::msr_r)); } @@ -563,13 +625,27 @@ static INPUT_PORTS_START( alphatro ) PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Break") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHANGED_MEMBER(DEVICE_SELF,alphatro_state,alphatro_break,0) PORT_START("CONFIG") - PORT_CONFNAME( 0x20, 0x00, "Monitor") - PORT_CONFSETTING( 0x00, "RGB") - PORT_CONFSETTING( 0x20, "Amber") - - PORT_CONFNAME(0x01, 0x00, "Floppy disk installed") - PORT_CONFSETTING(0x00, "Not present") - PORT_CONFSETTING(0x01, "Installed") + PORT_CONFNAME(0x01, 0x00, "FDD Unit installed") + PORT_DIPSETTING( 0x00, DEF_STR( No )) + PORT_DIPSETTING( 0x01, DEF_STR( Yes )) + + PORT_DIPNAME(0x1c, 0x00, "Character Set") PORT_DIPLOCATION("SW-102:1,2,3") + PORT_DIPSETTING( 0x00, "International") + PORT_DIPSETTING( 0x04, "German") + PORT_DIPSETTING( 0x08, "USA") + PORT_DIPSETTING( 0x0c, "French") + PORT_DIPSETTING( 0x10, "English") + PORT_DIPSETTING( 0x14, "Italian") + PORT_DIPSETTING( 0x18, "Spanish") + PORT_DIPSETTING( 0x1c, "reserved") + + PORT_DIPNAME(0x20, 0x00, "Printer Interface (LPRINT)") PORT_DIPLOCATION("SW-102:4") + PORT_DIPSETTING( 0x00, "Parallel") + PORT_DIPSETTING( 0x20, "Serial") + + PORT_CONFNAME(0x80, 0x00, "Monitor") + PORT_CONFSETTING( 0x00, "RGB") + PORT_CONFSETTING( 0x80, "Amber") INPUT_PORTS_END static const gfx_layout charlayout = @@ -591,11 +667,16 @@ void alphatro_state::machine_start() { m_port_10 = 0x01; + m_bicom_ram = make_unique_clear<uint8_t[]>(0x10000); + save_item(NAME(m_port_10)); save_item(NAME(m_port_20)); save_item(NAME(m_cass_data)); save_item(NAME(m_cassbit)); save_item(NAME(m_cassold)); + save_item(NAME(m_bicom_addr)); + save_item(NAME(m_bicom_en)); + save_pointer(NAME(m_bicom_ram), 0x10000); } void alphatro_state::machine_reset() @@ -612,6 +693,7 @@ void alphatro_state::machine_reset() m_usart->write_rxd(1); m_usart->write_cts(0); m_beep->set_state(0); + m_bicom_en = 0; } image_init_result alphatro_state::load_cart(device_image_interface &image, generic_slot_device *slot) @@ -705,11 +787,6 @@ WRITE_LINE_MEMBER(alphatro_state::kansas_r) m_usart->write_rxc(state); } -WRITE_LINE_MEMBER(alphatro_state::fdc_irq_w) -{ - m_fdc_irq = state ? false : true; -} - WRITE_LINE_MEMBER(alphatro_state::hrq_w) { m_maincpu->set_input_line(INPUT_LINE_HALT, state); @@ -721,17 +798,28 @@ static void alphatro_floppies(device_slot_interface &device) device.option_add("525dd", FLOPPY_525_DD); } +static DEVICE_INPUT_DEFAULTS_START(printer) + DEVICE_INPUT_DEFAULTS("RS232_TXBAUD", 0xff, RS232_BAUD_4800) + DEVICE_INPUT_DEFAULTS("RS232_RXBAUD", 0xff, RS232_BAUD_4800) + DEVICE_INPUT_DEFAULTS("RS232_DATABITS", 0xff, RS232_DATABITS_7) + DEVICE_INPUT_DEFAULTS("RS232_PARITY", 0xff, RS232_PARITY_EVEN) + DEVICE_INPUT_DEFAULTS("RS232_STOPBITS", 0xff, RS232_STOPBITS_2) +DEVICE_INPUT_DEFAULTS_END + void alphatro_state::alphatro(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 16_MHz_XTAL / 4); m_maincpu->set_addrmap(AS_PROGRAM, &alphatro_state::alphatro_map); m_maincpu->set_addrmap(AS_IO, &alphatro_state::alphatro_io); + m_maincpu->set_irq_acknowledge_callback(m_pic, FUNC(pic8259_device::inta_cb)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); if (m_is_ntsc) screen.set_raw(16_MHz_XTAL, 1016, 0, 640, 271, 0, 216); + else if (m_is_bicom) + screen.set_raw(14.318181_MHz_XTAL, 912, 0, 640, 312, 0, 264); else screen.set_raw(16_MHz_XTAL, 1016, 0, 640, 314, 0, 240); screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update)); @@ -745,7 +833,7 @@ void alphatro_state::alphatro(machine_config &config) /* Devices */ UPD765A(config, m_fdc, 16_MHz_XTAL / 2, true, true); // clocked through SED-9420C - m_fdc->intrq_wr_callback().set(FUNC(alphatro_state::fdc_irq_w)); + m_fdc->intrq_wr_callback().set([this] (int state){ m_fdc_irq = !state; }); m_fdc->drq_wr_callback().set(m_dmac, FUNC(i8257_device::dreq2_w)); FLOPPY_CONNECTOR(config, "fdc:0", alphatro_floppies, "525dd", floppy_image_device::default_pc_floppy_formats); FLOPPY_CONNECTOR(config, "fdc:1", alphatro_floppies, "525dd", floppy_image_device::default_pc_floppy_formats); @@ -753,24 +841,44 @@ void alphatro_state::alphatro(machine_config &config) I8257(config, m_dmac, 16_MHz_XTAL / 4); m_dmac->out_hrq_cb().set(FUNC(alphatro_state::hrq_w)); - m_dmac->in_memr_cb().set(FUNC(alphatro_state::ram0000_r)); - m_dmac->out_memw_cb().set(FUNC(alphatro_state::ram0000_w)); + m_dmac->in_memr_cb().set([this](offs_t offset) { return m_ram_ptr[offset]; }); + m_dmac->out_memw_cb().set([this](offs_t offset, u8 data) { m_ram_ptr[offset] = data; }); m_dmac->in_ior_cb<2>().set(m_fdc, FUNC(upd765a_device::dma_r)); m_dmac->out_iow_cb<2>().set(m_fdc, FUNC(upd765a_device::dma_w)); m_dmac->out_tc_cb().set(m_fdc, FUNC(upd765a_device::tc_line_w)); + PIC8259(config, m_pic, 0); + m_pic->in_sp_callback().set_constant(1); + m_pic->out_int_callback().set_inputline(m_maincpu, 0); + HD6845S(config, m_crtc, 16_MHz_XTAL / 8); m_crtc->set_screen("screen"); m_crtc->set_show_border_area(false); m_crtc->set_char_width(8); m_crtc->set_update_row_callback(FUNC(alphatro_state::crtc_update_row)); + m_crtc->out_vsync_callback().set(m_pic, FUNC(pic8259_device::ir7_w)); I8251(config, m_usart, 16_MHz_XTAL / 4); m_usart->txd_handler().set([this] (bool state) { m_cassbit = state; }); - - clock_device &usart_clock(CLOCK(config, "usart_clock", 16_MHz_XTAL / 4 / 13 / 16)); - usart_clock.signal_handler().set(FUNC(alphatro_state::kansas_w)); - usart_clock.signal_handler().append(FUNC(alphatro_state::kansas_r)); + m_usart->txd_handler().append("serial", FUNC(rs232_port_device::write_txd)); + m_usart->dtr_handler().set("serial", FUNC(rs232_port_device::write_dtr)); + m_usart->rts_handler().set("serial", FUNC(rs232_port_device::write_rts)); + m_usart->rxrdy_handler().set(m_pic, FUNC(pic8259_device::ir1_w)); + m_usart->txrdy_handler().set(m_pic, FUNC(pic8259_device::ir2_w)); + + clock_device &cass_clock(CLOCK(config, "cass_clock", 16_MHz_XTAL / 4 / 13 / 16)); // 19.2 kHz + cass_clock.signal_handler().set(FUNC(alphatro_state::kansas_w)); + cass_clock.signal_handler().append(FUNC(alphatro_state::kansas_r)); + + clock_device &serial_clock(CLOCK(config, "serial_clock", 16_MHz_XTAL / 4 / 13 / 4)); // 76.8 kHz 4800 baud (can be set with jumpers) + serial_clock.signal_handler().append(m_usart, FUNC(i8251_device::write_txc)); + serial_clock.signal_handler().append(m_usart, FUNC(i8251_device::write_rxc)); + + rs232_port_device &serial(RS232_PORT(config, "serial", default_rs232_devices, nullptr)); + serial.rxd_handler().set(m_usart, FUNC(i8251_device::write_rxd)); + serial.cts_handler().set(m_usart, FUNC(i8251_device::write_cts)); + serial.dsr_handler().set(m_usart, FUNC(i8251_device::write_dsr)); + serial.set_option_device_input_defaults("printer", DEVICE_INPUT_DEFAULTS_NAME(printer)); CASSETTE(config, m_cass); m_cass->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED); @@ -778,6 +886,12 @@ void alphatro_state::alphatro(machine_config &config) m_cass->set_interface("alphatro_cass"); SOFTWARE_LIST(config, "cass_list").set_original("alphatro_cass"); + CENTRONICS(config, m_centronics, centronics_devices, nullptr); + m_centronics->ack_handler().set([this](int state) { m_centronics_ack = !state; }); + m_centronics->busy_handler().set([this](int state) { m_centronics_busy = state; }); + output_latch_device ¢_data_out(OUTPUT_LATCH(config, "cent_data_out")); + m_centronics->set_output_latch(cent_data_out); + RAM(config, "ram").set_default_size("64K"); /* cartridge */ @@ -804,26 +918,37 @@ void alphatro_state::alphatro(machine_config &config) ROM_START( alphatro ) ROM_REGION( 0xa000, "roms", ROMREGION_ERASE00) ROM_SYSTEM_BIOS( 0, "pcb-ig", "Alphatronic PC PCB-IG" ) // correctly displays German Umlauts - ROMX_LOAD( "0_b4-6_ic1038.bin", 0x008000, 0x002000, CRC(e337db3b) SHA1(6010bade6a21975636383179903b58a4ca415e49), ROM_BIOS(0) ) - ROMX_LOAD( "1_b4-3_ic1058.bin", 0x000000, 0x002000, CRC(1509b15a) SHA1(225c36411de680eb8f4d6b58869460a58e60c0cf), ROM_BIOS(0) ) - ROMX_LOAD( "2_b4-3_ic1046.bin", 0x002000, 0x002000, CRC(998a865d) SHA1(294fe64e839ae6c4032d5db1f431c35e0d80d367), ROM_BIOS(0) ) - ROMX_LOAD( "3_b4-3_ic1037.bin", 0x004000, 0x002000, CRC(55cbafef) SHA1(e3376b92f80d5a698cdcb2afaa0f3ef4341dd624), ROM_BIOS(0) ) + ROMX_LOAD( "0_b4-6_ic1038.bin", 0x8000, 0x2000, CRC(e337db3b) SHA1(6010bade6a21975636383179903b58a4ca415e49), ROM_BIOS(0) ) + ROMX_LOAD( "1_b4-3_ic1058.bin", 0x0000, 0x2000, CRC(1509b15a) SHA1(225c36411de680eb8f4d6b58869460a58e60c0cf), ROM_BIOS(0) ) + ROMX_LOAD( "2_b4-3_ic1046.bin", 0x2000, 0x2000, CRC(998a865d) SHA1(294fe64e839ae6c4032d5db1f431c35e0d80d367), ROM_BIOS(0) ) + ROMX_LOAD( "3_b4-3_ic1037.bin", 0x4000, 0x2000, CRC(55cbafef) SHA1(e3376b92f80d5a698cdcb2afaa0f3ef4341dd624), ROM_BIOS(0) ) ROM_SYSTEM_BIOS( 1, "pcb-ii", "Alphatronic PC PCB-II") ROMX_LOAD( "613256.ic-1058", 0x0000, 0x6000, CRC(ceea4cb3) SHA1(b332dea0a2d3bb2978b8422eb0723960388bb467), ROM_BIOS(1) ) ROMX_LOAD( "2764.ic-1038", 0x8000, 0x2000, CRC(e337db3b) SHA1(6010bade6a21975636383179903b58a4ca415e49), ROM_BIOS(1) ) - ROM_SYSTEM_BIOS( 2, "bicom", "Alphatronic PC PCB-II with BICOM Graphics extension") // correctly displays German Umlauts - ROMX_LOAD( "613256.ic-1058", 0x0000, 0x6000, CRC(ceea4cb3) SHA1(b332dea0a2d3bb2978b8422eb0723960388bb467), ROM_BIOS(2) ) - ROMX_LOAD( "tapcgv2_ic1038.bin", 0x8000, 0x2000, CRC(446b4235) SHA1(ef835ae46b3fdfe6a6f394971396a577528e7b5a), ROM_BIOS(2) ) + ROM_SYSTEM_BIOS( 2, "term", "UKC Terminal") // University of Kent Terminal Emulator + ROMX_LOAD( "ukc-0.ic-1038", 0x8000, 0x2000, CRC(e337db3b) SHA1(6010bade6a21975636383179903b58a4ca415e49), ROM_BIOS(2) ) + ROMX_LOAD( "ukc-term.ic-1058", 0x0000, 0x2000, CRC(a1bc0926) SHA1(492ddd9088c0211355e9999e66dce0cd47c73d77), ROM_BIOS(2) ) ROM_REGION( 0x1000, "chargen", 0 ) - ROMX_LOAD( "4_b4-0_ic1067.bin", 0x000000, 0x001000, CRC(00796934) SHA1(8e70f77cfe3eb2ec2051f660518da5c9d409119a), ROM_BIOS(0) ) - ROMX_LOAD( "2732.ic-1067", 0x0000, 0x1000, CRC(61f38814) SHA1(35ba31c58a10d5bd1bdb202717792ca021dbe1a8), ROM_BIOS(1) ) - ROMX_LOAD( "b40r_ic1067.bin", 0x0000, 0x1000, CRC(543e3ee8) SHA1(3e6c6f8c85d3a5d0735edfec52709c5670ff1646), ROM_BIOS(2) ) + ROMX_LOAD( "4_b4-0_ic1067.bin", 0x0000, 0x1000, CRC(00796934) SHA1(8e70f77cfe3eb2ec2051f660518da5c9d409119a), ROM_BIOS(0) ) + ROMX_LOAD( "2732.ic-1067", 0x0000, 0x1000, CRC(61f38814) SHA1(35ba31c58a10d5bd1bdb202717792ca021dbe1a8), ROM_BIOS(1) ) + ROMX_LOAD( "charset.ic-1067", 0x0000, 0x1000, CRC(96a51551) SHA1(b4461e63d0b7ff405c9fabeb6e47f933ee18bd48), ROM_BIOS(2) ) ROM_END #define rom_alphatron rom_alphatro -COMP( 1983, alphatro, 0, 0, alphatro, alphatro, alphatro_pal_state, empty_init, "Triumph-Adler", "Alphatronic PC (PAL)", MACHINE_SUPPORTS_SAVE ) -COMP( 1983, alphatron, alphatro, 0, alphatro, alphatro, alphatro_ntsc_state, empty_init, "Triumph-Adler", "Alphatronic PC (NTSC)", MACHINE_SUPPORTS_SAVE ) +ROM_START( alphatrob ) + ROM_REGION( 0xa000, "roms", ROMREGION_ERASE00) + ROM_SYSTEM_BIOS( 0, "bicom", "Alphatronic PC PCB-II w/BiCom Graphics") // correctly displays German Umlauts + ROMX_LOAD( "613256_ic1058.bin", 0x0000, 0x8000, CRC(7fc5aa41) SHA1(f4727d1c5f1e5a2ce3a72e38aa37680d23b8e050), ROM_BIOS(0) ) + ROMX_LOAD( "tapcgv2_ic1038.bin", 0x8000, 0x2000, CRC(446b4235) SHA1(ef835ae46b3fdfe6a6f394971396a577528e7b5a), ROM_BIOS(0) ) + + ROM_REGION( 0x1000, "chargen", 0 ) + ROMX_LOAD( "b40r_ic1067.bin", 0x0000, 0x1000, CRC(543e3ee8) SHA1(3e6c6f8c85d3a5d0735edfec52709c5670ff1646), ROM_BIOS(0) ) +ROM_END + +COMP( 1983, alphatro, 0, 0, alphatro, alphatro, alphatro_pal_state, empty_init, "Triumph-Adler", "Alphatronic PC (PAL)", MACHINE_SUPPORTS_SAVE ) +COMP( 1983, alphatron, alphatro, 0, alphatro, alphatro, alphatro_ntsc_state, empty_init, "Triumph-Adler", "Alphatronic PC (NTSC)", MACHINE_SUPPORTS_SAVE ) +COMP( 1984, alphatrob, alphatro, 0, alphatro, alphatro, alphatro_bicom_state, empty_init, "Triumph-Adler", "Alphatronic PC w/BiCom Graphics", MACHINE_SUPPORTS_SAVE ) |