Fixed sector extract for FM recording.

This commit is contained in:
Michael Zapf 2014-02-12 11:58:29 +00:00
parent 2e3eafc3fb
commit 40c1c87b73

View File

@ -2473,35 +2473,21 @@ void floppy_image_format_t::extract_sectors_from_bitstream_fm_pc(const UINT8 *bi
// Scan the bitstream for sync marks and follow them to check for // Scan the bitstream for sync marks and follow them to check for
// blocks // blocks
// We scan for address marks only, as index marks are not mandatory,
// and many formats actually do not use them
for(int i=0; i<track_size; i++) { for(int i=0; i<track_size; i++) {
shift_reg = (shift_reg << 1) | sbit_r(bitstream, i); shift_reg = (shift_reg << 1) | sbit_r(bitstream, i);
if(shift_reg == 0xf77a) {
//index mark
UINT16 header;
int pos = i+1;
do {
header = 0;
for(int j=0; j<16; j++)
if(sbit_rp(bitstream, pos, track_size))
header |= 0x8000 >> j;
// Accept strings of sync marks as long and they're not wrapping
// Wrapping ones have already been take into account // fe
// thanks to the precharging if(shift_reg == 0xf57e) { // address mark
if(idblk_count < 100)
// fe idblk[idblk_count++] = i+1;
if(header == 0xf57e) { // address mark }
if(idblk_count < 100) // fb
idblk[idblk_count++] = pos; if(shift_reg == 0xf56f) { // data mark
i = pos-1; if(dblk_count < 100)
} dblk[dblk_count++] = i+1;
// fb
if(header == 0xf56f ) { // data mark
if(dblk_count < 100)
dblk[dblk_count++] = pos;
i = pos-1;
}
} while(header != 0xf77a);
} }
} }