From 7733378bdc59f0974d12958952f33b6075f35ba1 Mon Sep 17 00:00:00 2001 From: M4x1m3 Date: Sat, 6 Feb 2021 17:00:14 +0100 Subject: [PATCH] [ion/3ds] Make simulator work again --- ion/src/simulator/3ds/Makefile | 4 ++++ ion/src/simulator/3ds/clipboard.cpp | 18 ++++++++++++++++++ ion/src/simulator/3ds/driver/usb.cpp | 2 +- ion/src/simulator/3ds/events.cpp | 23 +++++++++++++++++++++++ ion/src/simulator/3ds/events.h | 24 ++++++++++++++++++++++++ 5 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 ion/src/simulator/3ds/clipboard.cpp create mode 100644 ion/src/simulator/3ds/events.cpp create mode 100644 ion/src/simulator/3ds/events.h diff --git a/ion/src/simulator/3ds/Makefile b/ion/src/simulator/3ds/Makefile index 7cb60f65c..6cd57c037 100644 --- a/ion/src/simulator/3ds/Makefile +++ b/ion/src/simulator/3ds/Makefile @@ -2,11 +2,13 @@ ion_src += $(addprefix ion/src/simulator/3ds/, \ main.cpp \ callback.cpp \ + clipboard.cpp \ display.cpp \ framebuffer.cpp \ telemetry_init.cpp \ keyboard.cpp \ events_keyboard.cpp \ + events.cpp \ driver/display.cpp \ driver/language.cpp \ driver/led.cpp \ @@ -22,8 +24,10 @@ sdl_simu_needs_to_be_removed += $(addprefix ion/src/simulator/shared/, \ dummy/led.cpp \ dummy/usb.cpp \ dummy/battery.cpp \ + clipboard.cpp \ display.cpp:-headless \ events_keyboard.cpp:-headless \ + events.cpp \ framebuffer_base.cpp \ keyboard_sdl.cpp:-headless \ main_sdl.cpp:-headless \ diff --git a/ion/src/simulator/3ds/clipboard.cpp b/ion/src/simulator/3ds/clipboard.cpp new file mode 100644 index 000000000..c3ce45627 --- /dev/null +++ b/ion/src/simulator/3ds/clipboard.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +namespace Ion { +namespace Clipboard { + +uint32_t localClipboardVersion; + +void write(const char * text) { +} + +const char * read() { + return nullptr; +} + +} +} diff --git a/ion/src/simulator/3ds/driver/usb.cpp b/ion/src/simulator/3ds/driver/usb.cpp index ea8d55d26..59e83bea5 100644 --- a/ion/src/simulator/3ds/driver/usb.cpp +++ b/ion/src/simulator/3ds/driver/usb.cpp @@ -13,7 +13,7 @@ bool Ion::USB::isEnumerated() { void Ion::USB::clearEnumerationInterrupt() { } -void Ion::USB::DFU() { +void Ion::USB::DFU(bool) { } void Ion::USB::enable() { diff --git a/ion/src/simulator/3ds/events.cpp b/ion/src/simulator/3ds/events.cpp new file mode 100644 index 000000000..9b8d00557 --- /dev/null +++ b/ion/src/simulator/3ds/events.cpp @@ -0,0 +1,23 @@ +#include "events.h" +#include + +namespace Ion { +namespace Events { + +void didPressNewKey() { +} + +char * sharedExternalTextBuffer() { + static char buffer[sharedExternalTextBufferSize]; + return buffer; +} + +const char * Event::text() const { + if (*this == ExternalText) { + return const_cast(sharedExternalTextBuffer()); + } + return defaultText(); +} + +} +} diff --git a/ion/src/simulator/3ds/events.h b/ion/src/simulator/3ds/events.h new file mode 100644 index 000000000..09e31cfed --- /dev/null +++ b/ion/src/simulator/3ds/events.h @@ -0,0 +1,24 @@ +#ifndef ION_SIMULATOR_EVENTS_H +#define ION_SIMULATOR_EVENTS_H + +#include + +namespace Ion { +namespace Simulator { +namespace Events { + +void dumpEventCount(int i); +void logAfter(int numberOfEvents); + +} +} + +namespace Events { + +static constexpr int sharedExternalTextBufferSize = 0; +char * sharedExternalTextBuffer(); + +} +} + +#endif