src/mess/machine/apple2.c
| r1844 | r1845 | |
| 312 | 312 | }; |
| 313 | 313 | UINT8 result = 0x00; |
| 314 | 314 | int slot; |
| 315 | running_machine *machine = Machine; |
| 315 | 316 | |
| 316 | 317 | offset &= 0xFF; |
| 317 | 318 | |
| r1844 | r1845 | |
| 324 | 325 | { |
| 325 | 326 | slot = (offset - 0x80) / 0x10; |
| 326 | 327 | if (a2_config->slots[slot] && a2_config->slots[slot]->read) |
| 327 | | result = a2_config->slots[slot]->read(a2_slot_tokens[slot], offset % 0x10); |
| 328 | result = a2_config->slots[slot]->read(machine, a2_slot_tokens[slot], offset % 0x10); |
| 328 | 329 | } |
| 329 | 330 | return result; |
| 330 | 331 | } |
| r1844 | r1845 | |
| 345 | 346 | apple2_c07x_w |
| 346 | 347 | }; |
| 347 | 348 | int slot; |
| 349 | running_machine *machine = Machine; |
| 348 | 350 | |
| 349 | 351 | offset &= 0xFF; |
| 350 | 352 | |
| r1844 | r1845 | |
| 357 | 359 | { |
| 358 | 360 | slot = (offset - 0x80) / 0x10; |
| 359 | 361 | if (a2_config->slots[slot] && a2_config->slots[slot]->write) |
| 360 | | a2_config->slots[slot]->write(a2_slot_tokens[slot], offset % 0x10, data); |
| 362 | a2_config->slots[slot]->write(machine, a2_slot_tokens[slot], offset % 0x10, data); |
| 361 | 363 | } |
| 362 | 364 | } |
| 363 | 365 | |
| r1844 | r1845 | |
| 743 | 745 | if (a2_config->slots[i]) |
| 744 | 746 | { |
| 745 | 747 | if (a2_config->slots[i]->reset) |
| 746 | | a2_config->slots[i]->reset(a2_slot_tokens[i]); |
| 748 | a2_config->slots[i]->reset(machine, a2_slot_tokens[i]); |
| 747 | 749 | } |
| 748 | 750 | } |
| 749 | 751 | |
| r1844 | r1845 | |
| 1135 | 1137 | * Language Card |
| 1136 | 1138 | * ----------------------------------------------------------------------- */ |
| 1137 | 1139 | |
| 1138 | | static UINT8 apple2_langcard_read(void *token, offs_t offset) |
| 1140 | static UINT8 apple2_langcard_read(running_machine *machine, void *token, offs_t offset) |
| 1139 | 1141 | { |
| 1140 | 1142 | return apple2_c08x_r(offset); |
| 1141 | 1143 | |
| r1844 | r1845 | |
| 1143 | 1145 | |
| 1144 | 1146 | |
| 1145 | 1147 | |
| 1146 | | static void apple2_langcard_write(void *token, offs_t offset, UINT8 data) |
| 1148 | static void apple2_langcard_write(running_machine *machine, void *token, offs_t offset, UINT8 data) |
| 1147 | 1149 | { |
| 1148 | 1150 | apple2_c08x_w(offset, data); |
| 1149 | 1151 | } |
| r1844 | r1845 | |
| 1166 | 1168 | * Mockingboard |
| 1167 | 1169 | * ----------------------------------------------------------------------- */ |
| 1168 | 1170 | |
| 1169 | | static void apple2_mockingboard_reset(void *token) |
| 1171 | static void apple2_mockingboard_reset(running_machine *machine, void *token) |
| 1170 | 1172 | { |
| 1171 | 1173 | /* TODO: fix this */ |
| 1172 | 1174 | /* What follows is pure filth. It abuses the core like an angry pimp on a bad hair day. */ |
| r1844 | r1845 | |
| 1181 | 1183 | |
| 1182 | 1184 | |
| 1183 | 1185 | |
| 1184 | | static UINT8 apple2_mockingboard_read(void *token, offs_t offset) |
| 1186 | static UINT8 apple2_mockingboard_read(running_machine *machine, void *token, offs_t offset) |
| 1185 | 1187 | { |
| 1186 | 1188 | static int flip1 = 0, flip2 = 0; |
| 1187 | 1189 | |
| r1844 | r1845 | |
| 1205 | 1207 | |
| 1206 | 1208 | |
| 1207 | 1209 | |
| 1208 | | static void apple2_mockingboard_write(void *token, offs_t offset, UINT8 data) |
| 1210 | static void apple2_mockingboard_write(running_machine *machine, void *token, offs_t offset, UINT8 data) |
| 1209 | 1211 | { |
| 1210 | 1212 | static int latch0, latch1; |
| 1211 | 1213 | |
| r1844 | r1845 | |
| 1423 | 1425 | |
| 1424 | 1426 | |
| 1425 | 1427 | |
| 1426 | | static void *apple2_fdc_init(int slot, applefdc_t fdc_type) |
| 1428 | static void *apple2_fdc_init(running_machine *machine, int slot, applefdc_t fdc_type) |
| 1427 | 1429 | { |
| 1428 | 1430 | const struct IODevice *dev; |
| 1429 | 1431 | struct applefdc_interface intf; |
| r1844 | r1845 | |
| 1455 | 1457 | |
| 1456 | 1458 | |
| 1457 | 1459 | |
| 1458 | | static void *apple2_fdc_apple2_init(int slot) |
| 1460 | static void *apple2_fdc_apple2_init(running_machine *machine, int slot) |
| 1459 | 1461 | { |
| 1460 | | return apple2_fdc_init(slot, APPLEFDC_APPLE2); |
| 1462 | return apple2_fdc_init(machine, slot, APPLEFDC_APPLE2); |
| 1461 | 1463 | } |
| 1462 | 1464 | |
| 1463 | 1465 | |
| 1464 | 1466 | |
| 1465 | | static void *apple2_fdc_iwm_init(int slot) |
| 1467 | static void *apple2_fdc_iwm_init(running_machine *machine, int slot) |
| 1466 | 1468 | { |
| 1467 | | return apple2_fdc_init(slot, APPLEFDC_IWM); |
| 1469 | return apple2_fdc_init(machine, slot, APPLEFDC_IWM); |
| 1468 | 1470 | } |
| 1469 | 1471 | |
| 1470 | 1472 | |
| 1471 | 1473 | |
| 1472 | | static UINT8 apple2_fdc_read(void *token, offs_t offset) |
| 1474 | static UINT8 apple2_fdc_read(running_machine *machine, void *token, offs_t offset) |
| 1473 | 1475 | { |
| 1474 | 1476 | return applefdc_r(offset); |
| 1475 | 1477 | } |
| 1476 | 1478 | |
| 1477 | 1479 | |
| 1478 | 1480 | |
| 1479 | | static void apple2_fdc_write(void *token, offs_t offset, UINT8 data) |
| 1481 | static void apple2_fdc_write(running_machine *machine, void *token, offs_t offset, UINT8 data) |
| 1480 | 1482 | { |
| 1481 | 1483 | applefdc_w(offset, data); |
| 1482 | 1484 | } |
| r1844 | r1845 | |
| 1540 | 1542 | if (a2_config->slots[i]) |
| 1541 | 1543 | { |
| 1542 | 1544 | if (a2_config->slots[i]->init) |
| 1543 | | token = a2_config->slots[i]->init(i); |
| 1545 | token = a2_config->slots[i]->init(machine, i); |
| 1544 | 1546 | else |
| 1545 | 1547 | token = (void *) ~0; |
| 1546 | 1548 | |