src/mame/drivers/megadriv.c
| r9354 | r9355 | |
| 366 | 366 | static int sega_cd_connected = 0x00; |
| 367 | 367 | static UINT16 segacd_irq_mask; |
| 368 | 368 | static UINT8 segacd_cdd_rx[10]; |
| 369 | static UINT8 segacd_cdd_tx[10]; |
| 369 | 370 | static struct |
| 370 | 371 | { |
| 371 | 372 | UINT8 status; |
| r9354 | r9355 | |
| 4495 | 4496 | return segacd_cdd_rx[offset] & 0xf; |
| 4496 | 4497 | } |
| 4497 | 4498 | |
| 4499 | static const char *const segacd_cdd_cmd[] = |
| 4500 | { |
| 4501 | "Status", |
| 4502 | "Stop All", |
| 4503 | "Get TOC Info", |
| 4504 | "Read", |
| 4505 | "Seek", |
| 4506 | "Pause/Stop", |
| 4507 | "Resume", |
| 4508 | "Fast Forward", |
| 4509 | "Fast Rewind", |
| 4510 | "Recover Initial state", |
| 4511 | "Close Tray", |
| 4512 | "Open Tray", |
| 4513 | "Unknown 0xE", |
| 4514 | "Unknown 0xF" |
| 4515 | }; |
| 4498 | 4516 | |
| 4499 | 4517 | static WRITE8_HANDLER( segacd_cdd_tx_w ) |
| 4500 | 4518 | { |
| 4501 | | printf("CDD Communication write %02x -> [%02x]\n",data,offset); |
| 4519 | //printf("CDD Communication write %02x -> [%02x]\n",data,offset); |
| 4520 | segacd_cdd_tx[offset] = data & 0xf; |
| 4521 | |
| 4522 | if(offset == 9) //execute the command when crc is sent (TODO: I wonder if we need to check if crc is valid ...) |
| 4523 | { |
| 4524 | switch(segacd_cdd_tx[0] & 0xf) |
| 4525 | { |
| 4526 | default: printf("CDD: unhandled command %s issued\n",segacd_cdd_cmd[segacd_cdd_tx[0] & 0xf]); |
| 4527 | } |
| 4528 | } |
| 4502 | 4529 | } |
| 4503 | 4530 | |
| 4504 | 4531 | |