Files
fmini-1/web/emu/native_check.c
T
ClaudeandКирилл Сапфиров c8d571bd22 Felucca 1.6.1
MENU > LARGE keeps one size per knob (#251): each knob shows all its
values in the size its longest value fits, so a value no longer jumps
between sizes while it is turned. No new fonts.

Updates check the package's size on the device: the update entry and the
update loader take only a package whose firmware area is exactly the
FM-1's. Another device's package is refused before anything is erased
(the update screen shows FAILED -15; the loader answers -14).

Second core (beta, PR #247): MENU > SYSTEM > 2ND CORE, OFF by default.
ON (BETA) applies from the next power-on: the second core renders some
of the four parts of each block, bit for bit the one-core sound. A unit
whose second core misreads goes on with one core and sets it back to
OFF. FELUCCA_CPU2=0 builds none of it. Start, mailbox and guards from
X0X (with Melodee's dual-core findings), the split and hardening after
Jangada.

Felucca-Engines: ANALOG, LOFI, TRIO, WHEEL and NOISE, the engine
interface, the shared DSP helpers and their table generator move to
https://github.com/hugelton/Felucca-Engines under the MIT licence,
included as the git submodule firmware/engines. The firmware stays
GPL-3.0-only; clone with --recurse-submodules. The sound is unchanged
(the same golden renders); the engines' own tests run with Felucca's.

Co-authored-by: Кирилл Сапфиров <gospodindilly@gmail.com>
2026-10-17 19:04:28 -03:00

42 lines
1.4 KiB
C

/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* web/emu/felucca_web.c built natively (cc, as the host tests), playing emu_test.mjs's heavy song with the same
* gestures and the same render calls: its samples, float32 L R interleaved, to OUT. emu_test.mjs compares the
* WebAssembly build's against them (the browser plays what the host build plays).
* cc -O2 -ffp-contract=off -w -Ibuild/gen -Ifirmware/src -o build/emu/native_check web/emu/native_check.c -lm
* build/emu/native_check OUT.f32 */
#include "felucca_web.c"
static FILE *out;
static int rec;
static void render(double ms) /* as emu_test.mjs: 128-frame calls, the last one shorter */
{
uint32_t n = (uint32_t)(ms * 44.1 + 0.5), k, i;
for (k = 0; k < n; k += 128u) {
uint32_t m = n - k < 128u ? n - k : 128u;
web_render(m);
for (i = 0; rec && i < m; i++) {
float s[2] = {out_l[i], out_r[i]};
fwrite(s, sizeof s, 1, out);
}
}
}
int main(int argc, char **argv)
{
if (argc < 2 || !(out = fopen(argv[1], "wb")))
return 2;
web_nor_erase();
web_boot();
render(500);
web_test_heavy();
web_buttons(1u << B_PLAY);
render(60);
web_buttons(0);
render(60);
rec = 1;
render(2000);
fclose(out);
return 0;
}