[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wudsn now supports Apple //



> I don't understand how the .xex is different, but it's perfect!  

I think if've already posted it earlier but since I cannot find it myself.. again some explanation:
The routine which puts the compiler output file onto the disk needs to know which executable format the file has. This is determined based on the file extension. 3 different formats are currently supported.

		if (fileName.endsWith(".b") && length > 4) {
		    // // AppleDos 3.3 binary file:
		    // start-lo,start-hi,length-lo,length-hi,data
		    address = getWord(outputFileContent, 0);
		    length = length - 4;
		    content = getData(outputFileContent, 4);
		} else if (fileName.endsWith(".prg") && length > 2) {
		    // C64 program file
		    // start-lo,start-hi,data
		    address = getWord(outputFileContent, 0);
		    length = length - 2;
		    content = getData(outputFileContent, 2);
		} else if (fileName.endsWith(".xex") && length > 6
			&& ((getWord(outputFileContent, 0) & 0xffff) == 0xffff)) {
		    // AtariDOS 2.5 binary file:
		    // $ff,$ff,start-lo,start-hi,end-lo,end-hi,data
		    address = getWord(outputFileContent, 2);
		    length = length - 6;
		    content = getData(outputFileContent, 6);