mirror of
https://github.com/mlaux/gb6.git
synced 2026-03-14 10:16:21 +00:00
29 lines
700 B
C
29 lines
700 B
C
#include <Patches.h>
|
|
|
|
#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);
|
|
}
|