File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -993,6 +993,13 @@ static void cmd_read(IDEState *s, uint8_t* buf)
993
993
}
994
994
995
995
lba = ldl_be_p (buf + 2 );
996
+
997
+ #ifdef XBOX
998
+ #define XGD1_LSEEK_OFFSET 0x18300000UL
999
+ lba += XGD1_LSEEK_OFFSET / ATAPI_SECTOR_SIZE ;
1000
+ total_sectors -= (XGD1_LSEEK_OFFSET / ATAPI_SECTOR_SIZE );
1001
+ #endif
1002
+
996
1003
if (lba >= total_sectors || lba + nb_sectors - 1 >= total_sectors ) {
997
1004
ide_atapi_cmd_error (s , ILLEGAL_REQUEST , ASC_LOGICAL_BLOCK_OOR );
998
1005
return ;
@@ -1007,6 +1014,7 @@ static void cmd_read_cd(IDEState *s, uint8_t* buf)
1007
1014
1008
1015
/* Total logical sectors of ATAPI_SECTOR_SIZE(=2048) bytes */
1009
1016
uint64_t total_sectors = s -> nb_sectors >> 2 ;
1017
+ total_sectors -= (XGD1_LSEEK_OFFSET / ATAPI_SECTOR_SIZE );
1010
1018
1011
1019
nb_sectors = (buf [6 ] << 16 ) | (buf [7 ] << 8 ) | buf [8 ];
1012
1020
if (nb_sectors == 0 ) {
You can’t perform that action at this time.
0 commit comments