Search
lxdream.org :: lxdream/src/gdrom/packet.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdrom/packet.h
changeset 858:368fc0dcd57c
prev736:a02d1475ccfd
next1097:d4807997e450
author nkeynes
date Tue Oct 14 08:44:37 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Fix a few more subtle flag problems
view annotate diff log raw
     1 /**
     2  * $Id$
     3  *
     4  * This file defines the command codes and any other flags used by the 
     5  * GD-Rom ATAPI packet commands.
     6  *
     7  * Copyright (c) 2005 Nathan Keynes.
     8  *
     9  * This program is free software; you can redistribute it and/or modify
    10  * it under the terms of the GNU General Public License as published by
    11  * the Free Software Foundation; either version 2 of the License, or
    12  * (at your option) any later version.
    13  *
    14  * This program is distributed in the hope that it will be useful,
    15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17  * GNU General Public License for more details.
    18  */
    20 #ifndef lxdream_packet_H
    21 #define lxdream_packet_H 1
    23 /**
    24  * Valid command codes (hex):
    25  * 00  Test 
    26  * 10  Drive Status
    27  * 11  Mode Sense
    28  * 12  Mode Select
    29  * 13  Request Sense
    30  * 14  Read TOC
    31  * 15  Read session info
    32  * 16
    33  * 20
    34  * 21
    35  * 22
    36  * 30  Read CD
    37  * 31
    38  * 40  Read Status ?
    39  * 50
    40  * 51
    41  * 52
    42  * 53
    43  * 54
    44  * 55
    45  * 70  
    46  * 71
    47  * 72
    48  * 73
    49  * FE
    50  */
    52 #define PKT_CMD_TEST_READY 0x00
    53 #define PKT_CMD_DRIVE_STATUS 0x10
    54 #define PKT_CMD_MODE_SENSE 0x11
    55 #define PKT_CMD_MODE_SELECT 0x12
    56 #define PKT_CMD_SENSE    0x13
    57 #define PKT_CMD_READ_TOC 0x14
    58 #define PKT_CMD_SESSION_INFO 0x15
    59 #define PKT_CMD_READ_SECTOR 0x30
    60 #define PKT_CMD_PLAY_AUDIO  0x20 /* ? */
    61 #define PKT_CMD_STATUS  0x40
    62 #define PKT_CMD_SPIN_UP 0x70 /* ??? */
    63 #define PKT_CMD_71      0x71 /* ??? seems to return garbage */
    65 #define PKT_ERR_OK        0x0000
    66 #define PKT_ERR_NODISC    0x3A02
    67 #define PKT_ERR_BADCMD    0x2005
    68 #define PKT_ERR_BADFIELD  0x2405
    69 #define PKT_ERR_BADREAD   0x3002
    70 #define PKT_ERR_BADREADMODE 0x6405  /* Illegal mode for this track */
    71 #define PKT_ERR_RESET     0x2906
    73 /* Parse CD read */
    74 #define READ_CD_MODE(x)    ((x)&0x0E)
    75 #define READ_CD_MODE_ANY   0x00
    76 #define READ_CD_MODE_CDDA  0x02 
    77 #define READ_CD_MODE_1     0x04
    78 #define READ_CD_MODE_2     0x06
    79 #define READ_CD_MODE_2_FORM_1 0x08
    80 #define READ_CD_MODE_2_FORM_2 0x0A
    82 #define READ_CD_CHANNELS(x) ((x)&0xF0)
    83 #define READ_CD_HEADER(x)  ((x)&0x80)
    84 #define READ_CD_SUBHEAD(x) ((x)&0x40)
    85 #define READ_CD_DATA(x)    ((x)&0x20)
    86 #define READ_CD_RAW(x)     ((x)&0x10)
    88 #endif /* !lxdream_packet_H */
.