This looks like a great project, reminds me a lot of development for GameBoy
using GBDK especially with clipping screen buffers for scrolling.
I ended up writing a rough JS implementation of GBDK and used Emscripten so I could debug those kinds of things while making GameBoy roms.
https://www.gbdkjs.com/docs/example-projects/
There's something about working within the limitations of retro systems that's really fun.