Search
lxdream.org :: lxdream/src/gdrom/ide.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdrom/ide.h
changeset 493:c8183f888b14
prev342:850502f0e8de
next561:533f6b478071
author nkeynes
date Tue Nov 06 08:35:33 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Implement mode select command
file annotate diff log raw
1.1 --- a/src/gdrom/ide.h Wed Jan 31 10:58:42 2007 +0000
1.2 +++ b/src/gdrom/ide.h Tue Nov 06 08:35:33 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: ide.h,v 1.13 2007-01-31 10:58:42 nkeynes Exp $
1.6 + * $Id: ide.h,v 1.14 2007-11-06 08:35:33 nkeynes Exp $
1.7 *
1.8 * This file defines the interface and structures of the dreamcast's IDE
1.9 * port. Note that the register definitions are in asic.h, as the registers
1.10 @@ -25,6 +25,9 @@
1.11
1.12 #include "dream.h"
1.13
1.14 +#define GDROM_SENSE_LENGTH 10
1.15 +#define GDROM_MODE_LENGTH 32
1.16 +
1.17 struct ide_registers {
1.18 /* IDE interface registers */
1.19 uint8_t status; /* A05F709C + A05F7018 Read-only */
1.20 @@ -43,22 +46,23 @@
1.21 uint8_t intrq_pending; /* Flag to indicate if the INTRQ line is active */
1.22 gboolean interface_enabled;
1.23 gboolean was_reset; /* Flag indicating that the device has just been reset */
1.24 - int state;
1.25 + uint32_t state;
1.26 + uint32_t last_packet_command; /* Identifies the command executing during a r/w cycle */
1.27
1.28 /* Sense response for the last executed packet command */
1.29 - unsigned char gdrom_sense[10];
1.30 -
1.31 + unsigned char gdrom_sense[GDROM_SENSE_LENGTH];
1.32 + unsigned char gdrom_mode[GDROM_MODE_LENGTH];
1.33
1.34 /* offset in the buffer of the next word to read/write, or -1
1.35 * if inactive.
1.36 */
1.37 - int data_offset;
1.38 - int data_length;
1.39 + int32_t data_offset;
1.40 + int32_t data_length;
1.41
1.42 /* Status reporting information */
1.43 uint8_t last_read_track;
1.44 - uint32_t read_lba;
1.45 - uint32_t read_mode;
1.46 + uint32_t current_lba;
1.47 + uint32_t current_mode;
1.48 uint32_t sectors_left; /* sectors left after current read */
1.49 };
1.50
1.51 @@ -116,7 +120,7 @@
1.52 uint32_t ide_read_data_dma( uint32_t addr, uint32_t length );
1.53 uint8_t ide_read_status(void);
1.54 uint8_t ide_get_drive_status(void);
1.55 -void ide_write_buffer( unsigned char *data, int length );
1.56 +void ide_write_buffer( unsigned char *data, uint32_t length );
1.57
1.58 void ide_write_command( uint8_t command );
1.59 void ide_write_control( uint8_t value );
.