From e804f9c0cab81dc2175e142ca1ed4e31c382bed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20DEL=20NERO?= Date: Mon, 4 May 2026 22:57:17 +0200 Subject: [PATCH] IMD Loader : report correctly the variable bitrate state when multiples bitrates are present across the whole image. --- .../sources/loaders/imd_loader/imd_loader.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/libhxcfe/sources/loaders/imd_loader/imd_loader.c b/libhxcfe/sources/loaders/imd_loader/imd_loader.c index 575b5baa..23fcc2b4 100644 --- a/libhxcfe/sources/loaders/imd_loader/imd_loader.c +++ b/libhxcfe/sources/loaders/imd_loader/imd_loader.c @@ -96,6 +96,7 @@ int IMD_libLoad_DiskFile(HXCFE_IMGLDR * imgldr_ctx,HXCFE_FLOPPY * floppydisk,cha HXCFE_CYLINDER* currentcylinder = NULL; HXCFE_SIDE* currentside = NULL; int32_t bitrate; + int32_t oldbitrate; int32_t pregap; unsigned char * sectormap = NULL; unsigned char * sectorcylmap = NULL; @@ -452,8 +453,6 @@ int IMD_libLoad_DiskFile(HXCFE_IMGLDR * imgldr_ctx,HXCFE_FLOPPY * floppydisk,cha sectorconfig[j].trackencoding=tracktype; } - floppydisk->floppyBitRate=bitrate; - if(!floppydisk->tracks[trackcfg.physical_cylinder]) { floppydisk->tracks[trackcfg.physical_cylinder] = allocCylinderEntry(rpm,floppydisk->floppyNumberOfSide); @@ -462,10 +461,24 @@ int IMD_libLoad_DiskFile(HXCFE_IMGLDR * imgldr_ctx,HXCFE_FLOPPY * floppydisk,cha currentcylinder = floppydisk->tracks[trackcfg.physical_cylinder]; - currentside = tg_generateTrackEx((unsigned short)trackcfg.number_of_sector,sectorconfig,interleave,0,floppydisk->floppyBitRate,rpm,tracktype,pregap,2500 | NO_SECTOR_UNDER_INDEX,-2500); + currentside = tg_generateTrackEx((unsigned short)trackcfg.number_of_sector,sectorconfig,interleave,0,bitrate,rpm,tracktype,pregap,2500 | NO_SECTOR_UNDER_INDEX,-2500); currentcylinder->sides[trackcfg.physical_head&0xF] = currentside; currentcylinder->floppyRPM = rpm; + if( i != 0 ) + { + if ( bitrate != oldbitrate) + { + floppydisk->floppyBitRate = VARIABLEBITRATE; + } + } + else + { + floppydisk->floppyBitRate = bitrate; + } + + oldbitrate = bitrate; + for(j=0;jhxcfe->hxc_printf(MSG_DEBUG,"Sector:%d %x %x %x",sectorconfig[j].sector,sectorconfig[j].alternate_datamark,sectorconfig[j].alternate_sector_size_id,tracktype);