1 |
|
/* |
2 |
|
* cdrom.cpp - CD-ROM driver |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2000 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2001 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
185 |
|
if (Sys_read(info->fh, map, i * 512, 512) != 512) |
186 |
|
break; |
187 |
|
|
188 |
< |
// Skip driver descriptor |
189 |
< |
uint16 sig = ntohs(((uint16 *)map)[0]); |
190 |
< |
if (sig == 0x4552) |
191 |
< |
continue; |
192 |
< |
|
193 |
< |
// No partition map? Then look at next block |
188 |
> |
// Not a partition map block? Then look at next block |
189 |
> |
uint16 sig = (map[0] << 8) | map[1]; |
190 |
|
if (sig != 0x504d) |
191 |
|
continue; |
192 |
|
|
193 |
< |
// Partition map found, Apple HFS partition? |
193 |
> |
// Partition map block found, Apple HFS partition? |
194 |
|
if (strcmp((char *)(map + 48), "Apple_HFS") == 0) { |
195 |
|
info->start_byte = ntohl(((uint32 *)map)[2]) << 9; |
196 |
|
D(bug(" HFS partition found at %d, %d blocks\n", info->start_byte, ntohl(((uint32 *)map)[3]))); |
874 |
|
WriteMacInt32(pb + csParam + 4, FOURCC('c','d','r','m')); |
875 |
|
break; |
876 |
|
case FOURCC('i','n','t','f'): // Interface type |
877 |
< |
WriteMacInt32(pb + csParam + 4, FOURCC('b','a','s','i')); |
877 |
> |
WriteMacInt32(pb + csParam + 4, EMULATOR_ID_4); |
878 |
|
break; |
879 |
|
case FOURCC('s','y','n','c'): // Only synchronous operation? |
880 |
|
WriteMacInt32(pb + csParam + 4, 0x01000000); |
917 |
|
|
918 |
|
// Drive-specific codes |
919 |
|
switch (code) { |
920 |
+ |
case 6: // Return format list |
921 |
+ |
if (ReadMacInt16(pb + csParam) > 0) { |
922 |
+ |
uint32 adr = ReadMacInt32(pb + csParam + 2); |
923 |
+ |
WriteMacInt16(pb + csParam, 1); // 1 format |
924 |
+ |
WriteMacInt32(adr, SysGetFileSize(info->fh) / 512); // Number of blocks |
925 |
+ |
WriteMacInt32(adr + 4, 0); // heads/track/sectors |
926 |
+ |
return noErr; |
927 |
+ |
} else |
928 |
+ |
return paramErr; |
929 |
+ |
|
930 |
|
case 8: // DriveStatus |
931 |
|
Mac2Mac_memcpy(pb + csParam, info->status, 22); |
932 |
|
return noErr; |