

/*		Fpl test   */

const onlydec=1;
const onlyhex=2;

void anykey();

{
	long fsize,pos;
	long com,start,stop,cdelta,temp;
	int cc;
	
	if(openconsole(320,100,320,30,"Command Scaler"))
		{
		conwrite("Written by [1mAndreas Öman[0m\n");

		if(blocky1()!=blocky2())
			{
			conwrite("Command Channel (0/1): ");
			cc=gethex(1);
			conwrite("Command: $");
			com=gethex(2);
			conwrite("Start: $");
			start=gethex(2);
			conwrite("Stop: $");
			stop=gethex(2);



			fsize=blocky2()-blocky1();
			cdelta=((stop-start)<<16)/fsize;
			start=start<<16;
			for(pos=blocky1();pos!=blocky2();pos++) {
				setcom(blocktrack(),pos,cc,(com<<8)+(start>>16));
				start=start+cdelta;
			}
			setcom(blocktrack(),pos,cc,(com<<8)+stop);
			refresh();
		}else{
			conwrite("No Block marked\n");
			anykey();
			}

		closeconsole();
		}
	exit;
	}

/***************************************************************
 *
 *	Waits for the anykey
 *
 */


void anykey()
{
	conwrite("Press [1mAnyKey[0m");
	getkey();
	conwrite("\n");
	}
