BIOS informalities
[Bios Calls]
Data Structures | |
| struct | BUP |
| BitUpPack ( for swi 10h). More... | |
| struct | MultiBootParam |
| Multiboot struct. More... | |
SoftReset flags | |
| #define | ROM_RESTART 0x00 |
| Restart from ROM entry point. | |
| #define | RAM_RESTART 0x01 |
| Restart from RAM entry point. | |
RegisterRamReset flags | |
| #define | RESET_EWRAM 0x0001 |
| Clear 256K on-board WRAM. | |
| #define | RESET_IWRAM 0x0002 |
| Clear 32K in-chip WRAM. | |
| #define | RESET_PALETTE 0x0004 |
| Clear Palette. | |
| #define | RESET_VRAM 0x0008 |
| Clear VRAM. | |
| #define | RESET_OAM 0x0010 |
| Clear OAM. does NOT disable OBJs! | |
| #define | RESET_REG_SIO 0x0020 |
| Switches to general purpose mode. | |
| #define | RESET_REG_SOUND 0x0040 |
| Reset Sound registers. | |
| #define | RESET_REG 0x0080 |
| All other registers. | |
| #define | RESET_MEM_MASK 0x001F |
| Clear 256K on-board WRAM. | |
| #define | RESET_REG_MASK 0x00E0 |
| Clear 256K on-board WRAM. | |
| #define | RESET_GFX 0x001C |
| Clear all gfx-related memory. | |
Cpu(Fast)Set flags | |
| #define | CS_CPY 0 |
| Copy mode. | |
| #define | CS_FILL (1<<24) |
| Fill mode. | |
| #define | CS_CPY16 0 |
| Copy in halfwords. | |
| #define | CS_CPY32 (1<<26) |
| Copy words. | |
| #define | CS_FILL32 (5<<24) |
| Fill words. | |
| #define | CFS_CPY CS_CPY |
| Copy words. | |
| #define | CFS_FILL CS_FILL |
| Fill words. | |
ObjAffineSet P-element offsets | |
| #define | BG_AFF_OFS 2 |
| BgAffineDest offsets. | |
| #define | OBJ_AFF_OFS 8 |
| ObjAffineDest offsets. | |
Decompression routines | |
| #define | BUP_ALL_OFS (1<<31) |
| #define | LZ_TYPE 0x00000010 |
| #define | LZ_SIZE_MASK 0xFFFFFF00 |
| #define | LZ_SIZE_SHIFT 8 |
| #define | HUF_BPP_MASK 0x0000000F |
| #define | HUF_TYPE 0x00000020 |
| #define | HUF_SIZE_MASK 0xFFFFFF00 |
| #define | HUF_SIZE_SHIFT 8 |
| #define | RL_TYPE 0x00000030 |
| #define | RL_SIZE_MASK 0xFFFFFF00 |
| #define | RL_SIZE_SHIFT 8 |
| #define | DIF_8 0x00000001 |
| #define | DIF_16 0x00000002 |
| #define | DIF_TYPE 0x00000080 |
| #define | DIF_SIZE_MASK 0xFFFFFF00 |
| #define | DIF_SIZE_SHIFT 8 |
Multiboot modes | |
| #define | MBOOT_NORMAL 0x00 |
| #define | MBOOT_MULTI 0x01 |
| #define | MBOOT_FAST 0x02 |
Defines | |
| #define | swi_call(x) asm volatile("swi\t"#x"<<16" ::: "r0", "r1", "r2", "r3") |
| BIOS calls from C. | |
Define Documentation
| #define swi_call | ( | x | ) | asm volatile("swi\t"#x"<<16" ::: "r0", "r1", "r2", "r3") |
BIOS calls from C.
You can use this macro in a C BIOS-call wrapper. The wrapper should declare the flags, then this call will do the rest.
- Parameters:
-
x Number of swi call (THUMB number)
- Note:
- It checks the __thumb__ #define to see whether we're in ARM or THUMB mode and fixes the swi number accordingly. Huzzah for the C proprocessor!
Generated on Mon Aug 25 17:03:57 2008 for libtonc by
1.5.3