Skip to content

Commit 0abeab2

Browse files
committed
Full switch off the ImGUI + better math SDK
1 parent 137b9d1 commit 0abeab2

4 files changed

Lines changed: 38 additions & 6 deletions

File tree

app/sysgui

iso_root/bin/sysgui.elf

62.1 KB
Binary file not shown.

sdk/include/math.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111
// Округление
1212
double floor(double x);
1313
double ceil(double x);
14+
float floorf(float x);
15+
float ceilf(float x);
1416

1517
// Экспоненты и логарифмы
1618
double pow(double x, double y);
1719
double log(double x);
1820
double log10(double x);
1921
double exp(double x);
2022
double sqrt(double x);
23+
float sqrtf(float x);
2124

2225
// Тригонометрия
2326
double sin(double x);
@@ -28,16 +31,19 @@ double acos(double x);
2831
double atan(double x);
2932
double atan2(double y, double x);
3033

34+
float sinf(float x);
35+
float cosf(float x);
36+
float tanf(float x);
37+
3138
// Манипуляции с числами (критично для Lua)
3239
double frexp(double x, int *exp);
3340
double ldexp(double x, int exp);
3441
double modf(double x, double *iptr);
3542
double fmod(double x, double y);
3643
double fabs(double x);
44+
float fabsf(float x);
3745

38-
/* C99 classification macros — QuickJS uses these in its number /
39-
* Math.* code. Map to GCC built-ins; they're constant-foldable and
40-
* don't require any libm symbol. */
46+
/* C99 classification macros */
4147
#ifndef isnan
4248
#define isnan(x) __builtin_isnan(x)
4349
#endif
@@ -54,8 +60,6 @@ double fabs(double x);
5460
#define copysign(x,y) __builtin_copysign((x),(y))
5561
#endif
5662

57-
/* Additional functions QuickJS' Math.* surface needs. Implementations
58-
* live in sdk/lib/qjs_math.c (simple but spec-correct). */
5963
double trunc(double x);
6064
double round(double x);
6165
double scalbn(double x, int n);

sdk/lib/math.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,31 @@ double difftime(time_t t1, time_t t0) { return (double)(t1 - t0); }
172172
float powf(float x, float y) {
173173
return (float)pow((double)x, (double)y);
174174
}
175+
176+
float fabsf(float x) {
177+
return x < 0.0f ? -x : x;
178+
}
179+
180+
float sqrtf(float x) {
181+
return (float)sqrt((double)x);
182+
}
183+
184+
float sinf(float x) {
185+
return (float)sin((double)x);
186+
}
187+
188+
float cosf(float x) {
189+
return (float)cos((double)x);
190+
}
191+
192+
float tanf(float x) {
193+
return (float)tan((double)x);
194+
}
195+
196+
float floorf(float x) {
197+
return (float)floor((double)x);
198+
}
199+
200+
float ceilf(float x) {
201+
return (float)ceil((double)x);
202+
}

0 commit comments

Comments
 (0)