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 So that was what that repo was for!
I don't have an fx-9860 (/derivative), and it seems to depend on the T6K11 drvier's functions so I can't test directly, but that just looks (and sounds!) awesome

@lda No idea what happens without a t6k11 (I mostly only use it for the initial snow and contrast setting).

Give it a shot on a different calculator with SH-4 if you've got one :)
(no promises, though :D)

@manawyrm hm, after removing basically all calls to t6k11-related functions (and with build-fxg3a), it still failed

looks like it's caused by the audio thread using DMA channel 0 (channel 0 and 1 are reserved for gint tasks on the fx-CG50, 0 IIRC is for sending VRAM over and 1 is... something? I honestly forgot why it was used)
I think you'd also need to mess with the C0MID address used as it's hardcoded (I'd say my branch of gint defines fields for that, but the forge it's on is getting hammered by AI scrappers, sorry!)

Still doesn't seem to get past the introduction sequence, so I assume there's something wrong with the DMA code still...

@manawyrm UPDATE: turns out the hang was because I used the wrong DMARS selector (I geninuely forgot each DMARS field held 2 RIDs!)

It now works (mostly) fine on fx-CG50/G90+E (except for audio playback speed, but that could likely be fixed by using a better value for the SCIF's SCBRR/computr it on the fly)

@manawyrm I saw that on the stream earlier and greatly enjoyed it, thank you.
@manawyrm
Amazing! How do you like the party so far?
@manawyrm one of the best demos this year :D i loved it
@manawyrm oh nice, that's exactly the calculator that got me through secondary school! should try it out sometime.
@manawyrm This is awesome, and I love that the demo scene is still a thing (I had no idea).
@manawyrm i just got to watch it, and I'm blown away. That's a LOT of demo for a little calculator
@manawyrm awesome piece of code!
@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.)

@manawyrm I forgot to consider you also using grayscale. Yeah, I *know* how heavy that thing can be. I Don't know your exact timing but I clearly remember the RevolutionFX-era VBR-breaking solutions being both a CPU hog and a good source of surprise OS reboots. I'm glad that the nouvelle garde picked up where the old one left and greatly improved on everything.

@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
@Ronflaix I didn‘t even optimize at all basically, it‘s all written in C (altough I had to be a bit careful in certain places like those interrupt routines)
@manawyrm Holy shit, that’s cool!
@manawyrm Loved it, the "feature reveals" were very fun! :)
@blinry @manawyrm most underrated demo IMHO, should qualify for technical achievement nomination @meteoriks