59#define MEM_SEEK_SET (0)
66#define MEM_SEEK_CUR (1)
73#define MEM_SEEK_END (2)
160 mfread(mf, &x,
sizeof(x));
173 mfread(mf, &x,
sizeof(x));
Data types and functions for accessing banked memory.
uint32_t bmemptr_t
Type of an address of banked memory.
bool mfeof(MemFile *mf)
Return true if reached to the end of stream.
void mfopen_mem(MemFile *mf, uint8_t *p, size_t size)
Open memory image in ROM/RAM as stream.
void mfopen_bmem(MemFile *mf, bmemptr_t p, uint32_t size)
Open memory image in banked memory (MegaROM) as stream.
void mfslice(MemFile *dst, const MemFile *src, long size)
Open a new stream with the specified size range from the current position.
size_t mfread(MemFile *mf, void *ptr, size_t size)
Read some bytes from stream pointed by mf.
uint8_t mfread_u8(MemFile *mf)
Read the next byte from stream pointed by mf.
uint16_t mfread_u16(MemFile *mf)
Read the next 16-bit of little-endian value from stream pointed by mf.
uint32_t mfread_u32(MemFile *mf)
Read the next 32-bit of little-endian value from stream pointed by mf.
void mfsetpos(MemFile *mf, const mempos_t *pos)
Set the stream position indicator of the stream pointed by mf.
void mfsetpos2(MemFile *mf, const mempos_t *base, long offset)
Set the stream position indicator of the stream pointed by mf.
void mfseek(MemFile *mf, long offset, int whence)
Set the stream position indicator for the stream pointed by mf.
void mfgetpos(MemFile *mf, mempos_t *pos)
Get the stream position indicator of the stream pointed by mf.
struct MemPos base
base position
Internal structure of MemFile type.
Internal structure of mempos_t type.