trunk/src/emu/devcb.h
| r29186 | r29187 | |
| 34 | 34 | write_line_device_func: (device, data) |
| 35 | 35 | read8_device_func: (device, offset) |
| 36 | 36 | write8_device_func: (device, offset, data) |
| 37 | | read8_space_func: (space, offset) |
| 38 | | write8_space_func: (space, offset, data) |
| 39 | 37 | read16_device_func: (device, offset) |
| 40 | 38 | write16_device_func: (device, offset, data) |
| 41 | | read16_space_func: (space, offset) |
| 42 | | write16_space_func: (space, offset, data) |
| 43 | 39 | read32_device_func: (device, offset) |
| 44 | 40 | write32_device_func: (device, offset, data) |
| 45 | | read32_space_func: (space, offset) |
| 46 | | write32_space_func: (space, offset, data) |
| 47 | 41 | read64_device_func: (device, offset) |
| 48 | 42 | write64_device_func: (device, offset, data) |
| 49 | | read64_space_func: (space, offset) |
| 50 | | write64_space_func: (space, offset, data) |
| 51 | 43 | |
| 52 | 44 | ***************************************************************************/ |
| 53 | 45 | |
| r29186 | r29187 | |
| 165 | 157 | #define DEVCB_NULL { DEVCB_TYPE_NULL } |
| 166 | 158 | |
| 167 | 159 | // line or read/write handlers for the driver device |
| 168 | | #define DEVCB_DRIVER_LINE_MEMBER(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, &devcb_line_stub<cls, &cls::memb>, NULL, NULL } |
| 169 | | #define DEVCB_DRIVER_MEMBER(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, NULL, &devcb_stub<cls, &cls::memb>, NULL } |
| 170 | | #define DEVCB_DRIVER_MEMBER16(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, NULL, &devcb_stub16<cls, &cls::memb>, NULL } |
| 171 | | #define DEVCB_DRIVER_MEMBER32(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, NULL, &devcb_stub32<cls, &cls::memb>, NULL } |
| 172 | | //#define DEVCB_DRIVER_MEMBER64(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, NULL, &devcb_stub64<cls, &cls::memb>, NULL } |
| 160 | #define DEVCB_DRIVER_LINE_MEMBER(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, &devcb_line_stub<cls, &cls::memb>, NULL } |
| 161 | #define DEVCB_DRIVER_MEMBER(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, NULL, &devcb_stub<cls, &cls::memb> } |
| 162 | #define DEVCB_DRIVER_MEMBER16(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, NULL, &devcb_stub16<cls, &cls::memb> } |
| 163 | #define DEVCB_DRIVER_MEMBER32(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, NULL, &devcb_stub32<cls, &cls::memb> } |
| 164 | //#define DEVCB_DRIVER_MEMBER64(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, NULL, &devcb_stub64<cls, &cls::memb> } |
| 173 | 165 | |
| 174 | 166 | // line or read/write handlers for another device |
| 175 | | #define DEVCB_DEVICE_LINE_MEMBER(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, &devcb_line_stub<cls, &cls::memb>, NULL, NULL } |
| 176 | | #define DEVCB_DEVICE_MEMBER(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, NULL, &devcb_stub<cls, &cls::memb>, NULL } |
| 177 | | #define DEVCB_DEVICE_MEMBER16(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, NULL, &devcb_stub16<cls, &cls::memb>, NULL } |
| 178 | | #define DEVCB_DEVICE_MEMBER32(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, NULL, &devcb_stub32<cls, &cls::memb>, NULL } |
| 179 | | //#define DEVCB_DEVICE_MEMBER64(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, NULL, &devcb_stub64<cls, &cls::memb>, NULL } |
| 167 | #define DEVCB_DEVICE_LINE_MEMBER(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, &devcb_line_stub<cls, &cls::memb>, NULL } |
| 168 | #define DEVCB_DEVICE_MEMBER(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, NULL, &devcb_stub<cls, &cls::memb> } |
| 169 | #define DEVCB_DEVICE_MEMBER16(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, NULL, &devcb_stub16<cls, &cls::memb> } |
| 170 | #define DEVCB_DEVICE_MEMBER32(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, NULL, &devcb_stub32<cls, &cls::memb> } |
| 171 | //#define DEVCB_DEVICE_MEMBER64(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, NULL, &devcb_stub64<cls, &cls::memb> } |
| 180 | 172 | |
| 181 | 173 | // constant values |
| 182 | | #define DEVCB_CONSTANT(value) { DEVCB_TYPE_CONSTANT, value, NULL, NULL, NULL, NULL } |
| 174 | #define DEVCB_CONSTANT(value) { DEVCB_TYPE_CONSTANT, value, NULL, NULL, NULL } |
| 183 | 175 | #define DEVCB_LINE_GND DEVCB_CONSTANT(0) |
| 184 | 176 | #define DEVCB_LINE_VCC DEVCB_CONSTANT(1) |
| 185 | 177 | |
| 186 | | #define DEVCB_UNMAPPED { DEVCB_TYPE_UNMAP, 0, NULL, NULL, NULL, NULL } |
| 178 | #define DEVCB_UNMAPPED { DEVCB_TYPE_UNMAP, 0, NULL, NULL, NULL } |
| 187 | 179 | |
| 188 | 180 | // read handlers for an I/O port by tag |
| 189 | | #define DEVCB_INPUT_PORT(tag) { DEVCB_TYPE_IOPORT, 0, (tag), NULL, NULL, NULL, NULL } |
| 181 | #define DEVCB_INPUT_PORT(tag) { DEVCB_TYPE_IOPORT, 0, (tag), NULL, NULL, NULL } |
| 190 | 182 | |
| 191 | 183 | // write handlers for a CPU input line |
| 192 | | #define DEVCB_CPU_INPUT_LINE(tag,line) { DEVCB_TYPE_INPUT_LINE, (line), (tag), NULL, NULL, NULL, NULL } |
| 184 | #define DEVCB_CPU_INPUT_LINE(tag,line) { DEVCB_TYPE_INPUT_LINE, (line), (tag), NULL, NULL, NULL } |
| 193 | 185 | |
| 194 | 186 | |
| 195 | 187 | |
| r29186 | r29187 | |
| 218 | 210 | UINT8 * null_indicator; |
| 219 | 211 | read_line_device_func read_line; |
| 220 | 212 | read8_device_func read8_device; |
| 221 | | read8_space_func read8_space; |
| 222 | 213 | read16_device_func read16_device; |
| 223 | | read16_space_func read16_space; |
| 224 | 214 | read32_device_func read32_device; |
| 225 | | read32_space_func read32_space; |
| 226 | 215 | read64_device_func read64_device; |
| 227 | | read64_space_func read64_space; |
| 228 | 216 | }; |
| 229 | 217 | |
| 230 | 218 | union devcb_resolved_write_helpers |
| r29186 | r29187 | |
| 232 | 220 | UINT8 * null_indicator; |
| 233 | 221 | write_line_device_func write_line; |
| 234 | 222 | write8_device_func write8_device; |
| 235 | | write8_space_func write8_space; |
| 236 | 223 | write16_device_func write16_device; |
| 237 | | write16_space_func write16_space; |
| 238 | 224 | write32_device_func write32_device; |
| 239 | | write32_space_func write32_space; |
| 240 | 225 | write64_device_func write64_device; |
| 241 | | write64_space_func write64_space; |
| 242 | 226 | int input_line; |
| 243 | 227 | }; |
| 244 | 228 | |
| r29186 | r29187 | |
| 254 | 238 | const char * name; // name of the target function |
| 255 | 239 | read_line_device_func readline; // read line function |
| 256 | 240 | read8_device_func readdevice; // read device function |
| 257 | | read8_space_func readspace; // read space function |
| 258 | 241 | }; |
| 259 | 242 | |
| 260 | 243 | |
| r29186 | r29187 | |
| 304 | 287 | const char * name; // name of the target function |
| 305 | 288 | write_line_device_func writeline; // write line function |
| 306 | 289 | write8_device_func writedevice; // write device function |
| 307 | | write8_space_func writespace; // write space function |
| 308 | 290 | }; |
| 309 | 291 | |
| 310 | 292 | |
| r29186 | r29187 | |
| 355 | 337 | const char * name; // name of the target function |
| 356 | 338 | read_line_device_func readline; // read line function |
| 357 | 339 | read8_device_func readdevice; // read device function |
| 358 | | read8_space_func readspace; // read space function |
| 359 | 340 | }; |
| 360 | 341 | |
| 361 | 342 | |
| r29186 | r29187 | |
| 386 | 367 | private: |
| 387 | 368 | // internal helpers |
| 388 | 369 | UINT8 from_port(offs_t offset, UINT8 mem_mask); |
| 389 | | UINT8 from_read8space(offs_t offset, UINT8 mem_mask); |
| 390 | 370 | UINT8 from_read8device(offs_t offset, UINT8 mem_mask); |
| 391 | 371 | UINT8 from_readline(offs_t offset, UINT8 mem_mask); |
| 392 | 372 | UINT8 from_constant(offs_t offset, UINT8 mem_mask); |
| r29186 | r29187 | |
| 410 | 390 | const char * name; // name of the target function |
| 411 | 391 | write_line_device_func writeline; // write line function |
| 412 | 392 | write8_device_func writedevice; // write device function |
| 413 | | write8_space_func writespace; // write space function |
| 414 | 393 | }; |
| 415 | 394 | |
| 416 | 395 | |
| r29186 | r29187 | |
| 442 | 421 | // internal helpers |
| 443 | 422 | void to_null(offs_t offset, UINT8 data, UINT8 mem_mask); |
| 444 | 423 | void to_port(offs_t offset, UINT8 data, UINT8 mem_mask); |
| 445 | | void to_write8space(offs_t offset, UINT8 data, UINT8 mem_mask); |
| 446 | 424 | void to_write8device(offs_t offset, UINT8 data, UINT8 mem_mask); |
| 447 | 425 | void to_writeline(offs_t offset, UINT8 data, UINT8 mem_mask); |
| 448 | 426 | void to_input(offs_t offset, UINT8 data, UINT8 mem_mask); |
| r29186 | r29187 | |
| 466 | 444 | const char * name; // name of the target function |
| 467 | 445 | read_line_device_func readline; // read line function |
| 468 | 446 | read16_device_func readdevice; // read device function |
| 469 | | read16_space_func readspace; // read space function |
| 470 | 447 | }; |
| 471 | 448 | |
| 472 | 449 | |
| r29186 | r29187 | |
| 520 | 497 | const char * name; // name of the target function |
| 521 | 498 | write_line_device_func writeline; // write line function |
| 522 | 499 | write16_device_func writedevice; // write device function |
| 523 | | write16_space_func writespace; // write space function |
| 524 | 500 | }; |
| 525 | 501 | |
| 526 | 502 | |
| r29186 | r29187 | |
| 574 | 550 | const char * name; // name of the target function |
| 575 | 551 | read_line_device_func readline; // read line function |
| 576 | 552 | read32_device_func readdevice; // read device function |
| 577 | | read32_space_func readspace; // read space function |
| 578 | 553 | }; |
| 579 | 554 | |
| 580 | 555 | |
| r29186 | r29187 | |
| 628 | 603 | const char * name; // name of the target function |
| 629 | 604 | write_line_device_func writeline; // write line function |
| 630 | 605 | write32_device_func writedevice; // write device function |
| 631 | | write32_space_func writespace; // write space function |
| 632 | 606 | }; |
| 633 | 607 | |
| 634 | 608 | |
| r29186 | r29187 | |
| 682 | 656 | const char * name; // name of the target function |
| 683 | 657 | read_line_device_func readline; // read line function |
| 684 | 658 | read64_device_func readdevice; // read device function |
| 685 | | read64_space_func readspace; // read space function |
| 686 | 659 | }; |
| 687 | 660 | |
| 688 | 661 | |
| r29186 | r29187 | |
| 736 | 709 | const char * name; // name of the target function |
| 737 | 710 | write_line_device_func writeline; // write line function |
| 738 | 711 | write64_device_func writedevice; // write device function |
| 739 | | write64_space_func writespace; // write space function |
| 740 | 712 | }; |
| 741 | 713 | |
| 742 | 714 | |