@machfour: I know how frustrating this activity is sometimes, and I fully sympathise.
Still, I decided to give it another try.
…and I think I almost nailed it (until I’m proven wrong of course).
First I enabled all warning flags: -Wall -Wextra -pedantic and I (painfully) suppressed all benign warnings.
But the most useful one is - Winline, which warns when inlining has not occurred for whatever reason.
It turns out that with -Os avg-gcc 4.3 inlines most sensible parts, while with -Os avr-gcc 9.3 decides to not inline some important asm code.
avr-gcc 9.3 -O2 does succeed in inlining all inlined-tagged functions, and produces a 30192 bytes firmware which is smaller than the limit (with a few tweaks though).
Still, some patches sounded weird, especially FM-based ones.
…until I discovered potentials slips in the code. When fixed, all patches sound right to my ears, except “voxelito”, and vowel-based sound in general.
A voicecard firmware should be joined to this message: it would be nice if someone confirms or refutes that it sounds right (again, except voxelito).
One thing is, if it’s right, then the sounds with this firmware might be different, as I changed (fixed?) the code.
Hopefully tomorrow I’ll find the last fix (I still haven’t figure out the vowel code), and I’ll send a PR to Emilie.
ambika_voicecard.bin.zip (24.5 KB)