KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Memory Card Function

API for features of the Memory Card Maple Function More...

Functions

int vmu_block_read (maple_device_t *dev, uint16_t blocknum, uint8_t *buffer)
 Read a block from a memory card.
 
int vmu_block_write (maple_device_t *dev, uint16_t blocknum, const uint8_t *buffer)
 Write a block to a memory card.
 

Detailed Description

API for features of the Memory Card Maple Function

The Memory Card Maple function is for exposing a low-level, block-based API that allows you to read from and write to random blocks within the memory card's filesystem.

Note
A standard memory card has a block size of 512 bytes; however, the block size is a configurable parameter in the "root" block, which can be queried to cover supporting homebrew memory cards with larger block sizes.
Warning
You should never use these functions directly, unless you really know what you're doing, as you can easily corrupt the filesystem by writing incorrect data. Instead, you should favor the high-level filesystem API found in vmufs.h, or just use the native C standard filesystem API within the virtual /vmu/ root directory to operate on VMU data.

Function Documentation

◆ vmu_block_read()

int vmu_block_read ( maple_device_t * dev,
uint16_t blocknum,
uint8_t * buffer )

Read a block from a memory card.

This function performs a low-level raw block read from a memory card.

Parameters
devThe device to read from.
blocknumThe block number to read.
bufferThe buffer to read into (512 bytes).
Return values
MAPLE_EOKOn success.
MAPLE_ETIMEOUTIf the command timed out while blocking.
MAPLE_EFAILOn errors other than timeout.
See also
vmu_block_write

◆ vmu_block_write()

int vmu_block_write ( maple_device_t * dev,
uint16_t blocknum,
const uint8_t * buffer )

Write a block to a memory card.

This function performs a low-level raw block write to a memory card.

Parameters
devThe device to write to.
blocknumThe block number to write.
bufferThe buffer to write from (512 bytes).
Return values
MAPLE_EOKOn success.
MAPLE_ETIMEOUTIf the command timed out while blocking.
MAPLE_EFAILOn errors other than timeout.
See also
vmu_block_read