I got a report from someone trying to run GLTron on a 8.1 system. Turns out
that some Low Memory (LM*) functions are not defined in InterfaceLib on
these older system versions. This function should be added to the CD-ROM
code:
cdrom:macos:SDL_syscdrom.c:
#if defined(powerc) || defined (__powerc)
pascal short LMGetUnitTableEntryCount()
{
return *(short *)0x01D2;
} #endif
It will generate a link warning for the newer version of InterfaceLib, but
that is OK. I suppose we could rename the function so that the warning does
not occur, which is probably a wise thing to do.
I got a report from someone trying to run GLTron on a 8.1 system. Turns out
that some Low Memory (LM*) functions are not defined in InterfaceLib on
these older system versions. This function should be added to the CD-ROM
code:
cdrom:macos:SDL_syscdrom.c:
#if defined(powerc) || defined (__powerc)
pascal short LMGetUnitTableEntryCount()
{
return *(short *)0x01D2;
} #endif
It will generate a link warning for the newer version of InterfaceLib, but
that is OK. I suppose we could rename the function so that the warning does
not occur, which is probably a wise thing to do.
It should probably be protected with some other guard, as this may not
work on some newer systems. Is there a way to dynamically detect the
LM* functions at runtime?
See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software
It should probably be protected with some other guard, as this may not
work on some newer systems. Is there a way to dynamically detect the
LM* functions at runtime?
Well, we have to use the CFM to search for the symbols, and set some
function pointers up.
Matt Slot has a function in FastTimes.c that can do this:
When I need this LowMem on a PowerPC, I don’t bother grabbing the symbol
from InterfaceLib – I just access the lowmem directly from a macro. This
avoids the (albeit benign) link error and doesn’t cause any problems on
older InterfaceLib runtimes.
There are a couple other rare symbols for which this is true as well.—
Also, accessing this LM directly would fail on Carbon, hence we
should in any case check via CFM if the call is available.
This call, and the rest of the Device Manager, are not available under
OSX or the Carbon APIs. These are 2 different issues.
Under OSX, CD-ROM and other devices are accessed using IOKit. That API
is not part of Carbon since it isn’t available on OS9 or earlier.
When running from Carbon, you need to manually load the device APIs for
the current system (IOKit on OSX or Device Manager on OS7-9). Note that
the LowMems will work on OS7-9, even if the macros aren’t defined by the
the compiler.
When I need this LowMem on a PowerPC, I don’t bother grabbing the symbol
from InterfaceLib – I just access the lowmem directly from a macro. This
avoids the (albeit benign) link error and doesn’t cause any problems on
older InterfaceLib runtimes.