diff --git a/docs/ROMinfo b/docs/ROMinfo
index 9d506b5d..b209bc17 100644
--- a/docs/ROMinfo
+++ b/docs/ROMinfo
@@ -103,7 +103,7 @@ Minor work that needs to be done
OpenCPicture just calls OpenPicture.
- RestoreClutDevice needs work
+ RestoreDeviceClut needs work
inverse color table routines don't do a good job of discriminating
between colors that are close to each other.
diff --git a/docs/faq.xml b/docs/faq.xml
index 31497de9..835f8252 100644
--- a/docs/faq.xml
+++ b/docs/faq.xml
@@ -2087,7 +2087,7 @@ GetStdFilterProc, SetDialogCancelItem, SetDialogTracksCursor, OutlineMetrics, Fl
GDeviceChanged, PortChanged, PixPatChanged and CTabChanged are poorly
implemented. GetCPixel doesn't work for bpp > 8. OpenCPicture just
-calls OpenPicture. RestoreClutDevice's implementation is shaky. Our
+calls OpenPicture. RestoreDeviceClut's implementation is shaky. Our
inverse color table routines don't do a good job of discriminating
between colors that are close to each other.
diff --git a/docs/faq/t1.html b/docs/faq/t1.html
index 921a856b..6bcc1621 100644
--- a/docs/faq/t1.html
+++ b/docs/faq/t1.html
@@ -4305,7 +4305,7 @@
>
GDeviceChanged, PortChanged, PixPatChanged and CTabChanged are poorly
implemented. GetCPixel doesn't work for bpp > 8. OpenCPicture just
-calls OpenPicture. RestoreClutDevice's implementation is shaky. Our
+calls OpenPicture. RestoreDeviceClut's implementation is shaky. Our
inverse color table routines don't do a good job of discriminating
between colors that are close to each other.
8. OpenCPicture just
-calls OpenPicture. RestoreClutDevice's implementation is shakey.
+calls OpenPicture. RestoreDeviceClut's implementation is shakey.
diff --git a/src/AE.cpp b/src/AE.cpp
index 6ab0d60d..b9bf9cdb 100644
--- a/src/AE.cpp
+++ b/src/AE.cpp
@@ -18,6 +18,7 @@
#include "rsys/mman.h"
#include "rsys/flags.h"
+#include "rsys/functions.impl.h"
namespace Executor
{
@@ -555,7 +556,7 @@ OSErr Executor::C_AEDisposeToken(AEDesc *theToken)
return noErr;
}
-OSErr Executor::C_AEREesolve(AEDesc *objectSpecifier, INTEGER callbackFlags,
+OSErr Executor::C_AEResolve(AEDesc *objectSpecifier, INTEGER callbackFlags,
AEDesc *theToken)
{
warning_unimplemented(NULL_STRING);
diff --git a/src/AE_desc.cpp b/src/AE_desc.cpp
index b0adfe90..cdaa020c 100644
--- a/src/AE_desc.cpp
+++ b/src/AE_desc.cpp
@@ -9,6 +9,7 @@
#include "rsys/mman.h"
#include "rsys/apple_events.h"
+#include
using namespace Executor;
@@ -564,7 +565,7 @@ ae_desc_to_ptr(descriptor_t *desc,
desc_data = DESC_DATA(desc);
desc_size = GetHandleSize(desc_data);
- copy_size = MIN(desc_size, max_size);
+ copy_size = std::min(desc_size, max_size);
memcpy(data, STARH(desc_data), copy_size);
@@ -1092,7 +1093,7 @@ OSErr Executor::C_AEGetAttributePtr(AppleEvent *evt, AEKeyword keyword,
data, max_size, size_out);
AE_RETURN_ERROR(AEDisposeDesc(coerced_desc));
}
-
+/* This does not exist.
OSErr Executor::C_AEDeleteAttribute(AppleEvent *evt, AEKeyword keyword)
{
if(!APPLE_EVENT_CLASS_P(evt))
@@ -1103,7 +1104,7 @@ OSErr Executor::C_AEDeleteAttribute(AppleEvent *evt, AEKeyword keyword)
else
AE_RETURN_ERROR(noErr);
}
-
+*/
OSErr Executor::C_AESizeOfAttribute(AppleEvent *evt, AEKeyword keyword,
GUEST *type_out,
GUEST *size_out)
diff --git a/src/AE_hdlr.cpp b/src/AE_hdlr.cpp
index be89d5bc..8e95169d 100644
--- a/src/AE_hdlr.cpp
+++ b/src/AE_hdlr.cpp
@@ -13,19 +13,12 @@
using namespace Executor;
-#define hdlr_table(system_p, class) \
- ({ \
- AE_info_t *info; \
- AE_zone_tables_h zone_tables; \
- \
- info = MR(LM(AE_info)); \
- \
- zone_tables = ((system_p) \
- ? MR(info->system_zone_tables) \
- : MR(info->appl_zone_tables)); \
- \
- HxP(zone_tables, class##_hdlr_table); \
- })
+inline AE_zone_tables_h get_zone_tables(bool system_p)
+{
+ auto info = MR(LM(AE_info));
+ return system_p ? MR(info->system_zone_tables) : MR(info->appl_zone_tables);
+}
+#define hdlr_table(system_p, class) HxP(get_zone_tables(system_p), class##_hdlr_table)
void Executor::AE_init(void)
{
@@ -141,7 +134,7 @@ hdlr_table_elt(AE_hdlr_table_h table,
}
OSErr Executor::C__AE_hdlr_table_alloc(int32_t unknown_1, int32_t unknown_2,
- int32_t unknown_3, int8 unknown_p,
+ int32_t unknown_3, int8_t unknown_p,
GUEST *table_return)
{
AE_hdlr_table_h table;
@@ -431,6 +424,7 @@ OSErr Executor::C_AEInstallSpecialHandler(
if(function_class == keySelectProc)
{
AE_OSL_select_fn = US_TO_SYN68K((void *)hdlr_fn);
+ warning_unimplemented("AEInstallSpecialHandler: keySelectProc set");
AE_RETURN_ERROR(noErr);
}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5fb7c36b..b03dc7ee 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -50,7 +50,6 @@ add_subdirectory(config/arch/generic_le)
add_subdirectory(config/os/win32)
add_subdirectory(config/os/macosx)
-
function(linkheader from to variant)
if(DEFINED ARGV3)
set(input ${ARGV3})
@@ -168,25 +167,30 @@ source_group(AppleEvents FILES ${ae_sources})
set(sound_sources sounddriver.cpp sound.cpp soundIMVI.cpp soundfake.cpp snth5.cpp
SpeechManager.cpp)
+if(HOST_OS STREQUAL macosx)
+set(sound_sources ${sound_sources} SpeechManager-MacBridge.mm)
+endif()
source_group(Sound FILES ${sound_sources})
set(num_sources bindec.cpp float4.cpp float5.cpp float7.cpp floatnext.cpp toolmath.cpp
mathlib.cpp)
source_group(Numerics FILES ${num_sources})
-set(misc_sources desk.cpp device.cpp disk.cpp diskinit.cpp dump.cpp trapname.cpp font.cpp
+set(misc_sources
+ traps.cpp logging.cpp
+ desk.cpp device.cpp disk.cpp diskinit.cpp dump.cpp trapname.cpp font.cpp
gestalt.cpp globals.cpp iu.cpp launch.cpp main.cpp mman.cpp mmansubr.cpp notify.cpp hle.cpp
osevent.cpp osutil.cpp pack.cpp scrap.cpp script.cpp segment.cpp serial.cpp
slash.cpp stdfile.cpp romlib_stubs.cpp syserr.cpp toolevent.cpp toolutil.cpp time.cpp
vbl.cpp syncint.cpp virtualint.cpp refresh.cpp autorefresh.cpp aboutbox.cpp
- option.cpp parseopt.cpp parsenum.cpp desperate.cpp
+ option.cpp parseopt.cpp parsenum.cpp
version.cpp shutdown.cpp uniquefile.cpp screen-dump.cpp
process.cpp alias.cpp string.cpp tempmem.cpp edition.cpp fontIMVI.cpp balloon.cpp
error.cpp adb.cpp color_wheel_bits.cpp finder.cpp system_error.cpp ibm_keycodes.cpp
icon.cpp redrawscreen.cpp ini.cpp checkpoint.cpp qt.cpp
paramline.c fauxdbm.cpp commtool.cpp cfm.cpp pef_hash.cpp
interfacelib.cpp mixed_mode.cpp suffix_maps.cpp appearance.cpp lockrange.cpp
- emutrap.cpp emutraptables.cpp emustubs.cpp unix_like.cpp parse.ypp check_structs.cpp
+ emutrap.cpp emustubs.cpp unix_like.cpp parse.ypp check_structs.cpp
executor.cpp crc.cpp)
set(include_sources hintemplate.h
@@ -252,7 +256,6 @@ set(include_sources hintemplate.h
include/rsys/dcache.h
include/rsys/depthconv.h
include/rsys/desk.h
- include/rsys/desperate.h
include/rsys/device.h
include/rsys/dial.h
include/rsys/dirtyrect.h
@@ -271,6 +274,8 @@ set(include_sources hintemplate.h
include/rsys/float_fcw.h
include/rsys/floatconv.h
include/rsys/font.h
+ include/rsys/functions.h
+ include/rsys/functions.impl.h
include/rsys/gestalt.h
include/rsys/glue.h
include/rsys/gworld.h
@@ -289,6 +294,7 @@ set(include_sources hintemplate.h
include/rsys/launch.h
include/rsys/list.h
include/rsys/lockunlock.h
+ include/rsys/logging.h
include/rsys/lowglobals.h
include/rsys/m68kint.h
include/rsys/macros.h
@@ -319,7 +325,6 @@ set(include_sources hintemplate.h
include/rsys/print.h
include/rsys/process.h
include/rsys/PSstrings.h
- include/rsys/pstuff.h
include/rsys/qcolor.h
include/rsys/quick.h
include/rsys/rawblt.h
@@ -354,7 +359,8 @@ set(include_sources hintemplate.h
include/rsys/toolutil.h
include/rsys/trapglue.h
include/rsys/trapname.h
- include/rsys/types.h
+ include/rsys/traps.h
+ include/rsys/traps.impl.h
include/rsys/uniquefile.h
include/rsys/vbl.h
include/rsys/vdriver.h
@@ -370,6 +376,7 @@ set(include_sources hintemplate.h
include/ShutDown.h
include/SoundDvr.h
include/SoundMgr.h
+ include/SpeechManager.h
include/StartMgr.h
include/StdFilePkg.h
include/SysErr.h
@@ -383,12 +390,15 @@ set(include_sources hintemplate.h
mkvol/mkvol.h
mkvol/mkvol_internal.h)
+include(trap_instances/trap_instances.cmake)
+
set(sources ${ctl_sources} ${dial_sources}
${list_sources} ${menu_sources}
${print_sources} ${qd_sources} ${res_sources}
${te_sources} ${wind_sources} ${ae_sources}
${sound_sources} ${num_sources} ${misc_sources}
${file_sources} ${hfs_sources}
+ ${trap_instance_sources}
${include_sources})
add_executable(executor ${sources}
@@ -404,3 +414,4 @@ else()
endif()
target_link_libraries(executor Threads::Threads syn68k)
+
diff --git a/src/PSprint.cpp b/src/PSprint.cpp
index df7f2c9a..2f53c21e 100644
--- a/src/PSprint.cpp
+++ b/src/PSprint.cpp
@@ -1359,7 +1359,7 @@ num_image_bytes(int numbytes, int pixelsize, int direct_color_p)
#define ROWMASK 0x1FFF
#endif
-void Executor::NeXTPrBits(BitMap *srcbmp, Rect *srcrp, Rect *dstrp,
+void Executor::NeXTPrBits(const BitMap *srcbmp, const Rect *srcrp, const Rect *dstrp,
LONGINT mode, RgnHandle mask, GrafPtr thePortp)
{
float scalex, scaley;
diff --git a/src/SpeechManager-MacBridge.mm b/src/SpeechManager-MacBridge.mm
index ada173d3..9f61915e 100644
--- a/src/SpeechManager-MacBridge.mm
+++ b/src/SpeechManager-MacBridge.mm
@@ -8,10 +8,22 @@
#include
#import
+#define BOOL BOOL_EXEC
+#undef YES
+#undef NO
+#define YES YES_EXEC
+#define NO NO_EXEC
+#undef SIGDIGLEN
#include "rsys/common.h"
#include "rsys/hfs.h"
#include "MemoryMgr.h"
+#include "rsys/byteswap.h"
#include "SpeechManager-MacBridge.h"
+#undef BOOL
+#undef YES
+#undef NO
+#define YES 1
+#define NO 0
#include
#include