Upon an interrupt, you can read from the interrupt status register to see what caused the interrupt.
Most of these are taken from https://cc65.github.io/doc/customizing.html, but modified to suit this setup.