diff -Naur '--exclude=CVS' '--exclude=autom4te.cache' '--exclude=config.*' '--exclude=configure' '--exclude=Makefile' franny-trunk/atr.cpp franny/atr.cpp
--- franny-trunk/atr.cpp	2010-09-27 20:13:04.000000000 +0200
+++ franny/atr.cpp	2014-01-07 13:00:22.000000000 +0100
@@ -33,7 +33,7 @@
 	image_type=IMAGE_UNKNOWN;
 	image=NULL;
 	total_sectors=0;
-	atr_bios_buffer=new unsigned char[SECTOR_DOUBLE];
+	atr_bios_buffer=new unsigned char[SECTOR_HDD];
 }
 
 ATR::ATR(char *fname)
@@ -43,7 +43,7 @@
 	image_type=IMAGE_UNKNOWN;
 	image=NULL;
 	total_sectors=0;
-	atr_bios_buffer=new unsigned char[SECTOR_DOUBLE];
+	atr_bios_buffer=new unsigned char[SECTOR_HDD];
 	OpenImage(fname);
 }
 
@@ -53,7 +53,7 @@
 	force_write=false;
 	image=NULL;
 	total_sectors=sectors;
-	atr_bios_buffer=new unsigned char[SECTOR_DOUBLE];
+	atr_bios_buffer=new unsigned char[SECTOR_HDD];
 	NewImage(fname, sectors, bps);
 }
 
@@ -88,6 +88,7 @@
 	a=0;
 	if((*(atr_bios_buffer+4)==(SECTOR_SINGLE&0xff)) && (*(atr_bios_buffer+5)==((SECTOR_SINGLE&0xff00)>>8))) a=7;
 	if((*(atr_bios_buffer+4)==(SECTOR_DOUBLE&0xff)) && (*(atr_bios_buffer+5)==((SECTOR_DOUBLE&0xff00)>>8))) a=8;
+	if((*(atr_bios_buffer+4)==(SECTOR_HDD&0xff)) && (*(atr_bios_buffer+5)==((SECTOR_HDD&0xff00)>>8))) a=9;
 	if(!a)
 		return false;
 	if((total_sectors+HEADER_SIZE)==real_image_size)
@@ -103,7 +104,13 @@
 		}
 		else corrupted=true;
 	}
-	if(a==8)
+	if(a==9)
+	{
+		bytes_per_sector=SECTOR_HDD;
+		total_sectors>>=9;
+		density=DENSITY_HDD;
+	}
+	else if(a==8)
 	{
 		bytes_per_sector=SECTOR_DOUBLE;
 		total_sectors=(total_sectors+(3*SECTOR_SINGLE))>>8;
@@ -140,10 +147,10 @@
 	}
 	else
 	{
-		pos=sector*SECTOR_SINGLE+HEADER_SIZE;
+		pos=sector*bytes_per_sector+HEADER_SIZE;
 		image->seekg(pos, ios::beg);
-		image->read((char *)buffer, SECTOR_SINGLE);
-		return SECTOR_SINGLE;
+		image->read((char *)buffer, bytes_per_sector);
+		return bytes_per_sector;
 	}
 	return 0;
 }
@@ -163,10 +170,10 @@
 	}
 	else
 	{
-		pos=sector*SECTOR_SINGLE+HEADER_SIZE;
+		pos=sector*bytes_per_sector+HEADER_SIZE;
 		image->seekg(pos, ios::beg);
-		image->write((char *)buffer, SECTOR_SINGLE);
-		return SECTOR_SINGLE;
+		image->write((char *)buffer, bytes_per_sector);
+		return bytes_per_sector;
 	}
 	return 0;
 }
@@ -189,7 +196,7 @@
 
 	if(image_load)
 		CloseImage();
-	if((bps!=SECTOR_SINGLE) && (bps!=SECTOR_DOUBLE))
+	if((bps!=SECTOR_SINGLE) && (bps!=SECTOR_DOUBLE) && (bps!=SECTOR_HDD))
 		return false;
 	if(sectors>MAX_SECTORS)
 		return false;
