X-Git-Url: https://git.jtryba.com/browse/friidump.git/blobdiff_plain/d44030dfa440b1967ec7dcd3ccfe46fb69934486..759ff43c97423ceb8ce4be11002237ff507284c6:/libfriidump/dvd_drive.h?ds=sidebyside diff --git a/libfriidump/dvd_drive.h b/libfriidump/dvd_drive.h index 2676b0a..2508fa2 100644 --- a/libfriidump/dvd_drive.h +++ b/libfriidump/dvd_drive.h @@ -29,12 +29,51 @@ typedef struct dvd_drive_s dvd_drive; +typedef enum { + DVD_VOLUME_LOCK_OK = 0, + DVD_VOLUME_LOCK_UNAVAILABLE = 1, + DVD_VOLUME_LOCK_FAILED = -1 +} dvd_volume_lock_result; + typedef struct { int sense_key; int asc; int ascq; } req_sense; +/* Snapshot of the most recently executed MMC command. This is retained even + * when the caller requested quiet error handling so release builds can report + * actionable seed/cache transport diagnostics without enabling DEBUG/VERBOSE. */ +typedef struct { + bool valid; + int transport_result; + int os_error; + int scsi_status; + int sense_key; + int asc; + int ascq; + int cdb_length; + u_int8_t cdb[12]; +} dvd_command_diagnostic; + +/* Read-only metadata for an exact HLDS/MN103 0xE7 profile match. + * Static firmware addresses are diagnostic evidence only. FriiDump does not + * execute these addresses or issue firmware-write commands through this API. */ +typedef struct { + u_int32_t type; + u_int32_t cache_base; + u_int32_t mem_blocks; + int preferred_method; + const char *label; + const char *support_tier; + const char *family; + const char *tokens; + const char *record_id; + u_int32_t static_cdb_base; + u_int32_t static_gate; + const char *notes; +} dvd_hlds_e7_profile_info; + typedef enum { DVD_DATA_NONE = 0, @@ -60,6 +99,7 @@ int dvd_read_sector_streaming (dvd_drive *dvd, u_int32_t sector, req_sense *sens int dvd_read_streaming (dvd_drive *dvd, u_int32_t sector, u_int32_t sectors, req_sense *sense, u_int8_t *extbuf, size_t extbufsize); int dvd_flush_cache_READ12 (dvd_drive *dvd, u_int32_t sector, req_sense *sense); int dvd_start_stop_unit (dvd_drive *dvd, bool start, bool load_eject, req_sense *sense); +int dvd_set_door_lock (dvd_drive *dvd, bool locked); int dvd_stop_unit (dvd_drive *dvd, bool start, req_sense *sense); int dvd_media_cycle (dvd_drive *dvd, req_sense *sense); int dvd_wait_ready (dvd_drive *dvd, unsigned int timeout_ms); @@ -74,7 +114,7 @@ int dvd_xbox_gdr8050l_unlock (dvd_drive *dvd, u_int32_t *unlocked_sectors); int dvd_xbox_vendor_lock (dvd_drive *dvd); int dvd_xbox_vendor_unlock_wxripper (dvd_drive *dvd, u_int32_t *unlocked_sectors); int dvd_xbox_vendor_set_error_skip (dvd_drive *dvd, bool enabled); -int dvd_xbox_recovery_kick (dvd_drive *dvd, bool auth_recovery); +int dvd_xbox_prepare_game_view (dvd_drive *dvd, u_int32_t *sectors, u_int32_t *sector_size); int dvd_refresh_volume (dvd_drive *dvd); int dvd_lock_volume (dvd_drive *dvd); int dvd_xbox_refresh_volume (dvd_drive *dvd); @@ -97,6 +137,17 @@ void *dvd_get_native_handle (dvd_drive *dvd); bool dvd_get_support_status (dvd_drive *dvd); u_int32_t dvd_get_def_method (dvd_drive *dvd); u_int32_t dvd_get_command (dvd_drive *dvd); +bool dvd_lookup_hlds_e7_profile ( + const char *vendor, + const char *product_id, + const char *revision, + dvd_hlds_e7_profile_info *out +); +u_int32_t dvd_detect_hlds_e7_type_for_identity ( + const char *vendor, + const char *product_id, + const char *revision +); const char *dvd_get_hlds_e7_profile_name (dvd_drive *dvd); const char *dvd_get_hlds_e7_support_tier (dvd_drive *dvd); const char *dvd_get_hlds_e7_family (dvd_drive *dvd); @@ -115,5 +166,6 @@ void dvd_set_hlds_e7_runtime_profile (dvd_drive *dvd, u_int32_t type, u_int32_t typedef int (*dvd_drive_memdump_func) (dvd_drive *dvd, u_int32_t block_off, u_int32_t block_len, u_int32_t block_size, u_int8_t *buf); void dvd_init_command (mmc_command *mmc, u_int8_t *buf, int len, req_sense *sense); int dvd_execute_cmd (dvd_drive *dvd, mmc_command *mmc, bool ignore_errors); +bool dvd_get_last_command_diagnostic (dvd_drive *dvd, dvd_command_diagnostic *out); #endif