forked from Omega-Numworks/Omega
-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathextapp_api.cpp
More file actions
601 lines (531 loc) · 18.6 KB
/
extapp_api.cpp
File metadata and controls
601 lines (531 loc) · 18.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
#include <ion.h>
#include <kandinsky.h>
#include <escher.h>
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
#include "archive.h"
#include "extapp_api.h"
#include "../apps_container.h"
#include "../global_preferences.h"
#ifdef DEVICE
#include <ion/src/device/shared/drivers/reset.h>
#include <ion/src/device/shared/drivers/board.h>
#include <ion/src/device/shared/drivers/flash.h>
#endif
#include <python/port/port.h>
extern "C" {
#include <python/port/mphalport.h>
}
uint64_t extapp_millis() {
return Ion::Timing::millis();
}
void extapp_msleep(uint32_t ms) {
Ion::Timing::msleep(ms);
}
uint64_t extapp_scanKeyboard() {
return Ion::Keyboard::scan();
}
void extapp_pushRect(int16_t x, int16_t y, uint16_t w, uint16_t h, const uint16_t * pixels) {
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) {
KDPoint point(x, y);
auto ctx = KDIonContext::sharedContext();
ctx->setClippingRect(KDRect(0, 0, 320, fake ? 0 : 240));
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();
}
int16_t extapp_drawTextSmall(const char * text, int16_t x, int16_t y, uint16_t fg, uint16_t bg, bool fake) {
KDPoint point(x, y);
auto ctx = KDIonContext::sharedContext();
ctx->setClippingRect(KDRect(0, 0, 320, fake ? 0 : 240));
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();
}
bool extapp_waitForVBlank() {
return Ion::Display::waitForVBlank();
}
void extapp_clipboardStore(const char * text) {
Clipboard::sharedClipboard()->store(text);
}
const char * extapp_clipboardText() {
return Clipboard::sharedClipboard()->storedText();
}
bool match(const char * filename, const char * extension) {
return strcmp(filename + strlen(filename) - strlen(extension), extension) == 0;
}
int extapp_fileListWithExtension(const char ** filenames, int maxrecords, const char * extension, int storage) {
int j = 0;
if (storage == EXTAPP_RAM_FILE_SYSTEM || storage == EXTAPP_BOTH_FILE_SYSTEM) {
int n = Ion::Storage::sharedStorage()->numberOfRecordsWithExtension(extension);
if (n > maxrecords) {
n = maxrecords;
}
for (; j < n; j++) {
filenames[j] = Ion::Storage::sharedStorage()->recordWithExtensionAtIndex(extension, j).fullName();
}
if (j == maxrecords) {
return j;
}
}
// Don't read external files the exam mode is enabled
if (GlobalPreferences::sharedGlobalPreferences()->isInExamMode()) return j;
if (storage == EXTAPP_FLASH_FILE_SYSTEM || storage == EXTAPP_BOTH_FILE_SYSTEM) {
int n = External::Archive::numberOfFiles();
for (int i = 0; i < n && j < maxrecords; i++) {
External::Archive::File entry;
// Filter extension
if (External::Archive::fileAtIndex(i, entry) && match(entry.name, extension)) {
filenames[j] = entry.name;
++j;
}
}
}
return j;
}
bool extapp_fileExists(const char * filename, int storage) {
if (storage == EXTAPP_RAM_FILE_SYSTEM || storage == EXTAPP_BOTH_FILE_SYSTEM) {
if (!Ion::Storage::sharedStorage()->recordNamed(filename).isNull())
return true;
}
if (storage == EXTAPP_FLASH_FILE_SYSTEM || storage == EXTAPP_BOTH_FILE_SYSTEM) {
return External::Archive::indexFromName(filename) >= 0;
}
return false;
}
bool extapp_fileErase(const char * filename, int storage) {
if (storage == EXTAPP_RAM_FILE_SYSTEM) {
Ion::Storage::Record record = Ion::Storage::sharedStorage()->recordNamed(filename);
if (record.isNull()) {
return false;
}
record.destroy();
return true;
}
return false;
}
const char * extapp_fileRead(const char * filename, size_t * len, int storage) {
if (storage == EXTAPP_RAM_FILE_SYSTEM || storage == EXTAPP_BOTH_FILE_SYSTEM) {
const Ion::Storage::Record record = Ion::Storage::sharedStorage()->recordNamed(filename);
if (!record.isNull()){
int delta = 0;
if (match(filename, ".py") || match(filename, ".xw"))
delta++;
// skip record type
if (len)
*len = record.value().size - delta;
return (const char *)record.value().buffer + delta;
}
}
if (storage == EXTAPP_FLASH_FILE_SYSTEM || storage == EXTAPP_BOTH_FILE_SYSTEM) {
int index = External::Archive::indexFromName(filename);
if (index >= 0) {
External::Archive::File entry;
External::Archive::fileAtIndex(index, entry);
if (len) {
*len = entry.dataLength;
}
return (const char *)entry.data;
}
}
return NULL;
}
bool extapp_fileWrite(const char * filename, const char * content, size_t len, int storage) {
if (storage == EXTAPP_RAM_FILE_SYSTEM) {
Ion::Storage::Record::ErrorStatus status = Ion::Storage::sharedStorage()->createRecordWithFullName(filename, content, len);
if (status == Ion::Storage::Record::ErrorStatus::NameTaken) {
Ion::Storage::Record::Data data;
data.buffer = content;
data.size = len;
return Ion::Storage::sharedStorage()->recordNamed(filename).setValue(data) == Ion::Storage::Record::ErrorStatus::None;
}
if (status == Ion::Storage::Record::ErrorStatus::None)
return true;
}
return false;
}
static void reloadTitleBar() {
AppsContainer::sharedAppsContainer()->setShiftAlphaStatus(Ion::Events::shiftAlphaStatus());
AppsContainer::sharedAppsContainer()->refreshPreferences();
AppsContainer::sharedAppsContainer()->updateBatteryState();
AppsContainer::sharedAppsContainer()->reloadTitleBarView();
AppsContainer::sharedAppsContainer()->redrawWindow();
// Refresh the display on simulator.
#ifndef DEVICE
Ion::Keyboard::scan();
#endif
}
void extapp_lockAlpha() {
Ion::Events::setShiftAlphaStatus(Ion::Events::ShiftAlphaStatus::AlphaLock);
reloadTitleBar();
}
void extapp_resetKeyboard() {
Ion::Events::setShiftAlphaStatus(Ion::Events::ShiftAlphaStatus::Default);
reloadTitleBar();
}
const int16_t translated_keys[] =
{
// non shifted
KEY_CTRL_LEFT,KEY_CTRL_UP,KEY_CTRL_DOWN,KEY_CTRL_RIGHT,KEY_CTRL_OK,KEY_CTRL_EXIT,
KEY_CTRL_MENU,KEY_PRGM_ACON,KEY_PRGM_ACON,9,10,11,
KEY_CTRL_SHIFT,KEY_CTRL_ALPHA,KEY_CTRL_XTT,KEY_CTRL_VARS,KEY_CTRL_CATALOG,KEY_CTRL_DEL,
KEY_CHAR_EXPN,KEY_CHAR_LN,KEY_CHAR_LOG,KEY_CHAR_IMGNRY,',',KEY_CHAR_POW,
KEY_CHAR_SIN,KEY_CHAR_COS,KEY_CHAR_TAN,KEY_CHAR_PI,KEY_CHAR_ROOT,KEY_CHAR_SQUARE,
'7','8','9','(',')',-1,
'4','5','6','*','/',-1,
'1','2','3','+','-',-1,
'0','.',KEY_CHAR_EXPN10,KEY_CHAR_ANS,KEY_CTRL_EXE,-1,
// shifted
KEY_SHIFT_LEFT,KEY_CTRL_PAGEUP,KEY_CTRL_PAGEDOWN,KEY_SHIFT_RIGHT,KEY_CTRL_OK,KEY_CTRL_EXIT,
KEY_CTRL_MENU,KEY_PRGM_ACON,KEY_PRGM_ACON,9,10,11,
KEY_CTRL_SHIFT,KEY_CTRL_ALPHA,KEY_CTRL_CUT,KEY_CTRL_CLIP,KEY_CTRL_PASTE,KEY_CTRL_AC,
KEY_CHAR_LBRCKT,KEY_CHAR_RBRCKT,KEY_CHAR_LBRACE,KEY_CHAR_RBRACE,'_',KEY_CHAR_STORE,
KEY_CHAR_ASIN,KEY_CHAR_ACOS,KEY_CHAR_ATAN,'=','<','>',
KEY_CTRL_F7,KEY_CTRL_F8,KEY_CTRL_F9,KEY_CTRL_F13,KEY_CTRL_F14,-1,
KEY_CTRL_F4,KEY_CTRL_F5,KEY_CTRL_F6,KEY_CHAR_FACTOR,'%',-1,
KEY_CTRL_F1,KEY_CTRL_F2,KEY_CTRL_F3,KEY_CHAR_NORMAL,'\\',-1,
KEY_CTRL_F10,KEY_CTRL_F11,KEY_CTRL_F12,KEY_SHIFT_ANS,KEY_CTRL_EXE,-1,
// alpha
KEY_CTRL_LEFT,KEY_CTRL_UP,KEY_CTRL_DOWN,KEY_CTRL_RIGHT,KEY_CTRL_OK,KEY_CTRL_EXIT,
KEY_CTRL_MENU,KEY_PRGM_ACON,KEY_PRGM_ACON,9,10,11,
KEY_CTRL_SHIFT,KEY_CTRL_ALPHA,':',';','"',KEY_CTRL_DEL,
'a','b','c','d','e','f',
'g','h','i','j','k','l',
'm','n','o','p','q',-1,
'r','s','t','u','v',-1,
'w','x','y','z',' ',-1,
'?','!',KEY_CHAR_EXPN10,KEY_CHAR_ANS,KEY_CTRL_EXE,-1,
// alpha shifted
KEY_SHIFT_LEFT,KEY_CTRL_PAGEUP,KEY_CTRL_PAGEDOWN,KEY_SHIFT_RIGHT,KEY_CTRL_OK,KEY_CTRL_EXIT,
KEY_CTRL_MENU,KEY_PRGM_ACON,KEY_PRGM_ACON,9,10,11,
KEY_CTRL_SHIFT,KEY_CTRL_ALPHA,':',';','\'','%',
'A','B','C','D','E','F',
'G','H','I','J','K','L',
'M','N','O','P','Q',-1,
'R','S','T','U','V',-1,
'W','X','Y','Z',' ',-1,
'?','!',KEY_CHAR_EXPN10,KEY_CHAR_ANS,KEY_CTRL_EXE,-1,
};
#ifdef SIMULATOR
#define TICKS_PER_MINUTE 60000
#else
#define TICKS_PER_MINUTE 11862
#endif
int extapp_restoreBackup(int mode) {
// Restoring the backup is allowed even if the write protection is enabled, because it may have been writted by Khi.x
if (GlobalPreferences::sharedGlobalPreferences()->isInExamMode())
return 0;
size_t length = 32 * 1024;
if (mode == -1) { // restore backup saved when exam mode was set
uint8_t * src = (uint8_t *)(0x90800000 - 2 * length);
if (src[0] == 0xba && src[1] == 0xdd && src[2] == 0x0b && src[3] == 0xee) {
memcpy((uint8_t *)Ion::storageAddress(), src, length);
return 1;
}
}
if (mode >= 0 && mode < 16) {
uint8_t * src = (uint8_t *)(0x90180000 + mode * length);
if (src[0] == 0xba && src[1] == 0xdd && src[2] == 0x0b && src[3] == 0xee) {
memcpy((uint8_t *)Ion::storageAddress(), src, length);
return 1;
}
}
return 0;
}
int extapp_getKey(int allowSuspend, bool * alphaWasActive) {
int key = -1;
size_t t1 = Ion::Timing::millis();
for (;;) {
int timeout = 10000;
if (alphaWasActive) {
*alphaWasActive = Ion::Events::isAlphaActive();
}
Ion::Events::Event event = Ion::Events::getEvent(&timeout);
reloadTitleBar();
if (event == Ion::Events::None) {
size_t t2 = Ion::Timing::millis();
if (t2 - t1 > 3 * TICKS_PER_MINUTE) {
event = Ion::Events::OnOff;
}
} else {
t1 = Ion::Timing::millis();
}
if (event.isKeyboardEvent()) {
Ion::Backlight::setBrightness(GlobalPreferences::sharedGlobalPreferences()->brightnessLevel());
}
if (event == Ion::Events::Shift || event == Ion::Events::Alpha) {
continue;
}
if (event.isKeyboardEvent()) {
key = static_cast<uint8_t>(event);
if (key == (int)Ion::Keyboard::Key::Backspace || key == (int)Ion::Keyboard::Key::OK || key == (int)Ion::Keyboard::Key::Back || key == (int)Ion::Keyboard::Key::EXE) {
extapp_resetKeyboard();
}
if (allowSuspend && key == (int)Ion::Keyboard::Key::OnOff) {
Ion::Power::suspend(true);
extapp_pushRectUniform(0, 0, 320, 240, 65535);
Ion::Backlight::setBrightness(GlobalPreferences::sharedGlobalPreferences()->brightnessLevel());
reloadTitleBar();
}
break;
}
}
return translated_keys[key];
}
bool extapp_isKeydown(int key) {
Ion::Keyboard::State scan = Ion::Keyboard::scan();
return scan.keyDown(Ion::Keyboard::Key(key));
}
bool extapp_eraseSector(void * ptr) {
#ifdef DEVICE
if (ptr == 0)
Ion::Device::Reset::core();
// Disable flash writting
if (GlobalPreferences::sharedGlobalPreferences()->externalAppWritePermission()) {
int i = Ion::Device::Flash::SectorAtAddress((size_t)ptr);
if (i < 0)
return false;
Ion::Device::Flash::EraseSector(i);
return true;
}
#endif
return false;
}
bool extapp_writeMemory(unsigned char * dest, const unsigned char * data, size_t length) {
#ifdef DEVICE
// Disable flash writting
if (GlobalPreferences::sharedGlobalPreferences()->externalAppWritePermission()) {
int n = Ion::Device::Flash::SectorAtAddress((uint32_t)dest);
if (n < 0)
return false;
Ion::Device::Flash::WriteMemory(dest, (unsigned char *)data, length);
return true;
}
#endif
return false;
}
bool extapp_inExamMode() {
return GlobalPreferences::sharedGlobalPreferences()->isInExamMode();
}
uint8_t extapp_getBrightness () {
// TODO: Support dimming
return GlobalPreferences::sharedGlobalPreferences()->brightnessLevel();
}
void extapp_setBrightness (uint8_t b) {
GlobalPreferences::sharedGlobalPreferences()->setBrightnessLevel(b);
Ion::Backlight::setBrightness(b);
}
int extapp_batteryLevel() {
return (int)Ion::Battery::level();
}
float extapp_batteryVoltage() {
return Ion::Battery::voltage();
}
bool extapp_batteryCharging() {
return Ion::Battery::isCharging();
}
int extapp_batteryPercentage() {
// We don't have a battery percentage, so compute it from the voltage
// TODO: Move it to Ion::Battery
int percentage = (extapp_batteryVoltage() - 3.6) * 166;
// Ensure that the percentage is between 0 and 100
if (percentage < 0)
percentage = 1;
if (percentage > 100)
percentage = 100;
return (int)percentage;
}
DateTime extapp_getDateTime() {
Ion::RTC::DateTime dt = Ion::RTC::dateTime();
// TODO: This should not be necessary
return DateTime {
dt.tm_sec,
dt.tm_min,
dt.tm_hour,
dt.tm_mday,
dt.tm_mon,
dt.tm_year,
dt.tm_wday,
};
}
void extapp_setDateTime(DateTime dt) {
// TODO: Conversion should not be necessary (same format is used in the RTC), but casting is not working...
Ion::RTC::setDateTime(Ion::RTC::DateTime {
dt.tm_sec,
dt.tm_min,
dt.tm_hour,
dt.tm_mday,
dt.tm_mon,
dt.tm_year,
dt.tm_wday,
});
}
void extapp_setRTCMode(int mode) {
Ion::RTC::setMode((Ion::RTC::Mode)mode);
}
int extapp_getRTCMode() {
return (int)Ion::RTC::mode();
}
////////////////////////////////////////////////////////////////////////////////
// Code from MicroPython
static const uint16_t days_since_jan1[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
bool is_leap_year(mp_uint_t year) {
return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
}
// compute the day of the year, between 1 and 366
// month should be between 1 and 12, date should start at 1
uint64_t year_day(uint16_t year, uint8_t month, uint8_t date) {
mp_uint_t yday = days_since_jan1[month - 1] + date;
if (month >= 3 && is_leap_year(year)) {
yday += 1;
}
return yday;
}
// returns the number of seconds, as an integer, since 2000-01-01
uint64_t seconds_since_2000(Ion::RTC::DateTime tm) {
return
tm.tm_sec
+ tm.tm_min * 60
+ tm.tm_hour * 3600
+ (year_day(tm.tm_year, tm.tm_mon, tm.tm_mday) - 1
+ ((tm.tm_year - 2000 + 3) / 4) // add a day each 4 years starting with 2001
- ((tm.tm_year - 2000 + 99) / 100) // subtract a day each 100 years starting with 2001
+ ((tm.tm_year - 2000 + 399) / 400) // add a day each 400 years starting with 2001
) * 86400
+ (tm.tm_year - 2000) * 31536000;
}
////////////////////////////////////////////////////////////////////////////////
uint64_t extapp_getTime() {
Ion::RTC::DateTime dt = Ion::RTC::dateTime();
return seconds_since_2000(dt);
}
uint32_t extapp_random() {
return Ion::random();
}
void extapp_reloadTitleBar() {
reloadTitleBar();
}
const char * extapp_username() {
return (const char *)Ion::username();
}
const char * extapp_getOS() {
return "Upsilon";
}
const char * extapp_getOSVersion() {
return Ion::upsilonVersion();
}
const char * extapp_getOSCommit() {
return Ion::patchLevel();
}
size_t extapp_storageSize() {
return Ion::Storage::k_storageSize;
}
size_t extapp_storageAvailable() {
return Ion::Storage::sharedStorage()->availableSize();
}
size_t extapp_storageUsed() {
return extapp_storageSize() - extapp_storageAvailable();
}
struct Settings extapp_getSettings() {
Poincare::Preferences * poincare_preferences = Poincare::Preferences::sharedPreferences();
return Settings {
(uint8_t)poincare_preferences->angleUnit(),
(uint8_t)poincare_preferences->displayMode(),
poincare_preferences->numberOfSignificantDigits(),
(uint8_t)poincare_preferences->complexFormat(),
GlobalPreferences::sharedGlobalPreferences()->font() == KDFont::LargeFont ? true : false,
};
}
void extapp_setSettings(Settings settings) {
Poincare::Preferences * poincare_preferences = Poincare::Preferences::sharedPreferences();
poincare_preferences->setAngleUnit((Poincare::Preferences::AngleUnit)settings.angleUnit);
poincare_preferences->setDisplayMode((Poincare::Preferences::PrintFloatMode)settings.displayMode);
poincare_preferences->setNumberOfSignificantDigits(settings.numberOfSignificantDigits);
poincare_preferences->setComplexFormat((Poincare::Preferences::ComplexFormat)settings.complexFormat);
if (settings.largeFont) {
GlobalPreferences::sharedGlobalPreferences()->setFont(KDFont::LargeFont);
} else {
GlobalPreferences::sharedGlobalPreferences()->setFont(KDFont::SmallFont);
}
}
extern "C" void (* const apiPointers[])(void) = {
(void (*)(void)) extapp_millis,
(void (*)(void)) extapp_msleep,
(void (*)(void)) extapp_scanKeyboard,
(void (*)(void)) extapp_pushRect,
(void (*)(void)) extapp_pushRectUniform,
(void (*)(void)) extapp_pullRect,
(void (*)(void)) extapp_drawTextLarge,
(void (*)(void)) extapp_drawTextSmall,
(void (*)(void)) extapp_waitForVBlank,
(void (*)(void)) extapp_clipboardStore,
(void (*)(void)) extapp_clipboardText,
(void (*)(void)) extapp_fileListWithExtension,
(void (*)(void)) extapp_fileExists,
(void (*)(void)) extapp_fileErase,
(void (*)(void)) extapp_fileRead,
(void (*)(void)) extapp_fileWrite,
(void (*)(void)) extapp_lockAlpha,
(void (*)(void)) extapp_resetKeyboard,
(void (*)(void)) extapp_getKey,
(void (*)(void)) extapp_isKeydown,
(void (*)(void)) extapp_restoreBackup,
(void (*)(void)) extapp_eraseSector,
(void (*)(void)) extapp_writeMemory,
(void (*)(void)) extapp_inExamMode,
(void (*)(void)) extapp_getBrightness,
(void (*)(void)) extapp_setBrightness,
(void (*)(void)) extapp_batteryLevel,
(void (*)(void)) extapp_batteryVoltage,
(void (*)(void)) extapp_batteryCharging,
(void (*)(void)) extapp_batteryPercentage,
(void (*)(void)) extapp_getDateTime,
(void (*)(void)) extapp_setDateTime,
(void (*)(void)) extapp_setRTCMode,
(void (*)(void)) extapp_getRTCMode,
(void (*)(void)) extapp_getTime,
(void (*)(void)) extapp_random,
(void (*)(void)) extapp_reloadTitleBar,
(void (*)(void)) extapp_username,
(void (*)(void)) extapp_getOS,
(void (*)(void)) extapp_getOSVersion,
(void (*)(void)) extapp_getOSCommit,
(void (*)(void)) extapp_storageSize,
(void (*)(void)) extapp_storageAvailable,
(void (*)(void)) extapp_storageUsed,
(void (*)(void)) extapp_getSettings,
(void (*)(void)) extapp_setSettings,
(void (*)(void)) nullptr,
};