I'm trying to learn about C64 interrupt handling (with the goal of putting it in practice). My understanding is that interrupts can be triggered by different sources but there is only one interrupt handler vector for all of them (apart from NMI and reset having their own vectors). It is possible to chain different interrupt handlers, but there are no dedicated interrupt handlers for different interrupt events.
For this reason I would assume that every interrupt handler would first have to check whether the event it is interested in had actually happened or whether the interrupt had been triggered by a different type of event. Yet every interrupt handler example I see just assumes that it was triggered by the right kind of event and proceeds to handle it. Even the default interrupt handler in the KERNAL ROM just seems to assume that it was triggered because 1/60 sec has elapsed and proceeds to increment the real time clock.
I found this article that briefly touches on this topic:
Interrupts [...] will call the same memory address. In a modern setting this would be as if you had to connect all your events to a single function, and then sort out which one has actually occurred.
But then it proceeds to show an example that does not check the interrupt source.
I also found the multiple interrupt service routines pattern, but it just keeps switching between a fixed number of interrupt handlers for the same number of interrupt triggers that follow each other in a regular repeating pattern.
Based on my findings above, it seems that there is no need to identify the IRQ source in interrupt handlers, or at least it is not a regular practice. Why?