[apps/external] Add simulator support (#238)

This commit is contained in:
Yaya-Cout
2022-05-21 17:38:26 +02:00
committed by GitHub
parent 19de87f9b5
commit e4718fcb95
2 changed files with 26 additions and 7 deletions

View File

@@ -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

View File

@@ -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();
}