src/emu/cpu/m6800/m6800.h
| r10191 | r10192 | |
| 23 | 23 | enum |
| 24 | 24 | { |
| 25 | 25 | M6800_IRQ_LINE = 0, /* IRQ line number */ |
| 26 | | M6800_TIN_LINE, /* P20/Tin Input Capture line (eddge sense) */ |
| 26 | M6801_TIN_LINE, /* P20/Tin Input Capture line (eddge sense) */ |
| 27 | 27 | /* Active eddge is selecrable by internal reg. */ |
| 28 | 28 | /* raise eddge : CLEAR_LINE -> ASSERT_LINE */ |
| 29 | 29 | /* fall eddge : ASSERT_LINE -> CLEAR_LINE */ |
| 30 | 30 | /* it is usuali to use PULSE_LINE state */ |
| 31 | | M6800_SC1_LINE |
| 31 | M6801_SC1_LINE |
| 32 | 32 | }; |
| 33 | 33 | |
| 34 | 34 | enum |
| r10191 | r10192 | |
| 43 | 43 | M6801_MODE_7 |
| 44 | 44 | }; |
| 45 | 45 | |
| 46 | | /* By default, on a port write port bits which are not set as output in the DDR */ |
| 47 | | /* are set to the value returned by a read from the same port. If you need to */ |
| 48 | | /* know the DDR for e.g. port 1, do m6803_internal_registers_r(M6801_DDR1) */ |
| 49 | | |
| 50 | 46 | enum |
| 51 | 47 | { |
| 52 | | M6803_DDR1 = 0x00, |
| 53 | | M6803_DDR2 = 0x01, |
| 54 | | M6803_DDR3 = 0x04, |
| 55 | | M6803_DDR4 = 0x05 |
| 48 | M6801_PORT1 = 0x100, |
| 49 | M6801_PORT2, |
| 50 | M6801_PORT3, |
| 51 | M6801_PORT4 |
| 56 | 52 | }; |
| 57 | 53 | |
| 58 | | enum |
| 59 | | { |
| 60 | | M6803_PORT1 = 0x100, |
| 61 | | M6803_PORT2, |
| 62 | | M6803_PORT3, |
| 63 | | M6803_PORT4 |
| 64 | | }; |
| 65 | | |
| 66 | 54 | DECLARE_LEGACY_CPU_DEVICE(M6800, m6800); |
| 67 | 55 | DECLARE_LEGACY_CPU_DEVICE(M6801, m6801); |
| 68 | 56 | DECLARE_LEGACY_CPU_DEVICE(M6802, m6802); |
| r10191 | r10192 | |
| 71 | 59 | DECLARE_LEGACY_CPU_DEVICE(HD63701, hd63701); |
| 72 | 60 | DECLARE_LEGACY_CPU_DEVICE(NSC8105, nsc8105); |
| 73 | 61 | |
| 74 | | /* FIMXE: these should be replaced to use m6803 ones */ |
| 75 | | #define HD63701_DDR1 M6803_DDR1 |
| 76 | | #define HD63701_DDR2 M6803_DDR2 |
| 77 | | #define HD63701_DDR3 M6803_DDR3 |
| 78 | | #define HD63701_DDR4 M6803_DDR4 |
| 62 | READ8_HANDLER( m6801_io_r ); |
| 63 | WRITE8_HANDLER( m6801_io_w ); |
| 79 | 64 | |
| 80 | | #define HD63701_PORT1 M6803_PORT1 |
| 81 | | #define HD63701_PORT2 M6803_PORT2 |
| 82 | | #define HD63701_PORT3 M6803_PORT3 |
| 83 | | #define HD63701_PORT4 M6803_PORT4 |
| 84 | | |
| 85 | | READ8_HANDLER( hd63701_internal_registers_r ); |
| 86 | | WRITE8_HANDLER( hd63701_internal_registers_w ); |
| 87 | | |
| 88 | | |
| 89 | 65 | CPU_DISASSEMBLE( m6800 ); |
| 90 | 66 | CPU_DISASSEMBLE( m6801 ); |
| 91 | 67 | CPU_DISASSEMBLE( m6802 ); |
| r10191 | r10192 | |
| 94 | 70 | CPU_DISASSEMBLE( hd63701 ); |
| 95 | 71 | CPU_DISASSEMBLE( nsc8105 ); |
| 96 | 72 | |
| 97 | | |
| 98 | | #if 0 |
| 99 | | /* Wonder if we need it */ |
| 100 | | /**************************************************************************** |
| 101 | | * For now make the 6801 using the m6800 variables and functions |
| 102 | | ****************************************************************************/ |
| 103 | | #define M6801_A M6800_A |
| 104 | | #define M6801_B M6800_B |
| 105 | | #define M6801_PC M6800_PC |
| 106 | | #define M6801_S M6800_S |
| 107 | | #define M6801_X M6800_X |
| 108 | | #define M6801_CC M6800_CC |
| 109 | | #define M6801_WAI_STATE M6800_WAI_STATE |
| 110 | | #define M6801_NMI_STATE M6800_NMI_STATE |
| 111 | | #define M6801_IRQ_STATE M6800_IRQ_STATE |
| 112 | | |
| 113 | | #define M6801_WAI M6800_WAI |
| 114 | | #define M6801_IRQ_LINE M6800_IRQ_LINE |
| 115 | | |
| 116 | | /**************************************************************************** |
| 117 | | * For now make the 6802 using the m6800 variables and functions |
| 118 | | ****************************************************************************/ |
| 119 | | #define M6802_A M6800_A |
| 120 | | #define M6802_B M6800_B |
| 121 | | #define M6802_PC M6800_PC |
| 122 | | #define M6802_S M6800_S |
| 123 | | #define M6802_X M6800_X |
| 124 | | #define M6802_CC M6800_CC |
| 125 | | #define M6802_WAI_STATE M6800_WAI_STATE |
| 126 | | #define M6802_NMI_STATE M6800_NMI_STATE |
| 127 | | #define M6802_IRQ_STATE M6800_IRQ_STATE |
| 128 | | |
| 129 | | #define M6802_WAI M6800_WAI |
| 130 | | #define M6802_IRQ_LINE M6800_IRQ_LINE |
| 131 | | |
| 132 | | /**************************************************************************** |
| 133 | | * For now make the 6803 using the m6800 variables and functions |
| 134 | | ****************************************************************************/ |
| 135 | | #define M6803_A M6800_A |
| 136 | | #define M6803_B M6800_B |
| 137 | | #define M6803_PC M6800_PC |
| 138 | | #define M6803_S M6800_S |
| 139 | | #define M6803_X M6800_X |
| 140 | | #define M6803_CC M6800_CC |
| 141 | | #define M6803_WAI_STATE M6800_WAI_STATE |
| 142 | | #define M6803_NMI_STATE M6800_NMI_STATE |
| 143 | | #define M6803_IRQ_STATE M6800_IRQ_STATE |
| 144 | | |
| 145 | | #define M6803_WAI M6800_WAI |
| 146 | | #define M6803_IRQ_LINE M6800_IRQ_LINE |
| 147 | | #define M6803_TIN_LINE M6800_TIN_LINE |
| 148 | | |
| 149 | | /* By default, on a port write port bits which are not set as output in the DDR */ |
| 150 | | /* are set to the value returned by a read from the same port. If you need to */ |
| 151 | | /* know the DDR for e.g. port 1, do m6803_internal_registers_r(M6801_DDR1) */ |
| 152 | | |
| 153 | | #define M6803_DDR1 0x00 |
| 154 | | #define M6803_DDR2 0x01 |
| 155 | | #define M6803_DDR3 0x04 |
| 156 | | #define M6803_DDR4 0x05 |
| 157 | | |
| 158 | | #define M6803_PORT1 0x100 |
| 159 | | #define M6803_PORT2 0x101 |
| 160 | | #define M6803_PORT3 0x102 |
| 161 | | #define M6803_PORT4 0x103 |
| 162 | | |
| 163 | | /**************************************************************************** |
| 164 | | * For now make the 6808 using the m6800 variables and functions |
| 165 | | ****************************************************************************/ |
| 166 | | #define M6808_A M6800_A |
| 167 | | #define M6808_B M6800_B |
| 168 | | #define M6808_PC M6800_PC |
| 169 | | #define M6808_S M6800_S |
| 170 | | #define M6808_X M6800_X |
| 171 | | #define M6808_CC M6800_CC |
| 172 | | #define M6808_WAI_STATE M6800_WAI_STATE |
| 173 | | #define M6808_NMI_STATE M6800_NMI_STATE |
| 174 | | #define M6808_IRQ_STATE M6800_IRQ_STATE |
| 175 | | |
| 176 | | #define M6808_WAI M6800_WAI |
| 177 | | #define M6808_IRQ_LINE M6800_IRQ_LINE |
| 178 | | |
| 179 | | /**************************************************************************** |
| 180 | | * For now make the HD63701 using the m6800 variables and functions |
| 181 | | ****************************************************************************/ |
| 182 | | #define HD63701_A M6800_A |
| 183 | | #define HD63701_B M6800_B |
| 184 | | #define HD63701_PC M6800_PC |
| 185 | | #define HD63701_S M6800_S |
| 186 | | #define HD63701_X M6800_X |
| 187 | | #define HD63701_CC M6800_CC |
| 188 | | #define HD63701_WAI_STATE M6800_WAI_STATE |
| 189 | | #define HD63701_NMI_STATE M6800_NMI_STATE |
| 190 | | #define HD63701_IRQ_STATE M6800_IRQ_STATE |
| 191 | | |
| 192 | | #define HD63701_WAI M6800_WAI |
| 193 | | #define HD63701_SLP M6800_SLP |
| 194 | | #define HD63701_IRQ_LINE M6800_IRQ_LINE |
| 195 | | #define HD63701_TIN_LINE M6800_TIN_LINE |
| 196 | | |
| 197 | | #define HD63701_DDR1 M6803_DDR1 |
| 198 | | #define HD63701_DDR2 M6803_DDR2 |
| 199 | | #define HD63701_DDR3 M6803_DDR3 |
| 200 | | #define HD63701_DDR4 M6803_DDR4 |
| 201 | | |
| 202 | | #define HD63701_PORT1 M6803_PORT1 |
| 203 | | #define HD63701_PORT2 M6803_PORT2 |
| 204 | | #define HD63701_PORT3 M6803_PORT3 |
| 205 | | #define HD63701_PORT4 M6803_PORT4 |
| 206 | | |
| 207 | | READ8_HANDLER( hd63701_internal_registers_r ); |
| 208 | | WRITE8_HANDLER( hd63701_internal_registers_w ); |
| 209 | | |
| 210 | | |
| 211 | | /**************************************************************************** |
| 212 | | * For now make the NSC8105 using the m6800 variables and functions |
| 213 | | ****************************************************************************/ |
| 214 | | #define NSC8105_A M6800_A |
| 215 | | #define NSC8105_B M6800_B |
| 216 | | #define NSC8105_PC M6800_PC |
| 217 | | #define NSC8105_S M6800_S |
| 218 | | #define NSC8105_X M6800_X |
| 219 | | #define NSC8105_CC M6800_CC |
| 220 | | #define NSC8105_WAI_STATE M6800_WAI_STATE |
| 221 | | #define NSC8105_NMI_STATE M6800_NMI_STATE |
| 222 | | #define NSC8105_IRQ_STATE M6800_IRQ_STATE |
| 223 | | |
| 224 | | #define NSC8105_WAI M6800_WAI |
| 225 | | #define NSC8105_IRQ_LINE M6800_IRQ_LINE |
| 226 | | #define NSC8105_TIN_LINE M6800_TIN_LINE |
| 227 | | |
| 228 | | #endif |
| 229 | 73 | #endif /* __M6800_H__ */ |
| 230 | 74 | |
src/emu/cpu/m6800/m6800.c
| r10191 | r10192 | |
| 630 | 630 | { |
| 631 | 631 | TAKE_ICI; |
| 632 | 632 | if( cpustate->irq_callback ) |
| 633 | | (void)(*cpustate->irq_callback)(cpustate->device, M6800_TIN_LINE); |
| 633 | (void)(*cpustate->irq_callback)(cpustate->device, M6801_TIN_LINE); |
| 634 | 634 | } |
| 635 | 635 | else if ((cpustate->tcsr & (TCSR_EOCI|TCSR_OCF)) == (TCSR_EOCI|TCSR_OCF)) |
| 636 | 636 | { |
| r10191 | r10192 | |
| 768 | 768 | |
| 769 | 769 | data &= 0x1f; |
| 770 | 770 | |
| 771 | | cpustate->io->write_byte(M6803_PORT2, data); |
| 771 | cpustate->io->write_byte(M6801_PORT2, data); |
| 772 | 772 | } |
| 773 | 773 | |
| 774 | 774 | /* include the opcode prototypes and function pointer tables */ |
| r10191 | r10192 | |
| 779 | 779 | |
| 780 | 780 | static int m6800_rx(m6800_state *cpustate) |
| 781 | 781 | { |
| 782 | | return (cpustate->io->read_byte(M6803_PORT2) & M6800_PORT2_IO3) >> 3; |
| 782 | return (cpustate->io->read_byte(M6801_PORT2) & M6800_PORT2_IO3) >> 3; |
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | static void serial_transmit(m6800_state *cpustate) |
| r10191 | r10192 | |
| 1066 | 1066 | cpustate->nmi_pending = 0; |
| 1067 | 1067 | cpustate->sc1_state = 0; |
| 1068 | 1068 | cpustate->irq_state[M6800_IRQ_LINE] = 0; |
| 1069 | | cpustate->irq_state[M6800_TIN_LINE] = 0; |
| 1069 | cpustate->irq_state[M6801_TIN_LINE] = 0; |
| 1070 | 1070 | cpustate->ic_eddge = 0; |
| 1071 | 1071 | |
| 1072 | 1072 | cpustate->port1_ddr = 0x00; |
| r10191 | r10192 | |
| 1118 | 1118 | cpustate->nmi_state = state; |
| 1119 | 1119 | break; |
| 1120 | 1120 | |
| 1121 | | case M6800_SC1_LINE: |
| 1121 | case M6801_SC1_LINE: |
| 1122 | 1122 | if (!cpustate->port3_latched && (cpustate->p3csr & M6801_P3CSR_LE)) |
| 1123 | 1123 | { |
| 1124 | 1124 | if (!cpustate->sc1_state && state) |
| 1125 | 1125 | { |
| 1126 | 1126 | // latch input data to port 3 |
| 1127 | | cpustate->port3_data = (cpustate->io->read_byte(M6803_PORT3) & (cpustate->port3_ddr ^ 0xff)) | (cpustate->port3_data & cpustate->port3_ddr); |
| 1127 | cpustate->port3_data = (cpustate->io->read_byte(M6801_PORT3) & (cpustate->port3_ddr ^ 0xff)) | (cpustate->port3_data & cpustate->port3_ddr); |
| 1128 | 1128 | cpustate->port3_latched = 1; |
| 1129 | 1129 | //logerror("M6801 '%s' Latched Port 3 Data: %02x\n", cpustate->device->tag(), cpustate->port3_data); |
| 1130 | 1130 | |
| r10191 | r10192 | |
| 1139 | 1139 | LOG(("M6800 '%s' set_irq_line %d,%d\n", cpustate->device->tag(), irqline, state)); |
| 1140 | 1140 | cpustate->irq_state[irqline] = state; |
| 1141 | 1141 | |
| 1142 | | if (irqline == M6800_TIN_LINE && state != cpustate->irq_state[irqline]) |
| 1142 | if (irqline == M6801_TIN_LINE && state != cpustate->irq_state[irqline]) |
| 1143 | 1143 | { |
| 1144 | 1144 | //eddge = (state == CLEAR_LINE ) ? 2 : 0; |
| 1145 | 1145 | if( ((cpustate->tcsr&TCSR_IEDG) ^ (state==CLEAR_LINE ? TCSR_IEDG : 0))==0 ) |
| r10191 | r10192 | |
| 1254 | 1254 | cpustate->sci_timer = timer_alloc(device->machine, sci_tick, cpustate); |
| 1255 | 1255 | |
| 1256 | 1256 | state_register(cpustate, "m6803"); |
| 1257 | | } |
| 1258 | 1257 | |
| 1259 | | static READ8_HANDLER( m6801_io_r ); |
| 1260 | | static WRITE8_HANDLER( m6801_io_w ); |
| 1258 | if (device->baseconfig().static_config() != NULL) |
| 1259 | { |
| 1260 | m6801_interface *intf = (m6801_interface *) device->baseconfig().static_config(); |
| 1261 | 1261 | |
| 1262 | devcb_resolve_write_line(&cpustate->out_sc2_func, &intf->out_sc2_func, device); |
| 1263 | } |
| 1264 | } |
| 1265 | |
| 1262 | 1266 | static ADDRESS_MAP_START(m6803_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 1263 | 1267 | AM_RANGE(0x0000, 0x001f) AM_READWRITE(m6801_io_r, m6801_io_w) |
| 1264 | 1268 | AM_RANGE(0x0020, 0x007f) AM_NOP /* unused */ |
| r10191 | r10192 | |
| 1324 | 1328 | } |
| 1325 | 1329 | #endif |
| 1326 | 1330 | |
| 1327 | | static READ8_HANDLER( m6801_io_r ); |
| 1328 | | static WRITE8_HANDLER( m6801_io_w ); |
| 1329 | | |
| 1330 | | READ8_HANDLER( hd63701_internal_registers_r ) |
| 1331 | | { |
| 1332 | | return m6801_io_r(space, offset); |
| 1333 | | } |
| 1334 | | |
| 1335 | | WRITE8_HANDLER( hd63701_internal_registers_w ) |
| 1336 | | { |
| 1337 | | m6801_io_w(space, offset,data); |
| 1338 | | } |
| 1339 | | |
| 1340 | 1331 | /**************************************************************************** |
| 1341 | 1332 | * NSC-8105 similiar to the M6800, but the opcodes are scrambled and there |
| 1342 | 1333 | * is at least one new opcode ($fc) |
| r10191 | r10192 | |
| 1364 | 1355 | devcb_call_write_line(&cpustate->out_sc2_func, state); |
| 1365 | 1356 | } |
| 1366 | 1357 | |
| 1367 | | static READ8_HANDLER( m6801_io_r ) |
| 1358 | READ8_HANDLER( m6801_io_r ) |
| 1368 | 1359 | { |
| 1369 | 1360 | m6800_state *cpustate = get_safe_token(space->cpu); |
| 1370 | 1361 | |
| r10191 | r10192 | |
| 1384 | 1375 | if(cpustate->port1_ddr == 0xff) |
| 1385 | 1376 | data = cpustate->port1_data; |
| 1386 | 1377 | else |
| 1387 | | data = (cpustate->io->read_byte(M6803_PORT1) & (cpustate->port1_ddr ^ 0xff)) |
| 1378 | data = (cpustate->io->read_byte(M6801_PORT1) & (cpustate->port1_ddr ^ 0xff)) |
| 1388 | 1379 | | (cpustate->port1_data & cpustate->port1_ddr); |
| 1389 | 1380 | break; |
| 1390 | 1381 | |
| r10191 | r10192 | |
| 1392 | 1383 | if(cpustate->port2_ddr == 0xff) |
| 1393 | 1384 | data = cpustate->port2_data; |
| 1394 | 1385 | else |
| 1395 | | data = (cpustate->io->read_byte(M6803_PORT2) & (cpustate->port2_ddr ^ 0xff)) |
| 1386 | data = (cpustate->io->read_byte(M6801_PORT2) & (cpustate->port2_ddr ^ 0xff)) |
| 1396 | 1387 | | (cpustate->port2_data & cpustate->port2_ddr); |
| 1397 | 1388 | break; |
| 1398 | 1389 | |
| r10191 | r10192 | |
| 1420 | 1411 | if ((cpustate->p3csr & M6801_P3CSR_LE) || (cpustate->port3_ddr == 0xff)) |
| 1421 | 1412 | data = cpustate->port3_data; |
| 1422 | 1413 | else |
| 1423 | | data = (cpustate->io->read_byte(M6803_PORT3) & (cpustate->port3_ddr ^ 0xff)) |
| 1414 | data = (cpustate->io->read_byte(M6801_PORT3) & (cpustate->port3_ddr ^ 0xff)) |
| 1424 | 1415 | | (cpustate->port3_data & cpustate->port3_ddr); |
| 1425 | 1416 | |
| 1426 | 1417 | cpustate->port3_latched = 0; |
| r10191 | r10192 | |
| 1435 | 1426 | if(cpustate->port4_ddr == 0xff) |
| 1436 | 1427 | data = cpustate->port4_data; |
| 1437 | 1428 | else |
| 1438 | | data = (cpustate->io->read_byte(M6803_PORT4) & (cpustate->port4_ddr ^ 0xff)) |
| 1429 | data = (cpustate->io->read_byte(M6801_PORT4) & (cpustate->port4_ddr ^ 0xff)) |
| 1439 | 1430 | | (cpustate->port4_data & cpustate->port4_ddr); |
| 1440 | 1431 | break; |
| 1441 | 1432 | |
| r10191 | r10192 | |
| 1563 | 1554 | return data; |
| 1564 | 1555 | } |
| 1565 | 1556 | |
| 1566 | | static WRITE8_HANDLER( m6801_io_w ) |
| 1557 | WRITE8_HANDLER( m6801_io_w ) |
| 1567 | 1558 | { |
| 1568 | 1559 | m6800_state *cpustate = get_safe_token(space->cpu); |
| 1569 | 1560 | |
| r10191 | r10192 | |
| 1576 | 1567 | { |
| 1577 | 1568 | cpustate->port1_ddr = data; |
| 1578 | 1569 | if(cpustate->port1_ddr == 0xff) |
| 1579 | | cpustate->io->write_byte(M6803_PORT1,cpustate->port1_data); |
| 1570 | cpustate->io->write_byte(M6801_PORT1,cpustate->port1_data); |
| 1580 | 1571 | else |
| 1581 | | cpustate->io->write_byte(M6803_PORT1,(cpustate->port1_data & cpustate->port1_ddr) | (cpustate->port1_ddr ^ 0xff)); |
| 1572 | cpustate->io->write_byte(M6801_PORT1,(cpustate->port1_data & cpustate->port1_ddr) | (cpustate->port1_ddr ^ 0xff)); |
| 1582 | 1573 | } |
| 1583 | 1574 | break; |
| 1584 | 1575 | |
| r10191 | r10192 | |
| 1600 | 1591 | |
| 1601 | 1592 | cpustate->port1_data = data; |
| 1602 | 1593 | if(cpustate->port1_ddr == 0xff) |
| 1603 | | cpustate->io->write_byte(M6803_PORT1,cpustate->port1_data); |
| 1594 | cpustate->io->write_byte(M6801_PORT1,cpustate->port1_data); |
| 1604 | 1595 | else |
| 1605 | | cpustate->io->write_byte(M6803_PORT1,(cpustate->port1_data & cpustate->port1_ddr) | (cpustate->port1_ddr ^ 0xff)); |
| 1596 | cpustate->io->write_byte(M6801_PORT1,(cpustate->port1_data & cpustate->port1_ddr) | (cpustate->port1_ddr ^ 0xff)); |
| 1606 | 1597 | break; |
| 1607 | 1598 | |
| 1608 | 1599 | case IO_P2DATA: |
| r10191 | r10192 | |
| 1620 | 1611 | { |
| 1621 | 1612 | cpustate->port3_ddr = data; |
| 1622 | 1613 | if(cpustate->port3_ddr == 0xff) |
| 1623 | | cpustate->io->write_byte(M6803_PORT3,cpustate->port3_data); |
| 1614 | cpustate->io->write_byte(M6801_PORT3,cpustate->port3_data); |
| 1624 | 1615 | else |
| 1625 | | cpustate->io->write_byte(M6803_PORT3,(cpustate->port3_data & cpustate->port3_ddr) | (cpustate->port3_ddr ^ 0xff)); |
| 1616 | cpustate->io->write_byte(M6801_PORT3,(cpustate->port3_data & cpustate->port3_ddr) | (cpustate->port3_ddr ^ 0xff)); |
| 1626 | 1617 | } |
| 1627 | 1618 | break; |
| 1628 | 1619 | |
| r10191 | r10192 | |
| 1633 | 1624 | { |
| 1634 | 1625 | cpustate->port4_ddr = data; |
| 1635 | 1626 | if(cpustate->port4_ddr == 0xff) |
| 1636 | | cpustate->io->write_byte(M6803_PORT4,cpustate->port4_data); |
| 1627 | cpustate->io->write_byte(M6801_PORT4,cpustate->port4_data); |
| 1637 | 1628 | else |
| 1638 | | cpustate->io->write_byte(M6803_PORT4,(cpustate->port4_data & cpustate->port4_ddr) | (cpustate->port4_ddr ^ 0xff)); |
| 1629 | cpustate->io->write_byte(M6801_PORT4,(cpustate->port4_data & cpustate->port4_ddr) | (cpustate->port4_ddr ^ 0xff)); |
| 1639 | 1630 | } |
| 1640 | 1631 | break; |
| 1641 | 1632 | |
| r10191 | r10192 | |
| 1656 | 1647 | |
| 1657 | 1648 | cpustate->port3_data = data; |
| 1658 | 1649 | if(cpustate->port3_ddr == 0xff) |
| 1659 | | cpustate->io->write_byte(M6803_PORT3,cpustate->port3_data); |
| 1650 | cpustate->io->write_byte(M6801_PORT3,cpustate->port3_data); |
| 1660 | 1651 | else |
| 1661 | | cpustate->io->write_byte(M6803_PORT3,(cpustate->port3_data & cpustate->port3_ddr) | (cpustate->port3_ddr ^ 0xff)); |
| 1652 | cpustate->io->write_byte(M6801_PORT3,(cpustate->port3_data & cpustate->port3_ddr) | (cpustate->port3_ddr ^ 0xff)); |
| 1662 | 1653 | |
| 1663 | 1654 | if (cpustate->p3csr & M6801_P3CSR_OSS) |
| 1664 | 1655 | { |
| r10191 | r10192 | |
| 1671 | 1662 | |
| 1672 | 1663 | cpustate->port4_data = data; |
| 1673 | 1664 | if(cpustate->port4_ddr == 0xff) |
| 1674 | | cpustate->io->write_byte(M6803_PORT4,cpustate->port4_data); |
| 1665 | cpustate->io->write_byte(M6801_PORT4,cpustate->port4_data); |
| 1675 | 1666 | else |
| 1676 | | cpustate->io->write_byte(M6803_PORT4,(cpustate->port4_data & cpustate->port4_ddr) | (cpustate->port4_ddr ^ 0xff)); |
| 1667 | cpustate->io->write_byte(M6801_PORT4,(cpustate->port4_data & cpustate->port4_ddr) | (cpustate->port4_ddr ^ 0xff)); |
| 1677 | 1668 | break; |
| 1678 | 1669 | |
| 1679 | 1670 | case IO_TCSR: |
| r10191 | r10192 | |
| 1806 | 1797 | { |
| 1807 | 1798 | /* --- the following bits of info are set as 64-bit signed integers --- */ |
| 1808 | 1799 | case CPUINFO_INT_INPUT_STATE + M6800_IRQ_LINE: set_irq_line(cpustate, M6800_IRQ_LINE, info->i); break; |
| 1809 | | case CPUINFO_INT_INPUT_STATE + M6800_TIN_LINE: set_irq_line(cpustate, M6800_TIN_LINE, info->i); break; |
| 1810 | | case CPUINFO_INT_INPUT_STATE + M6800_SC1_LINE: set_irq_line(cpustate, M6800_SC1_LINE, info->i); break; |
| 1800 | case CPUINFO_INT_INPUT_STATE + M6801_TIN_LINE: set_irq_line(cpustate, M6801_TIN_LINE, info->i); break; |
| 1801 | case CPUINFO_INT_INPUT_STATE + M6801_SC1_LINE: set_irq_line(cpustate, M6801_SC1_LINE, info->i); break; |
| 1811 | 1802 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(cpustate, INPUT_LINE_NMI, info->i); break; |
| 1812 | 1803 | |
| 1813 | 1804 | case CPUINFO_INT_PC: PC = info->i; break; |
| r10191 | r10192 | |
| 1855 | 1846 | case DEVINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; |
| 1856 | 1847 | |
| 1857 | 1848 | case CPUINFO_INT_INPUT_STATE + M6800_IRQ_LINE: info->i = cpustate->irq_state[M6800_IRQ_LINE]; break; |
| 1858 | | case CPUINFO_INT_INPUT_STATE + M6800_TIN_LINE: info->i = cpustate->irq_state[M6800_TIN_LINE]; break; |
| 1859 | | case CPUINFO_INT_INPUT_STATE + M6800_SC1_LINE: info->i = cpustate->irq_state[M6800_SC1_LINE]; break; |
| 1849 | case CPUINFO_INT_INPUT_STATE + M6801_TIN_LINE: info->i = cpustate->irq_state[M6801_TIN_LINE]; break; |
| 1850 | case CPUINFO_INT_INPUT_STATE + M6801_SC1_LINE: info->i = cpustate->irq_state[M6801_SC1_LINE]; break; |
| 1860 | 1851 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->nmi_state; break; |
| 1861 | 1852 | |
| 1862 | 1853 | case CPUINFO_INT_PREVIOUSPC: info->i = cpustate->ppc.w.l; break; |
src/mess/drivers/adam.c
| r10191 | r10192 | |
| 1255 | 1255 | //------------------------------------------------- |
| 1256 | 1256 | |
| 1257 | 1257 | static ADDRESS_MAP_START( master6801_mem, ADDRESS_SPACE_PROGRAM, 8, adam_state ) |
| 1258 | | AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(hd63701_internal_registers_r, hd63701_internal_registers_w) |
| 1258 | AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w) |
| 1259 | 1259 | AM_RANGE(0x0080, 0x00ff) AM_RAM |
| 1260 | 1260 | AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_MAIN_TAG, 0) |
| 1261 | 1261 | ADDRESS_MAP_END |
| r10191 | r10192 | |
| 1266 | 1266 | //------------------------------------------------- |
| 1267 | 1267 | |
| 1268 | 1268 | static ADDRESS_MAP_START( master6801_io, ADDRESS_SPACE_IO, 8, adam_state ) |
| 1269 | | AM_RANGE(M6803_PORT1, M6803_PORT1) AM_WRITE(master6801_p1_w) |
| 1270 | | AM_RANGE(M6803_PORT2, M6803_PORT2) AM_READWRITE(master6801_p2_r, master6801_p2_w) |
| 1271 | | AM_RANGE(M6803_PORT3, M6803_PORT3) AM_READWRITE(master6801_p3_r, master6801_p3_w) |
| 1272 | | AM_RANGE(M6803_PORT4, M6803_PORT4) AM_WRITE(master6801_p4_w) |
| 1269 | AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(master6801_p1_w) |
| 1270 | AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(master6801_p2_r, master6801_p2_w) |
| 1271 | AM_RANGE(M6801_PORT3, M6801_PORT3) AM_READWRITE(master6801_p3_r, master6801_p3_w) |
| 1272 | AM_RANGE(M6801_PORT4, M6801_PORT4) AM_WRITE(master6801_p4_w) |
| 1273 | 1273 | ADDRESS_MAP_END |
| 1274 | 1274 | |
| 1275 | 1275 | |
| r10191 | r10192 | |
| 1278 | 1278 | //------------------------------------------------- |
| 1279 | 1279 | |
| 1280 | 1280 | static ADDRESS_MAP_START( kb6801_mem, ADDRESS_SPACE_PROGRAM, 8, adam_state ) |
| 1281 | | AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(hd63701_internal_registers_r, hd63701_internal_registers_w) |
| 1281 | AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w) |
| 1282 | 1282 | AM_RANGE(0x0080, 0x00ff) AM_RAM |
| 1283 | 1283 | AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_KB_TAG, 0) |
| 1284 | 1284 | ADDRESS_MAP_END |
| r10191 | r10192 | |
| 1289 | 1289 | //------------------------------------------------- |
| 1290 | 1290 | |
| 1291 | 1291 | static ADDRESS_MAP_START( kb6801_io, ADDRESS_SPACE_IO, 8, adam_state ) |
| 1292 | | AM_RANGE(M6803_PORT1, M6803_PORT1) AM_READ(kb6801_p1_r) |
| 1293 | | AM_RANGE(M6803_PORT2, M6803_PORT2) AM_READWRITE(kb6801_p2_r, kb6801_p2_w) |
| 1294 | | AM_RANGE(M6803_PORT3, M6803_PORT3) AM_READWRITE(kb6801_p3_r, kb6801_p3_w) |
| 1295 | | AM_RANGE(M6803_PORT4, M6803_PORT4) AM_READWRITE(kb6801_p4_r, kb6801_p4_w) |
| 1292 | AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READ(kb6801_p1_r) |
| 1293 | AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(kb6801_p2_r, kb6801_p2_w) |
| 1294 | AM_RANGE(M6801_PORT3, M6801_PORT3) AM_READWRITE(kb6801_p3_r, kb6801_p3_w) |
| 1295 | AM_RANGE(M6801_PORT4, M6801_PORT4) AM_READWRITE(kb6801_p4_r, kb6801_p4_w) |
| 1296 | 1296 | ADDRESS_MAP_END |
| 1297 | 1297 | |
| 1298 | 1298 | |
| r10191 | r10192 | |
| 1301 | 1301 | //------------------------------------------------- |
| 1302 | 1302 | |
| 1303 | 1303 | static ADDRESS_MAP_START( ddp6801_mem, ADDRESS_SPACE_PROGRAM, 8, adam_state ) |
| 1304 | | AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(hd63701_internal_registers_r, hd63701_internal_registers_w) |
| 1304 | AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w) |
| 1305 | 1305 | AM_RANGE(0x0080, 0x00ff) AM_RAM |
| 1306 | 1306 | AM_RANGE(0x0400, 0x07ff) AM_RAM |
| 1307 | 1307 | AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_DDP_TAG, 0) |
| r10191 | r10192 | |
| 1313 | 1313 | //------------------------------------------------- |
| 1314 | 1314 | |
| 1315 | 1315 | static ADDRESS_MAP_START( ddp6801_io, ADDRESS_SPACE_IO, 8, adam_state ) |
| 1316 | | AM_RANGE(M6803_PORT1, M6803_PORT1) AM_WRITE(ddp6801_p1_w) |
| 1317 | | AM_RANGE(M6803_PORT2, M6803_PORT2) AM_READWRITE(ddp6801_p2_r, ddp6801_p2_w) |
| 1318 | | AM_RANGE(M6803_PORT3, M6803_PORT3) AM_NOP // Multiplexed Address/Data |
| 1319 | | AM_RANGE(M6803_PORT4, M6803_PORT4) AM_READ(ddp6801_p4_r) |
| 1316 | AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(ddp6801_p1_w) |
| 1317 | AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(ddp6801_p2_r, ddp6801_p2_w) |
| 1318 | AM_RANGE(M6801_PORT3, M6801_PORT3) AM_NOP // Multiplexed Address/Data |
| 1319 | AM_RANGE(M6801_PORT4, M6801_PORT4) AM_READ(ddp6801_p4_r) |
| 1320 | 1320 | ADDRESS_MAP_END |
| 1321 | 1321 | |
| 1322 | 1322 | |
| r10191 | r10192 | |
| 1325 | 1325 | //------------------------------------------------- |
| 1326 | 1326 | |
| 1327 | 1327 | static ADDRESS_MAP_START( printer6801_mem, ADDRESS_SPACE_PROGRAM, 8, adam_state ) |
| 1328 | | AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(hd63701_internal_registers_r, hd63701_internal_registers_w) |
| 1328 | AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w) |
| 1329 | 1329 | AM_RANGE(0x0080, 0x00ff) AM_RAM |
| 1330 | 1330 | AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_PRN_TAG, 0) |
| 1331 | 1331 | ADDRESS_MAP_END |
| r10191 | r10192 | |
| 1336 | 1336 | //------------------------------------------------- |
| 1337 | 1337 | |
| 1338 | 1338 | static ADDRESS_MAP_START( printer6801_io, ADDRESS_SPACE_IO, 8, adam_state ) |
| 1339 | | AM_RANGE(M6803_PORT1, M6803_PORT1) AM_WRITE(printer6801_p1_w) |
| 1340 | | AM_RANGE(M6803_PORT2, M6803_PORT2) AM_READWRITE(printer6801_p2_r, printer6801_p2_w) |
| 1341 | | AM_RANGE(M6803_PORT3, M6803_PORT3) AM_READ(printer6801_p3_r) |
| 1342 | | AM_RANGE(M6803_PORT4, M6803_PORT4) AM_READWRITE(printer6801_p4_r, printer6801_p4_w) |
| 1339 | AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(printer6801_p1_w) |
| 1340 | AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(printer6801_p2_r, printer6801_p2_w) |
| 1341 | AM_RANGE(M6801_PORT3, M6801_PORT3) AM_READ(printer6801_p3_r) |
| 1342 | AM_RANGE(M6801_PORT4, M6801_PORT4) AM_READWRITE(printer6801_p4_r, printer6801_p4_w) |
| 1343 | 1343 | ADDRESS_MAP_END |
| 1344 | 1344 | |
| 1345 | 1345 | |
| r10191 | r10192 | |
| 1348 | 1348 | //------------------------------------------------- |
| 1349 | 1349 | |
| 1350 | 1350 | static ADDRESS_MAP_START( fdc6801_mem, ADDRESS_SPACE_PROGRAM, 8, adam_state ) |
| 1351 | | AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(hd63701_internal_registers_r, hd63701_internal_registers_w) |
| 1351 | AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w) |
| 1352 | 1352 | AM_RANGE(0x0080, 0x00ff) AM_RAM |
| 1353 | 1353 | AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_FDC_TAG, 0) |
| 1354 | 1354 | ADDRESS_MAP_END |
| r10191 | r10192 | |
| 1359 | 1359 | //------------------------------------------------- |
| 1360 | 1360 | |
| 1361 | 1361 | static ADDRESS_MAP_START( fdc6801_io, ADDRESS_SPACE_IO, 8, adam_state ) |
| 1362 | | AM_RANGE(M6803_PORT1, M6803_PORT1) AM_READWRITE(fdc6801_p1_r, fdc6801_p1_w) |
| 1363 | | AM_RANGE(M6803_PORT2, M6803_PORT2) AM_READWRITE(fdc6801_p2_r, fdc6801_p2_w) |
| 1364 | | AM_RANGE(M6803_PORT3, M6803_PORT3) |
| 1365 | | AM_RANGE(M6803_PORT4, M6803_PORT4) AM_WRITE(fdc6801_p4_w) |
| 1362 | AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READWRITE(fdc6801_p1_r, fdc6801_p1_w) |
| 1363 | AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(fdc6801_p2_r, fdc6801_p2_w) |
| 1364 | AM_RANGE(M6801_PORT3, M6801_PORT3) |
| 1365 | AM_RANGE(M6801_PORT4, M6801_PORT4) AM_WRITE(fdc6801_p4_w) |
| 1366 | 1366 | ADDRESS_MAP_END |
| 1367 | 1367 | |
| 1368 | 1368 | |
| r10191 | r10192 | |
| 1590 | 1590 | |
| 1591 | 1591 | //logerror("Master 6801 read from %04x data %02x\n", m_ba, m_data_out); |
| 1592 | 1592 | |
| 1593 | | cpu_set_input_line(m_netcpu, M6800_SC1_LINE, ASSERT_LINE); |
| 1594 | | cpu_set_input_line(m_netcpu, M6800_SC1_LINE, CLEAR_LINE); |
| 1593 | cpu_set_input_line(m_netcpu, M6801_SC1_LINE, ASSERT_LINE); |
| 1594 | cpu_set_input_line(m_netcpu, M6801_SC1_LINE, CLEAR_LINE); |
| 1595 | 1595 | } |
| 1596 | 1596 | } |
| 1597 | 1597 | } |