libtonc
BIOS informalities

Modules

 BIOS functions
 

Data Structures

struct  BUP
 BitUpPack ( for swi 10h) More...
 
struct  MultiBootParam
 Multiboot struct. More...
 

Multiboot modes

typedef struct BUP BUP
 BitUpPack ( for swi 10h)
 
#define MBOOT_NORMAL   0x00
 BIOS calls from C.
 
#define MBOOT_MULTI   0x01
 BIOS calls from C.
 
#define MBOOT_FAST   0x02
 BIOS calls from C.
 
#define swi_call(x)   __asm("swi\t"#x"<<16" ::: "r0", "r1", "r2", "r3")
 BIOS calls from C.
 

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
 

Detailed Description

Macro Definition Documentation

◆ MBOOT_FAST

#define MBOOT_FAST   0x02

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
xNumber 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!
Deprecated:
This macro will not work properly for functions that have IO.

◆ MBOOT_MULTI

#define MBOOT_MULTI   0x01

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
xNumber 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!
Deprecated:
This macro will not work properly for functions that have IO.

◆ MBOOT_NORMAL

#define MBOOT_NORMAL   0x00

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
xNumber 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!
Deprecated:
This macro will not work properly for functions that have IO.

◆ swi_call

#define swi_call (   x)    __asm("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
xNumber 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!
Deprecated:
This macro will not work properly for functions that have IO.