mirror of
https://github.com/jfdelnero/HxCFloppyEmulator.git
synced 2026-10-26 22:10:31 +00:00
missing data address mark support.
This commit is contained in:
1 parent
21f724e249
commit
fac98f2eb8
5 files changed
+41
-52
No files matched your search
+4
-4
@@ -1,7 +1,7 @@
|
||||
#define FILE_VERSION 2,16,6,1
|
||||
#define STR_FILE_VERSION "2,16,6,1\0"
|
||||
#define STR_FILE_VERSION2 "2.16.6.1"
|
||||
#define STR_DATE "1 Dec 2024\0"
|
||||
#define FILE_VERSION 2,16,6,2
|
||||
#define STR_FILE_VERSION "2,16,6,2\0"
|
||||
#define STR_FILE_VERSION2 "2.16.6.2"
|
||||
#define STR_DATE "11 Dec 2024\0"
|
||||
#define NOMFENETRE "HxCFloppyEmulator v" STR_FILE_VERSION2
|
||||
|
||||
#define FILEVER FILE_VERSION
|
||||
|
||||
@@ -20,7 +20,7 @@ Sources : https://github.com/jfdelnero/HxCFloppyEmulator
|
||||
** **** 2024 : HxCFloppyEmulator *.*.*.* - (Work in progress/beta version)
|
||||
|
||||
*** Latest beta version : https://hxc2001.com/download/floppy_drive_emulator/HxCFloppyEmulator_soft_beta.zip ***
|
||||
*** Last update : v2.16.6.1, 1 Dec 2024 ***
|
||||
*** Last update : v2.16.6.2, 11 Dec 2024 ***
|
||||
|
||||
-> New Writer : PNG file (Disk/tracks and stream layouts) -> Disk layout can now be exported into a PNG file (for disk analysis) !
|
||||
|
||||
@@ -63,6 +63,8 @@ Sources : https://github.com/jfdelnero/HxCFloppyEmulator
|
||||
|
||||
-> New Loader : Mame MFI files. (WIP!)
|
||||
|
||||
-> IMD Loader/Writer : Missing data mark support.
|
||||
|
||||
/*********************************************************
|
||||
|
||||
/*********************************************************
|
||||
|
||||
@@ -375,6 +375,10 @@ int IMD_libLoad_DiskFile(HXCFE_IMGLDR * imgldr_ctx,HXCFE_FLOPPY * floppydisk,cha
|
||||
switch(sectordatarecordcode)
|
||||
{
|
||||
case 0x00:
|
||||
sectorconfig[j].input_data = NULL;
|
||||
sectorconfig[j].use_alternate_datamark = 1;
|
||||
sectorconfig[j].alternate_datamark = 0x01;
|
||||
sectorconfig[j].missingdataaddressmark = 1;
|
||||
break;
|
||||
case 0x01:
|
||||
hxc_fread(&track_data[j*sectorsize],sectorsize,f);
|
||||
|
||||
@@ -305,41 +305,9 @@ int IMD_libWrite_DiskFile(HXCFE_IMGLDR* imgldr_ctx,HXCFE_FLOPPY * floppy,char *
|
||||
}
|
||||
else
|
||||
{
|
||||
// Compressed
|
||||
if(!sca[k]->use_alternate_data_crc)
|
||||
{
|
||||
// CRC ok
|
||||
switch(sca[k]->alternate_datamark)
|
||||
{
|
||||
case 0xFB:
|
||||
sector_type = 2;
|
||||
break;
|
||||
case 0xF8: // Deleted datamark
|
||||
sector_type = 4;
|
||||
break;
|
||||
default:
|
||||
sector_type = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// CRC Error
|
||||
switch(sca[k]->alternate_datamark)
|
||||
{
|
||||
case 0xFB:
|
||||
sector_type = 6;
|
||||
break;
|
||||
case 0xF8: // Deleted datamark
|
||||
sector_type = 8;
|
||||
break;
|
||||
default:
|
||||
sector_type = 6;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Missing Data mark
|
||||
sector_type = 0;
|
||||
fwrite(§or_type,1,1,outfile);
|
||||
fwrite(&sca[k]->fill_byte,1,1,outfile);
|
||||
}
|
||||
|
||||
log_str = hxc_dyn_sprintfcat(log_str,"%d ",sca[k]->sector);
|
||||
|
||||
@@ -1007,27 +1007,42 @@ void tg_addISOSectorToTrack(track_generator *tg,HXCFE_SECTCFG * sectorconfig,HXC
|
||||
//02 CRC The CRC of the data
|
||||
CRC16_Init(&CRC16_High,&CRC16_Low,(unsigned char*)&crctable,configptr->crc_poly,configptr->crc_initial);
|
||||
|
||||
// data mark
|
||||
for(i=0;i<configptr->len_datamarkp1;i++)
|
||||
if( !sectorconfig->missingdataaddressmark )
|
||||
{
|
||||
pushTrackCode(tg,configptr->data_datamarkp1,configptr->clock_datamarkp1,currentside,sectorconfig->trackencoding);
|
||||
CRC16_Update(&CRC16_High,&CRC16_Low, configptr->data_datamarkp1,(unsigned char*)&crctable );
|
||||
}
|
||||
|
||||
if(sectorconfig->use_alternate_datamark)
|
||||
{
|
||||
for(i=0;i<configptr->len_datamarkp2;i++)
|
||||
// data mark
|
||||
for(i=0;i<configptr->len_datamarkp1;i++)
|
||||
{
|
||||
pushTrackCode(tg,(uint8_t)sectorconfig->alternate_datamark,configptr->clock_datamarkp2,currentside,sectorconfig->trackencoding);
|
||||
CRC16_Update(&CRC16_High,&CRC16_Low, (uint8_t)sectorconfig->alternate_datamark,(unsigned char*)&crctable );
|
||||
pushTrackCode(tg,configptr->data_datamarkp1,configptr->clock_datamarkp1,currentside,sectorconfig->trackencoding);
|
||||
CRC16_Update(&CRC16_High,&CRC16_Low, configptr->data_datamarkp1,(unsigned char*)&crctable );
|
||||
}
|
||||
|
||||
if(sectorconfig->use_alternate_datamark)
|
||||
{
|
||||
for(i=0;i<configptr->len_datamarkp2;i++)
|
||||
{
|
||||
pushTrackCode(tg,(uint8_t)sectorconfig->alternate_datamark,configptr->clock_datamarkp2,currentside,sectorconfig->trackencoding);
|
||||
CRC16_Update(&CRC16_High,&CRC16_Low, (uint8_t)sectorconfig->alternate_datamark,(unsigned char*)&crctable );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i=0;i<configptr->len_datamarkp2;i++)
|
||||
{
|
||||
pushTrackCode(tg,configptr->data_datamarkp2,configptr->clock_datamarkp2,currentside,sectorconfig->trackencoding);
|
||||
CRC16_Update(&CRC16_High,&CRC16_Low, configptr->data_datamarkp2,(unsigned char*)&crctable );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i=0;i<configptr->len_datamarkp1;i++)
|
||||
{
|
||||
pushTrackCode(tg,0x00,0xFF,currentside,sectorconfig->trackencoding);
|
||||
}
|
||||
|
||||
for(i=0;i<configptr->len_datamarkp2;i++)
|
||||
{
|
||||
pushTrackCode(tg,configptr->data_datamarkp2,configptr->clock_datamarkp2,currentside,sectorconfig->trackencoding);
|
||||
CRC16_Update(&CRC16_High,&CRC16_Low, configptr->data_datamarkp2,(unsigned char*)&crctable );
|
||||
pushTrackCode(tg,0x00,0xFF,currentside,sectorconfig->trackencoding);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user