From 51508dcdc6c8ff94be87bf09ed56b4fb8de05157 Mon Sep 17 00:00:00 2001 From: Edward Li Date: Sun, 5 Nov 2023 05:13:31 +0800 Subject: [PATCH] macOS: Indicate slave machines by dock badge label --- .../emulator-osx/emulator-osx/osx-main.mm | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/shell/apple/emulator-osx/emulator-osx/osx-main.mm b/shell/apple/emulator-osx/emulator-osx/osx-main.mm index d78439992..4ea0bae2e 100644 --- a/shell/apple/emulator-osx/emulator-osx/osx-main.mm +++ b/shell/apple/emulator-osx/emulator-osx/osx-main.mm @@ -13,6 +13,7 @@ #include #include "types.h" +#include "cfg/option.h" #include "log/LogManager.h" #if defined(USE_SDL) #include "sdl/sdl.h" @@ -144,6 +145,27 @@ static void emu_flycast_term() CFRelease(mainBundle); emu_flycast_init(); + + int boardId = cfgLoadInt("naomi", "BoardId", 0); + if (boardId > 0) + { + NSString *label = @"S"; // Slave + if (config::MultiboardSlaves == 2) // 1 = Single, 2 = Deluxe + { + switch (boardId) { + case 1: + label = @"C"; // Center + break; + case 2: + label = @"L"; // Left + break; + case 3: + label = @"R"; // Right + } + } + [[NSApp dockTile] setBadgeLabel:label]; + } + #ifdef USE_BREAKPAD auto async = std::async(std::launch::async, uploadCrashes, "/tmp"); #endif