src/mess/machine/ctronics.c
| r6192 | r6193 | |
| 87 | 87 | { |
| 88 | 88 | centronics_state *centronics = get_safe_token(device); |
| 89 | 89 | const centronics_interface *intf = device->static_config; |
| 90 | | astring *tempstring = astring_alloc(); |
| 91 | 90 | |
| 92 | 91 | /* validate some basic stuff */ |
| 93 | 92 | assert(device->static_config != NULL); |
| r6192 | r6193 | |
| 99 | 98 | centronics->strobe = TRUE; |
| 100 | 99 | |
| 101 | 100 | /* get printer device */ |
| 102 | | centronics->printer = devtag_get_device(device->machine, device_build_tag(tempstring, device, "printer")); |
| 103 | | assert(centronics->printer != NULL); |
| 101 | centronics->printer = device_find_child_by_tag(device, "printer"); |
| 104 | 102 | |
| 105 | | /* make sure it's running */ |
| 106 | | if (!centronics->printer->started) |
| 107 | | { |
| 108 | | device_delay_init(device); |
| 109 | | astring_free(tempstring); |
| 110 | | return; |
| 111 | | } |
| 112 | | |
| 113 | 103 | /* resolve callbacks */ |
| 114 | 104 | devcb_resolve_write_line(¢ronics->out_ack_func, &intf->out_ack_func, device); |
| 115 | 105 | devcb_resolve_write_line(¢ronics->out_busy_func, &intf->out_busy_func, device); |
| r6192 | r6193 | |
| 121 | 111 | state_save_register_device_item(device, 0, centronics->busy); |
| 122 | 112 | state_save_register_device_item(device, 0, centronics->ack); |
| 123 | 113 | state_save_register_device_item(device, 0, centronics->data); |
| 124 | | |
| 125 | | astring_free(tempstring); |
| 126 | 114 | } |
| 127 | 115 | |
| 128 | 116 | static DEVICE_RESET( centronics ) |