Events pertaining to the DC's System ASIC
More...
|
| Event Codes |
| Values for various Holly event codes
|
|
| IRQ Levels |
| values for the various ASIC event IRQ levels
|
|
| Registers |
| Addresses for various ASIC eveng registers
|
|
|
file | asic.h |
| Dreamcast ASIC event handling support.
|
|
|
typedef void(* | asic_evt_handler) (uint32_t code, void *data) |
| ASIC event handler type.
|
|
Events pertaining to the DC's System ASIC
◆ asic_evt_handler
typedef void(* asic_evt_handler) (uint32_t code, void *data) |
ASIC event handler type.
Any event handlers registered must be of this type. These will be run in an interrupt context, so don't try anything funny.
- Parameters
-
code | The ASIC event code that generated this event. |
data | The user pointer that was passed to asic_evt_set_handler. |
- See also
- Event Codes
◆ asic_evt_disable()
void asic_evt_disable |
( |
uint16_t | code, |
|
|
uint8_t | irqlevel ) |
Disable one ASIC event.
This function will disable the hook for a specified code that was registered at the given IRQ level. Generally, you will never have to do this yourself unless you're adding in some new functionality.
- Parameters
-
code | The ASIC event code to unhook (see Event Codes). |
irqlevel | The IRQ level it was hooked on (see IRQ Levels). |
◆ asic_evt_disable_all()
void asic_evt_disable_all |
( |
void | | ) |
|
Disable all ASIC events.
This function will disable hooks for every event that has been hooked. In order to reinstate them, you must individually re-enable them. Not a very good idea to be doing this normally.
◆ asic_evt_enable()
void asic_evt_enable |
( |
uint16_t | code, |
|
|
uint8_t | irqlevel ) |
Enable an ASIC event.
This function will enable the hook for a specified code and register it at the given IRQ level. You should only register each event at a max of one IRQ level (this will not check that for you), and this does not actually set the hook function for the event, you must do that separately with asic_evt_set_handler(). Generally, unless you're adding in new functionality, you'll never have to do this.
- Parameters
-
◆ asic_evt_remove_handler()
void asic_evt_remove_handler |
( |
uint16_t | code | ) |
|
Unregister any handler set to the given ASIC event.
- Parameters
-
◆ asic_evt_request_threaded_handler()
int asic_evt_request_threaded_handler |
( |
uint16_t | code, |
|
|
asic_evt_handler | handler, |
|
|
void * | data, |
|
|
void(* | ack_and_mask )(uint16_t), |
|
|
void(* | unmask )(uint16_t) ) |
Register a threaded handler with the given ASIC event.
This function will spawn a thread, that will sleep until notified when an event happens. It will then call the handler. As the handler is not called in an interrupt context, it can hold locks, and even sleep.
- Parameters
-
code | The ASIC event code to hook (see Event Codes). |
handler | The function to call when the event happens. |
data | A user pointer that will be passed to the callback. |
ack_and_mask | An optional function that will be called by the real interrupt handler, to acknowledge and mask the interrupt, so that it won't trigger again while the threaded handler is running. |
unmask | An optional function that will be called by the thread after the handler function returned, to re-enable the interrupt. |
◆ asic_evt_set_handler()
void asic_evt_set_handler |
( |
uint16_t | code, |
|
|
asic_evt_handler | handler, |
|
|
void * | data ) |
Set or remove an ASIC handler.
This function will register an event handler for a given event code, or if the handler is NULL, unregister any that is currently registered.
- Parameters
-
code | The ASIC event code to hook (see Event Codes). |
handler | The function to call when the event happens. |
data | A user pointer that will be passed to the callback. |