--- trunk/src/diskimage.c 2007/10/08 16:19:23 20 +++ trunk/src/diskimage.c 2007/10/08 16:20:10 26 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2005 Anders Gavare. All rights reserved. + * Copyright (C) 2003-2006 Anders Gavare. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: diskimage.c,v 1.102 2005/11/21 09:17:25 debug Exp $ + * $Id: diskimage.c,v 1.110 2006/06/24 19:52:27 debug Exp $ * * Disk image support. * @@ -524,7 +524,7 @@ fatal(" %02x", xferp->cmd[i]); fatal("\n"); if (xferp->cmd_len > 7 && xferp->cmd[5] == 0x11) - single_step = 1; + single_step = ENTER_SINGLE_STEPPING; #endif #if 0 @@ -595,7 +595,7 @@ memcpy(xferp->data_in+8, "GXemul ", 8); if (diskimage_getname(cpu->machine, id, type, namebuf, sizeof(namebuf))) { - int i; + size_t i; for (i=0; imachine_type == MACHINE_DEC) { + if (machine->machine_type == MACHINE_PMAX) { /* DEC, RZ25 (rev 0900) = 832527 sectors */ /* DEC, RZ58 (rev 2000) = 2698061 sectors */ memcpy(xferp->data_in+8, "DEC ", 8); @@ -626,7 +626,7 @@ xferp->data_in[1] = 0x80; /* 0x80 = removable */ /* memcpy(xferp->data_in+16, "CD-ROM ", 16);*/ - if (machine->machine_type == MACHINE_DEC) { + if (machine->machine_type == MACHINE_PMAX) { /* SONY, CD-ROM: */ memcpy(xferp->data_in+8, "SONY ", 8); memcpy(xferp->data_in+16, @@ -652,7 +652,7 @@ xferp->data_in[1] = 0x80; /* 0x80 = removable */ memcpy(xferp->data_in+16, "TAPE ", 16); - if (machine->machine_type == MACHINE_DEC) { + if (machine->machine_type == MACHINE_PMAX) { /* * TODO: find out if these are correct. * @@ -897,9 +897,9 @@ * blocks to transfer. (NOTE: If the value is * 0, this means 0, not 65536. :-) */ - ofs = (xferp->cmd[2] << 24) + (xferp->cmd[3] - << 16) + (xferp->cmd[4] << 8) + - xferp->cmd[5]; + ofs = ((uint64_t)xferp->cmd[2] << 24) + + (xferp->cmd[3] << 16) + (xferp->cmd[4] << 8) + + xferp->cmd[5]; retlen = (xferp->cmd[7] << 8) + xferp->cmd[8]; } @@ -975,8 +975,9 @@ * transfer. (NOTE: If the value is 0 this means 0, * not 65536.) */ - ofs = (xferp->cmd[2] << 24) + (xferp->cmd[3] << 16) + - (xferp->cmd[4] << 8) + xferp->cmd[5]; + ofs = ((uint64_t)xferp->cmd[2] << 24) + + (xferp->cmd[3] << 16) + (xferp->cmd[4] << 8) + + xferp->cmd[5]; retlen = (xferp->cmd[7] << 8) + xferp->cmd[8]; } @@ -1024,7 +1025,7 @@ if (xferp->cmd_len != 6) debug(" (weird len=%i)", xferp->cmd_len); - for (i=0; icmd_len; i++) + for (i=0; i<(ssize_t)xferp->cmd_len; i++) debug(" %02x", xferp->cmd[i]); /* TODO: actualy care about cmd[] */ @@ -1285,10 +1286,10 @@ } else { int i; fatal("[ unknown MODE_SELECT: cmd ="); - for (i=0; icmd_len; i++) + for (i=0; i<(ssize_t)xferp->cmd_len; i++) fatal(" %02x", xferp->cmd[i]); fatal(", data_out ="); - for (i=0; idata_out_len; i++) + for (i=0; i<(ssize_t)xferp->data_out_len; i++) fatal(" %02x", xferp->data_out[i]); fatal(" ]"); } @@ -1307,7 +1308,7 @@ case 0xbd: fatal("[ SCSI 0x%02x (len %i), TODO: ", xferp->cmd[0], xferp->cmd_len); - for (i=0; icmd_len; i++) + for (i=0; i<(ssize_t)xferp->cmd_len; i++) fatal(" %02x", xferp->cmd[i]); fatal(" ]\n"); @@ -1498,19 +1499,13 @@ d2->next = d; } - d->type = DISKIMAGE_SCSI; + /* Default to IDE disks... */ + d->type = DISKIMAGE_IDE; - /* Special cases: some machines usually have FLOPPY/IDE, not SCSI: */ - if (machine->arch == ARCH_X86 || - machine->machine_type == MACHINE_COBALT || - machine->machine_type == MACHINE_EVBMIPS || - machine->machine_type == MACHINE_HPCMIPS || - machine->machine_type == MACHINE_BEBOX || - machine->machine_type == MACHINE_PREP || - machine->machine_type == MACHINE_CATS || - machine->machine_type == MACHINE_NETWINDER || - machine->machine_type == MACHINE_PS2) - d->type = DISKIMAGE_IDE; + /* ... but some machines use SCSI by default: */ + if (machine->machine_type == MACHINE_PMAX || + machine->machine_type == MACHINE_ARC) + d->type = DISKIMAGE_SCSI; if (prefix_i + prefix_f + prefix_s > 1) { fprintf(stderr, "Invalid disk image prefix(es). You can" @@ -1563,7 +1558,7 @@ */ #if 0 - if (machine->machine_type == MACHINE_DEC) + if (machine->machine_type == MACHINE_PMAX) d->logical_block_size = 512; else d->logical_block_size = 2048; @@ -1777,7 +1772,7 @@ */ void diskimage_dump_info(struct machine *machine) { - int iadd=4; + int iadd = DEBUG_INDENTATION; struct diskimage *d = machine->first_diskimage; while (d != NULL) {