diff --git a/Samples/Raytracer/CMakeLists.txt b/Samples/Raytracer/CMakeLists.txt index 622112df9b..58966e2853 100644 --- a/Samples/Raytracer/CMakeLists.txt +++ b/Samples/Raytracer/CMakeLists.txt @@ -37,7 +37,7 @@ if(APPLE) target_link_libraries(Raytracer2 "-framework Carbon") else() set(CMAKE_CXX_FLAGS "-std=c++11") - +if(FALSE) # save 200KB of code by removing unused stuff set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections") @@ -55,4 +55,14 @@ else() add_application(FixedBenchmark CONSOLE FILES fixedbenchmark.cc fixed.h fixed.cc) endif() + set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections -nostdlib") + add_definitions(-DRETRO_CARBON) + add_application(RaytracerCarbon + raytracer2.cc + fixed.h + fixed.cc + carb.r + ) + target_link_libraries(RaytracerCarbon "-lstdc++" "-lc" retrocrt "-lc" "-lgcc" retrocrt "-lc" CarbonLib) +endif() diff --git a/Samples/Raytracer/carb.r b/Samples/Raytracer/carb.r new file mode 100644 index 0000000000..1e77065673 --- /dev/null +++ b/Samples/Raytracer/carb.r @@ -0,0 +1,3 @@ +data 'carb' (0) { + $"00" +}; diff --git a/Samples/Raytracer/raytracer2.cc b/Samples/Raytracer/raytracer2.cc index 28338f4af4..4efaff7b4f 100644 --- a/Samples/Raytracer/raytracer2.cc +++ b/Samples/Raytracer/raytracer2.cc @@ -22,17 +22,20 @@ #include #else +#ifdef RETRO_CARBON +//#define __FP__ +#include +#include +#else #include #include #include #include #include #include - -#ifdef __GNUC__ -QDGlobals qd; #endif + #endif #include "fixed.h" @@ -286,7 +289,11 @@ int main() } Rect r2; SetRect(&r2,0,y,r.right,y+1); +#if TARGET_API_MAC_CARBON + CopyBits(&line, GetPortBitMapForCopyBits(GetWindowPort(win)), &line.bounds, &r2, srcCopy, NULL); +#else CopyBits(&line, &win->portBits, &line.bounds, &r2, srcCopy, NULL); +#endif if(Button()) return 0; #if TARGET_API_MAC_CARBON diff --git a/libretro/RetroPPCAPPL.r b/libretro/RetroPPCAPPL.r index 206409c7a2..e0d4877467 100644 --- a/libretro/RetroPPCAPPL.r +++ b/libretro/RetroPPCAPPL.r @@ -24,9 +24,10 @@ resource 'SIZE' (-1) { dontGetFrontClicks, ignoreChildDiedEvents, is32BitCompatible, - reserved, - reserved, - reserved, + + isHighLevelEventAware, + onlyLocalHLEvents, + notStationeryAware, reserved, reserved, reserved,