The SGADE Documentation

the SGADE The Socrates Gameboy Advance Development Engine

The SGADE is a development library for the Nintendo Gameboy Advance. It's free for all uses and is distributed without guarantees. For more information visit the SGADE page.


Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

SoFlashMem

SRam handling functionality. More...

Files

file  SoFlashMem.c
file  SoFlashMem.h

Functions

u16 SoFlashMemSaveByte (u16 a_Offset, u8 a_Value)
 Saves a byte (8 bit) into SRAM.

u16 SoFlashMemSaveHalfword (u16 a_Offset, u16 a_Value)
 Saves a halfword (16 bit) into SRAM.

u16 SoFlashMemSaveWord (u16 a_Offset, u32 a_Value)
 Saves a word (32 bit) into SRAM.

u16 SoFlashMemSaveBuffer (u16 a_Offset, u16 a_Length, u8 *a_Buffer)
 Saves a buffer into SRAM.

u8 SoFlashMemLoadByte (u16 a_Offset)
 Loads a byte (8 bit) from SRAM.

u16 SoFlashMemLoadHalfword (u16 a_Offset)
 Loads a halfword (16 bit) from SRAM.

u32 SoFlashMemLoadWord (u16 a_Offset)
 Loads a word (32 bit) from SRAM.

u16 SoFlashMemLoadBuffer (u16 a_Offset, u16 a_Length, u8 *a_Buffer)
 Loads a buffer from SRAM.


Detailed Description

SRam handling functionality.

Singleton

This module is for saving and loading data in SRAM (flash memory) on GBA Rom packs. For example, you can use it for savegames, highscores, etc. etc.


Function Documentation

u16 SoFlashMemLoadBuffer u16    a_Offset,
u16    a_Length,
u8   a_Buffer
 

Loads a buffer from SRAM.

Parameters:
a_Offset  Offset against the start of SRAM. Location you want to read from.
a_Length  Length of the buffer you want to read.
Return values:
a_Buffer  Buffer you want to put the data into.
Returns :
Amount of bytes read. Subtract this from a_Offset to get the new offset.

u8 SoFlashMemLoadByte u16    a_Offset
 

Loads a byte (8 bit) from SRAM.

Parameters:
a_Offset  Offset against the start of SRAM. Location you want to read from.
Returns :
The byte read.

u16 SoFlashMemLoadHalfword u16    a_Offset
 

Loads a halfword (16 bit) from SRAM.

Parameters:
a_Offset  Offset against the start of SRAM. Location you want to read from.
Returns :
The halfword read.

u32 SoFlashMemLoadWord u16    a_Offset
 

Loads a word (32 bit) from SRAM.

Parameters:
a_Offset  Offset against the start of SRAM. Location you want to read from.
Returns :
The word read.

u16 SoFlashMemSaveBuffer u16    a_Offset,
u16    a_Length,
u8   a_Buffer
 

Saves a buffer into SRAM.

Parameters:
a_Offset  Offset against the start of SRAM. Location you want to write.
a_Length  Number of bytes in the buffer.
a_Buffer  Start of the buffer
Returns :
The amount of bytes written. Add this to a_Offset to get the new offset.

u16 SoFlashMemSaveByte u16    a_Offset,
u8    a_Value
 

Saves a byte (8 bit) into SRAM.

Parameters:
a_Offset  Offset against the start of SRAM. Location you want to write.
a_Value  Value you want to write in SRAM.
Returns :
The amount of bytes written. Add this to a_Offset to get the new offset.

u16 SoFlashMemSaveHalfword u16    a_Offset,
u16    a_Value
 

Saves a halfword (16 bit) into SRAM.

Parameters:
a_Offset  Offset against the start of SRAM. Location you want to write.
a_Value  Value you want to write in SRAM.
Returns :
The amount of bytes written. Add this to a_Offset to get the new offset.

u16 SoFlashMemSaveWord u16    a_Offset,
u32    a_Value
 

Saves a word (32 bit) into SRAM.

Parameters:
a_Offset  Offset against the start of SRAM. Location you want to write.
a_Value  Value you want to write in SRAM.
Returns :
The amount of bytes written. Add this to a_Offset to get the new offset.


Copyright 2002 by the SGADE authors. See SoLicense.h or Visit the SGADE page for more information.