mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/external] Add simulator support (#238)
This commit is contained in:
11
Makefile
11
Makefile
@@ -31,14 +31,11 @@ ifeq ($(filter reader,$(apps_list)),)
|
||||
HAS_READER := 1
|
||||
endif
|
||||
|
||||
ifeq (${MODEL}, n0110)
|
||||
apps_list = ${EPSILON_APPS}
|
||||
else
|
||||
ifeq (${MODEL},bootloader)
|
||||
apps_list = ${EPSILON_APPS}
|
||||
else
|
||||
# Remove the external apps for the n0100
|
||||
ifeq (${MODEL}, n0100)
|
||||
apps_list = $(foreach i, ${EPSILON_APPS}, $(if $(filter external, $(i)),,$(i)))
|
||||
endif
|
||||
else
|
||||
apps_list = ${EPSILON_APPS}
|
||||
endif
|
||||
|
||||
ifdef FORCE_EXTERNAL
|
||||
|
||||
22
apps/external/extapp_api.cpp
vendored
22
apps/external/extapp_api.cpp
vendored
@@ -37,18 +37,30 @@ void extapp_pushRect(int16_t x, int16_t y, uint16_t w, uint16_t h, const uint16_
|
||||
KDRect rect(x, y, w, h);
|
||||
|
||||
Ion::Display::pushRect(rect, reinterpret_cast<const KDColor *>(pixels));
|
||||
#ifndef DEVICE
|
||||
// Refresh the display.
|
||||
Ion::Keyboard::scan();
|
||||
#endif
|
||||
}
|
||||
|
||||
void extapp_pushRectUniform(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t color) {
|
||||
KDRect rect(x, y, w, h);
|
||||
|
||||
Ion::Display::pushRectUniform(rect, KDColor::RGB16(color));
|
||||
#ifndef DEVICE
|
||||
// Refresh the display.
|
||||
Ion::Keyboard::scan();
|
||||
#endif
|
||||
}
|
||||
|
||||
void extapp_pullRect(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t * pixels) {
|
||||
KDRect rect(x, y, w, h);
|
||||
|
||||
Ion::Display::pullRect(rect, (KDColor *)pixels);
|
||||
#ifndef DEVICE
|
||||
// Refresh the display.
|
||||
Ion::Keyboard::scan();
|
||||
#endif
|
||||
}
|
||||
|
||||
int16_t extapp_drawTextLarge(const char * text, int16_t x, int16_t y, uint16_t fg, uint16_t bg, bool fake) {
|
||||
@@ -59,6 +71,11 @@ int16_t extapp_drawTextLarge(const char * text, int16_t x, int16_t y, uint16_t f
|
||||
ctx->setOrigin(KDPoint(0, 0));
|
||||
point = ctx->drawString(text, point, KDFont::LargeFont, KDColor::RGB16(fg), KDColor::RGB16(bg));
|
||||
|
||||
#ifndef DEVICE
|
||||
// Refresh the display.
|
||||
Ion::Keyboard::scan();
|
||||
#endif
|
||||
|
||||
return point.x();
|
||||
}
|
||||
|
||||
@@ -70,6 +87,11 @@ int16_t extapp_drawTextSmall(const char * text, int16_t x, int16_t y, uint16_t f
|
||||
ctx->setOrigin(KDPoint(0, 0));
|
||||
point = ctx->drawString(text, point, KDFont::SmallFont, KDColor::RGB16(fg), KDColor::RGB16(bg));
|
||||
|
||||
#ifndef DEVICE
|
||||
// Refresh the display.
|
||||
Ion::Keyboard::scan();
|
||||
#endif
|
||||
|
||||
return point.x();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user