Skip to content

Commit

Permalink
ASUS 3.10/RibShark full support, some refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
superg committed Oct 2, 2023
1 parent 2ed4ec5 commit c0718d8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cd/cd_dump.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ export bool redumper_dump_cd(Context &ctx, const Options &options, bool refine)
}

// grow lead-out overread if we still can read
if(lba + 1 == lba_overread && !options.lba_end)
if(lba + 1 == lba_overread && !options.lba_end && (lba_overread - lba_end <= 100 || options.overread_leadout))
++lba_overread;
}
else
Expand Down
2 changes: 1 addition & 1 deletion commands.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export bool redumper_subchannel(Context &ctx, Options &options)

export bool redumper_debug(Context &ctx, Options &options)
{
debug(options);
debug(ctx, options);

return true;
}
Expand Down
10 changes: 8 additions & 2 deletions debug.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export void debug_subchannel(Options &options)
}


export void debug(Options &options)
export void debug(Context &ctx, Options &options)
{
std::string image_prefix = (std::filesystem::path(options.image_path) / options.image_name).string();
std::filesystem::path state_path(image_prefix + ".state");
Expand Down Expand Up @@ -135,8 +135,14 @@ export void debug(Options &options)
*/
}

// LG/ASUS cache dump extract
if(1)
{
auto cache = asus_cache_read(*ctx.sptd, DriveConfig::Type::LG_ASU3);
LOG("");
}

// LG/ASUS cache dump extract
if(0)
{
auto drive_type = DriveConfig::Type::LG_ASU83;
std::vector<uint8_t> cache = read_vector(cache_path);
Expand Down
1 change: 1 addition & 0 deletions drive.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ static const std::vector<DriveConfig> KNOWN_DRIVES =
{"ATAPI" , "iHBS312 2" , "PL17", "2012/10/31 13:50" , +6, 0, -135, DriveConfig::ReadMethod::BE_CDDA, DriveConfig::SectorOrder::DATA_C2_SUB, DriveConfig::Type::LG_ASU8}, // olofolleola4

// OTHER
{"ASUS" , "BW-16D1HT" , "3.10", "WM01601KLZL4TG5625" , +6, 0, -135, DriveConfig::ReadMethod::BE_CDDA, DriveConfig::SectorOrder::DATA_C2_SUB, DriveConfig::Type::GENERIC}, // default or RibShark FW definition
{"ASUS" , "SDRW-08D2S-U" , "B901", "2015/03/03 15:29" , +6, 0, -135, DriveConfig::ReadMethod::BE , DriveConfig::SectorOrder::DATA_SUB_C2, DriveConfig::Type::GENERIC}, // internal model: DU-8A6NH11B
{"ASUS" , "SDRW-08U9M-U" , "A112", "M045600 K0QL92H5616", +6, 0, -135, DriveConfig::ReadMethod::BE , DriveConfig::SectorOrder::DATA_SUB_C2, DriveConfig::Type::GENERIC},
{"Lite-On" , "LTN483S 48x Max" , "PD03", "" , -1164, 0, 0, DriveConfig::ReadMethod::BE , DriveConfig::SectorOrder::DATA_C2 , DriveConfig::Type::GENERIC},
Expand Down
11 changes: 8 additions & 3 deletions options.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export struct Options
std::unique_ptr<int> force_offset;
int audio_silence_threshold;
int dump_read_size;
bool overread_leadout;


Options(int argc, const char *argv[])
Expand All @@ -82,6 +83,7 @@ export struct Options
, offset_shift_relocate(false)
, audio_silence_threshold(32)
, dump_read_size(32)
, overread_leadout(false)
{
for(int i = 0; i < argc; ++i)
{
Expand Down Expand Up @@ -218,6 +220,8 @@ export struct Options
i_value = &audio_silence_threshold;
else if(key == "--dump-read-size")
i_value = &dump_read_size;
else if(key == "--overread-leadout")
overread_leadout = true;
// unknown option
else
{
Expand Down Expand Up @@ -299,17 +303,18 @@ export struct Options
LOG("\t(split)");
LOG("\t--force-split \tforce track split with errors");
LOG("\t--leave-unchanged \tdon't replace erroneous sectors with generated ones");
LOG("\t--force-qtoc \tForce QTOC based track split");
LOG("\t--legacy-subs \tReplicate DIC style subchannel based track split");
LOG("\t--force-qtoc \tforce QTOC based track split");
LOG("\t--legacy-subs \treplicate DIC style subchannel based track split");
LOG("\t--skip-fill=VALUE \tfill byte value for skipped sectors (default: 0x{:02X})", skip_fill);
LOG("\t--iso9660-trim \ttrim each ISO9660 data track to PVD volume size, useful for discs with fake TOC");
LOG("");
LOG("\t(miscellaneous)");
LOG("\t--lba-start=VALUE \tLBA to start dumping from");
LOG("\t--lba-end=VALUE \tLBA to stop dumping at (everything before the value), useful for discs with fake TOC");
LOG("\t--refine-subchannel \tIn addition to SCSI/C2, refine subchannel");
LOG("\t--refine-subchannel \tin addition to SCSI/C2, refine subchannel");
LOG("\t--skip=VALUE \tLBA ranges of sectors to skip");
LOG("\t--dump-read-size=VALUE \tnumber of sectors to read at once on initial dump, DVD only (default: {})", dump_read_size);
LOG("\t--overread-leadout \tdo not limit lead-out to the first hundred sectors, read until drive returns SCSI error");
}
};

Expand Down
2 changes: 1 addition & 1 deletion redumper.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const std::map<std::string, std::pair<bool, bool (*)(Context &, Options &)>> COM
{ "info" , { false, redumper_info }},

{ "subchannel", { false, redumper_subchannel }},
{ "debug" , { false, redumper_debug }}
{ "debug" , { true , redumper_debug }}
};


Expand Down

0 comments on commit c0718d8

Please sign in to comment.