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

Mintlibs to be MagiC!3 compatible?



Apparently MagiC!3 contains a lot of Mint compatible functions, so would
there be mileage in converting the Mintlibs for use with MagiC!3 as well?

The libs won't currently work as they check the MiNT version number before
attempting a Mint call. I doubt MagiC will install a MiNT cookie :-)

I *guess* the best approach would be to rewrite routines to attempt the
"best" function call, and if this returns EINVFN, try the next best call,
and if this fails, try the TOS call.

eg
void foo(int)
{
	static int calltype = -1;

	if (calltype == -1) {
		if (Dxreaddir(blah) != EINVFN)
			calltype = 2; /* Best Mint call available */
		else if (Dreaddir(blah) != EINVFN)
			calltype = 1; /* Old Mint call available */
		else
			calltype = 0; /* Emulate using TOS */
	}
	switch (calltype) {
	case 0: /* emulate under TOS */
		...
		break;
	case 1: /* use old Mint calls */
		...
		break;
	case 2: /* Use better Mint calls */
		...
		break;
	}
}

Opinions?

Chris