src/mess/formats/ami_dsk.c
| r9206 | r9207 | |
| 22 | 22 | static FLOPPY_IDENTIFY( amiga_dsk_identify ) |
| 23 | 23 | { |
| 24 | 24 | UINT64 size; |
| 25 | | UINT8 header[4]; |
| 26 | 25 | |
| 27 | 26 | *vote = 100; |
| 28 | 27 | |
| 29 | | /* get first 4 bytes */ |
| 30 | | floppy_image_read(floppy, &header, 0, sizeof(header)); |
| 31 | | |
| 32 | 28 | /* first check the size of the image */ |
| 33 | 29 | size = floppy_image_size(floppy); |
| 34 | 30 | if ((size != 901120) && (size != 1802240)) |
| 35 | 31 | *vote = 0; |
| 36 | 32 | |
| 37 | | /* then check the first sector for the magic string */ |
| 38 | | if (memcmp(header, "DOS", 3)) |
| 39 | | *vote = 0; |
| 40 | | |
| 41 | | /* then check the disk type */ |
| 42 | | if (header[3] > 5) |
| 43 | | *vote = 0; |
| 44 | | |
| 45 | 33 | return FLOPPY_ERROR_SUCCESS; |
| 46 | 34 | } |
| 47 | 35 | |