#ifdef DEBUG_RAMDISK
static void rd_print_state(struct ramdisk_t *ramdisk);
-static int check_bit_fields(struct controller_t * controller);
#endif
drive->private_data = private_data;
-
-#ifdef DEBUG_RAMDISK
- if (check_bit_fields(controller) == INTR_REASON_BIT_ERR) {
- PrintError("interrupt reason: bit field error\n");
- return INTR_REASON_BIT_ERR;
- }
-#endif
-
controller->sector_count = 0;
drive->cdrom.cd = cd;
strcat ((char*)(drive->model_no), " ");
}
- }//for device
- }//for channel
+ }
+ }
#ifdef DEBUG_RAMDISK
rd_print_state(ramdisk);
}
case 0x42: // read sub-channel
{
- //bool msf = get_packet_field(channel,1, 1, 1);
- bool sub_q = get_packet_field(channel,2, 6, 1);
- //uint8_t data_format = get_packet_byte(channel,3);
- //uint8_t track_number = get_packet_byte(channel,6);
- uint16_t alloc_length = get_packet_word(channel,7);
+ //bool msf = get_packet_field(channel, 1, 1, 1);
+ bool sub_q = get_packet_field(channel, 2, 6, 1);
+ //uint8_t data_format = get_packet_byte(channel, 3);
+ //uint8_t track_number = get_packet_byte(channel, 6);
+ uint16_t alloc_length = get_packet_word(channel, 7);
/*
drive->id_drive[i] = 0;
}
- for (i = 0; i < strlen(firmware)/2; i++) {
+ for (i = 0; i < strlen(firmware) / 2; i++) {
drive->id_drive[23 + i] = ((firmware[i * 2] << 8) |
(firmware[(i * 2) + 1]));
}
drive->id_drive[27 + i] = ((drive->model_no[i * 2] << 8) |
(drive->model_no[(i * 2) + 1]));
}
+
V3_ASSERT((27 + i) == 47);
drive->id_drive[47] = 0;
}
-
-
-static int check_bit_fields(struct controller_t * controller) {
- //Check bit fields
- controller->sector_count = 0;
- controller->interrupt_reason.c_d = 1;
- if (controller->sector_count != 0x01) {
- return INTR_REASON_BIT_ERR;
- }
-
- controller->sector_count = 0;
- controller->interrupt_reason.i_o = 1;
- if (controller->sector_count != 0x02) {
- return INTR_REASON_BIT_ERR;
- }
-
- controller->sector_count = 0;
- controller->interrupt_reason.rel = 1;
- if (controller->sector_count != 0x04) {
- return INTR_REASON_BIT_ERR;
- }
-
- controller->sector_count = 0;
- controller->interrupt_reason.tag = 3;
- if (controller->sector_count != 0x18) {
- return INTR_REASON_BIT_ERR;
- }
-
- return 0;
-}
-
#endif