trunk/src/mess/machine/mb8795.c
| r26274 | r26275 | |
| 18 | 18 | |
| 19 | 19 | mb8795_device::mb8795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 20 | 20 | : device_t(mconfig, MB8795, "Fujitsu MB8795", tag, owner, clock, "mb8795", __FILE__), |
| 21 | | device_network_interface(mconfig, *this, 10) |
| 21 | device_network_interface(mconfig, *this, 10) |
| 22 | 22 | { |
| 23 | 23 | } |
| 24 | 24 | |
| r26274 | r26275 | |
| 81 | 81 | |
| 82 | 82 | READ8_MEMBER(mb8795_device::txstat_r) |
| 83 | 83 | { |
| 84 | | // fprintf(stderr, "mb8795: txstat_r %02x (%08x)\n", txstat, space.device().safe_pc()); |
| 84 | // logerror("%s: txstat_r %02x (%08x)\n", tag(), txstat, space.device().safe_pc()); |
| 85 | 85 | return txstat; |
| 86 | 86 | } |
| 87 | 87 | |
| r26274 | r26275 | |
| 89 | 89 | { |
| 90 | 90 | txstat = txstat & (0xf0 | ~data); |
| 91 | 91 | check_irq(); |
| 92 | | fprintf(stderr, "mb8795: txstat_w %02x (%08x)\n", txstat, space.device().safe_pc()); |
| 92 | logerror("%s: txstat_w %02x (%08x)\n", tag(), txstat, space.device().safe_pc()); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | READ8_MEMBER(mb8795_device::txmask_r) |
| 96 | 96 | { |
| 97 | | fprintf(stderr, "mb8795: txmask_r %02x (%08x)\n", txmask, space.device().safe_pc()); |
| 97 | logerror("%s: txmask_r %02x (%08x)\n", tag(), txmask, space.device().safe_pc()); |
| 98 | 98 | return txmask; |
| 99 | 99 | } |
| 100 | 100 | |
| r26274 | r26275 | |
| 102 | 102 | { |
| 103 | 103 | txmask = data & 0xaf; |
| 104 | 104 | check_irq(); |
| 105 | | fprintf(stderr, "mb8795: txmask_w %02x (%08x)\n", txmask, space.device().safe_pc()); |
| 105 | logerror("%s: txmask_w %02x (%08x)\n", tag(), txmask, space.device().safe_pc()); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | READ8_MEMBER(mb8795_device::rxstat_r) |
| 109 | 109 | { |
| 110 | | fprintf(stderr, "mb8795: rxstat_r %02x (%08x)\n", rxstat, space.device().safe_pc()); |
| 110 | logerror("%s: rxstat_r %02x (%08x)\n", tag(), rxstat, space.device().safe_pc()); |
| 111 | 111 | return rxstat; |
| 112 | 112 | } |
| 113 | 113 | |
| r26274 | r26275 | |
| 115 | 115 | { |
| 116 | 116 | rxstat = rxstat & (0x70 | ~data); |
| 117 | 117 | check_irq(); |
| 118 | | fprintf(stderr, "mb8795: rxstat_w %02x (%08x)\n", rxstat, space.device().safe_pc()); |
| 118 | logerror("%s: rxstat_w %02x (%08x)\n", tag(), rxstat, space.device().safe_pc()); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | READ8_MEMBER(mb8795_device::rxmask_r) |
| 122 | 122 | { |
| 123 | | fprintf(stderr, "mb8795: rxmask_r %02x (%08x)\n", rxmask, space.device().safe_pc()); |
| 123 | logerror("%s: rxmask_r %02x (%08x)\n", tag(), rxmask, space.device().safe_pc()); |
| 124 | 124 | return rxmask; |
| 125 | 125 | } |
| 126 | 126 | |
| r26274 | r26275 | |
| 128 | 128 | { |
| 129 | 129 | rxmask = data & 0x9f; |
| 130 | 130 | check_irq(); |
| 131 | | fprintf(stderr, "mb8795: rxmask_w %02x (%08x)\n", rxmask, space.device().safe_pc()); |
| 131 | logerror("%s: rxmask_w %02x (%08x)\n", tag(), rxmask, space.device().safe_pc()); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | READ8_MEMBER(mb8795_device::txmode_r) |
| 135 | 135 | { |
| 136 | | fprintf(stderr, "mb8795: txmode_r %02x (%08x)\n", txmode, space.device().safe_pc()); |
| 136 | logerror("%s: txmode_r %02x (%08x)\n", tag(), txmode, space.device().safe_pc()); |
| 137 | 137 | return txmode; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | WRITE8_MEMBER(mb8795_device::txmode_w) |
| 141 | 141 | { |
| 142 | 142 | txmode = data; |
| 143 | | fprintf(stderr, "mb8795: txmode_w %02x (%08x)\n", txmode, space.device().safe_pc()); |
| 143 | logerror("%s: txmode_w %02x (%08x)\n", tag(), txmode, space.device().safe_pc()); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | READ8_MEMBER(mb8795_device::rxmode_r) |
| 147 | 147 | { |
| 148 | | fprintf(stderr, "mb8795: rxmode_r %02x (%08x)\n", rxmode, space.device().safe_pc()); |
| 148 | logerror("%s: rxmode_r %02x (%08x)\n", tag(), rxmode, space.device().safe_pc()); |
| 149 | 149 | return rxmode; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | WRITE8_MEMBER(mb8795_device::rxmode_w) |
| 153 | 153 | { |
| 154 | 154 | rxmode = data; |
| 155 | | fprintf(stderr, "mb8795: rxmode_w %02x (%08x)\n", rxmode, space.device().safe_pc()); |
| 155 | logerror("%s: rxmode_w %02x (%08x)\n", tag(), rxmode, space.device().safe_pc()); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | WRITE8_MEMBER(mb8795_device::reset_w) |
| r26274 | r26275 | |
| 163 | 163 | |
| 164 | 164 | READ8_MEMBER(mb8795_device::tdc_lsb_r) |
| 165 | 165 | { |
| 166 | | fprintf(stderr, "mb8795: tdc_lsb_r %02x (%08x)\n", txcount & 0xff, space.device().safe_pc()); |
| 166 | logerror("%s: tdc_lsb_r %02x (%08x)\n", tag(), txcount & 0xff, space.device().safe_pc()); |
| 167 | 167 | return txcount; |
| 168 | 168 | } |
| 169 | 169 | |
| r26274 | r26275 | |
| 172 | 172 | if(offset < 6) |
| 173 | 173 | return mac[offset]; |
| 174 | 174 | if(offset == 7) { |
| 175 | | fprintf(stderr, "mb8795: tdc_msb_r %02x (%08x)\n", txcount >> 8, space.device().safe_pc()); |
| 175 | logerror("%s: tdc_msb_r %02x (%08x)\n", tag(), txcount >> 8, space.device().safe_pc()); |
| 176 | 176 | return (txcount >> 8) & 0x3f; |
| 177 | 177 | } |
| 178 | 178 | return 0; |
| r26274 | r26275 | |
| 204 | 204 | drq_tx_cb(drq_tx); |
| 205 | 205 | |
| 206 | 206 | if(eof) { |
| 207 | | fprintf(stderr, "mb8795: send packet, dest=%02x.%02x.%02x.%02x.%02x.%02x len=%04x\n", |
| 208 | | txbuf[0], txbuf[1], txbuf[2], txbuf[3], txbuf[4], txbuf[5], |
| 209 | | txlen); |
| 210 | | if(!(txmode & EN_TMD_LB_DISABLE)) |
| 211 | | fprintf(stderr, " -> loopback active\n"); |
| 207 | logerror("%s: send packet, dest=%02x.%02x.%02x.%02x.%02x.%02x len=%04x loopback=%s\n", tag(), |
| 208 | txbuf[0], txbuf[1], txbuf[2], txbuf[3], txbuf[4], txbuf[5], |
| 209 | txlen, |
| 210 | txmode & EN_TMD_LB_DISABLE ? "off" : "on"); |
| 212 | 211 | |
| 212 | if(txlen > 1500) |
| 213 | txlen = 1500; // Weird packet send on loopback test in the next |
| 214 | |
| 213 | 215 | if(!(txmode & EN_TMD_LB_DISABLE)) { |
| 214 | 216 | memcpy(rxbuf, txbuf, txlen); |
| 215 | 217 | rxlen = txlen; |
| r26274 | r26275 | |
| 246 | 248 | |
| 247 | 249 | void mb8795_device::receive() |
| 248 | 250 | { |
| 249 | | fprintf(stderr, "mb8975: received packet for %02x.%02x.%02x.%02x.%02x.%02x len=%04x, mode=%d\n", |
| 250 | | rxbuf[0], rxbuf[1], rxbuf[2], rxbuf[3], rxbuf[4], rxbuf[5], |
| 251 | | rxlen, rxmode & 3); |
| 252 | 251 | bool keep = false; |
| 253 | 252 | switch(rxmode & EN_RMD_WHATRECV) { |
| 254 | 253 | case EN_RMD_RECV_NONE: |
| r26274 | r26275 | |
| 264 | 263 | keep = true; |
| 265 | 264 | break; |
| 266 | 265 | } |
| 267 | | fprintf(stderr, " -> %s\n", keep ? "kept" : "dropped"); |
| 266 | logerror("%s: received packet for %02x.%02x.%02x.%02x.%02x.%02x len=%04x, mode=%d -> %s\n", tag(), |
| 267 | rxbuf[0], rxbuf[1], rxbuf[2], rxbuf[3], rxbuf[4], rxbuf[5], |
| 268 | rxlen, rxmode & 3, keep ? "kept" : "dropped"); |
| 268 | 269 | if(!keep) |
| 269 | 270 | rxlen = false; |
| 270 | 271 | else { |
trunk/src/mess/drivers/next.c
| r26274 | r26275 | |
| 4 | 4 | |
| 5 | 5 | TODO: |
| 6 | 6 | |
| 7 | - Find out why we get a segfault in the middle of the install |
| 8 | |
| 7 | 9 | - Hook up the mouse (not before the system boots though, see the first problem) |
| 8 | 10 | |
| 9 | 11 | - Find why the kernel doesn't manage to change the nvram at boot (readback error) |
| r26274 | r26275 | |
| 348 | 350 | eof = false; |
| 349 | 351 | switch(slot) { |
| 350 | 352 | case 1: |
| 351 | | if(fdc && fdc->get_drq()) |
| 353 | if(fdc && fdc->get_drq()) { |
| 352 | 354 | val = fdc->dma_r(); |
| 353 | | else |
| 355 | if(eof) { |
| 356 | fdc->tc_w(true); |
| 357 | fdc->tc_w(false); |
| 358 | } |
| 359 | } else |
| 354 | 360 | val = scsi->dma_r(); |
| 355 | 361 | break; |
| 356 | 362 | |
| r26274 | r26275 | |
| 360 | 366 | |
| 361 | 367 | case 21: |
| 362 | 368 | net->rx_dma_r(val, eof); |
| 369 | logerror("dma read net %02x %s\n", val, eof ? "eof" : ""); |
| 363 | 370 | break; |
| 364 | 371 | |
| 365 | 372 | default: |
| r26274 | r26275 | |
| 374 | 381 | err = false; |
| 375 | 382 | switch(slot) { |
| 376 | 383 | case 1: |
| 377 | | scsi->dma_w(data); |
| 384 | if(fdc && fdc->get_drq()) { |
| 385 | fdc->dma_w(data); |
| 386 | if(eof) { |
| 387 | fdc->tc_w(true); |
| 388 | fdc->tc_w(false); |
| 389 | } |
| 390 | } else |
| 391 | scsi->dma_w(data); |
| 378 | 392 | break; |
| 379 | 393 | |
| 380 | 394 | case 4: |
| r26274 | r26275 | |
| 422 | 436 | ds.state &= ~DMA_SUPDATE; |
| 423 | 437 | } |
| 424 | 438 | ds.state |= DMA_COMPLETE; |
| 439 | logerror("dma end slot %d irq %d\n", slot, dma_irqs[slot]); |
| 425 | 440 | if(dma_irqs[slot] >= 0) |
| 426 | 441 | irq_set(dma_irqs[slot], true); |
| 427 | 442 | } |
| r26274 | r26275 | |
| 952 | 967 | // devices |
| 953 | 968 | MCFG_NSCSI_BUS_ADD("scsibus") |
| 954 | 969 | MCFG_MCCS1850_ADD("rtc", XTAL_32_768kHz, |
| 955 | | line_cb_t(), line_cb_t(), line_cb_t()) |
| 970 | line_cb_t(), line_cb_t(), line_cb_t()) |
| 956 | 971 | MCFG_SCC8530_ADD("scc", XTAL_25MHz, line_cb_t(FUNC(next_state::scc_irq), static_cast<next_state *>(owner))) |
| 957 | 972 | MCFG_NEXTKBD_ADD("keyboard", |
| 958 | 973 | line_cb_t(FUNC(next_state::keyboard_irq), static_cast<next_state *>(owner)), |