libmsx
C library for MSX
Loading...
Searching...
No Matches
Reading and copying from resource in banked memory.

APIs for indirect access to banked memory by name. More...

+ Collaboration diagram for Reading and copying from resource in banked memory.:

Functions

void resource_copy_to_vmem (const char *path, vmemptr_t dst)
 Copy a resource in banked memory to VRAM.
 
void resource_bload_s (const char *path)
 Load a BSAVE formatted binary resource in banked memory into VRAM.
 

Detailed Description

APIs for indirect access to banked memory by name.

Banked memory is treated as a ROM with one large address space, and as storage of named embedded resources.

Function Documentation

◆ resource_copy_to_vmem()

void resource_copy_to_vmem ( const char *  path,
vmemptr_t  dst 
)

Copy a resource in banked memory to VRAM.

Searches for an embedded resource in banked memory by name and copy it into the specified address in VRAM. If the resource is not found, do nothing.

This function is same as the following code:

c
const ResourceIndex * res = resource_find(path);
if (res) {
bmem_copy_to_vmem(res->offset, dst, res->size);
}
void bmem_copy_to_vmem(bmemptr_t src, vmemptr_t dst, uint32_t len)
Copy from banked memory to VRAM.
const ResourceIndex * resource_find(const char *path)
Find an embedded resource by name.
Index record of an embedded resource.
Definition resources.h:45
Parameters
pathpath/file name of the resource.
dstdestination address of VRAM.
See also
bmem_copy_to_vmem()

◆ resource_bload_s()

void resource_bload_s ( const char *  path)

Load a BSAVE formatted binary resource in banked memory into VRAM.

Searches for an embedded resource in banked memory by name and loads it into VRAM as a BSAVE formatted binary. If the resource is not found, or is not a BSAVE formatted binary, do nothing.

This function is same as the following code:

c
const ResourceIndex * res = resource_find(path);
if (res) {
bmem_bload_s(res->offset);
}
void bmem_bload_s(bmemptr_t src)
Load a BSAVE formatted binary in banked memory into VRAM.
Parameters
pathpath/file name of the resource.
See also
bmem_bload_s()