mirror of
https://github.com/marciot/mac-tip.git
synced 2024-12-27 05:32:27 +00:00
Additional fixes.
This commit is contained in:
parent
c3fff87822
commit
de7879f4bf
@ -10,6 +10,7 @@
|
||||
#include "iomega_cmds.h"
|
||||
|
||||
bool process_command();
|
||||
void confirm_run_tip(int id);
|
||||
void printn( unsigned char *c, int n );
|
||||
void print_help();
|
||||
void scan_bus();
|
||||
@ -24,7 +25,7 @@ void main() {
|
||||
printf( "This Mac port (c) 2021 Marcio Teixeira http://github.com/marciot/mac-tip\n" );
|
||||
printf( "Based on code (c) 2006 Gibson Research Corp http://grc.com/tip/clickdeath.htm\n" );
|
||||
|
||||
SIOUXSetTitle("\pIomega Tester (Beta) V0.1");
|
||||
SIOUXSetTitle("\pIomega Tester Beta (" __DATE__ ")");
|
||||
|
||||
print_help();
|
||||
|
||||
@ -58,7 +59,7 @@ bool process_command() {
|
||||
case 'i': dev_info(arg_val); break;
|
||||
case 'v': mac_list_volumes(); break;
|
||||
case 'u': mac_unmount(arg_val); break;
|
||||
case 't': run_tip(arg_val); break;
|
||||
case 't': confirm_run_tip(arg_val); break;
|
||||
case 'q': return false;
|
||||
case 'o': SetRichEditText(arg_str); break;
|
||||
default: printf("Unknown command, type 'h' for help\n");
|
||||
@ -66,6 +67,15 @@ bool process_command() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void confirm_run_tip(int id) {
|
||||
char cmd[80];
|
||||
printf("\nThis program is in BETA TESTING and may cause severe data loss!\n\nProceed [Y/N]? ");
|
||||
gets( cmd );
|
||||
if(tolower(cmd[0]) == 'y') {
|
||||
run_tip(id);
|
||||
}
|
||||
}
|
||||
|
||||
void print_help() {
|
||||
printf(
|
||||
"\nGeneral commands:\n"
|
||||
|
Binary file not shown.
@ -53,7 +53,7 @@ OSErr scsi_cmd(int id, void *cmd, size_t clen, void *buff, size_t siz, size_t cn
|
||||
/* Send the command to the SCSI device and perform the requested I/O */
|
||||
err = SCSICmd( (Ptr) cmd, clen );
|
||||
if (err == noErr) {
|
||||
OSErr io_err;
|
||||
OSErr io_err = noErr;
|
||||
switch(flags) {
|
||||
case SCSI_WRITE | SCSI_BLIND: io_err = SCSIWBlind( (Ptr) TIB ); break;
|
||||
case SCSI_READ | SCSI_BLIND: io_err = SCSIRBlind( (Ptr) TIB ); break;
|
||||
|
@ -526,7 +526,7 @@ void SetCartridgeStatusToEAX(long eax) {
|
||||
esi = szPressToStop;
|
||||
break;
|
||||
case DISK_NOT_PRESENT:
|
||||
SetRichEditText(szNotRunning);
|
||||
//SetRichEditText(szNotRunning);
|
||||
goto DisableActions;
|
||||
case DISK_AT_SPEED:
|
||||
eax = GetSpareSectorCounts(true); // update the Cart Condition
|
||||
@ -683,8 +683,6 @@ long PerformRegionTransfer(short XferCmd, void *pBuffer) {
|
||||
long eax = SCSICommand(CurrentDevice, Scsi, pBuffer, NumberOfLBAs * BYTES_PER_SECTOR);
|
||||
// if we failed somewhere during our transfer ... let's zero in on it
|
||||
if (eax) {
|
||||
printf("Error during transfer %lx (lba: %ld)\n", eax, FirstLBASector);
|
||||
|
||||
if ( eax == SS_ERR || // if it's a CONTROLLER ERROR, skip!
|
||||
eax == BUFFER_TOO_BIG ||
|
||||
eax == LBA_TOO_LARGE) {
|
||||
@ -797,7 +795,7 @@ void TestTheDisk() {
|
||||
StopApplicationTimer();
|
||||
|
||||
PreventProgramExit();
|
||||
SetRichEditText(szRunning);
|
||||
//SetRichEditText(szRunning);
|
||||
CartridgeStatus = DISK_TEST_UNDERWAY;
|
||||
TestingPhase = TESTING_STARTUP; // inhibit stopping now
|
||||
SetWindowText(hTestButton, szPressToStop);
|
||||
@ -854,7 +852,7 @@ void TestTheDisk() {
|
||||
// -------------------------------
|
||||
TestingPhase = WRITING_DATA;
|
||||
UpdateRunPhaseDisplay();
|
||||
PerformRegionTransfer(SCSI_Cmd_Verify, pUserDataBuffer);
|
||||
PerformRegionTransfer(SCSI_Cmd_WriteMany, pUserDataBuffer);
|
||||
}
|
||||
else if (eax == LBA_TOO_LARGE) {
|
||||
// if we hit the end of the disk ... exit gracefully!
|
||||
|
@ -201,6 +201,7 @@ void DoDiskEvent(EventRecord &event) {
|
||||
mac_get_drive_volumes(driveNum, volumes);
|
||||
|
||||
// Ask the user whether they want to unmount the disk
|
||||
ParamText(volumes, "\p", "\p", "\p");
|
||||
if (CautionAlert(128, NULL) == 1) {
|
||||
// The user wishes to unmount the disk
|
||||
OSErr err = mac_unmount_drive(driveNum);
|
||||
@ -253,6 +254,7 @@ int ShowAlert(AlertTypes type, const char* format, ...) {
|
||||
void SetRichEditText(const char *name) {
|
||||
static const char *lastName = 0;
|
||||
if(name == lastName) return;
|
||||
lastName = name;
|
||||
|
||||
if(ShowAlert(YN_DLG, "Would you like to read the document \"%s\" now?", name) == 2) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user