@@ -204,13 +211,14 @@
 	image->write((char *)atr_bios_buffer, HEADER_SIZE);
 	memset(atr_bios_buffer, 0, bps);
 	for(a=0;a<sectors;a++)
-		{ (a<3)?image->write((char *)atr_bios_buffer, SECTOR_SINGLE):image->write((char *)atr_bios_buffer, bps); }
+		{ ((a<3) && (bps==SECTOR_DOUBLE))?image->write((char *)atr_bios_buffer, SECTOR_SINGLE):image->write((char *)atr_bios_buffer, bps); }
 	image_load=true;
 	corrupted=false;
 	image_type=IMAGE_STANDARD;
 	bytes_per_sector=bps;
 	total_sectors=sectors;
-	if(sectors==720) (bps==SECTOR_DOUBLE)?density=DENSITY_DOUBLE:density=DENSITY_SINGLE;
+	if (bps==SECTOR_HDD) density=DENSITY_HDD;
+	else if(sectors==720) (bps==SECTOR_DOUBLE)?density=DENSITY_DOUBLE:density=DENSITY_SINGLE;
 	else if((sectors==1040) && (bps==SECTOR_SINGLE)) density=DENSITY_MEDIUM;
 	else (bps==SECTOR_DOUBLE)?density=DENSITY_CUSTOM_256:density=DENSITY_CUSTOM_128;
 	return true;
