Just released my first ever demoscene demo at Revision 2026 in the Wild-Compo:
A tech demo for Casio fx-9860G graphical calculators!

Sourcecode: https://github.com/Manawyrm/Casiomania

Details: https://kittenlabs.de/casiomania/

https://youtu.be/aLiuF9k3Xt4?t=31

EDIT: 5th place in the Wild compo \o/

#revision2026

GitHub - Manawyrm/Casiomania: Demo for Casio fx-9860G graphical calculators (audio, grayscale, 3d rendering)

Demo for Casio fx-9860G graphical calculators (audio, grayscale, 3d rendering) - Manawyrm/Casiomania

GitHub
@manawyrm glad to see that there are still people pumping out wonders on these calculators.
@manawyrm so music is doable on the serial port? I haven't looked at the source (well I stopped after recognizing the fxsdk's structure) but I suppose it's something you did through timers, isn't it? Also, DMA? How so? Are you mixing on CPU and just pushing the data through serial with the DMA?

@Ronflaix no timers (those are used for grayscale!) but DMA yes.

Every time the DMA finishes sending bits, it triggers an interrupt which will then generate a new PCM buffer and also convert that into the PWM bitstream.

No mixing at all, just single stream, but you could totally mix if you wanted too.

@manawyrm ooh, I didn't know you could wire an interrupt this way, neat! I'm really piss poor at optimizing for SH4 (the pipeline timings wring my brain like nobody's business) but hearing about it kinda makes me wanting for more haha
@manawyrm that's pretty good nonetheless! Can we say you made a port audio system (pun intended)? :D
@manawyrm by the way, can I ask you how much such a audio subsystem takes on the CPU? It's for a friend's project!

@Ronflaix ehh, well, there's a lot of interrupts, but generally speaking, it's not too bad. the CPU is suuper fast, you have lots of time to do most things (as long as you don't do soft-float calculations :P).

If you were really strapped for CPU time, I guess the routines could also be optimized a bunch. The audio samples and the big PWM lookup table are all just stored in the code right now, which I'm guessing will load them into the CPU d-cache at every firing of the interrupt.

@Ronflaix
In other words, every few milliseconds your actual main loop will get interrupted, the cache will be overwritten with audio data and then it'll return execution.

That could (and maybe should?) be benchmarked and probably fixed :)

@Ronflaix The grayscale graphics is the actual CPU hog, that's very very noticable in terms of CPU performance.
Audio isn't too bad.

@manawyrm The CPU might be super fast but only its cache and the DSP's memory banks are as fast as that, sadly. (Still haven't opened the repo, sorry) I suppose you're not really using Azure and you're using that free extra cache for shenanigans, aren't you? :D

(I'm using Azure as my own "equivalent" failed to follow up on performance as I was starting to add text for *that* project and I lacked patience, time and tooling to investigate the innards of the CPU.)

@Ronflaix i don't even know what Azure is :D

I'm using a couple of the Y and XRAM regions as well, which are internal to the CPU iirc.

If one were really clever, the DSP RAM could probably be also used for audio usage very well (but I didn't bother).

@manawyrm Azur* is Lephe's "game" framework running on top of gint. I mostly use its rendering and game loop system, replacing my own homebrew ones. I forgot whether it was gint or Azure but one of both used the DSP RAM as partial VRAM to blit to the screen chunk per chunk of scanlines.

If I have some time and motivation, i guess I could check how that'd work on my end. Thanks a bunch for showing me it can be possible.

*EDIT: Azur, not Azure, my bad.
https://git.planet-casio.com/Lephenixnoir/Azur

@manawyrm @Ronflaix I'm actually working on my own tools to generate sound samples (though no playback!) with some DSP abuse, although I've been working on other things for the past few days

https://git.planet-casio.com/lda/libraiko

libraiko

Just a gibblet I'm making...

Forge de Planète Casio