static void josvolly_8741_w(const address_space *space, int num, int offset, int data) { JV8741 *mcu = &i8741[num]; if(offset==1) { LOG(("%s:8741[%d] CW %02X\n", cpuexec_describe_context(space->machine), num, data)); /* read pointer */ mcu->cmd = data; /* CMD */ switch(data) { case 0: mcu->txd = data ^ 0x40; mcu->sts |= 0x02; break; case 1: mcu->txd = data ^ 0x40; mcu->sts |= 0x02; #if 1 /* ?? */ mcu->rxd = 0; /* SBSTS ( DIAG ) , killed */ mcu->sts |= 0x01; /* RD ready */ #endif break; case 2: #if 1 mcu->rxd = input_port_read(space->machine, "DSW2"); mcu->sts |= 0x01; /* RD ready */ #endif break; case 3: /* normal mode ? */ break; case 0xf0: /* clear main sts ? */ mcu->txd = data ^ 0x40; mcu->sts |= 0x02; break; } } else { /* data */ LOG(("%s:8741[%d] DW %02X\n", cpuexec_describe_context(space->machine), num, data)); mcu->txd = data ^ 0x40; /* parity reverce ? */ mcu->sts |= 0x02; /* TXD busy */ #if 1 /* interrupt ? */ if(num == 0) { if(josvolly_nmi_enable) { cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); josvolly_nmi_enable = 0; } } #endif } josvolly_8741_do(space->machine, num); }
static void josvolly_8741_w(int num,int offset,int data,int log) { JV8741 *mcu = &i8741[num]; if(offset==1) { #if __log__ if(log) logerror("PC=%04X 8741[%d] CW %02X\n",activecpu_get_pc(),num,data); #endif /* read pointer */ mcu->cmd = data; /* CMD */ switch(data) { case 0: mcu->txd = data ^ 0x40; mcu->sts |= 0x02; break; case 1: mcu->txd = data ^ 0x40; mcu->sts |= 0x02; #if 1 /* ?? */ mcu->rxd = 0; /* SBSTS ( DIAG ) , killed */ mcu->sts |= 0x01; /* RD ready */ #endif break; case 2: #if 1 mcu->rxd = input_port_4_r(0); /* DSW2 */ mcu->sts |= 0x01; /* RD ready */ #endif break; case 3: /* normal mode ? */ break; case 0xf0: /* clear main sts ? */ mcu->txd = data ^ 0x40; mcu->sts |= 0x02; break; } } else { /* data */ #if __log__ if(log) logerror("PC=%04X 8741[%d] DW %02X\n",activecpu_get_pc(),num,data); #endif mcu->txd = data^0x40; /* parity reverce ? */ mcu->sts |= 0x02; /* TXD busy */ #if 1 /* interrupt ? */ if(num==0) { if(josvolly_nmi_enable) { cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); josvolly_nmi_enable = 0; } } #endif } josvolly_8741_do(num); }