|
0.3.1
|
Modules | |
| Setters | |
Data Structures | |
| struct | scu_ic_priority |
| SCU IC priority entry. More... | |
Typedefs | |
| typedef enum scu_ic_interrupt | scu_ic_interrupt_t |
| Interrupt vectors. | |
| typedef enum scu_ic_mask | scu_ic_mask_t |
| Mask values. | |
| typedef enum scu_ic_status_reg | scu_ic_status_reg_t |
| Interrupt status bits. | |
| typedef struct scu_ic_priority | scu_ic_priority_t |
| SCU IC priority entry. | |
| typedef void(* | scu_ic_ihr_t) (void) |
| Callback type. | |
Enumerations | |
| enum | scu_ic_interrupt |
| Interrupt vectors. More... | |
| enum | scu_ic_mask |
| Mask values. More... | |
| enum | scu_ic_status_reg |
| Interrupt status bits. More... | |
Functions | |
| static void | scu_ic_ihr_set (scu_ic_interrupt_t vector, scu_ic_ihr_t ihr) |
| Set the interrupt handler for the specified SCU related interrupt. | |
| static void | scu_ic_ihr_clear (scu_ic_interrupt_t vector) |
| Clear the interrupt handler for the specified SCU related interrupt. | |
| static scu_ic_ihr_t | scu_ic_ihr_get (scu_ic_interrupt_t vector) |
| Obtain the interrupt handler for the specified SCU related interrupt. | |
| static void | scu_ic_mask_set (scu_ic_mask_t mask) |
| Write a mask value the SCU I/O register IMS. | |
| static void | scu_ic_mask_chg (scu_ic_mask_t and_mask, scu_ic_mask_t or_mask) |
| Change the mask value in the SCU I/O register IMS. | |
| static scu_ic_mask_t | scu_ic_mask_get (void) |
| Obtain the SCU IMS mask. | |
| static scu_ic_status_reg_t | scu_ic_status_get (void) |
| Obtain the 32-bit SCU IST value. | |
| static void | scu_ic_status_set (scu_ic_status_reg_t value) |
| Write to the SCU IST register. | |
| static void | scu_ic_status_chg (scu_ic_status_reg_t and_mask, scu_ic_status_reg_t or_mask) |
| Change value in the SCU IST register. | |
| static const scu_ic_priority_t * | scu_ic_priority_table_get (void) |
| Obtain a read-only pointer to the priority table. | |
| static void | scu_ic_priority_table_set (const scu_ic_priority_t *table) |
| Set the priority table. | |
Description goes here.
| struct scu_ic_priority |
SCU IC priority entry.
| Data Fields | ||
|---|---|---|
| uint16_t | sr_mask |
CPU sr register priority level mask. |
| scu_ic_interrupt_t | scu_mask:16 | SCU IMS mask. |
| typedef void(* scu_ic_ihr_t) (void) |
Callback type.
| enum scu_ic_interrupt |
Interrupt vectors.
| enum scu_ic_mask |
Mask values.
| enum scu_ic_status_reg |
Interrupt status bits.
|
inlinestatic |
Set the interrupt handler for the specified SCU related interrupt.
This is a BIOS call. The function should not use rte to return, unlike cpu_intc_ihr_set.
It's possible to use cpu_intc_ihr_set to set an SCU related interrupt. However, the IST, as well as the IMS I/O registers need to be updated.
Below is the disassembly of the BIOS function.
The actual handler is located at 0x060008F4:
| vector | The vector number. |
| ihr | The interrupt handler. |
|
inlinestatic |
Clear the interrupt handler for the specified SCU related interrupt.
This is a BIOS call.
| vector | The vector number. |
|
inlinestatic |
Obtain the interrupt handler for the specified SCU related interrupt.
This is a BIOS call.
| vector | The vector |
|
inlinestatic |
|
inlinestatic |
Change the mask value in the SCU I/O register IMS.
The and_mask is the 32-bit mask value that enables/disables (masks) interrupts, while or_mask is the 32-bit mask value that enables interrupts.
Effectively, the function does the following,
To disable (mask) the SCU_IC_MASK_VBLANK_IN interrupt,
To unmask (enable) SCU_IC_MASK_VBLANK_IN, but mask SCU_IC_MASK_SPRITE_END,
To mask all interrupts,
To unmask all interrupts:
This is a BIOS call.
| and_mask | The bitwise AND mask. |
| or_mask | The bitwise OR mask. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Change value in the SCU IST register.
This function behaves exactly in the same way as scu_ic_mask_chg, except the SCU IST is changed.
| and_mask | The bitwise AND mask. |
| or_mask | The bitwise OR mask. |
|
inlinestatic |
Obtain a read-only pointer to the priority table.
The priority table is 128 bytes. Each priority table entry is 32-bits and is split between SR and SCU interrupt mask. Upper 16-bits is the SR interrupt mask value, and the lower 16-bits is the SCU interrupt mask value and is signed extended.
As an exmple, for HBLANK-IN, disable all interrupts, but allow VBLANK-IN and VBLANK-OUT.
Below is the decoded table:
| Vector | SR | SCU | SCU Interrupt | Value |
|---|---|---|---|---|
| 0x40 | 0x00F0 | 0xFFFF | VBLANK-IN | Mask all |
| 0x41 | 0x00E0 | 0xFFFE | VBLANK-OUT | Mask all, allow VBLANK-IN |
| 0x42 | 0x00D0 | 0xFFFC | HBLANK-IN | Mask all, allow VBLANK-IN, VBLANK-OUT |
| 0x43 | 0x00C0 | 0xFFF8 | Timer 0 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN |
| 0x44 | 0x00B0 | 0xFFF0 | Timer 1 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0 |
| 0x45 | 0x00A0 | 0xFFE0 | DSP End | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1 |
| 0x46 | 0x0090 | 0xFFC0 | Sound Request | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End |
| 0x47 | 0x0080 | 0xFF80 | System Manager | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request |
| 0x48 | 0x0080 | 0xFF80 | Pad Interrupt | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request |
| 0x49 | 0x0070 | 0xFE00 | Level 2 DMA End | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt |
| 0x4A | 0x0070 | 0xFE00 | Level 1 DMA End | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt |
| 0x4B | 0x0070 | 0xFE00 | Level 0 DMA End | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt |
| 0x4C | 0x0070 | 0xFE00 | DMA Illegal | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt |
| 0x4D | 0x0070 | 0xFE00 | Sprite End | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt |
| 0x4E | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x4F | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x50 | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x51 | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x52 | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x53 | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x54 | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x55 | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x56 | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x57 | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x58 | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x59 | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x5A | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x5B | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x5C | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x5D | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x5E | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt | |
| 0x5F | 0x0070 | 0xFE00 | Mask all, allow VBLANK-IN, VBLANK-OUT, HBLANK-IN, Timer 0, Timer 1, DSP End, Sound Request, Pad Interrupt |
This is a BIOS call.
|
inlinestatic |
Set the priority table.
For a detailed explanation, see scu_ic_priority_table_get.
The size of the table is irrelevant, as only 128 bytes will be considered.
This is a BIOS call.
| table | Pointer to the priority table. |