libmsx
C library for MSX
Loading...
Searching...
No Matches
Interrupts handler

Pluggable interrupts handler interface. More...

+ Collaboration diagram for Interrupts handler:

Functions

void set_interrupt_handler (void(*handler)(void))
 MSX Register user defined interrupt handler.
 
void set_vsync_handler (void(*handler)(void))
 MSX Register user defined VSYNC interrupt handler.
 

Detailed Description

Pluggable interrupts handler interface.

Function Documentation

◆ set_interrupt_handler()

void set_interrupt_handler ( void(*)(void)  handler)

MSX Register user defined interrupt handler.

After this function is called, the given user-defined handler will be called from the H.KEYI hook each time an interrupt occurs. When the user-defined handler returns, the original interrupt handler will be called. In other words, this function inserts a function at the beginning of H.KEYI and chains it to the original handler.

If this function is called twice, the previous user-defined handler will be replaced by the specified handler.

If NULL is passed to this function, the registered user-defined handler will be unregistered.

Parameters
handlerthe user defined interrupt handler.

◆ set_vsync_handler()

void set_vsync_handler ( void(*)(void)  handler)

MSX Register user defined VSYNC interrupt handler.

After this function is called, the given user-defined handler will be called from the H.TIMI hook each time a VSYNC interrupt occurs. When the user-defined handler returns, the original VSYNC interrupt handler will be called. In other words, this function inserts a function at the beginning of H.TIMI and chains it to the original handler.

If this function is called twice, the previous user-defined handler will be replaced by the specified handler.

If NULL is passed to this function, the registered user-defined handler will be unregistered.

Parameters
handlerthe user defined VSYNC interrupt handler.