I find getting stuff up on the rM2 screen a hassle.
The challenge comes from the way the e-paper works. To turn a pixel from white to black (or vice versa) it needs multiple actual frames. The pixel data must also be packed in a specific format. Instructions for how many frames a single operation requires are coded in a wbf[0] file, which comes included with the OEM firmware.
The most commonly used approach is hooking into xochitl, since it handles all of the user facing stuff like the notebooks but also the actual drawing. This is somewhat brittle and tends to break with software updates, because all of the actual function addresses have to be updated as well.
I was excited to find waved[1], a C++ library that allowed to drive the display directly using a sane API. Although it's not been updated for quite a while it still works and you can compile and run it yourself.
Since I was interested in driving the display myself, I tried to rewriting waved in Zig. It works - I can now get pixels up on the screen. Unfortunately the code is a mess and its only redeeming quality (stemming from being written in Zig) is that I can cross compile a statically linked binary that 'just werks' using just the Zig toolchain as the only dependency. For debugging purposes, I also implemented a SDL emulator for the display. [2]
While writing this, I stumbled upon a recent Rust implementation of the same ideas. Nice. [3]
Since the xochitl display implementation is the most optimized, that's probably the reason why it's being used most commonly*, even though it might be 'ugly'.
* Citation needed
[0] https://gitlab.com/zephray/glider#understanding-waveform
[1] https://github.com/matteodelabre/waved
My reMarkable is still stuck on a super old version (v3.3 I think), precisely because of xochitl being closed source and there's no stable and efficient way of driving the display. It's super sad because I would love to have much more things appearing on my tablet yet I cannot develop reMarkable apps easily. I'm not talking about browsers, but more like my Linear TODO list, calendar, etc., so I don't have to reach for my phone.
I really want to try for further reverse engineering of xochitl now that I've heard those AI tools have gotten so good at doing it.
Man I really wish one day I could run mainline Linux kernel on this tablet with the display just works.