nds/bios.h File Reference

Nintendo DS Bios functions. More...

#include <nds/jtypes.h>

Data Structures

struct  DecompressionStream
struct  UnpackStruct

Defines

#define COPY_MODE_HWORD   (0)
#define COPY_MODE_WORD   (1<<26)
#define COPY_MODE_COPY   (0)
#define COPY_MODE_FILL   (1<<24)

Typedefs

typedef struct DecompressionStream TDecompressionStream
typedef struct UnpackStruct TUnpackStruct
typedef struct UnpackStructPUnpackStruct

Functions

void swiSoftReset (void)
 reset the DS.
void swiDelay (uint32 duration)
 delay
void swiIntrWait (int waitForSet, uint32 flags)
 wait for interrupt(s) to occur
void swiWaitForVBlank (void)
 Wait for vblank interrupt.
int swiDivide (int numerator, int divisor)
int swiRemainder (int numerator, int divisor)
void swiDivMod (int numerator, int divisor, int *result, int *remainder)
void swiCopy (const void *source, void *dest, int flags)
void swiFastCopy (const void *source, void *dest, int flags)
int swiSqrt (int value)
uint16 swiCRC16 (uint16 crc, void *data, uint32 size)
int swiIsDebugger (void)
void swiUnpackBits (uint8 *source, uint32 *destination, PUnpackStruct params)
void swiDecompressLZSSWram (void *source, void *destination)
int swiDecompressLZSSVram (void *source, void *destination, uint32 toGetSize, TDecompressionStream *stream)
int swiDecompressHuffman (void *source, void *destination, uint32 toGetSize, TDecompressionStream *stream)
void swiDecompressRLEWram (void *source, void *destination)
int swiDecompressRLEVram (void *source, void *destination, uint32 toGetSize, TDecompressionStream *stream)
void swiWaitForIRQ (void)
 wait for any interrupt
void swiSetHaltCR (uint32 data)
void swiDecodeDelta8 (void *source, void *destination)
void swiDecodeDelta16 (void *source, void *destination)


Detailed Description

Nintendo DS Bios functions.


Define Documentation

#define COPY_MODE_COPY   (0)

#define COPY_MODE_FILL   (1<<24)

#define COPY_MODE_HWORD   (0)

#define COPY_MODE_WORD   (1<<26)


Typedef Documentation

typedef struct UnpackStruct * PUnpackStruct

typedef struct DecompressionStream TDecompressionStream

typedef struct UnpackStruct TUnpackStruct


Function Documentation

swiCopy ( const void *  source,
void *  dest,
int  flags 
)

Parameters:
source pointer to transfer source
dest dest = pointer to transfer destination
flags copy mode and size flags(26) = transfer width (0: halfwords, 1: words) flags(24) = transfer mode (0: copy, 1: fill) flags(20..0) = transfer count (always in words)

uint16 swiCRC16 ( uint16  crc,
void *  data,
uint32  size 
)

void swiDecodeDelta16 ( void *  source,
void *  destination 
)

void swiDecodeDelta8 ( void *  source,
void *  destination 
)

int swiDecompressHuffman ( void *  source,
void *  destination,
uint32  toGetSize,
TDecompressionStream stream 
)

int swiDecompressLZSSVram ( void *  source,
void *  destination,
uint32  toGetSize,
TDecompressionStream stream 
)

void swiDecompressLZSSWram ( void *  source,
void *  destination 
)

int swiDecompressRLEVram ( void *  source,
void *  destination,
uint32  toGetSize,
TDecompressionStream stream 
)

void swiDecompressRLEWram ( void *  source,
void *  destination 
)

swiDelay ( uint32  duration  ) 

delay

Delays for for a period X + Y*duration where X is the swi overhead and Y is a cycle of

     loop:
       sub r0, #1
       bgt loop
of thumb fetches in BIOS memory
Parameters:
duration length of delay
Note:
Duration should be 1 or more, a duration of 0 is a huge delay

int swiDivide ( int  numerator,
int  divisor 
)

Parameters:
numerator signed integer to divide
divisor signed integer to divide by
Returns:
numerator / divisor

void swiDivMod ( int  numerator,
int  divisor,
int *  result,
int *  remainder 
)

Parameters:
numerator signed integer to divide
divisor signed integer to divide by
result pointer to integer set to numerator / divisor
remainder pointer to integer set to numerator % divisor

swiFastCopy ( const void *  source,
void *  dest,
int  flags 
)

Parameters:
source pointer to transfer source
dest dest = pointer to transfer destination
flags copy mode and size flags(24) = transfer mode (0: copy, 1: fill) flags(20..0) = transfer count (in words)
Note:
Transfers more quickly than swiCopy, but has higher interrupt latency

swiIntrWait ( int  waitForSet,
uint32  flags 
)

wait for interrupt(s) to occur

Parameters:
waitForSet 0: Return if the interrupt has already occured 1: Wait until the interrupt has been set since the call
flags interrupt mask to wait for

int swiIsDebugger ( void   ) 

int swiRemainder ( int  numerator,
int  divisor 
)

Parameters:
numerator signed integer to divide
divisor signed integer to divide by
Returns:
numerator % divisor

void swiSetHaltCR ( uint32  data  ) 

swiSoftReset ( void   ) 

reset the DS.

int swiSqrt ( int  value  ) 

void swiUnpackBits ( uint8 source,
uint32 destination,
PUnpackStruct  params 
)

swiWaitForIRQ ( void   ) 

wait for any interrupt

Note:
ARM9 exclusive

swiWaitForVBlank ( void   ) 

Wait for vblank interrupt.

Waits for a vertical blank interrupt

Note:
Identical to calling swiIntrWait(1, 1)


Generated on Tue Jan 22 15:48:57 2008 for libnds(ARM9) by  doxygen 1.5.4