Error message when disk could not be inserted. Also fix indentation.
Chris Pressey
6 years ago
506 | 506 | int lf = strlen(imagefilename); |
507 | 507 | if(lf > 3 && imagefilename[lf-1] == 'z' && imagefilename[lf-2] == 'g' && imagefilename[lf-3] == '.') |
508 | 508 | {// .gz? |
509 | snprintf(tempdsk, 12, "drive%d.dsk", drive); | |
510 | if (DiskUnGzip((char*)imagefilename, tempdsk)) { | |
511 | writeprotected = 1; | |
512 | createifnecessary = 0; | |
513 | tmp = tempdsk; | |
514 | } | |
509 | snprintf(tempdsk, 12, "drive%d.dsk", drive); | |
510 | if (DiskUnGzip((char*)imagefilename, tempdsk)) { | |
511 | writeprotected = 1; | |
512 | createifnecessary = 0; | |
513 | tmp = tempdsk; | |
514 | } | |
515 | 515 | } |
516 | 516 | else |
517 | 517 | if(lf > 4 && imagefilename[lf-1] == 'p' && imagefilename[lf-2] == 'i' && imagefilename[lf-3] == 'z' |
518 | 518 | && imagefilename[lf-4] == '.') // .zip? |
519 | 519 | { |
520 | snprintf(tempdsk, 12, "drive%d.dsk", drive); | |
521 | if (DiskUnZip((char*)imagefilename, tempdsk)) { | |
522 | writeprotected = 1; | |
523 | createifnecessary = 0; | |
524 | tmp = tempdsk; | |
525 | } | |
520 | snprintf(tempdsk, 12, "drive%d.dsk", drive); | |
521 | if (DiskUnZip((char*)imagefilename, tempdsk)) { | |
522 | writeprotected = 1; | |
523 | createifnecessary = 0; | |
524 | tmp = tempdsk; | |
525 | } | |
526 | 526 | } |
527 | 527 | |
528 | 528 | fptr->writeprotected = writeprotected; |
537 | 537 | snprintf(s_title, MAX_DISK_IMAGE_NAME + 32, "%s - %s", g_pAppTitle, tmp); // |
538 | 538 | if(drive == 0) SDL_WM_SetCaption(s_title, g_pAppTitle);// change caption just for drive 0 (leading) |
539 | 539 | printf("Disk is inserted. Full name = %s\n", /*g_aFloppyDisk[drive].fullname*/imagefilename); |
540 | } | |
541 | else | |
542 | { | |
543 | printf("Error %d when inserting disk %s\n", error, imagefilename); | |
540 | 544 | } |
541 | 545 | return error; |
542 | 546 | } |