The BIOS Functions Module can be used to execute functions from the GBA's BIOS. Several functions expect halfword or word-aligned memory addresses to work properly.
The debug library contains a memory address-checking-mechanism which will display an error when an incoming parameter contains an invalid memory address. Invalid in sense of wrong alignment.
| void ATTR_NOINLINE ATTR_NOINSTRUMENT hel_SwiCpuFastCopy | ( | void * | pDst, | |
| const void * | pSrc, | |||
| u32 | LengthInWords | |||
| ) |
Copy a block of memory.
| [in] | pDst | Pointer to copy destination (must be word aligned). |
| [in] | pSrc | Pointer to block to copy (must be word aligned). |
| [in] | LengthInWords | Length in 32bit words of block to copy. This value must be multiple of 8, which means you can only copy blocks of memory which are multiple 32bytes. |
// copy 256 bytes from pSrc to pDest hel_SwiCpuFastCopy(pDst, pSrc, 256/sizeof(u32));
| void ATTR_NOINLINE ATTR_NOINSTRUMENT hel_SwiHalt | ( | void | ) |
Switch CPU into low-power mode.
hel_SwiHalt switch the CPU into low-power mode. The Halt mode is terminated when any interrupt becomes executed.
| void hel_SwiLZ77UnCompVram | ( | void * | pDst, | |
| const void * | pSrc | |||
| ) |
Expand LZ77-compressed data.
| [in] | pDst | Destination address, must be halfword aligned! |
| [in] | pSrc | Source address, must be word aligned and data size must be multiple 4. |
| void hel_SwiLZ77UnCompWram | ( | void * | pDst, | |
| const void * | pSrc | |||
| ) |
Expand LZ77-compressed data.
| [in] | pDst | Destination address. |
| [in] | pSrc | Source address, must be word aligned and data size must be multiple 4. |
| void hel_SwiRLUnCompVram | ( | void * | pDst, | |
| const void * | pSrc | |||
| ) |
Expand Run-Length-Encoded data.
| [in] | pDst | Destination address, must be halfword aligned! |
| [in] | pSrc | Source address, must be word aligned and data size must be multiple 4. |
| void hel_SwiRLUnCompWram | ( | void * | pDst, | |
| const void * | pSrc | |||
| ) |
Expand Run-Length-Encoded data.
| [in] | pDst | Destination address. |
| [in] | pSrc | Source address, must be word aligned and data size must be multiple 4. |
| void ATTR_NOINLINE ATTR_NOINSTRUMENT hel_SwiSoftReset | ( | u32 | ReturnAddr | ) |
Reset device.
hel_SwiSoftReset clears the CPU internal RAM area from 3007E00h-3007FFFh, initializes system, supervisor, and irq stack pointers, and sets R0-R12 to zero, and enters system mode.
| [in] | ReturnAddr | Return address selection (0 for 0x8000000, 1-255 for 0x2000000) |
| void hel_SwiUnComp | ( | void * | pDst, | |
| const void * | pSrc, | |||
| u32 | CompressionType | |||
| ) |
Expand compressed data.
| [in] | pDst | Destination address |
| [in] | pSrc | Source address |
| [in] | CompressionType | Compression-type of source data. This can be one of the following predefines values:
|
| void ATTR_NOINLINE ATTR_NOINSTRUMENT hel_SwiVBlankIntrWait | ( | void | ) |
Wait for Vertical Blank interrupt.
The hel_SwiVBlankIntrWait function calls SWI 5, which continues to wait in Halt status until a new Vertical Blank interrupt occurs.
1.5.3