mirror of
https://github.com/mlaux/gb6.git
synced 2026-03-13 01:42:21 +00:00
27 lines
678 B
C
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);
|
|
}
|