@@ -251,7 +259,9 @@
 	*(atr_bios_buffer+5)=(char)((bytes_per_sector&0xff00)>>8);
 	if(type==IMAGE_STANDARD)
 	{
-		len=((3*SECTOR_SINGLE)+(total_sectors-3)*bytes_per_sector)>>4;
+		len=(density==DENSITY_HDD)?
+			(total_sectors*bytes_per_sector)>>4:
+			((3*SECTOR_SINGLE)+(total_sectors-3)*bytes_per_sector)>>4;
 		*(atr_bios_buffer+2)=(char)(len&0xff);
 		*(atr_bios_buffer+3)=(char)((len&0xff00)>>8);
 		*(atr_bios_buffer+6)=(char)((len&0xff0000)>>16);
@@ -276,7 +286,7 @@
 
 	if((image_load==false) || (sector==0) || (sector>total_sectors))
 		return false;
-	((sector>3) && (bytes_per_sector==SECTOR_DOUBLE))?a=SECTOR_DOUBLE:a=SECTOR_SINGLE;
+	((sector<=3) && (bytes_per_sector==SECTOR_DOUBLE))?a=SECTOR_SINGLE:a=bytes_per_sector;
 	if(ReadSector(atr_bios_buffer, sector)>0)
 	{
 		cout<<hex;
@@ -310,7 +320,9 @@
 	unsigned int len;
 
 	memset(atr_bios_buffer, 0, HEADER_SIZE);
-	len=((3*SECTOR_SINGLE)+(sectors-3)*bps)>>4;
+	len=(density==DENSITY_DOUBLE)?
+		((3*SECTOR_SINGLE)+(sectors-3)*bps)>>4:
+		(sectors*bps)>>4;
 	*atr_bios_buffer=0x96;
 	*(atr_bios_buffer+1)=0x02;
 	*(atr_bios_buffer+2)=(char)(len&0xff);
diff -Naur '--exclude=CVS' '--exclude=autom4te.cache' '--exclude=config.*' '--exclude=configure' '--exclude=Makefile' franny-trunk/franny.cpp franny/franny.cpp
--- franny-trunk/franny.cpp	2010-09-27 20:13:04.000000000 +0200
+++ franny/franny.cpp	2014-01-07 13:13:17.000000000 +0100
@@ -76,6 +76,8 @@
 					sector_size=128;
 				else if(*optarg=='d')
 					sector_size=256;
+				else if(*optarg=='h')
+					sector_size=512;
 				else
 				{
 					cerr<<PROGRAM_NAME<<": Bad -d parameter. Try: "<<PROGRAM_NAME<<" -h!"<<endl;
@@ -107,7 +109,7 @@
 				cout<<"-A\t\tadd file to image (parameters must be added with -i and -o),"<<endl;
 				cout<<"-c\t\tconvert text file: Atari<->Unix,"<<endl;
 				cout<<"-C\t\tcreate new image,"<<endl;
-				cout<<"-d [s|d]\tsector's size [single|double]; default: double,"<<endl;
+				cout<<"-d [s|d]\tsector's size [single|double|hdd]; default: double,"<<endl;
 				cout<<"-f [a|s]\tfile system type [AtariDOS II|Sparta 2.0]; default: Sparta 2.0,"<<endl;
 				cout<<"-F\t\tformat,"<<endl;
 				cout<<"-h\t\thelp,"<<endl;
@@ -123,7 +125,7 @@
 				cout<<"-R dirname\tremove dir,"<<endl;
 				cout<<"-s sectors\ttotal sectors; default: 720,"<<endl;
 				cout<<"-S\t\tsave (extract) filename from image (parameters must be added with -i and -o),"<<endl;
-				cout<<"-t [s|m|d|f|F]\timage templates [single|medium|double|full/Full(65535 sectors, 128/256 bytes each)],"<<endl;
+				cout<<"-t [s|m|d|f|F|h]\n\t\timage templates [single|medium|double|full/Full/hdd(65535 sectors, 128/256/512 bytes each)],"<<endl;
 				cout<<"-T [d|s]\tchange image type (default|sio2ide),"<<endl;
 				cout<<"-U filename\tunlink(remove) file,"<<endl;
 				cout<<"-v\t\tversion,"<<endl;
@@ -273,6 +275,11 @@
 					sector_size=256;
 					sectors=65535;
 				}
+				else if(*optarg=='h')
+				{
+					sector_size=512;
+					sectors=65535;
+				}
 				else
 				{
 					cerr<<PROGRAM_NAME<<": Bad -t parameter. Try: "<<PROGRAM_NAME<<" -h!"<<endl;
diff -Naur '--exclude=CVS' '--exclude=autom4te.cache' '--exclude=config.*' '--exclude=configure' '--exclude=Makefile' franny-trunk/interface.cpp franny/interface.cpp
--- franny-trunk/interface.cpp	2010-09-27 20:13:04.000000000 +0200
+++ franny/interface.cpp	2014-01-07 14:03:29.000000000 +0100
@@ -136,16 +136,17 @@
 	{
 		case FSTYPE_DOS2:
 			((file->Attributes&0x20)>0)?cout<<"R":cout<<"-";
-			cout<<"-";
+			cout<<"--";
 			((file->Attributes&0x01)>0)?cout<<"2":cout<<"-";
 			break;
 		case FSTYPE_SPARTA2:
 			((file->Attributes&0x01)>0)?cout<<"R":cout<<"-";
 			((file->Attributes&0x02)>0)?cout<<"H":cout<<"-";
+			((file->Attributes&0x04)>0)?cout<<"A":cout<<"-";
 			((file->Attributes&0x20)>0)?cout<<"D":cout<<"-";
 			break;
 		default:
-			cout<<"---"<<endl;
+			cout<<"----"<<endl;
 			break;
 	}
 	return true;
@@ -209,7 +210,8 @@
 
 	if(filename==NULL)
 		return false;
-	if((sectors==720) && (bps==SECTOR_SINGLE)) density=DENSITY_SINGLE;
+	if (bps==SECTOR_HDD) density=DENSITY_HDD;
+	else if((sectors==720) && (bps==SECTOR_SINGLE)) density=DENSITY_SINGLE;
 	else if((sectors==1040) && (bps==SECTOR_SINGLE)) density=DENSITY_MEDIUM;
 	else if((sectors==720) && (bps==SECTOR_DOUBLE)) density=DENSITY_DOUBLE;
 	try
@@ -539,6 +541,9 @@
 		case DENSITY_CUSTOM_256:
 			cout<<"custom (256 bytes per sector)";
 			break;
+		case DENSITY_HDD:
+			cout<<"hdd (512 bytes per sector)";
+			break;
 		default:
 			cout<<"unknown";
 			break;
@@ -615,7 +620,7 @@
 	CFS *result=NULL;
 	unsigned char *sector;
 
-	sector=new unsigned char[SECTOR_DOUBLE];
+	sector=new unsigned char[SECTOR_HDD];
 	if(media->ReadSector(sector, 0x168)!=0)
 	{
 		if(*sector==0x02)
@@ -626,7 +631,7 @@
 		{
 			if(media->ReadSector(sector, 1)!=0)
 			{
-				if(*(sector+32)==0x20)
+				if(*(sector+32)==0x20 || *(sector+32)==0x21)
 				{
 					result=new SPARTA(media);
 				}
@@ -721,7 +726,7 @@
 	IMAGE *local_image;
 	unsigned int sectors;
 	unsigned int bps;
-	unsigned char sector_buffer[SECTOR_DOUBLE];
+	unsigned char sector_buffer[SECTOR_HDD];
 
 	if(media_image==NULL)
 		return false;
diff -Naur '--exclude=CVS' '--exclude=autom4te.cache' '--exclude=config.*' '--exclude=configure' '--exclude=Makefile' franny-trunk/raw.cpp franny/raw.cpp
--- franny-trunk/raw.cpp	2010-09-27 20:13:04.000000000 +0200
+++ franny/raw.cpp	2014-01-07 13:03:20.000000000 +0100
@@ -33,7 +33,7 @@
 	force_write=false;
 	image=NULL;
 	total_sectors=0;
-	raw_bios_buffer=new unsigned char[SECTOR_DOUBLE];
+	raw_bios_buffer=new unsigned char[SECTOR_HDD];
 }
 
 RAW::RAW(char *fname)
@@ -43,7 +43,7 @@
 	force_write=false;
 	image=NULL;
 	total_sectors=0;
-	raw_bios_buffer=new unsigned char[SECTOR_DOUBLE];
+	raw_bios_buffer=new unsigned char[SECTOR_HDD];
 	OpenImage(fname);
 }
 
@@ -54,7 +54,7 @@
 	force_write=false;
 	image=NULL;
 	total_sectors=sectors;
-	raw_bios_buffer=new unsigned char[SECTOR_DOUBLE];
+	raw_bios_buffer=new unsigned char[SECTOR_HDD];
 	NewImage(fname, sectors, bps);
 }
 
diff -Naur '--exclude=CVS' '--exclude=autom4te.cache' '--exclude=config.*' '--exclude=configure' '--exclude=Makefile' franny-trunk/sparta.cpp franny/sparta.cpp
--- franny-trunk/sparta.cpp	2010-09-27 20:13:04.000000000 +0200
+++ franny/sparta.cpp	2014-01-07 13:53:59.000000000 +0100
@@ -31,7 +31,7 @@
 	media_image=NULL;
 	current_path=NULL;
 	*file_mask='\0';
-	sparta_buffer=new unsigned char[SECTOR_DOUBLE];
+	sparta_buffer=new unsigned char[SECTOR_HDD];
 	main_dir_sector_map=dir_sector_map=dir_sector_map_cnt=disk_bit_map=disk_bit_map_cnt=disk_bit_map_cnt=0;
 	set_mask=false;
 }
@@ -39,7 +39,7 @@
 SPARTA::SPARTA(IMAGE *media)
 {
 	media_image=media;
-	sparta_buffer=new unsigned char[SECTOR_DOUBLE];
+	sparta_buffer=new unsigned char[SECTOR_HDD];
 	media_image->ReadSector(sparta_buffer, 1);
 	if((*(sparta_buffer+11)+(*(sparta_buffer+12)<<8))!=GetTotalSectors())
 		media_image->SetCorrupted(true);
@@ -229,8 +229,8 @@
 			continue;
 		file->Attributes=dir_entry[0];
 		file->SizeInBytes=dir_entry[3]+(dir_entry[4]<<8)+(dir_entry[5]<<16);
-		(b==SECTOR_SINGLE)?file->SizeInSectors=(file->SizeInBytes>>7):file->SizeInSectors=(file->SizeInBytes>>8);
-		(b==SECTOR_SINGLE)?c=0x7f:c=0xff;
+		(b==SECTOR_SINGLE)?file->SizeInSectors=(file->SizeInBytes>>7):((b==SECTOR_DOUBLE)?file->SizeInSectors=(file->SizeInBytes>>8):file->SizeInSectors=(file->SizeInBytes>>9));
+		(b==SECTOR_SINGLE)?c=0x7f:((b==SECTOR_DOUBLE)?c=0xff:c=0x1ff);
 		if((file->SizeInBytes&c)>0) ++file->SizeInSectors;
 		file->FirstSector=dir_entry[1]+(dir_entry[2]<<8);
 		file->FileId=current_file-1;
@@ -305,8 +305,8 @@
 			continue;
 		file->Attributes=dir_entry[0];
 		file->SizeInBytes=dir_entry[3]+(dir_entry[4]<<8)+(dir_entry[5]<<16);
-		(b==SECTOR_SINGLE)?file->SizeInSectors=(file->SizeInBytes>>7):file->SizeInSectors=(file->SizeInBytes>>8);
-		(b==SECTOR_SINGLE)?c=0x7f:c=0xff;
+		(b==SECTOR_SINGLE)?file->SizeInSectors=(file->SizeInBytes>>7):((b==SECTOR_DOUBLE)?file->SizeInSectors=(file->SizeInBytes>>8):file->SizeInSectors=(file->SizeInBytes>>9));
+		(b==SECTOR_SINGLE)?c=0x7f:((b==SECTOR_DOUBLE)?c=0xff:c=0x1ff);
 		if((file->SizeInBytes&c)>0) ++file->SizeInSectors;
 		file->FirstSector=dir_entry[1]+(dir_entry[2]<<8);
 		file->FileId=current_file-1;
@@ -392,8 +392,8 @@
 			continue;
 		file->Attributes=dir_entry[0];
 		file->SizeInBytes=dir_entry[3]+(dir_entry[4]<<8)+(dir_entry[5]<<16);
-		(b==SECTOR_SINGLE)?file->SizeInSectors=(file->SizeInBytes>>7):file->SizeInSectors=(file->SizeInBytes>>8);
-		(b==SECTOR_SINGLE)?c=0x7f:c=0xff;
+		(b==SECTOR_SINGLE)?file->SizeInSectors=(file->SizeInBytes>>7):((b==SECTOR_DOUBLE)?file->SizeInSectors=(file->SizeInBytes>>8):file->SizeInSectors=(file->SizeInBytes>>9));
+		(b==SECTOR_SINGLE)?c=0x7f:((b==SECTOR_DOUBLE)?c=0xff:c=0x1ff);
 		if((file->SizeInBytes&c)>0) ++file->SizeInSectors;
 		file->FirstSector=dir_entry[1]+(dir_entry[2]<<8);
 		file->FileId=local_current_file-1;
@@ -413,7 +413,7 @@
 	int a, b;
 	bool first_sector_map;
 
-	memset(sparta_buffer, 0, SECTOR_SINGLE);
+	memset(sparta_buffer, 0, SECTOR_HDD);
 	b=GetTotalSectors();
 	disk_bit_map=a=4;
 	disk_bit_map_cnt=0;
@@ -482,8 +482,8 @@
 	*(sparta_buffer+39)=0xfa;
 	*(sparta_buffer+40)=0;
 	b=media_image->SaveSector(sparta_buffer, 1);
-	if(b!=SECTOR_SINGLE)
-		return false;
+	/*if(b!=SECTOR_SINGLE)
+		return false;*/
 	b=4;
 	while(b<a)
 	{
@@ -553,7 +553,7 @@
 	map_sector=FindFreeSector();
 	if(SetSectorState(map_sector, SECTOR_FILL)==false)
 		return -3;
-	memset(sparta_buffer, 0, SECTOR_DOUBLE);
+	memset(sparta_buffer, 0, SECTOR_HDD);
 	media_image->SaveSector(sparta_buffer, map_sector);
 	saved_bytes=0;
 	while(size>saved_bytes)
@@ -715,11 +715,11 @@
 	dir_sector=FindFreeSector();
 	if(SetSectorState(dir_sector, SECTOR_FILL)==false)
 		return false;
-	memset(sparta_buffer, 0, SECTOR_DOUBLE);
+	memset(sparta_buffer, 0, SECTOR_HDD);
 	*(sparta_buffer+4)=(unsigned char)(dir_sector&0xff);
 	*(sparta_buffer+5)=(unsigned char)(dir_sector>>8);
 	media_image->SaveSector(sparta_buffer, map_sector);
-	memset(sparta_buffer, 0, SECTOR_DOUBLE);
+	memset(sparta_buffer, 0, SECTOR_HDD);
 	*(sparta_buffer)=0x28;
 	*(sparta_buffer+1)=(unsigned char)(dir_sector_map&0xff);
 	*(sparta_buffer+2)=(unsigned char)(dir_sector_map>>8);
@@ -894,22 +894,28 @@
 	int sector, new_sector=0, a, b, c, d, seek, add_sector;
 
 	sector=media_image->ReadSector(sparta_buffer, 1);
-	if(sector!=SECTOR_SINGLE)
-		return -1;
+	/*if(sector!=SECTOR_SINGLE)
+		return -1;*/
 	sector=*(sparta_buffer+18)+(*(sparta_buffer+19)<<8);
 	d=sector&0x07;
-	if(media_image->GetSectorSize()==SECTOR_SINGLE)
+	if(media_image->GetSectorSize()==SECTOR_HDD)
 	{
-		map_index=sector>>10;
-		seek=(sector>>3)&0x7f;
-		add_sector=map_index*(SECTOR_SINGLE)<<3;
+		map_index=sector>>12;
+		seek=(sector>>3)&0xff;
+		add_sector=map_index*(SECTOR_HDD)<<3;
 	}
-	else
+	else if(media_image->GetSectorSize()==SECTOR_DOUBLE)
 	{
 		map_index=sector>>11;
 		seek=(sector>>3)&0xff;
 		add_sector=map_index*(SECTOR_DOUBLE)<<3;
 	}
+	else
+	{
+		map_index=sector>>10;
+		seek=(sector>>3)&0x7f;
+		add_sector=map_index*(SECTOR_SINGLE)<<3;
+	}
 	b=media_image->ReadSector(sparta_buffer, disk_bit_map+map_index);
 	while(new_sector==0)
 	{
@@ -966,8 +972,8 @@
 		media_image->ReadSector(sparta_buffer, 1);
 		*(sparta_buffer+18)=(unsigned char)(new_sector&0xff);
 		*(sparta_buffer+19)=(unsigned char)(new_sector>>8);
-		if(media_image->SaveSector(sparta_buffer, 1)!=SECTOR_SINGLE)
-			return -2;
+		/*if(*/media_image->SaveSector(sparta_buffer, 1)/*!=SECTOR_SINGLE)
+			return -2*/;
 	}
 	return new_sector;
 }
@@ -978,22 +984,28 @@
 	int sector, new_sector=0, a, b, c, d, seek, add_sector;
 
 	sector=media_image->ReadSector(sparta_buffer, 1);
-	if(sector!=SECTOR_SINGLE)
-		return -1;
+	/*if(sector!=SECTOR_SINGLE)
+		return -1*/;
 	sector=*(sparta_buffer+20)+(*(sparta_buffer+21)<<8);
 	d=sector&0x07;
-	if(media_image->GetSectorSize()==SECTOR_SINGLE)
+	if(media_image->GetSectorSize()==SECTOR_HDD)
 	{
-		map_index=sector>>10;
-		seek=(sector>>3)&0x7f;
-		add_sector=map_index*(SECTOR_SINGLE)<<3;
+		map_index=sector>>12;
+		seek=(sector>>3)&0xff;
+		add_sector=map_index*(SECTOR_HDD)<<3;
 	}
-	else
+	else if(media_image->GetSectorSize()==SECTOR_DOUBLE)
 	{
 		map_index=sector>>11;
 		seek=(sector>>3)&0xff;
 		add_sector=map_index*(SECTOR_DOUBLE)<<3;
 	}
+	else
+	{
+		map_index=sector>>10;
+		seek=(sector>>3)&0x7f;
+		add_sector=map_index*(SECTOR_SINGLE)<<3;
+	}
 	b=media_image->ReadSector(sparta_buffer, disk_bit_map+map_index);
 	while(new_sector==0)
 	{
@@ -1027,8 +1039,8 @@
 		media_image->ReadSector(sparta_buffer, 1);
 		*(sparta_buffer+20)=(unsigned char)(new_sector&0xff);
 		*(sparta_buffer+21)=(unsigned char)(new_sector>>8);
-		if(media_image->SaveSector(sparta_buffer, 1)!=SECTOR_SINGLE)
-			return -2;
+		/*if(*/media_image->SaveSector(sparta_buffer, 1)/*!=SECTOR_SINGLE)
+			return -2*/;
 	}
 	return new_sector;
 }
@@ -1041,16 +1053,21 @@
 
 	if((sector<4) || (sector>media_image->GetTotalSectors()))
 		return false;
-	if(media_image->GetSectorSize()==SECTOR_SINGLE)
+	if(media_image->GetSectorSize()==SECTOR_HDD)
 	{
-		a=sector>>10;
-		sector=sector&0x3ff;
+		a=sector>>12;
+		sector=sector&0xfff;
 	}
-	else
+	else if(media_image->GetSectorSize()==SECTOR_DOUBLE)
 	{
 		a=sector>>11;
 		sector=sector&0x7ff;
 	}
+	else
+	{
+		a=sector>>10;
+		sector=sector&0x3ff;
+	}
 	bitmap=disk_bit_map+a;
 	a=media_image->ReadSector(sparta_buffer, bitmap);
 	if(a!=GetSectorSize())
@@ -1070,16 +1087,16 @@
 	if(media_image->SaveSector(sparta_buffer, bitmap)!=media_image->GetSectorSize())
 		return false;
 	a=media_image->ReadSector(sparta_buffer, 1);
-	if(a!=SECTOR_SINGLE)
-		return false;
+	/*if(a!=SECTOR_SINGLE)
+		return false;*/
 	mask=*(sparta_buffer+13)+(*(sparta_buffer+14)<<8);
 	mask+=diff;
 	if(mask>(*(sparta_buffer+11)+(*(sparta_buffer+12)<<8)))
 		return false;
 	*(sparta_buffer+13)=(unsigned char)(mask&0xff);
 	*(sparta_buffer+14)=(unsigned char)(mask>>8);
-	if(media_image->SaveSector(sparta_buffer, 1)!=SECTOR_SINGLE)
-		return false;
+	/*if(*/media_image->SaveSector(sparta_buffer, 1)/*!=SECTOR_SINGLE)
+		return false*/;
 	return true;
 }
 
@@ -1095,8 +1112,8 @@
 
 	if(label==NULL)
 		return false;
-	if(media_image->ReadSector(sparta_buffer, 1)!=SECTOR_SINGLE)
-		return false;
+	/*if(*/media_image->ReadSector(sparta_buffer, 1)/*!=SECTOR_SINGLE)
+		return false*/;
 	a=strlen(label);
 	if(a>8)
 		a=8;
@@ -1106,8 +1123,8 @@
 		while(a<8)
 			*(sparta_buffer+22+a++)=' ';
 	}
