Closed Lokathor closed 5 years ago
Do remember that this array has to be aligned (to an address that is a multiple of four), or you'll get a lot of weirdness.
Ah, yes. If it's typed as [u32;5]
then the fact that they're u32
values will keep it aligned, but very important to keep in mind.
Sorted this out with the full interrupt handler update
Thanks to a bit of madness and a contribution from @aaaaaa123456789 of the gbdev Discord (
ax6
on the Discord), it has been decided that, even if the ability to program an arbitrary ISR that's reusable within the crates ecosystem is not currently easy/possible, we can still hand code a basic ISR for just acknowledging a vblank, which allows us to at least usebios::vblank_interrupt_wait
.This is a stepping stone, not a destination.
But all we have to do is make a static array of
u32
values, the raw opcodes of the ARM assembly we want, and then use the pointer to that as our interrupt handling pointer.They kindly provided the handler code and the
u32
values of said code for us: