libnds
Data Structures | Macros | Typedefs | Functions
memory.h File Reference

Defines for many of the regions of memory on the DS as well as a few control functions for memory bus access. More...

#include "ndstypes.h"
#include <assert.h>

Data Structures

struct  sGBAHeader
 the GBA file header format. See gbatek for more info. More...
 
struct  sNDSBanner
 the NDS banner format. See gbatek for more information. More...
 
struct  sNDSHeader
 the NDS file header format See gbatek for more info. More...
 

Macros

#define ALLRAM   ((u8*)0x00000000)
 8 bit pointer to the start of all the ram.
 
#define GBA_BUS   ((vu16 *)(0x08000000))
 16 bit volatile pointer to the GBA slot bus.
 
#define GBAROM   ((u16*)0x08000000)
 16 bit pointer to the GBA slot ROM.
 
#define MAINRAM16   ((u16*)0x02000000)
 16 bit pointer to main ram.
 
#define MAINRAM32   ((u32*)0x02000000)
 32 bit pointer to main ram.
 
#define MAINRAM8   ((u8*)0x02000000)
 8 bit pointer to main ram.
 
#define SRAM   ((u8*)0x0A000000)
 8 bit pointer to GBA slot Save ram.
 

Typedefs

typedef struct sGBAHeader tGBAHeader
 the GBA file header format. See gbatek for more info.
 
typedef struct sNDSBanner tNDSBanner
 the NDS banner format. See gbatek for more information.
 
typedef struct sNDSHeader tNDSHeader
 the NDS file header format See gbatek for more info.
 

Functions

void sysSetBusOwners (bool arm9rom, bool arm9card)
 Sets the owner of the DS card bus (slot 1) and gba cart bus (slot 2). Only one cpu may access the device at a time. More...
 
void sysSetCardOwner (bool arm9)
 Sets the owner of the DS card bus. Both CPUs cannot have access to the DS card bus (slot 1). More...
 
void sysSetCartOwner (bool arm9)
 Sets the owner of the GBA cart. Both CPUs cannot have access to the gba cart (slot 2). More...
 

Detailed Description

Defines for many of the regions of memory on the DS as well as a few control functions for memory bus access.

Function Documentation

static void sysSetBusOwners ( bool  arm9rom,
bool  arm9card 
)
inline

Sets the owner of the DS card bus (slot 1) and gba cart bus (slot 2). Only one cpu may access the device at a time.

Parameters
arm9romif true the arm9 is the owner of slot 2, otherwise the arm7
arm9cardif true the arm9 is the owner of slot 1, otherwise the arm7
static void sysSetCardOwner ( bool  arm9)
inline

Sets the owner of the DS card bus. Both CPUs cannot have access to the DS card bus (slot 1).

Parameters
arm9if true the arm9 is the owner, otherwise the arm7
static void sysSetCartOwner ( bool  arm9)
inline

Sets the owner of the GBA cart. Both CPUs cannot have access to the gba cart (slot 2).

Parameters
arm9if true the arm9 is the owner, otherwise the arm7