-	if(media_image->SaveSector(sparta_buffer, 1)!=SECTOR_SINGLE)
-		return false;
+	/*if(*/media_image->SaveSector(sparta_buffer, 1)/*!=SECTOR_SINGLE)
+		return false*/;
 	return true;
 }
 
@@ -1116,8 +1133,8 @@
 	int a;
 
 	a=media_image->ReadSector(sparta_buffer, 1);
-	if(a!=SECTOR_SINGLE)
-		return false;
+	/*if(a!=SECTOR_SINGLE)
+		return false;*/
 	strncpy(result, (char *)(sparta_buffer+22), 8);
 	a=0;
 	while((*(result+a)!=' ') && (a<8)) ++a;
@@ -1130,8 +1147,8 @@
 	int ret;
 
 	ret=media_image->ReadSector(sparta_buffer, 1);
-	if(ret!=SECTOR_SINGLE)
-		return -1;
+	/*if(ret!=SECTOR_SINGLE)
+		return -1;*/
 	ret=*(sparta_buffer+13)+(*(sparta_buffer+14)<<8);
 	return ret;
 }
@@ -1240,7 +1257,7 @@
 				if(AllocateSector(dir_sector_map, a)==false)
 					return false;
 				SetSectorState(a, SECTOR_FILL);
