From a7babd4ec2a525b675855fcd74aee4c5c7eb261c Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Mon, 18 Aug 2025 06:33:50 -0300 Subject: [PATCH] Adding LinkWireless::isWirelessMultibootRom() --- lib/LinkWireless.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/LinkWireless.hpp b/lib/LinkWireless.hpp index 2ba3771..8bd94c6 100644 --- a/lib/LinkWireless.hpp +++ b/lib/LinkWireless.hpp @@ -959,6 +959,21 @@ class LinkWireless { */ Config config; + /** + * Returns whether the current multiboot ROM has started wirelessly or not. + */ + static bool isWirelessMultibootRom() { + const vu8* ewram = (const vu8*)0x02000000; + static const u8 header[12] = {0x52, 0x46, 0x55, 0x2D, 0x4D, 0x42, + 0x4F, 0x4F, 0x54, 0x00, 0x00, 0x00}; + + for (unsigned i = 0; i < 12; ++i) + if (ewram[4 + i] != header[i]) + return false; + + return true; + } + #ifndef LINK_WIRELESS_DEBUG_MODE private: #endif