From aa1dc4415a14f8f899f14403816efacd6fe6bb63 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 25 Nov 2018 17:18:38 +1100 Subject: mark climbers melody ROM bad while waiting for decap confirmation, and fix validity error (nw) --- src/mame/drivers/alien.cpp | 2 +- src/mame/drivers/hh_sm510.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/alien.cpp b/src/mame/drivers/alien.cpp index 87ffb53174f..3e9acc190fe 100644 --- a/src/mame/drivers/alien.cpp +++ b/src/mame/drivers/alien.cpp @@ -239,7 +239,7 @@ ROM_START( dokodemo ) ROM_LOAD32_WORD( "ic30", 0x000000, 0x400000, BAD_DUMP CRC(6b2d2ef1) SHA1(0db6490b40c5716c1271b7f99608e8c7ad916516) ) // ROM_LOAD32_WORD( "ic33", 0x000002, 0x400000, BAD_DUMP CRC(64049fc3) SHA1(b373b2c8cb4d66b9c700e0542bd26444484fae40) ) // modified boot roms from dkbanans - ROM_REGION( 0x800100, "ymz770b", 0 ) //sound samples flash rom, not really needed, programmed by boot loader + ROM_REGION( 0x800100, "ymz770b", ROMREGION_ERASEFF ) //sound samples flash rom, not really needed, programmed by boot loader DISK_REGION( "card" ) //compact flash DISK_IMAGE( "dokodemo", 0, SHA1(0c786b6857a29b26971578abe1c8439fe43d94b5) ) diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp index bb5263e6858..47ff5e45f7f 100644 --- a/src/mame/drivers/hh_sm510.cpp +++ b/src/mame/drivers/hh_sm510.cpp @@ -6987,7 +6987,7 @@ ROM_START( gnw_climber ) ROM_LOAD( "dr-106.program", 0x0000, 0x1000, CRC(2adcbd6d) SHA1(110dc08c65120ab2c76ee647e89aa2726e24ac1a) ) ROM_REGION( 0x100, "maincpu:melody", 0 ) - ROM_LOAD( "dr-106.melody", 0x000, 0x100, CRC(c99d7998) SHA1(4f8cf35b13f8b7654e7186bfd67d197d9053e949) ) + ROM_LOAD( "dr-106.melody", 0x000, 0x100, BAD_DUMP CRC(c99d7998) SHA1(4f8cf35b13f8b7654e7186bfd67d197d9053e949) ) ROM_REGION( 542332, "svg", 0) ROM_LOAD( "gnw_climber.svg", 0, 542332, CRC(d7e84c21) SHA1(a5b5b68c8cdb3a09966bfb91b281791bef311248) ) -- cgit v1.2.3 From 74b0a51c10ac31cd25cb0f7daeda43fbc44d6575 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 26 Nov 2018 19:44:54 +1100 Subject: (nw) more adjustments: * MU100 isn't really working * clone relationship is for different versions of the same thing, not different parts of a system * indentation should follow structure --- src/emu/layout/hp9122c.lay | 6 +++--- src/mame/drivers/segasp.cpp | 2 +- src/mame/drivers/ymmu100.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/emu/layout/hp9122c.lay b/src/emu/layout/hp9122c.lay index 242fb486415..72ce2ef1b43 100644 --- a/src/emu/layout/hp9122c.lay +++ b/src/emu/layout/hp9122c.lay @@ -18,9 +18,9 @@ Hewlett-Packard HP 9122C floppy drive Layout - - - + + + diff --git a/src/mame/drivers/segasp.cpp b/src/mame/drivers/segasp.cpp index 19579541bc7..5dd358870d8 100644 --- a/src/mame/drivers/segasp.cpp +++ b/src/mame/drivers/segasp.cpp @@ -612,7 +612,7 @@ ROM_END GAME( 2004, segasp, 0, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Sega System SP (Spider) BIOS", GAME_FLAGS | MACHINE_IS_BIOS_ROOT ) // These use ROMs GAME( 2009, bingogal,segasp, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Bingo Galaxy (main)", GAME_FLAGS ) // 28.05.2009 -GAME( 2009, bingogals,bingogal, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Bingo Galaxy (satellite)", GAME_FLAGS ) // 28.05.2009 +GAME( 2009, bingogals,segasp, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Bingo Galaxy (satellite)", GAME_FLAGS ) // 28.05.2009 GAME( 2009, brickppl,segasp, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Brick People / Block PeePoo (Ver 1.002)", GAME_FLAGS ) GAME( 2005, dinoking,segasp, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Dinosaur King (USA)", GAME_FLAGS ) GAME( 2006, lovebery,segasp, segasp, segasp, segasp_state, init_segasp, ROT0, "Sega", "Love And Berry - 1st-2nd Collection (Export, Ver 2.000)", GAME_FLAGS ) diff --git a/src/mame/drivers/ymmu100.cpp b/src/mame/drivers/ymmu100.cpp index 873de1463d5..c0e258aa305 100644 --- a/src/mame/drivers/ymmu100.cpp +++ b/src/mame/drivers/ymmu100.cpp @@ -789,5 +789,5 @@ ROM_START( mu100r ) ROM_LOAD( "mu100-font.bin", 0x0000, 0x1000, BAD_DUMP CRC(a7d6c1d6) SHA1(9f0398d678bdf607cb34d83ee535f3b7fcc97c41) ) ROM_END -CONS( 1997, mu100, 0, 0, mu100, mu100, mu100_state, empty_init, "Yamaha", "MU100", 0 ) -CONS( 1997, mu100r, mu100, 0, mu100, mu100, mu100r_state, empty_init, "Yamaha", "MU100 Rackable version", 0 ) +CONS( 1997, mu100, 0, 0, mu100, mu100, mu100_state, empty_init, "Yamaha", "MU100", MACHINE_NOT_WORKING ) +CONS( 1997, mu100r, mu100, 0, mu100, mu100, mu100r_state, empty_init, "Yamaha", "MU100 Rackable version", MACHINE_NOT_WORKING ) -- cgit v1.2.3 From 60b868c836958d4faa8ff6b0d4a176b871812ac6 Mon Sep 17 00:00:00 2001 From: Patrick Mackinlay Date: Sun, 25 Nov 2018 15:04:44 +0700 Subject: am79c90: many fixes (nw) Significantly reduces the number of diagnostic errors reported by hp9k_3xx, while not breaking the Amiga, MIPS or NCD drivers. Many uncertainties or errors have been addressed, however external loopback, some timing issues and some hp9k_3xx-specific issues still have to be resolved. Actual networking via tun is tested functional with Amiga and MIPS drivers. * corrected reset behaviour * corrected internal loopback behaviour * descriptor handling fixes * fixed multicast hash logic * corrected csr0 logic --- src/devices/machine/am79c90.cpp | 399 +++++++++++++++++++++++----------------- src/devices/machine/am79c90.h | 9 + 2 files changed, 236 insertions(+), 172 deletions(-) diff --git a/src/devices/machine/am79c90.cpp b/src/devices/machine/am79c90.cpp index ab447a13d8a..9a014674c93 100644 --- a/src/devices/machine/am79c90.cpp +++ b/src/devices/machine/am79c90.cpp @@ -7,9 +7,11 @@ * * Sources: * - * https://datasheet.datasheetarchive.com/originals/distributors/Datasheets-115/DSAP00824.pdf + * http://bitsavers.org/components/amd/Am7990/Am7990.pdf + * http://bitsavers.org/components/amd/Am7990/Am79c90.pdf * * TODO + * - external loopback * - hp9k/3xx diagnostic failures * * _____ _____ @@ -106,6 +108,7 @@ void am7990_device_base::device_start() save_item(NAME(m_tx_md)); save_item(NAME(m_intr_out_state)); + save_item(NAME(m_idon)); save_item(NAME(m_lb_buf)); save_item(NAME(m_lb_length)); } @@ -114,10 +117,11 @@ void am7990_device_base::device_reset() { m_rap = 0; m_csr[0] = CSR0_STOP; - m_csr[1] = 0; - m_csr[2] = 0; m_csr[3] = 0; + + m_mode = 0; m_lb_length = 0; + m_idon = false; update_interrupts(); } @@ -147,14 +151,6 @@ void am7990_device_base::update_interrupts() int am7990_device_base::recv_start_cb(u8 *buf, int length) { - // check receiving enabled - if (!(m_csr[0] & CSR0_RXON)) - { - LOGMASKED(LOG_RXTX, "receive disabled, external packet discarded\n"); - - return 0; - } - // check internal loopback if ((m_mode & MODE_LOOP) && (m_mode & MODE_INTL)) { @@ -171,21 +167,32 @@ int am7990_device_base::recv_start_cb(u8 *buf, int length) return 0; } - // address filter - if (!address_filter(buf)) - return 0; - return receive(buf, length); } int am7990_device_base::receive(u8 *buf, int length) { + // check receiver enabled + if (!(m_csr[0] & CSR0_RXON)) + { + LOGMASKED(LOG_RXTX, "receive disabled, external packet discarded\n"); + + return -1; + } + + // address filter + if (!address_filter(buf)) + return -1; + + LOGMASKED(LOG_RXTX, "receive packet length %d\n", length); + dump_bytes(buf, length); + // check we have a buffer u32 ring_address = (m_rx_ring_base + (m_rx_ring_pos << 3)) & RING_ADDR_MASK; m_rx_md[1] = m_dma_in_cb(ring_address | 2); if (!(m_rx_md[1] & RMD1_OWN)) - return -1; + return -2; // flag start of packet m_rx_md[1] |= RMD1_STP; @@ -198,28 +205,37 @@ int am7990_device_base::receive(u8 *buf, int length) m_rx_md[2] = m_dma_in_cb(ring_address | 4); u32 const rx_buf_address = (u32(m_rx_md[1] & 0xff) << 16) | m_rx_md[0]; - int const rx_buf_length = -s16(m_rx_md[2]); + int const rx_buf_length = get_buf_length(m_rx_md[2]); - LOGMASKED(LOG_RXTX, "receive buffer address 0x%06x length %d\n", rx_buf_address, rx_buf_length); + // FIXME: In the C-LANCE device, the case of all 0's in the receive + // descriptor may produce unpredictable results. // write the data to memory int const count = std::min(length - offset, rx_buf_length); dma_out(rx_buf_address, &buf[offset], count); offset += count; + LOGMASKED(LOG_RXTX, "receive buffer address 0x%06x length %d wrote %d\n", rx_buf_address, rx_buf_length, count); + + // clear ownership + m_rx_md[1] &= ~RMD1_OWN; + if (offset < length) { // look ahead to next descriptor u8 const next_ring_pos = (m_rx_ring_pos + 1) & m_rx_ring_mask; u32 const next_ring_address = (m_rx_ring_base + (next_ring_pos << 3)) & RING_ADDR_MASK; - u16 next_rmd1 = m_dma_in_cb(ring_address | 2); + // only read the next descriptor if there's more than one in the ring + u16 const next_rmd1 = (next_ring_address != ring_address) ? m_dma_in_cb(next_ring_address | 2) : m_rx_md[1]; + + // check ownership of the next descriptor if (next_rmd1 & RMD1_OWN) { - // release the current descriptor - m_dma_out_cb(ring_address | 2, m_rx_md[1] & ~RMD1_OWN); + // update the descriptor + m_dma_out_cb(ring_address | 2, m_rx_md[1]); - // advance ring position + // advance the ring m_rx_ring_pos = next_ring_pos; ring_address = next_ring_address; m_rx_md[1] = next_rmd1; @@ -227,7 +243,7 @@ int am7990_device_base::receive(u8 *buf, int length) else { // overflow error - m_rx_md[1] |= RMD1_BUFF | RMD1_OFLO; + m_rx_md[1] |= RMD1_ERR | RMD1_BUFF; break; } } @@ -236,7 +252,7 @@ int am7990_device_base::receive(u8 *buf, int length) if (offset == length) { // check fcs - if (!(m_mode & MODE_LOOP) || !(m_mode & MODE_INTL) || (m_mode & MODE_DTCR)) + if (!(m_mode & MODE_LOOP) || (m_mode & MODE_DTCR)) { u32 const crc = util::crc32_creator::simple(buf, length); @@ -251,27 +267,33 @@ int am7990_device_base::receive(u8 *buf, int length) m_rx_md[1] |= RMD1_ENP; } - LOGMASKED(LOG_RXTX, "receive packet length %d\n", length); - dump_bytes(buf, length); - return offset; } void am7990_device_base::recv_complete_cb(int result) { - if (result > 0) + switch (result) { - // update the final descriptor - u32 const ring_address = (m_rx_ring_base + (m_rx_ring_pos << 3)) & RING_ADDR_MASK; + case -2: // missed packet + m_csr[0] |= CSR0_ERR | CSR0_MISS; + break; + + case -1: // packet discarded or filtered + return; + + default: // received something + { + // update the final descriptor + u32 const ring_address = (m_rx_ring_base + (m_rx_ring_pos << 3)) & RING_ADDR_MASK; - m_dma_out_cb(ring_address | 2, m_rx_md[1] & ~RMD1_OWN); - m_dma_out_cb(ring_address | 6, result & RMD3_MCNT); + m_dma_out_cb(ring_address | 2, m_rx_md[1]); + m_dma_out_cb(ring_address | 6, result & RMD3_MCNT); - // advance the ring - m_rx_ring_pos = (m_rx_ring_pos + 1) & m_rx_ring_mask; + // advance the ring + m_rx_ring_pos = (m_rx_ring_pos + 1) & m_rx_ring_mask; + } + break; } - else if (result == -1) - m_csr[0] |= CSR0_ERR | CSR0_MISS; // generate receive interrupt m_csr[0] |= CSR0_RINT | CSR0_INTR; @@ -280,57 +302,59 @@ void am7990_device_base::recv_complete_cb(int result) void am7990_device_base::transmit_poll(void *ptr, s32 param) { - // receive pending internal loopback data - if (m_lb_length && (m_mode & MODE_LOOP) && (m_mode & MODE_INTL) && (m_csr[0] & CSR0_RXON)) - { - int const result = receive(m_lb_buf, m_lb_length); - m_lb_length = 0; - recv_complete_cb(result); - - return; - } - + // check transmitter enabled if (m_csr[0] & CSR0_TXON) { + // clear transmit demand m_csr[0] &= ~CSR0_TDMD; + // read a transmit descriptor u32 const ring_address = (m_tx_ring_base + (m_tx_ring_pos << 3)) & RING_ADDR_MASK; m_tx_md[1] = m_dma_in_cb(ring_address | 2); - // start transmitting if we own the current descriptor + // check ownership if (m_tx_md[1] & TMD1_OWN) - transmit(); + { + // check for start of packet + if (!(m_tx_md[1] & TMD1_STP)) + { + // clear ownership + m_dma_out_cb(ring_address | 2, m_tx_md[1] & ~TMD1_OWN); + + // advance the ring + m_tx_ring_pos = (m_tx_ring_pos + 1) & m_tx_ring_mask; + } + else + transmit(); + } + } + + // receive pending loopback data + if (m_lb_length && (m_mode & MODE_LOOP)) + { + LOGMASKED(LOG_RXTX, "receive loopback packet length %d\n", m_lb_length); + + int const result = receive(m_lb_buf, m_lb_length); + m_lb_length = 0; + recv_complete_cb(result); } } void am7990_device_base::transmit() { - u32 ring_address = (m_tx_ring_base + (m_tx_ring_pos << 3)) & RING_ADDR_MASK; - - // check if the descriptor contains the start of a packet - if (!(m_tx_md[1] & TMD1_STP)) - { - // release owned descriptors which don't start a packet - while ((m_tx_md[1] & TMD1_OWN) && !(m_tx_md[1] & TMD1_STP)) - { - // release the descriptor - m_dma_out_cb(ring_address | 2, m_tx_md[1] & ~TMD1_OWN); + // stop transmit polling + m_transmit_poll->enable(false); - // advance the ring - m_tx_ring_pos = (m_tx_ring_pos + 1) & m_tx_ring_mask; - ring_address = (m_tx_ring_base + (m_tx_ring_pos << 3)) & RING_ADDR_MASK; - m_tx_md[1] = m_dma_in_cb(ring_address | 2); - } + // check whether to append fcs + bool append_fcs = !(m_mode & MODE_DTCR); - return; - } + // this bit can be used to detect C-LANCE + if (type() == AM79C90) + append_fcs = append_fcs || bool(m_tx_md[1] & TMD1_ADD_FCS); else - // stop transmit polling - m_transmit_poll->enable(false); - - // check whether to append fcs or not - bool const append_fcs = !(m_mode & MODE_DTCR) || ((type() == AM79C90) && (m_tx_md[1] & TMD1_ADD_FCS)); + m_tx_md[1] &= ~TMD1_ADD_FCS; + u32 ring_address = (m_tx_ring_base + (m_tx_ring_pos << 3)) & RING_ADDR_MASK; u8 buf[4096]; int length = 0; @@ -341,13 +365,29 @@ void am7990_device_base::transmit() m_tx_md[2] = m_dma_in_cb(ring_address | 4); m_tx_md[3] = 0; - u32 const tx_buf_address = (u32(m_tx_md[1] & 0xff) << 16) | m_tx_md[0]; - u16 const tx_buf_length = -s16(m_tx_md[2]); + u32 const tx_buf_address = (u32(m_tx_md[1] & TMD1_HADR) << 16) | m_tx_md[0]; + int const tx_buf_length = get_buf_length(m_tx_md[2]); + + LOGMASKED(LOG_RXTX, "transmit buffer address 0x%06x length %d%s%s%s\n", tx_buf_address, tx_buf_length, + m_tx_md[1] & TMD1_OWN ? " OWN" : "", m_tx_md[1] & TMD1_STP ? " STP" : "", m_tx_md[1] & TMD1_ENP ? " ENP" : ""); + + // clear ownership + m_tx_md[1] &= ~TMD1_OWN; - LOGMASKED(LOG_RXTX, "transmit buffer address 0x%06x length %d\n", tx_buf_address, tx_buf_length); + // FIXME: zero length transmit buffer + if (tx_buf_length == 0) + { + // update the descriptor + m_dma_out_cb(ring_address | 2, m_tx_md[1]); - // minimum length 100 when chaining, or 64 when not (except for internal loopback mode) - if (!length && tx_buf_length < ((m_tx_md[1] & TMD1_ENP) ? 64 : 100) && ((m_mode & (MODE_LOOP | MODE_INTL)) != (MODE_LOOP | MODE_INTL))) + // advance the ring + m_tx_ring_pos = (m_tx_ring_pos + 1) & m_tx_ring_mask; + + return; + } + + // minimum length 100 when chaining, or 64 when not, except in loopback mode + if (!length && !(m_mode & MODE_LOOP) && tx_buf_length < ((m_tx_md[1] & TMD1_ENP) ? 64 : 100)) logerror("first transmit buffer length %d less than required minimum\n", tx_buf_length); // read the data from memory @@ -360,17 +400,19 @@ void am7990_device_base::transmit() // look ahead to next descriptor u8 const next_ring_pos = (m_tx_ring_pos + 1) & m_tx_ring_mask; u32 const next_ring_address = (m_tx_ring_base + (next_ring_pos << 3)) & RING_ADDR_MASK; - u16 const next_tx_md1 = m_dma_in_cb(ring_address | 2); - if (next_tx_md1 & TMD1_OWN) + // only read the next descriptor if there's more than one in the ring + u16 const next_tmd1 = (next_ring_address != ring_address) ? m_dma_in_cb(next_ring_address | 2) : m_tx_md[1]; + + if (next_tmd1 & TMD1_OWN) { - // release the current descriptor - m_dma_out_cb(ring_address | 2, m_tx_md[1] & ~TMD1_OWN); + // update the descriptor + m_dma_out_cb(ring_address | 2, m_tx_md[1]); - // advance ring position + // advance the ring m_tx_ring_pos = next_ring_pos; ring_address = next_ring_address; - m_tx_md[1] = next_tx_md1; + m_tx_md[1] = next_tmd1; } else { @@ -388,6 +430,10 @@ void am7990_device_base::transmit() break; } + // check for babble + if (length > 1518) + m_csr[0] |= CSR0_ERR | CSR0_BABL; + // compute and append the fcs if (append_fcs) { @@ -400,18 +446,14 @@ void am7990_device_base::transmit() buf[length++] = crc >> 24; } - // check for babble - if (length > 1518) - m_csr[0] |= CSR0_ERR | CSR0_BABL; - LOGMASKED(LOG_RXTX, "transmit sending packet length %d\n", length); dump_bytes(buf, length); - // handle internal loopback - if ((m_mode & MODE_LOOP) && (m_mode & MODE_INTL)) + // handle loopback + if (m_mode & MODE_LOOP) { // forced collision - if (m_mode & MODE_COLL) + if ((m_mode & MODE_COLL) && (m_mode & MODE_INTL)) { send_complete_cb(-1); return; @@ -431,10 +473,14 @@ void am7990_device_base::transmit() memcpy(m_lb_buf, buf, length); m_lb_length = length; - send_complete_cb(length); + if (m_mode & MODE_INTL) + { + send_complete_cb(length); + return; + } } - else - send(buf, length); + + send(buf, length); } void am7990_device_base::send_complete_cb(int result) @@ -444,7 +490,7 @@ void am7990_device_base::send_complete_cb(int result) // update tmd3 on error switch (result) { - case -2: // invalid internal loopback packet + case -2: // invalid loopback packet m_tx_md[1] |= TMD1_ERR; break; @@ -459,8 +505,8 @@ void am7990_device_base::send_complete_cb(int result) break; } - // release the current descriptor - m_dma_out_cb(ring_address | 2, m_tx_md[1] & ~TMD1_OWN); + // update the last descriptor + m_dma_out_cb(ring_address | 2, m_tx_md[1]); // advance the ring m_tx_ring_pos = (m_tx_ring_pos + 1) & m_tx_ring_mask; @@ -507,8 +553,76 @@ WRITE16_MEMBER(am7990_device_base::regs_w) * */ - // setting STOP overrides all other bits - if (!(data & CSR0_STOP)) + // STOP takes priority over all other bits + if (data & CSR0_STOP) + { + if ((type() == AM7990) || !(m_csr[0] & CSR0_STOP)) + device_reset(); + break; + } + + // interrupt/error flags are all cleared by writing 1 + m_csr[0] &= ~(data & (CSR0_BABL | CSR0_CERR | CSR0_MISS | CSR0_MERR | CSR0_RINT | CSR0_TINT | CSR0_IDON)); + + // handle INIT + if ((data & CSR0_INIT) && !(m_csr[0] & CSR0_INIT)) + { + if (m_csr[0] & CSR0_STOP) + initialize(); + else + m_csr[0] |= m_idon ? CSR0_IDON : CSR0_INIT; + } + + /* + * From the Am7990 datasheet: + * + * The STOP bit must be set prior to setting the STRT bit. INIT + * and STRT must not be set at the same time. The LANCE must be + * initialized first and the user must wait for the IDON bit to + * be set (IDON=1) before setting the STRT bit. + * + * And: + * + * The STOP bit must be set prior to setting the INIT bit. + * Setting INIT clears the STOP bit. + * + * This is clearly contradictory; driver code sets the STRT bit + * after INIT, so assume STRT does not require STOP to be set. + * + * HP9000/3xx diagnostic sets INIT and STRT simultaneously. + */ + // handle STRT + if ((data & CSR0_STRT) && !(m_csr[0] & CSR0_STRT)) + { + LOG("START receiver %s transmitter %s\n", + (m_mode & MODE_DRX) ? "OFF" : "ON", (m_mode & MODE_DTX) ? "OFF" : "ON"); + + m_csr[0] |= CSR0_STRT; + m_csr[0] &= ~CSR0_STOP; + + if (m_mode & MODE_DRX) + m_csr[0] &= ~CSR0_RXON; + else + m_csr[0] |= CSR0_RXON; + + if (m_mode & MODE_DTX) + m_csr[0] &= ~CSR0_TXON; + else + m_csr[0] |= CSR0_TXON; + + // trigger an immediate transmit poll + m_transmit_poll->adjust(attotime::zero, 0, TX_POLL_PERIOD); + } + + // transmit demand + if ((data & CSR0_TDMD) && !(m_csr[0] & CSR0_TDMD)) + { + m_csr[0] |= CSR0_TDMD; + m_transmit_poll->adjust(attotime::zero, 0, TX_POLL_PERIOD); + } + + // interrupt enable + if (!(m_csr[0] & CSR0_STOP) || type() == AM79C90) { // interrupt enable is read/write if ((data ^ m_csr[0]) & CSR0_INEA) @@ -518,80 +632,21 @@ WRITE16_MEMBER(am7990_device_base::regs_w) m_csr[0] |= CSR0_INEA; else m_csr[0] &= ~CSR0_INEA; + } - // interrupt/error flags are all cleared by writing 1 - m_csr[0] &= ~(data & (CSR0_BABL | CSR0_CERR | CSR0_MISS | CSR0_MERR | CSR0_RINT | CSR0_TINT | CSR0_IDON)); - - // INIT and STRT are only valid if STOP is set - if (m_csr[0] & CSR0_STOP) - { - // handle INIT - if ((data & CSR0_INIT) && !(m_csr[0] & CSR0_INIT)) - initialize(); - - // FIXME: handle STRT, see below - } - - /* - * From the Am7990 datasheet: - * - * The STOP bit must be set prior to setting the STRT bit. INIT - * and STRT must not be set at the same time. The LANCE must be - * initialized first and the user must wait for the IDON bit to - * be set (IDON=1) before setting the STRT bit. - * - * And: - * - * The STOP bit must be set prior to setting the INIT bit. - * Setting INIT clears the STOP bit. - * - * This is clearly contradictory; driver code sets the STRT bit - * after INIT, so assume STRT does not require STOP to be set. - */ - // handle STRT - if ((data & CSR0_STRT) && !(m_csr[0] & CSR0_STRT)) - { - LOG("START receiver %s transmitter %s\n", - (m_mode & MODE_DRX) ? "OFF" : "ON", (m_mode & MODE_DTX) ? "OFF" : "ON"); - - m_csr[0] |= CSR0_STRT; - m_csr[0] &= ~CSR0_STOP; - - if (m_mode & MODE_DRX) - m_csr[0] &= ~CSR0_RXON; - else - m_csr[0] |= CSR0_RXON; - - if (m_mode & MODE_DTX) - m_csr[0] &= ~CSR0_TXON; - else - m_csr[0] |= CSR0_TXON; - } - - // transmit demand - if ((data & CSR0_TDMD) && !(m_csr[0] & CSR0_TDMD)) - { - m_csr[0] |= CSR0_TDMD; - m_transmit_poll->adjust(attotime::zero, 0, TX_POLL_PERIOD); - } - - // ERR == BABL || CERR || MISS || MERR - if (m_csr[0] & CSR0_ANY_ERR) - m_csr[0] |= CSR0_ERR; - else - m_csr[0] &= ~CSR0_ERR; - - // INTR == BABL || MISS || MERR || RINT || TINT || IDON - if (m_csr[0] & CSR0_ANY_INTR) - m_csr[0] |= CSR0_INTR; - else - m_csr[0] &= ~CSR0_INTR; + // ERR == BABL || CERR || MISS || MERR + if (m_csr[0] & CSR0_ANY_ERR) + m_csr[0] |= CSR0_ERR; + else + m_csr[0] &= ~CSR0_ERR; - update_interrupts(); - } + // INTR == BABL || MISS || MERR || RINT || TINT || IDON + if (m_csr[0] & CSR0_ANY_INTR) + m_csr[0] |= CSR0_INTR; else - device_reset(); + m_csr[0] &= ~CSR0_INTR; + update_interrupts(); break; case 1: // Least significant 15 bits of the Initialization Block @@ -661,6 +716,8 @@ void am7990_device_base::initialize() m_csr[0] |= CSR0_IDON | CSR0_INIT; m_csr[0] &= ~CSR0_STOP; + + m_idon = true; } void am7990_device_base::dma_in(u32 address, u8 *buf, int length) @@ -796,14 +853,12 @@ bool am7990_device_base::address_filter(u8 *buf) // multicast /* - * FIXME: This logic is unverified. It's based on the assumption that - * the computed crc is bit-reversed compared to hardware, so it uses - * the low-order 6 bits instead of the high-order bits, then reverses - * them to find the hash position. Unsure if inversion is required. + * Multicast address matching is performed by computing the fcs crc of + * the destination address, and then using the upper 6 bits as an index + * into the 64-bit logical address filter. */ u32 const crc = util::crc32_creator::simple(buf, 6); - u8 const hash = bitswap<6>(crc, 0, 1, 2, 3, 4, 5); - if (m_logical_addr_filter & (1U << hash)) + if (BIT(m_logical_addr_filter, 63 - (crc >> 26))) { LOGMASKED(LOG_FILTER, "address_filter accepted (logical address match) %02x-%02x-%02x-%02x-%02x-%02x\n", buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]); diff --git a/src/devices/machine/am79c90.h b/src/devices/machine/am79c90.h index 0597dbdb944..ef28930273e 100644 --- a/src/devices/machine/am79c90.h +++ b/src/devices/machine/am79c90.h @@ -42,6 +42,8 @@ protected: void dma_out(u32 address, u8 *buf, int length); void dump_bytes(u8 *buf, int length); + virtual int get_buf_length(u16 data) const = 0; + // constants and masks static constexpr u32 FCS_RESIDUE = 0xdebb20e3; static const u8 ETH_BROADCAST[]; @@ -161,6 +163,7 @@ private: emu_timer *m_transmit_poll; int m_intr_out_state; + bool m_idon; // internal loopback buffer u8 m_lb_buf[36]; @@ -171,12 +174,18 @@ class am7990_device : public am7990_device_base { public: am7990_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + +protected: + virtual int get_buf_length(u16 data) const override { return (data == 0xf000) ? 4096 : -s16(0xf000 | data); } }; class am79c90_device : public am7990_device_base { public: am79c90_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + +protected: + virtual int get_buf_length(u16 data) const override { return data ? ((data == 0xf000) ? 4096 : -s16(0xf000 | data)) : 0; } }; DECLARE_DEVICE_TYPE(AM7990, am7990_device) -- cgit v1.2.3 From ce3306d31d50964225c9cc8a3e723ffe35a67495 Mon Sep 17 00:00:00 2001 From: Ryan Holtz Date: Mon, 26 Nov 2018 06:28:19 +0100 Subject: Temporarily disabled Hyperstone DRC and demoted several games due to non-DRC issues, nw --- src/devices/cpu/e132xs/e132xs.h | 2 +- src/mame/drivers/vamphalf.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/devices/cpu/e132xs/e132xs.h b/src/devices/cpu/e132xs/e132xs.h index c9df8f271f6..84ddd3e060b 100644 --- a/src/devices/cpu/e132xs/e132xs.h +++ b/src/devices/cpu/e132xs/e132xs.h @@ -38,7 +38,7 @@ #define SINGLE_INSTRUCTION_MODE (1) -#define ENABLE_E132XS_DRC (1) +#define ENABLE_E132XS_DRC (0) #define E132XS_LOG_DRC_REGS (0) #define E132XS_LOG_INTERPRETER_REGS (0) diff --git a/src/mame/drivers/vamphalf.cpp b/src/mame/drivers/vamphalf.cpp index bb58b2867a6..d7e3fe22704 100644 --- a/src/mame/drivers/vamphalf.cpp +++ b/src/mame/drivers/vamphalf.cpp @@ -3558,7 +3558,7 @@ GAME( 1999, poosho, 0, jmpbreak, common, vamphalf_state, init GAME( 1999, newxpang, 0, newxpang, common, vamphalf_state, init_newxpang, ROT0, "F2 System", "New Cross Pang" , MACHINE_SUPPORTS_SAVE ) -GAME( 1999, worldadv, 0, worldadv, common, vamphalf_state, init_worldadv, ROT0, "Logic / F2 System", "World Adventure" , MACHINE_SUPPORTS_SAVE ) +GAME( 1999, worldadv, 0, worldadv, common, vamphalf_state, init_worldadv, ROT0, "Logic / F2 System", "World Adventure" , MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // game starts to stall for several seconds at a time after it's been running for a certain amount of time GAME( 1999, suplup, 0, suplup, common, vamphalf_state, init_suplup, ROT0, "Omega System", "Super Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 4.0 / 990518)" , MACHINE_SUPPORTS_SAVE ) GAME( 1999, luplup, suplup, suplup, common, vamphalf_state, init_luplup, ROT0, "Omega System", "Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 3.0 / 990128)", MACHINE_SUPPORTS_SAVE ) @@ -3573,8 +3573,8 @@ GAME( 1999, vamphalfk, vamphalf, vamphalf, common, vamphalf_state, init GAME( 2000, dquizgo2, 0, coolmini, common, vamphalf_state, init_dquizgo2, ROT0, "SemiCom", "Date Quiz Go Go Episode 2" , MACHINE_SUPPORTS_SAVE ) -GAME( 2000, misncrft, 0, misncrft, common, vamphalf_qdsp_state, init_misncrft, ROT90, "Sun", "Mission Craft (version 2.7)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 2000, misncrfta, misncrft, misncrft, common, vamphalf_qdsp_state, init_misncrft, ROT90, "Sun", "Mission Craft (version 2.4)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 2000, misncrft, 0, misncrft, common, vamphalf_qdsp_state, init_misncrft, ROT90, "Sun", "Mission Craft (version 2.7)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // game starts to stall for several seconds at a time after it's been running for a certain amount of time (you can usually complete 1 loop) +GAME( 2000, misncrfta, misncrft, misncrft, common, vamphalf_qdsp_state, init_misncrft, ROT90, "Sun", "Mission Craft (version 2.4)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) GAME( 2000, mrdig, 0, mrdig, common, vamphalf_state, init_mrdig, ROT0, "Sun", "Mr. Dig", MACHINE_SUPPORTS_SAVE ) @@ -3587,9 +3587,9 @@ GAME( 2001, mrkickera, mrkicker, mrkickera, finalgdr, vamphalf_nvram_state,init GAME( 2001, toyland, 0, coolmini, common, vamphalf_state, init_toyland, ROT0, "SemiCom", "Toy Land Adventure", MACHINE_SUPPORTS_SAVE ) -GAME( 2001, wivernwg, 0, wyvernwg, common, vamphalf_qdsp_state, init_wyvernwg, ROT270, "SemiCom", "Wivern Wings", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 2001, wyvernwg, wivernwg, wyvernwg, common, vamphalf_qdsp_state, init_wyvernwg, ROT270, "SemiCom (Game Vision license)", "Wyvern Wings (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 2001, wyvernwga, wivernwg, wyvernwg, common, vamphalf_qdsp_state, init_wyvernwg, ROT270, "SemiCom (Game Vision license)", "Wyvern Wings (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 2001, wivernwg, 0, wyvernwg, common, vamphalf_qdsp_state, init_wyvernwg, ROT270, "SemiCom", "Wivern Wings", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) // gives a protection error after a certain number of plays / coins? +GAME( 2001, wyvernwg, wivernwg, wyvernwg, common, vamphalf_qdsp_state, init_wyvernwg, ROT270, "SemiCom (Game Vision license)", "Wyvern Wings (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) +GAME( 2001, wyvernwga, wivernwg, wyvernwg, common, vamphalf_qdsp_state, init_wyvernwg, ROT270, "SemiCom (Game Vision license)", "Wyvern Wings (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) GAME( 2001, aoh, 0, aoh, aoh, vamphalf_state, init_aoh, ROT0, "Unico", "Age Of Heroes - Silkroad 2 (v0.63 - 2001/02/07)", MACHINE_SUPPORTS_SAVE ) -- cgit v1.2.3 From fbdd163d0c57f14e38edd1f79d63136cee79f77d Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 27 Nov 2018 20:06:18 +1100 Subject: catseye: flag imperfect graphics due to unimplemented accelerated drawing features (nw) --- src/devices/video/catseye.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/devices/video/catseye.h b/src/devices/video/catseye.h index 257ae13f3ee..35e3838d406 100644 --- a/src/devices/video/catseye.h +++ b/src/devices/video/catseye.h @@ -8,6 +8,8 @@ class catseye_device: public device_t { public: + static constexpr feature_type imperfect_features() { return feature::GRAPHICS; } + catseye_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER(vram_r); -- cgit v1.2.3 From ac6053ecb0c1d2cea91fc2bd4aa72d9e3df6b41f Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 27 Nov 2018 21:52:59 +1100 Subject: metadata and flags (nw) --- src/devices/bus/hp_dio/hp98550.cpp | 2 +- src/devices/bus/sbus/cgsix.h | 2 ++ src/devices/bus/sbus/cgthree.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/devices/bus/hp_dio/hp98550.cpp b/src/devices/bus/hp_dio/hp98550.cpp index 6e01255ce41..28d87d5a52f 100644 --- a/src/devices/bus/hp_dio/hp98550.cpp +++ b/src/devices/bus/hp_dio/hp98550.cpp @@ -23,7 +23,7 @@ ROM_START(hp98550) ROM_LOAD("98550a.bin", 0x000000, 0x008000, CRC(9d639233) SHA1(d6b23a34850f24525ca5fb36de3deb91196d2dc5)) ROM_END -DEFINE_DEVICE_TYPE_NS(HPDIO_98550, bus::hp_dio, dio32_98550_device, "dio98550", "HP98550 high-res color DIO video card") +DEFINE_DEVICE_TYPE_NS(HPDIO_98550, bus::hp_dio, dio32_98550_device, "dio98550", "HP98550A high-res color DIO video card") namespace bus { namespace hp_dio { diff --git a/src/devices/bus/sbus/cgsix.h b/src/devices/bus/sbus/cgsix.h index 4e3302799c1..e74ef2d97cb 100644 --- a/src/devices/bus/sbus/cgsix.h +++ b/src/devices/bus/sbus/cgsix.h @@ -18,6 +18,8 @@ class sbus_cgsix_device : public device_t, public device_sbus_card_interface { protected: + static constexpr feature_type imperfect_features() { return feature::GRAPHICS; } + // construction/destruction sbus_cgsix_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const uint32_t vram_size) : sbus_cgsix_device(mconfig, type, tag, owner, clock) diff --git a/src/devices/bus/sbus/cgthree.h b/src/devices/bus/sbus/cgthree.h index df016a55de7..9b99d4a2fba 100644 --- a/src/devices/bus/sbus/cgthree.h +++ b/src/devices/bus/sbus/cgthree.h @@ -17,6 +17,8 @@ class sbus_cgthree_device : public device_t, public device_sbus_card_interface { public: + static constexpr feature_type imperfect_features() { return feature::GRAPHICS; } + // construction/destruction sbus_cgthree_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); -- cgit v1.2.3 From b47259fa0800d8fa22b28e3547865e83ba94702b Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 28 Nov 2018 00:00:28 +1100 Subject: that would help (nw) --- src/devices/bus/sbus/cgsix.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/bus/sbus/cgsix.h b/src/devices/bus/sbus/cgsix.h index e74ef2d97cb..3bee124d229 100644 --- a/src/devices/bus/sbus/cgsix.h +++ b/src/devices/bus/sbus/cgsix.h @@ -17,9 +17,10 @@ class sbus_cgsix_device : public device_t, public device_sbus_card_interface { -protected: +public: static constexpr feature_type imperfect_features() { return feature::GRAPHICS; } +protected: // construction/destruction sbus_cgsix_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const uint32_t vram_size) : sbus_cgsix_device(mconfig, type, tag, owner, clock) @@ -44,7 +45,6 @@ protected: DECLARE_READ32_MEMBER(fbc_r); DECLARE_WRITE32_MEMBER(fbc_w); -protected: uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint8_t perform_rasterop(uint8_t src, uint8_t dst); void handle_font_poke(); -- cgit v1.2.3 From c6150e754289e07af2579c40cbc53d06115b9d8a Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 28 Nov 2018 06:12:23 +1100 Subject: version bump (nw) --- android-project/app/src/main/AndroidManifest.xml | 4 ++-- makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index 02b31b3af14..b811380f2bd 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -4,8 +4,8 @@ --> diff --git a/makefile b/makefile index a1244b74efb..60655420859 100644 --- a/makefile +++ b/makefile @@ -1584,14 +1584,14 @@ endif ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.203"' > $@ + @echo '#define BARE_BUILD_VERSION "0.204"' > $@ @echo 'extern const char bare_build_version[];' >> $@ @echo 'extern const char build_version[];' >> $@ @echo 'const char bare_build_version[] = BARE_BUILD_VERSION;' >> $@ @echo 'const char build_version[] = BARE_BUILD_VERSION " ($(NEW_GIT_VERSION))";' >> $@ else $(GENDIR)/version.cpp: $(GENDIR)/git_desc - @echo #define BARE_BUILD_VERSION "0.203" > $@ + @echo #define BARE_BUILD_VERSION "0.204" > $@ @echo extern const char bare_build_version[]; >> $@ @echo extern const char build_version[]; >> $@ @echo const char bare_build_version[] = BARE_BUILD_VERSION; >> $@ -- cgit v1.2.3