src/mess/machine/svi318.c
| r2373 | r2374 | |
| 265 | 265 | |
| 266 | 266 | /* Printer port */ |
| 267 | 267 | |
| 268 | static const device_config *printer_device(running_machine *machine) |
| 269 | { |
| 270 | return device_list_find_by_tag(machine->config->devicelist, PRINTER, "printer"); |
| 271 | } |
| 272 | |
| 268 | 273 | static WRITE8_HANDLER( svi318_printer_w ) |
| 269 | 274 | { |
| 270 | 275 | if (!offset) |
| r2373 | r2374 | |
| 272 | 277 | else |
| 273 | 278 | { |
| 274 | 279 | if ( (svi.prn_strobe & 1) && !(data & 1) ) |
| 275 | | printer_output(image_from_devtype_and_index(IO_PRINTER, 0), svi.prn_data); |
| 280 | printer_output(printer_device(machine), svi.prn_data); |
| 276 | 281 | |
| 277 | 282 | svi.prn_strobe = data; |
| 278 | 283 | } |
| 279 | 284 | } |
| 280 | 285 | |
| 281 | | static const device_config *printer_device(running_machine *machine) |
| 282 | | { |
| 283 | | return device_list_find_by_tag(machine->config->devicelist, PRINTER, "printer"); |
| 284 | | } |
| 285 | | |
| 286 | 286 | static READ8_HANDLER( svi318_printer_r ) |
| 287 | 287 | { |
| 288 | | if (printer_is_ready(printer_device(machine)) ) |
| 289 | | return 0xfe; |
| 290 | | |
| 291 | | return 0xff; |
| 288 | return printer_is_ready(printer_device(machine)) ? 0xfe:0xff; /* 0xfe if printer is ready to work */ |
| 292 | 289 | } |
| 293 | 290 | |
| 294 | 291 | /* PSG */ |