Thomson TO8

HxC Floppy emulator support for all others computers...
gilles
Posts: 35
Joined: Sat Jun 18, 2011 11:54 pm

Re: Thomson TO8

Post by gilles »

ok I was in the wrong file
extended_hfe_file_writer.c

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Thomson TO8

Post by Jeff »

gilles wrote:ok I was in the wrong file
extended_hfe_file_writer.c
Tell me if this correct the issue, will commit the modification.

gilles
Posts: 35
Joined: Sat Jun 18, 2011 11:54 pm

Re: Thomson TO8

Post by gilles »

yes it corrects the issue.

For my use I also added double sided sap support with the convention:
<filename>a.sap as lower side and <filename>b.sap as upper side
(if we can find a file with this name then we're in double sided mode).

It seems ok but unfortunatly the puls demo does not start, I'll check with the coder.

pulkomandy
Posts: 132
Joined: Sun Mar 20, 2011 6:55 pm

Re: Thomson TO8

Post by pulkomandy »

I didn't have problems on my TO8, I can start PULS demos fine. However disk 2 of Space Project didn't load (I'll recheck, maybe I did something wrong).

To convert the files, I used FD files, DD under linux to make them double-sided, then loaded them as HFE with the correct interleaving factor using the windos version of the HxC tools.
For regular disks (sap files out of my own projects, created with sapfs), I have no problems.

gilles
Posts: 35
Joined: Sat Jun 18, 2011 11:54 pm

Re: Thomson TO8

Post by gilles »

for disk 2 maybe the problem is that space project loader detects a disk in the drive B?
I'll try again with recompiled version of linux tools. I'll add an option to force interleave factor (for now and for sap files, it's 1 built in the plugin).
Also, maybe I'll try to get hfe files from my PC using the sap2 tool (I'll plug the HxC in my PC...).

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Thomson TO8

Post by Jeff »

gilles wrote:for disk 2 maybe the problem is that space project loader detects a disk in the drive B?
I'll try again with recompiled version of linux tools. I'll add an option to force interleave factor (for now and for sap files, it's 1 built in the plugin).
Also, maybe I'll try to get hfe files from my PC using the sap2 tool (I'll plug the HxC in my PC...).
post your 2 sap files and your hfe files. I will check if all is ok.

gilles
Posts: 35
Joined: Sat Jun 18, 2011 11:54 pm

Re: Thomson TO8

Post by gilles »

sap files:

http://www.alternative-system.com/speci ... s/sp1a.sap
http://www.alternative-system.com/speci ... s/sp1b.sap

hfe:
http://www.alternative-system.com/speci ... 1a_sap.hfe

same result with .fd files

Also I created a blank floppy, I could create and use unit 0 (lower side) but format on the host failed at track 79 of unit 1 (upper side).

My firmware is 1.6.0.0

gilles
Posts: 35
Joined: Sat Jun 18, 2011 11:54 pm

Re: Thomson TO8

Post by gilles »

I tried to plug the hxc in a PC (celeron 400 running win98).
the original sap tool cannot write to empty .hfe created with the hxc floppy tool. (error message: no disc)

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Thomson TO8

Post by Jeff »

gilles wrote:sap files:

http://www.alternative-system.com/speci ... s/sp1a.sap
http://www.alternative-system.com/speci ... s/sp1b.sap

hfe:
http://www.alternative-system.com/speci ... 1a_sap.hfe

same result with .fd files

Also I created a blank floppy, I could create and use unit 0 (lower side) but format on the host failed at track 79 of unit 1 (upper side).

My firmware is 1.6.0.0
The interleave seems to be set to 1.
According to your previous posts you need to change it!

gilles
Posts: 35
Joined: Sat Jun 18, 2011 11:54 pm

Re: Thomson TO8

Post by gilles »

still no luck with the demos (interleave 1 or 7).
I have no problem with unprotected single sided games, even with interleave factor of 1.
I'll try on a TO8D as replacement of internal drive to see if it changes something.

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Thomson TO8

Post by Jeff »

gilles wrote:still no luck with the demos (interleave 1 or 7).
I have no problem with unprotected single sided games, even with interleave factor of 1.
I'll try on a TO8D as replacement of internal drive to see if it changes something.
And what is the protection used ?

gilles
Posts: 35
Joined: Sat Jun 18, 2011 11:54 pm

Re: Thomson TO8

Post by gilles »

some read are supposed to return error codes.
TEO emulates return code at an high level (list of value to read in controler registers) but the real content/conding is not known.
Thomson discs copied with Xcopy on amiga are supposed to preserve protections but I do not know an imaging format equivalent to Xcopy (maybe IPF should fit?)

pulkomandy
Posts: 132
Joined: Sun Mar 20, 2011 6:55 pm

Re: Thomson TO8

Post by pulkomandy »

Use the floppy disk dump in the HxC software if you can on some working disks (I can't...)

I believe the B-side of disks as the head marker in sectors set to side 0 (instead of 1 on normal computers). Is it possible to do that with the HxC and the converter tools ? I think we also still miss conversion for 2-sided SAP files, would be much less annoying than messing with the FD format...


This week I tried running some demos on my TO8, but I didn't succeed. I'm sure it worked before. I could run HCL Megademo, but none of the PULS demos did work. On the other hand... I never got these to run with a real disk drive either on my TO8...

gilles
Posts: 35
Joined: Sat Jun 18, 2011 11:54 pm

Re: Thomson TO8

Post by gilles »

HCL megademo can run on single sided floppy (maybe there are additionnal images on the other side but I'm unsure, I have 2 sap files for HCL megademo but on most sites only the 1st side is available).

So for now second side of TO8 discs do not work as expected or do not work at all, It's not blocking since most software are single sided but it's a bit annoying since all thomson demos after HCL are double sided (ok, it makes just 3 demos...)

my quick and dirty hack for sap double sided:

I'm not certain of parameters in tg_generatetrack() call

Code: Select all

int SAP_libLoad_DiskFile(HXCFLOPPYEMULATOR* floppycontext,FLOPPY * floppydisk,char * imgfile,void * parameters)
{
	unsigned int i,j;
	unsigned char* trackdata;
	unsigned char gap3len,interleave;
	unsigned char skew;
	unsigned short rpm;
	unsigned short sectorsize;

	unsigned char trackformat;
	int floppyformat;
	sapID sapid;
	sapID sapid2=-1;

	CYLINDER* currentcylinder;
	
	floppycontext->hxc_printf(MSG_DEBUG,"SAP_libLoad_DiskFile %s",imgfile);

	sapid=sap_OpenArchive(imgfile, &floppyformat);
	if(sapid==SAP_ERROR)
	{
		floppycontext->hxc_printf(MSG_ERROR,"Cannot open %s !",imgfile);
		return -1;
	}

	/* special case of double sided 2 files SAP */
	/* name totoa.sap and totob.sap */
	if ((strlen(imgfile)>5) && (imgfile[strlen(imgfile)-5]=='a')) {
		char *imgfile2=malloc(strlen(imgfile)+1);
		strcpy(imgfile2,imgfile);
		imgfile2[strlen(imgfile)-5]='b';
		sapid2=sap_OpenArchive(imgfile2, &floppyformat);
		floppycontext->hxc_printf(MSG_DEBUG,"SAP_libLoad_DiskFile %s as second side",imgfile2);
		free(imgfile2);
	}

	gap3len=50;
	interleave=7;
	skew=0;

	switch(floppyformat)
	{

	case SAP_FORMAT1:
		sectorsize=SAP_SECTSIZE1;
		floppydisk->floppyNumberOfTrack=SAP_NTRACKS1;
		floppydisk->floppySectorPerTrack=SAP_NSECTS;
		floppydisk->floppyNumberOfSide=1;
		trackformat=ISOFORMAT_DD;
		break;

	case SAP_FORMAT2:
		sectorsize=SAP_SECTSIZE2;
		floppydisk->floppyNumberOfTrack=SAP_NTRACKS2;
		floppydisk->floppySectorPerTrack=SAP_NSECTS;
		floppydisk->floppyNumberOfSide=1;
		trackformat=ISOFORMAT_SD;
		break;
	default:
		floppycontext->hxc_printf(MSG_ERROR,"Unknow floppy format: %d !",floppyformat);
		sap_CloseArchive(sapid);
		return -1;
		break;

	}
	
	/* if we found a second disk */
	if (sapid2!=-1) {
		floppydisk->floppyNumberOfSide=2;
	}		

	floppydisk->floppyBitRate=250000;
	floppydisk->floppyiftype=GENERIC_SHUGART_DD_FLOPPYMODE;
	floppydisk->tracks=(CYLINDER**)malloc(sizeof(CYLINDER*)*floppydisk->floppyNumberOfTrack);
	rpm=300; // normal rpm
	
			
	floppycontext->hxc_printf(MSG_INFO_1,"%d tracks, %d side(s), %d sectors/track,%d bytes/sector gap3:%d, interleave:%d,rpm:%d",floppydisk->floppyNumberOfTrack,floppydisk->floppyNumberOfSide,floppydisk->floppySectorPerTrack,sectorsize,gap3len,interleave,rpm);
			
	trackdata=(unsigned char*)malloc(sectorsize*floppydisk->floppySectorPerTrack);
			
	for(j=0;j<floppydisk->floppyNumberOfTrack;j++)
	{
				
		floppydisk->tracks[j]=allocCylinderEntry(rpm,floppydisk->floppyNumberOfSide);
		currentcylinder=floppydisk->tracks[j];
				
		for(i=0;i<floppydisk->floppyNumberOfSide;i++)
		{
			if (i==0)
				sap_ReadSectorEx(sapid,j,1,SAP_NSECTS, trackdata);
			else
				sap_ReadSectorEx(sapid2,j,1,SAP_NSECTS, trackdata);
		
			currentcylinder->sides[i]=tg_generatetrack(trackdata,sectorsize,floppydisk->floppySectorPerTrack,(unsigned char)j,(unsigned char)i,1,interleave,(unsigned char)(((j<<1)|(i&1))*skew),floppydisk->floppyBitRate,currentcylinder->floppyRPM,trackformat,gap3len,2500,-2500);
		}
	}

	free(trackdata);
		
	sap_CloseArchive(sapid);

	if (sapid2!=-1)
		sap_CloseArchive(sapid2);

	floppycontext->hxc_printf(MSG_INFO_1,"track file successfully loaded and encoded!");
		
	return LOADER_NOERROR;
	
}

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Thomson TO8

Post by Jeff »

Bon j'ai amélioré la prise en charge des fichiers sap:

https://hxc2001.com/floppy_drive_emulat ... t_beta.zip

Dans l'ancienne version le side était a 1 sur la face 1. C'est peut être le pb.

Les secteurs sont maintenant traité un a un pour gérer plus tard les éventuelles protection (il ne s'agit pas de cela dans le cas présent car les sap que vous m'avez envoyés sont sans protection (voir logs).

Les sources à jour sont sur le trunk.

Post Reply