diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2017-10-28 12:20:09 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2017-10-28 12:20:09 -0400 |
commit | 7744e97938be89593cf68585182ea619a04a39e8 (patch) | |
tree | 807b83ba5ae950066090eb5c0076113dd0052f42 | |
parent | e56806f7dcd93e47ade9b6da39a9d610e59acfdb (diff) |
bigbord2: Add 74LS259 latches (nw)
-rw-r--r-- | src/devices/machine/74259.cpp | 11 | ||||
-rw-r--r-- | src/devices/machine/74259.h | 1 | ||||
-rw-r--r-- | src/mame/drivers/bigbord2.cpp | 161 |
3 files changed, 82 insertions, 91 deletions
diff --git a/src/devices/machine/74259.cpp b/src/devices/machine/74259.cpp index da6a7cfa99d..021be2a1a34 100644 --- a/src/devices/machine/74259.cpp +++ b/src/devices/machine/74259.cpp @@ -324,6 +324,17 @@ WRITE8_MEMBER(addressable_latch_device::write_nibble) } //------------------------------------------------- +// write_nibble_alt - write handler using bit 3 of +// data as input and lowest three bits as address +// (offset is ignored) +//------------------------------------------------- + +WRITE8_MEMBER(addressable_latch_device::write_nibble_alt) +{ + write_bit(data & 0x07, BIT(data, 3)); +} + +//------------------------------------------------- // clear - pulse clear line from bus write //------------------------------------------------- diff --git a/src/devices/machine/74259.h b/src/devices/machine/74259.h index e4496240687..5cdb51e80f6 100644 --- a/src/devices/machine/74259.h +++ b/src/devices/machine/74259.h @@ -78,6 +78,7 @@ public: DECLARE_WRITE8_MEMBER(write_a0); DECLARE_WRITE8_MEMBER(write_a3); DECLARE_WRITE8_MEMBER(write_nibble); + DECLARE_WRITE8_MEMBER(write_nibble_alt); DECLARE_WRITE8_MEMBER(clear); // read handlers (inlined for the sake of optimization) diff --git a/src/mame/drivers/bigbord2.cpp b/src/mame/drivers/bigbord2.cpp index 3ee18f4f1df..5e5c39d958c 100644 --- a/src/mame/drivers/bigbord2.cpp +++ b/src/mame/drivers/bigbord2.cpp @@ -73,6 +73,7 @@ X - change banks #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/z80/z80daisy.h" +#include "machine/74259.h" #include "machine/clock.h" #include "machine/keyboard.h" #include "machine/wd_fdc.h" @@ -101,7 +102,7 @@ public: , m_fdc(*this, "fdc") , m_floppy0(*this, "fdc:0") , m_floppy1(*this, "fdc:1") - , m_beeper(*this, "beeper") + , m_syslatch1(*this, "syslatch1") , m_dsw(*this, "DSW") , m_bankr(*this, "bankr") , m_bankv(*this, "bankv") @@ -109,11 +110,14 @@ public: { } - DECLARE_WRITE8_MEMBER(portc0_w ); - DECLARE_WRITE8_MEMBER(portc8_w ); - DECLARE_WRITE8_MEMBER(portcc_w ); - DECLARE_READ8_MEMBER(portc4_r); - DECLARE_READ8_MEMBER(portd0_r); + DECLARE_WRITE_LINE_MEMBER(side_select_w); + DECLARE_WRITE_LINE_MEMBER(smc1_w); + DECLARE_WRITE_LINE_MEMBER(smc2_w); + DECLARE_WRITE_LINE_MEMBER(head_load_w); + DECLARE_WRITE_LINE_MEMBER(disk_motor_w); + DECLARE_WRITE8_MEMBER(syslatch2_w); + DECLARE_READ8_MEMBER(status_port_r); + DECLARE_READ8_MEMBER(kbd_r); void kbd_put(u8 data); DECLARE_WRITE_LINE_MEMBER(clock_w); DECLARE_WRITE_LINE_MEMBER(busreq_w); @@ -133,7 +137,6 @@ private: u8 m_term_data; u8 m_term_status; uint16_t m_cnt; - bool m_c8[8]; bool m_cc[8]; floppy_image_device *m_floppy; virtual void machine_start() override; @@ -151,18 +154,13 @@ private: required_device<mb8877_device> m_fdc; required_device<floppy_connector> m_floppy0; required_device<floppy_connector> m_floppy1; - required_device<beep_device> m_beeper; + required_device<ls259_device> m_syslatch1; required_ioport m_dsw; required_memory_bank m_bankr; required_memory_bank m_bankv; required_memory_bank m_banka; }; -// Eprom programming port -WRITE8_MEMBER( bigbord2_state::portc0_w ) -{ -} - /* Status port 0 = RXDA 1 = RXDB @@ -173,16 +171,16 @@ WRITE8_MEMBER( bigbord2_state::portc0_w ) 6 = DIPSW 3 7 = DIPSW 4 */ -READ8_MEMBER( bigbord2_state::portc4_r ) +READ8_MEMBER(bigbord2_state::status_port_r) { - u8 ret = m_term_status | 3 | (m_c8[6]<<2) | m_dsw->read(); + u8 ret = m_term_status | 3 | (m_syslatch1->q6_r() << 2) | m_dsw->read(); m_term_status = 0; return ret; } // KBD port - read ascii value of key pressed -READ8_MEMBER( bigbord2_state::portd0_r ) +READ8_MEMBER(bigbord2_state::kbd_r) { u8 ret = m_term_data; m_term_data = 0; @@ -249,73 +247,35 @@ WRITE8_MEMBER( bigbord2_state::io_write_byte ) /* Read/Write Handlers */ - -WRITE8_MEMBER( bigbord2_state::portc8_w ) +WRITE_LINE_MEMBER(bigbord2_state::side_select_w) { - /* - - This port uses a 74LS259, which allows individual bits - to be switched on and off, while the other bits are - unaffected. - - bit signal description - - 0 D_S memory bank - 1 SIDSEL side select - 2 SMC1 u6 data separator pin 5 - 3 SMC2 u6 data separator pin 6 - 4 DDEN density - 5 HLD head load - 6 MOTOR disk motor - 7 BELL beeper pulse - - */ + if (m_floppy) + m_floppy->ss_w(state); +} - m_c8[data&7] = BIT(data, 3); +WRITE_LINE_MEMBER(bigbord2_state::smc1_w) +{ + // connects to "U6 (FDC9216B)" which drives the fdc "rawread" and "rclk" pins +} - switch (data&7) - { - case 0: - // memory bank - m_bankr->set_entry(m_c8[0]); - m_bankv->set_entry(m_c8[0]); - m_banka->set_entry(m_c8[0]); - break; - case 1: - // side select - if (m_floppy) - { - m_floppy->ss_w(m_c8[1]); - } +WRITE_LINE_MEMBER(bigbord2_state::smc2_w) +{ + // connects to "U6 (FDC9216B)" which drives the fdc "rawread" and "rclk" pins +} - break; +WRITE_LINE_MEMBER(bigbord2_state::head_load_w) +{ + // connects to HLD pin on floppy drive +} - case 2: - case 3: - // these connect to "U6 (FDC9216B)" which drives the fdc "rawread" and "rclk" pins - break; - case 4: - // density - m_fdc->dden_w(m_c8[4]); - break; - case 5: - // connects to HLD pin on floppy drive - break; - case 6: - // motor on - if (m_floppy) - { - m_floppy->mon_w(m_c8[6]? 0 : 1); - } - break; - case 7: - // beeper - m_beeper->set_state(m_c8[7]); - break; - } +WRITE_LINE_MEMBER(bigbord2_state::disk_motor_w) +{ + // motor on + if (m_floppy) + m_floppy->mon_w(state ? 0 : 1); } -WRITE8_MEMBER( bigbord2_state::portcc_w ) +WRITE8_MEMBER(bigbord2_state::syslatch2_w) { /* @@ -346,6 +306,11 @@ WRITE8_MEMBER( bigbord2_state::portcc_w ) //if (BIT(data, 4)) m_floppy = m_floppy3->get_device(); m_fdc->set_floppy(m_floppy); + if (m_floppy) + { + m_floppy->ss_w(m_syslatch1->q1_r()); + m_floppy->mon_w(m_syslatch1->q6_r() ? 0 : 1); + } m_dma->rdy_w(m_cc[data & 7]); } @@ -369,16 +334,17 @@ static ADDRESS_MAP_START( bigbord2_io, AS_IO, 8, bigbord2_state ) AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("sio", z80sio_device, ba_cd_r, ba_cd_w) // u16 AM_RANGE(0x84, 0x87) AM_DEVREADWRITE("ctc1", z80ctc_device, read, write) // u37 has issues AM_RANGE(0x88, 0x8b) AM_DEVREADWRITE("ctc2", z80ctc_device, read, write) // u21 - AM_RANGE(0x8C, 0x8F) AM_DEVREADWRITE("dma", z80dma_device, read, write) // u62 - AM_RANGE(0xC0, 0xC3) AM_WRITE(portc0_w) // eprom programming port - AM_RANGE(0xC4, 0xC7) AM_READ (portc4_r) - AM_RANGE(0xC8, 0xCB) AM_WRITE(portc8_w) - AM_RANGE(0xCC, 0xCF) AM_WRITE(portcc_w) - AM_RANGE(0xD0, 0xD3) AM_READ (portd0_r) - AM_RANGE(0xD4, 0xD7) AM_DEVREADWRITE("fdc", mb8877_device, read, write) // u10 - //AM_RANGE(0xD8, 0xDB) AM_READWRITE(portd8_r, portd8_w) // various external data ports; DB = centronics printer - AM_RANGE(0xDC, 0xDC) AM_MIRROR(2) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w) // u30 - AM_RANGE(0xDD, 0xDD) AM_MIRROR(2) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) + AM_RANGE(0x8c, 0x8f) AM_DEVREADWRITE("dma", z80dma_device, read, write) // u62 + AM_RANGE(0xc0, 0xc3) AM_DEVWRITE("proglatch", ls259_device, write_nibble_alt) // u41 - eprom programming port + AM_RANGE(0xc4, 0xc7) AM_READ(status_port_r) // u11 + AM_RANGE(0xc8, 0xcb) AM_DEVWRITE("syslatch1", ls259_device, write_nibble_alt) // u14 + AM_RANGE(0xcc, 0xcf) AM_WRITE(syslatch2_w) + AM_RANGE(0xd0, 0xd3) AM_READ(kbd_r) // u1 + AM_RANGE(0xd4, 0xd7) AM_DEVREADWRITE("fdc", mb8877_device, read, write) // u10 + //AM_RANGE(0xd8, 0xdb) AM_READWRITE(portd8_r, portd8_w) // various external data ports; DB = centronics printer + AM_RANGE(0xd9, 0xd9) AM_DEVWRITE("outlatch1", ls259_device, write_nibble_alt) // u96 + AM_RANGE(0xdc, 0xdc) AM_MIRROR(2) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w) // u30 + AM_RANGE(0xdd, 0xdd) AM_MIRROR(2) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) ADDRESS_MAP_END @@ -450,12 +416,8 @@ void bigbord2_state::machine_reset() { u8 i; for (i = 0; i < 8; i++) - { - m_c8[i] = 0; m_cc[i] = 1; - } m_cc[2] = 0; - m_beeper->set_state(0); m_bankr->set_entry(0); m_bankv->set_entry(0); m_banka->set_entry(0); @@ -632,6 +594,23 @@ static MACHINE_CONFIG_START( bigbord2 ) MCFG_MC6845_UPDATE_ROW_CB(bigbord2_state, crtc_update_row) MCFG_MC6845_OUT_VSYNC_CB(DEVWRITELINE("ctc1", z80ctc_device, trg3)) + MCFG_DEVICE_ADD("proglatch", LS259, 0) // U41 + MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(DEVWRITELINE("outlatch1", ls259_device, clear_w)) // FCRST - also resets the 8877 + + MCFG_DEVICE_ADD("syslatch1", LS259, 0) // U14 + MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(MEMBANK("bankr")) // D_S + MCFG_DEVCB_CHAIN_OUTPUT(MEMBANK("bankv")) + MCFG_DEVCB_CHAIN_OUTPUT(MEMBANK("banka")) + MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(bigbord2_state, side_select_w)) // SIDSEL + MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(bigbord2_state, smc1_w)) // SMC1 + MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(bigbord2_state, smc2_w)) // SMC2 + MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(DEVWRITELINE("fdc", mb8877_device, dden_w)) // DDEN + MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(bigbord2_state, head_load_w)) // HLD + MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(bigbord2_state, disk_motor_w)) // MOTOR + MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(DEVWRITELINE("beeper", beep_device, set_state)) // BELL + + MCFG_DEVICE_ADD("outlatch1", LS259, 0) // U96 + /* keyboard */ MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0) MCFG_GENERIC_KEYBOARD_CB(PUT(bigbord2_state, kbd_put)) @@ -656,4 +635,4 @@ ROM_END /* System Drivers */ // YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS -COMP( 1982, bigbord2, bigboard, 0, bigbord2, bigbord2, bigbord2_state, bigbord2, "Digital Research Computers", "Big Board II", MACHINE_NOT_WORKING ) +COMP( 1982, bigbord2, 0, 0, bigbord2, bigbord2, bigbord2_state, bigbord2, "Digital Research Computers", "Big Board II", MACHINE_NOT_WORKING ) |