src/mess/machine/kc.c
| r3678 | r3679 | |
| 204 | 204 | WRITE8_HANDLER(kc85_disc_hw_terminal_count_w) |
| 205 | 205 | { |
| 206 | 206 | logerror("kc85 disc hw tc w: %02x\n",data); |
| 207 | | nec765_set_tc_state(machine, data & 0x01); |
| 207 | nec765_set_tc_state(space->machine, data & 0x01); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | |
| r3678 | r3679 | |
| 232 | 232 | |
| 233 | 233 | static TIMER_CALLBACK(kc85_disk_reset_timer_callback) |
| 234 | 234 | { |
| 235 | | cpunum_set_reg(1, REG_PC, 0x0f000); |
| 235 | cpu_set_reg(machine->cpu[1], REG_PC, 0x0f000); |
| 236 | 236 | cpu_set_reg(machine->cpu[0], REG_PC, 0x0f000); |
| 237 | 237 | } |
| 238 | 238 | |
| r3678 | r3679 | |
| 1131 | 1131 | |
| 1132 | 1132 | static void kc85_4_update_0x08000(running_machine *machine) |
| 1133 | 1133 | { |
| 1134 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 1134 | 1135 | unsigned char *ram_page; |
| 1135 | 1136 | |
| 1136 | 1137 | if (kc85_pio_data[1] & (1<<5)) |
| r3678 | r3679 | |
| 1145 | 1146 | |
| 1146 | 1147 | memory_set_bankptr(machine, 3, mem_ptr); |
| 1147 | 1148 | memory_set_bankptr(machine, 4, mem_ptr+0x02800); |
| 1148 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK3); |
| 1149 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK4); |
| 1149 | memory_install_read8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_BANK3); |
| 1150 | memory_install_read8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_BANK4); |
| 1150 | 1151 | |
| 1151 | 1152 | /* write protect RAM8 ? */ |
| 1152 | 1153 | if ((kc85_pio_data[1] & (1<<6))==0) |
| 1153 | 1154 | { |
| 1154 | 1155 | /* ram8 is enabled and write protected */ |
| 1155 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP); |
| 1156 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP); |
| 1156 | memory_install_write8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_NOP); |
| 1157 | memory_install_write8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_NOP); |
| 1157 | 1158 | } |
| 1158 | 1159 | else |
| 1159 | 1160 | { |
| 1160 | 1161 | LOG(("RAM8 write enabled\n")); |
| 1161 | 1162 | |
| 1162 | 1163 | /* ram8 is enabled and write enabled */ |
| 1163 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK9); |
| 1164 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK10); |
| 1164 | memory_install_write8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_BANK9); |
| 1165 | memory_install_write8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_BANK10); |
| 1165 | 1166 | memory_set_bankptr(machine, 9, mem_ptr); |
| 1166 | 1167 | memory_set_bankptr(machine, 10, mem_ptr+0x02800); |
| 1167 | 1168 | } |
| r3678 | r3679 | |
| 1170 | 1171 | { |
| 1171 | 1172 | LOG(("no memory at ram8\n")); |
| 1172 | 1173 | |
| 1173 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP); |
| 1174 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP); |
| 1175 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP); |
| 1176 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP); |
| 1174 | memory_install_read8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_NOP); |
| 1175 | memory_install_read8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_NOP); |
| 1176 | memory_install_write8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_NOP); |
| 1177 | memory_install_write8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_NOP); |
| 1177 | 1178 | } |
| 1178 | 1179 | |
| 1179 | 1180 | /* if IRM is enabled override block 3/9 settings */ |
| r3678 | r3679 | |
| 1184 | 1185 | |
| 1185 | 1186 | memory_set_bankptr(machine, 3, ram_page); |
| 1186 | 1187 | memory_set_bankptr(machine, 9, ram_page); |
| 1187 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK3); |
| 1188 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK9); |
| 1188 | memory_install_read8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_BANK3); |
| 1189 | memory_install_write8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_BANK9); |
| 1189 | 1190 | |
| 1190 | 1191 | ram_page = kc85_4_get_video_ram_base(0, 0); |
| 1191 | 1192 | |
| 1192 | | memory_set_bankptr( 4, ram_page + 0x2800); |
| 1193 | memory_set_bankptr(machine, 4, ram_page + 0x2800); |
| 1193 | 1194 | memory_set_bankptr(machine, 10, ram_page + 0x2800); |
| 1194 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK4); |
| 1195 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK10); |
| 1195 | memory_install_read8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_BANK4); |
| 1196 | memory_install_write8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_BANK10); |
| 1196 | 1197 | } |
| 1197 | 1198 | } |
| 1198 | 1199 | |
| 1199 | 1200 | /* update status of memory area 0x0000-0x03fff */ |
| 1200 | 1201 | static void kc85_4_update_0x00000(running_machine *machine) |
| 1201 | 1202 | { |
| 1203 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 1204 | |
| 1202 | 1205 | /* access ram? */ |
| 1203 | 1206 | if (kc85_pio_data[0] & (1<<1)) |
| 1204 | 1207 | { |
| 1205 | 1208 | LOG(("ram0 enabled\n")); |
| 1206 | 1209 | |
| 1207 | 1210 | /* yes; set address of bank */ |
| 1208 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1); |
| 1211 | memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK1); |
| 1209 | 1212 | memory_set_bankptr(machine, 1, mess_ram); |
| 1210 | 1213 | |
| 1211 | 1214 | /* write protect ram? */ |
| r3678 | r3679 | |
| 1215 | 1218 | LOG(("ram0 write protected\n")); |
| 1216 | 1219 | |
| 1217 | 1220 | /* ram is enabled and write protected */ |
| 1218 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); |
| 1221 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); |
| 1219 | 1222 | } |
| 1220 | 1223 | else |
| 1221 | 1224 | { |
| 1222 | 1225 | LOG(("ram0 write enabled\n")); |
| 1223 | 1226 | |
| 1224 | 1227 | /* ram is enabled and write enabled; and set address of bank */ |
| 1225 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK7); |
| 1228 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK7); |
| 1226 | 1229 | memory_set_bankptr(machine, 7, mess_ram); |
| 1227 | 1230 | } |
| 1228 | 1231 | } |
| r3678 | r3679 | |
| 1232 | 1235 | |
| 1233 | 1236 | // memory_set_bankptr(machine, 1,memory_region(machine, "main") + 0x013000); |
| 1234 | 1237 | /* ram is disabled */ |
| 1235 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_NOP); |
| 1236 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_NOP); |
| 1238 | memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_NOP); |
| 1239 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_NOP); |
| 1237 | 1240 | } |
| 1238 | 1241 | } |
| 1239 | 1242 | |
| 1240 | 1243 | /* update status of memory area 0x4000-0x07fff */ |
| 1241 | 1244 | static void kc85_4_update_0x04000(running_machine *machine) |
| 1242 | 1245 | { |
| 1243 | | read8_machine_func rh; |
| 1244 | | write8_machine_func wh; |
| 1246 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 1247 | read8_space_func rh; |
| 1248 | write8_space_func wh; |
| 1245 | 1249 | |
| 1246 | 1250 | /* access ram? */ |
| 1247 | 1251 | if (kc85_86_data & (1<<0)) |
| r3678 | r3679 | |
| 1282 | 1286 | rh = SMH_NOP; |
| 1283 | 1287 | wh = SMH_NOP; |
| 1284 | 1288 | } |
| 1285 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, rh); |
| 1286 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, wh); |
| 1289 | memory_install_read8_handler(space, 0x4000, 0x7fff, 0, 0, rh); |
| 1290 | memory_install_write8_handler(space, 0x4000, 0x7fff, 0, 0, wh); |
| 1287 | 1291 | } |
| 1288 | 1292 | |
| 1289 | 1293 | |
| 1290 | 1294 | /* update memory address 0x0c000-0x0e000 */ |
| 1291 | 1295 | static void kc85_4_update_0x0c000(running_machine *machine) |
| 1292 | 1296 | { |
| 1293 | | read8_machine_func rh; |
| 1297 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 1298 | read8_space_func rh; |
| 1294 | 1299 | |
| 1295 | 1300 | if (kc85_86_data & (1<<7)) |
| 1296 | 1301 | { |
| r3678 | r3679 | |
| 1325 | 1330 | rh = SMH_NOP; |
| 1326 | 1331 | } |
| 1327 | 1332 | } |
| 1328 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rh); |
| 1333 | memory_install_read8_handler(space, 0xc000, 0xdfff, 0, 0, rh); |
| 1329 | 1334 | } |
| 1330 | 1335 | |
| 1331 | 1336 | /* update memory address 0x0e000-0x0ffff */ |
| 1332 | 1337 | static void kc85_4_update_0x0e000(running_machine *machine) |
| 1333 | 1338 | { |
| 1334 | | read8_machine_func rh; |
| 1339 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 1340 | read8_space_func rh; |
| 1335 | 1341 | |
| 1336 | 1342 | if (kc85_pio_data[0] & (1<<0)) |
| 1337 | 1343 | { |
| r3678 | r3679 | |
| 1347 | 1353 | |
| 1348 | 1354 | rh = SMH_NOP; |
| 1349 | 1355 | } |
| 1350 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, rh); |
| 1356 | memory_install_read8_handler(space, 0xe000, 0xffff, 0, 0, rh); |
| 1351 | 1357 | } |
| 1352 | 1358 | |
| 1353 | 1359 | /* PIO PORT A: port 0x088: |
| r3678 | r3679 | |
| 1382 | 1388 | |
| 1383 | 1389 | case 0: |
| 1384 | 1390 | { |
| 1385 | | kc85_4_update_0x0c000(machine); |
| 1386 | | kc85_4_update_0x0e000(machine); |
| 1387 | | kc85_4_update_0x08000(machine); |
| 1388 | | kc85_4_update_0x00000(machine); |
| 1391 | kc85_4_update_0x0c000(space->machine); |
| 1392 | kc85_4_update_0x0e000(space->machine); |
| 1393 | kc85_4_update_0x08000(space->machine); |
| 1394 | kc85_4_update_0x00000(space->machine); |
| 1389 | 1395 | |
| 1390 | | kc_cassette_set_motor(machine, (data>>6) & 0x01); |
| 1396 | kc_cassette_set_motor(space->machine, (data>>6) & 0x01); |
| 1391 | 1397 | } |
| 1392 | 1398 | break; |
| 1393 | 1399 | |
| r3678 | r3679 | |
| 1395 | 1401 | { |
| 1396 | 1402 | int speaker_level; |
| 1397 | 1403 | |
| 1398 | | kc85_4_update_0x08000(machine); |
| 1404 | kc85_4_update_0x08000(space->machine); |
| 1399 | 1405 | |
| 1400 | 1406 | /* 16 speaker levels */ |
| 1401 | 1407 | speaker_level = (data>>1) & 0x0f; |
| r3678 | r3679 | |
| 1415 | 1421 | |
| 1416 | 1422 | kc85_86_data = data; |
| 1417 | 1423 | |
| 1418 | | kc85_4_update_0x0c000(machine); |
| 1419 | | kc85_4_update_0x04000(machine); |
| 1424 | kc85_4_update_0x0c000(space->machine); |
| 1425 | kc85_4_update_0x04000(space->machine); |
| 1420 | 1426 | } |
| 1421 | 1427 | |
| 1422 | 1428 | READ8_HANDLER ( kc85_4_86_r ) |
| r3678 | r3679 | |
| 1433 | 1439 | |
| 1434 | 1440 | kc85_4_video_ram_select_bank(data & 0x01); |
| 1435 | 1441 | |
| 1436 | | kc85_4_update_0x08000(machine); |
| 1442 | kc85_4_update_0x08000(space->machine); |
| 1437 | 1443 | } |
| 1438 | 1444 | |
| 1439 | 1445 | READ8_HANDLER ( kc85_4_84_r ) |
| r3678 | r3679 | |
| 1445 | 1451 | /* update memory region 0x0c000-0x0e000 */ |
| 1446 | 1452 | static void kc85_3_update_0x0c000(running_machine *machine) |
| 1447 | 1453 | { |
| 1448 | | read8_machine_func rh; |
| 1454 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 1455 | read8_space_func rh; |
| 1449 | 1456 | |
| 1450 | 1457 | if (kc85_pio_data[0] & (1<<7)) |
| 1451 | 1458 | { |
| r3678 | r3679 | |
| 1461 | 1468 | |
| 1462 | 1469 | rh = SMH_NOP; |
| 1463 | 1470 | } |
| 1464 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rh); |
| 1471 | memory_install_read8_handler(space, 0xc000, 0xdfff, 0, 0, rh); |
| 1465 | 1472 | } |
| 1466 | 1473 | |
| 1467 | 1474 | /* update memory address 0x0e000-0x0ffff */ |
| 1468 | 1475 | static void kc85_3_update_0x0e000(running_machine *machine) |
| 1469 | 1476 | { |
| 1470 | | read8_machine_func rh; |
| 1477 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 1478 | read8_space_func rh; |
| 1471 | 1479 | |
| 1472 | 1480 | if (kc85_pio_data[0] & (1<<0)) |
| 1473 | 1481 | { |
| r3678 | r3679 | |
| 1483 | 1491 | |
| 1484 | 1492 | rh = SMH_NOP; |
| 1485 | 1493 | } |
| 1486 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, rh); |
| 1494 | memory_install_read8_handler(space, 0xe000, 0xffff, 0, 0, rh); |
| 1487 | 1495 | } |
| 1488 | 1496 | |
| 1489 | 1497 | /* update status of memory area 0x0000-0x03fff */ |
| r3678 | r3679 | |
| 1491 | 1499 | for write operations */ |
| 1492 | 1500 | static void kc85_3_update_0x00000(running_machine *machine) |
| 1493 | 1501 | { |
| 1494 | | read8_machine_func rh; |
| 1495 | | write8_machine_func wh; |
| 1502 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 1503 | read8_space_func rh; |
| 1504 | write8_space_func wh; |
| 1496 | 1505 | |
| 1497 | 1506 | /* access ram? */ |
| 1498 | 1507 | if (kc85_pio_data[0] & (1<<1)) |
| r3678 | r3679 | |
| 1532 | 1541 | wh = SMH_NOP; |
| 1533 | 1542 | } |
| 1534 | 1543 | |
| 1535 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, rh); |
| 1536 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, wh); |
| 1544 | memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, rh); |
| 1545 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, wh); |
| 1537 | 1546 | } |
| 1538 | 1547 | |
| 1539 | 1548 | /* update status of memory area 0x08000-0x0ffff */ |
| 1540 | 1549 | /* SMH_BANK3 is used for read, SMH_BANK8 is used for write */ |
| 1541 | 1550 | static void kc85_3_update_0x08000(running_machine *machine) |
| 1542 | 1551 | { |
| 1543 | | read8_machine_func rh; |
| 1544 | | write8_machine_func wh; |
| 1552 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 1553 | read8_space_func rh; |
| 1554 | write8_space_func wh; |
| 1545 | 1555 | unsigned char *ram_page; |
| 1546 | 1556 | |
| 1547 | 1557 | if (kc85_pio_data[0] & (1<<2)) |
| r3678 | r3679 | |
| 1587 | 1597 | wh = SMH_NOP; |
| 1588 | 1598 | } |
| 1589 | 1599 | |
| 1590 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, rh); |
| 1591 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, wh); |
| 1600 | memory_install_read8_handler(space, 0x8000, 0xbfff, 0, 0, rh); |
| 1601 | memory_install_write8_handler(space, 0x8000, 0xbfff, 0, 0, wh); |
| 1592 | 1602 | } |
| 1593 | 1603 | |
| 1594 | 1604 | |
| r3678 | r3679 | |
| 1624 | 1634 | |
| 1625 | 1635 | case 0: |
| 1626 | 1636 | { |
| 1627 | | kc85_3_update_0x0c000(machine); |
| 1628 | | kc85_3_update_0x0e000(machine); |
| 1629 | | kc85_3_update_0x00000(machine); |
| 1637 | kc85_3_update_0x0c000(space->machine); |
| 1638 | kc85_3_update_0x0e000(space->machine); |
| 1639 | kc85_3_update_0x00000(space->machine); |
| 1630 | 1640 | |
| 1631 | | kc_cassette_set_motor(machine, (data>>6) & 0x01); |
| 1641 | kc_cassette_set_motor(space->machine, (data>>6) & 0x01); |
| 1632 | 1642 | } |
| 1633 | 1643 | break; |
| 1634 | 1644 | |
| r3678 | r3679 | |
| 1636 | 1646 | { |
| 1637 | 1647 | int speaker_level; |
| 1638 | 1648 | |
| 1639 | | kc85_3_update_0x08000(machine); |
| 1649 | kc85_3_update_0x08000(space->machine); |
| 1640 | 1650 | |
| 1641 | 1651 | /* 16 speaker levels */ |
| 1642 | 1652 | speaker_level = (data>>1) & 0x0f; |
src/mess/drivers/kc.c
| r3678 | r3679 | |
| 37 | 37 | switch (port) |
| 38 | 38 | { |
| 39 | 39 | // case 0x080: |
| 40 | | // return kc85_module_r(machine, offset); |
| 40 | // return kc85_module_r(space, offset); |
| 41 | 41 | |
| 42 | 42 | case 0x085: |
| 43 | 43 | case 0x084: |
| 44 | | return kc85_4_84_r(machine, offset); |
| 44 | return kc85_4_84_r(space, offset); |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | case 0x086: |
| 48 | 48 | case 0x087: |
| 49 | | return kc85_4_86_r(machine, offset); |
| 49 | return kc85_4_86_r(space, offset); |
| 50 | 50 | |
| 51 | 51 | case 0x088: |
| 52 | 52 | case 0x089: |
| 53 | | return kc85_pio_data_r(machine, port-0x088); |
| 53 | return kc85_pio_data_r(space, port-0x088); |
| 54 | 54 | case 0x08a: |
| 55 | 55 | case 0x08b: |
| 56 | | return kc85_pio_control_r(machine, port-0x08a); |
| 56 | return kc85_pio_control_r(space, port-0x08a); |
| 57 | 57 | case 0x08c: |
| 58 | 58 | case 0x08d: |
| 59 | 59 | case 0x08e: |
| 60 | 60 | case 0x08f: |
| 61 | | return kc85_ctc_r(device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c); |
| 61 | return kc85_ctc_r(device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c); |
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | |
| r3678 | r3679 | |
| 75 | 75 | switch (port) |
| 76 | 76 | { |
| 77 | 77 | // case 0x080: |
| 78 | | // kc85_module_w(machine, offset,data); |
| 78 | // kc85_module_w(space, offset,data); |
| 79 | 79 | // return; |
| 80 | 80 | |
| 81 | 81 | case 0x085: |
| 82 | 82 | case 0x084: |
| 83 | | kc85_4_84_w(machine, offset,data); |
| 83 | kc85_4_84_w(space, offset,data); |
| 84 | 84 | return; |
| 85 | 85 | |
| 86 | 86 | case 0x086: |
| 87 | 87 | case 0x087: |
| 88 | | kc85_4_86_w(machine, offset,data); |
| 88 | kc85_4_86_w(space, offset,data); |
| 89 | 89 | return; |
| 90 | 90 | |
| 91 | 91 | case 0x088: |
| 92 | 92 | case 0x089: |
| 93 | | kc85_4_pio_data_w(machine, port-0x088, data); |
| 93 | kc85_4_pio_data_w(space, port-0x088, data); |
| 94 | 94 | return; |
| 95 | 95 | |
| 96 | 96 | case 0x08a: |
| 97 | 97 | case 0x08b: |
| 98 | | kc85_pio_control_w(machine, port-0x08a, data); |
| 98 | kc85_pio_control_w(space, port-0x08a, data); |
| 99 | 99 | return; |
| 100 | 100 | |
| 101 | 101 | case 0x08c: |
| 102 | 102 | case 0x08d: |
| 103 | 103 | case 0x08e: |
| 104 | 104 | case 0x08f: |
| 105 | | kc85_ctc_w(device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c, data); |
| 105 | kc85_ctc_w(device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c, data); |
| 106 | 106 | return; |
| 107 | 107 | } |
| 108 | 108 | |
| r3678 | r3679 | |
| 146 | 146 | |
| 147 | 147 | case 0x088: |
| 148 | 148 | case 0x089: |
| 149 | | return kc85_pio_data_r(machine, port-0x088); |
| 149 | return kc85_pio_data_r(space, port-0x088); |
| 150 | 150 | case 0x08a: |
| 151 | 151 | case 0x08b: |
| 152 | | return kc85_pio_control_r(machine, port-0x08a); |
| 152 | return kc85_pio_control_r(space, port-0x08a); |
| 153 | 153 | case 0x08c: |
| 154 | 154 | case 0x08d: |
| 155 | 155 | case 0x08e: |
| 156 | 156 | case 0x08f: |
| 157 | | return kc85_ctc_r(device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c); |
| 157 | return kc85_ctc_r(device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | logerror("unhandled port r: %04x\n",offset); |
| r3678 | r3679 | |
| 170 | 170 | switch (port) |
| 171 | 171 | { |
| 172 | 172 | // case 0x080: |
| 173 | | // kc85_module_w(offset,data); |
| 173 | // kc85_module_w(space, offset,data); |
| 174 | 174 | // return; |
| 175 | 175 | |
| 176 | 176 | case 0x088: |
| 177 | 177 | case 0x089: |
| 178 | | kc85_3_pio_data_w(machine, port-0x088, data); |
| 178 | kc85_3_pio_data_w(space, port-0x088, data); |
| 179 | 179 | return; |
| 180 | 180 | |
| 181 | 181 | case 0x08a: |
| 182 | 182 | case 0x08b: |
| 183 | | kc85_pio_control_w(machine, port-0x08a, data); |
| 183 | kc85_pio_control_w(space, port-0x08a, data); |
| 184 | 184 | return; |
| 185 | 185 | |
| 186 | 186 | case 0x08c: |
| 187 | 187 | case 0x08d: |
| 188 | 188 | case 0x08e: |
| 189 | 189 | case 0x08f: |
| 190 | | kc85_ctc_w(device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c, data); |
| 190 | kc85_ctc_w(device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c, data); |
| 191 | 191 | return; |
| 192 | 192 | } |
| 193 | 193 | |