Files
gb6/system6/cpu_cache.c
2026-01-22 23:16:30 -06:00

27 lines
678 B
C

#include "cpu_cache.h"
// from Inside Macintosh: OS Utilities
// "Determining If a System Software Routine is Available"
Boolean TrapAvailable(short trapWord)
{
TrapType trType;
/* determine whether it is an Operating System or Toolbox routine */
if ((trapWord & 0x0800) == 0) {
trType = OSTrap;
} else {
trType = ToolTrap;
}
/* filter cases where older systems mask with $1FF rather than $3FF */
if (
trType == ToolTrap
&& (trapWord & 0x03ff) >= 0x200
&& GetToolboxTrapAddress(0xa86e) == GetToolboxTrapAddress(0xaa6e)
) {
return false;
}
return NGetTrapAddress(trapWord, trType) != GetToolboxTrapAddress(_Unimplemented);
}