]> localhost Git - WindEmu.git/commitdiff
emubase: add a Uart data sink
authorGeorge Wright <gw@gwright.org.uk>
Thu, 25 Jun 2026 03:03:18 +0000 (20:03 -0700)
committerGeorge Wright <gw@gwright.org.uk>
Fri, 26 Jun 2026 03:44:07 +0000 (20:44 -0700)
WindCore/emubase.h

index ceb001817c975139a7a93bb5368fe24cebf7c8b8..f57f43c0f2ee5f508b8bee54077181d3039d1d42 100644 (file)
@@ -128,8 +128,16 @@ public:
   virtual void setKeyboardKey(EpocKey key, bool value) = 0;
   virtual void updateTouchInput(int32_t x, int32_t y, bool down) = 0;
 
+  void setSerialOutput(std::function<void(const char*)> serialOutput) {
+    mSerialOutput = serialOutput;
+  }
+  std::function<void(const char*)>& getSerialOutput() { return mSerialOutput; }
+
 #ifndef __EMSCRIPTEN__
   std::unordered_set<uint32_t>& breakpoints() { return _breakpoints; }
 #endif
   uint64_t currentCycles() const { return passedCycles; }
+
+private:
+  std::function<void(const char*)> mSerialOutput = [&](const char*) {};
 };