-				memset(sparta_buffer, 0, SECTOR_DOUBLE);
+				memset(sparta_buffer, 0, SECTOR_HDD);
 				memcpy(sparta_buffer, &dir_row[c], DIR_ENTRY_SIZE-c);
 				if(b!=media_image->SaveSector(sparta_buffer, a))
 					return false;
@@ -1307,7 +1324,7 @@
 		sparta_buffer[1]=(unsigned char)(next_sector>>8);
 		if(media_image->SaveSector(sparta_buffer, sector)!=media_image->GetSectorSize())
 			return false;
-		memset(sparta_buffer, 0, SECTOR_DOUBLE);
+		memset(sparta_buffer, 0, SECTOR_HDD);
 		sparta_buffer[2]=(unsigned char)(sector&0xff);
 		sparta_buffer[3]=(unsigned char)(sector>>8);
 		sector=next_sector;
@@ -1324,13 +1341,13 @@
 {
 	unsigned char a;
 
-	if(media_image->ReadSector(sparta_buffer, 1)!=SECTOR_SINGLE)
-		return false;
+	/*if(*/media_image->ReadSector(sparta_buffer, 1)/*!=SECTOR_SINGLE)
+		return false*/;
 	a=*(sparta_buffer+38);
 	++a;
 	*(sparta_buffer+38)=a;
-	if(media_image->SaveSector(sparta_buffer, 1)!=SECTOR_SINGLE)
-		return false;
+	/*if(*/media_image->SaveSector(sparta_buffer, 1)/*!=SECTOR_SINGLE)
+		return false*/;
 	return true;
 }
 
diff -Naur '--exclude=CVS' '--exclude=autom4te.cache' '--exclude=config.*' '--exclude=configure' '--exclude=Makefile' franny-trunk/types.h franny/types.h
--- franny-trunk/types.h	2010-09-27 20:13:04.000000000 +0200
+++ franny/types.h	2014-01-07 13:01:22.000000000 +0100
@@ -36,12 +36,14 @@
 const unsigned int MAX_SECTORS=0x10000;
 const unsigned short int SECTOR_SINGLE=0x80;
 const unsigned short int SECTOR_DOUBLE=0x100;
+const unsigned short int SECTOR_HDD=0x200;
 const unsigned char HEADER_SIZE=0x10;
 const unsigned char DENSITY_SINGLE=0;
 const unsigned char DENSITY_MEDIUM=1;
 const unsigned char DENSITY_CUSTOM_128=2;
 const unsigned char DENSITY_DOUBLE=10;
 const unsigned char DENSITY_CUSTOM_256=11;
+const unsigned char DENSITY_HDD=20;
 const unsigned char DENSITY_UNKNOWN=255;
 const char IMAGE_UNKNOWN=0;
 const char IMAGE_STANDARD=1;
