libmsx
C library for MSX
Loading...
Searching...
No Matches
ZX0 decompressor.

Decompressor of the ZX0 data compression format version 2. More...

+ Collaboration diagram for ZX0 decompressor.:

Functions

size_t ZX0_decompress (const uint8_t *src, uint8_t *dst)
 MSX Decompress a ZX0 data stream.
 
size_t ZX0_decompress_bmem (bmemptr_t src, uint8_t *dst)
 MSX Decompress a ZX0 data stream in Banked Memory.
 
uint32_t ZX0_decompress_bmem_to_vmem (bmemptr_t src, vmemptr_t dst)
 MSX Decompress a ZX0 data stream in Banked Memory to VRAM.
 
uint32_t ZX0_decompress_bmem_to_vmem_buffer (bmemptr_t src, vmemptr_t dst)
 MSX2 Decompress a ZX0 data stream in Banked Memory to VRAM via main RAM page #0 buffer.
 
uint32_t ZX0_decompress_resource_to_vmem (const char *path, vmemptr_t dst)
 MSX Decompress a ZX0 resource in banked memory to VRAM.
 
uint32_t ZX0_decompress_resource_to_vmem_buffer (const char *path, vmemptr_t dst)
 MSX2 Decompress a ZX0 resource in banked memory to VRAM via main RAM page #0 buffer.
 

Detailed Description

Decompressor of the ZX0 data compression format version 2.

Function Documentation

◆ ZX0_decompress()

size_t ZX0_decompress ( const uint8_t *  src,
uint8_t *  dst 
)

MSX Decompress a ZX0 data stream.

Parameters
srcPointer to ZX0 data stream.
dstDestination base address.
Returns
Length (in bytes) of the decompressed data.

◆ ZX0_decompress_bmem()

size_t ZX0_decompress_bmem ( bmemptr_t  src,
uint8_t *  dst 
)

MSX Decompress a ZX0 data stream in Banked Memory.

Parameters
srcPointer to ZX0 data stream in Banked Memory.
dstDestination base address.
Returns
Length (in bytes) of the decompressed data.

◆ ZX0_decompress_bmem_to_vmem()

uint32_t ZX0_decompress_bmem_to_vmem ( bmemptr_t  src,
vmemptr_t  dst 
)

MSX Decompress a ZX0 data stream in Banked Memory to VRAM.

Parameters
srcPointer to ZX0 data stream in Banked Memory.
dstDestination base address.
Returns
Length (in bytes) of the decompressed data.

◆ ZX0_decompress_bmem_to_vmem_buffer()

uint32_t ZX0_decompress_bmem_to_vmem_buffer ( bmemptr_t  src,
vmemptr_t  dst 
)

MSX2 Decompress a ZX0 data stream in Banked Memory to VRAM via main RAM page #0 buffer.

High throughput (but low responsiveness) version of ZX0_decompress_bmem_to_vmem().

This function uses main RAM page #0 as 16KiB buffer for faster decompression.

Parameters
srcPointer to ZX0 data stream in Banked Memory.
dstDestination base address.
Returns
Length (in bytes) of the decompressed data.
Note
This is available for MSX1 w/ 64KiB main RAM if main RAM resides in same slot.
But some MSX1 has only 8, 16, or 32 KiB main RAM. Or even if it has 64KiB main RAM, some part of main RAM may resides in different slot. This function does not support such MSX1. So it is described as for MSX2 or later.

◆ ZX0_decompress_resource_to_vmem()

uint32_t ZX0_decompress_resource_to_vmem ( const char *  path,
vmemptr_t  dst 
)

MSX Decompress a ZX0 resource in banked memory to VRAM.

Searches for an embedded resource in banked memory by name and decmompress 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) {
return ZX0_decompress_bmem_to_vmem(res->offset, dst);
}
return 0;
const ResourceIndex * resource_find(const char *path)
Find an embedded resource by name.
Index record of an embedded resource.
Definition resources.h:45
uint32_t ZX0_decompress_bmem_to_vmem(bmemptr_t src, vmemptr_t dst)
MSX Decompress a ZX0 data stream in Banked Memory to VRAM.
Parameters
pathpath/file name of the resource.
dstdestination address of VRAM.
Returns
size of decompressed image.
See also
ZX0_decompress_bmem_to_vmem()

◆ ZX0_decompress_resource_to_vmem_buffer()

uint32_t ZX0_decompress_resource_to_vmem_buffer ( const char *  path,
vmemptr_t  dst 
)

MSX2 Decompress a ZX0 resource in banked memory to VRAM via main RAM page #0 buffer.

High throughput (but low responsiveness) version of ZX0_decompress_resource_to_vmem().

This function uses main RAM page #0 as 16KiB buffer for faster decompression.

This function is same as the following code:

c
const ResourceIndex * res = resource_find(path);
if (res) {
return ZX0_decompress_bmem_to_vmem_buffer(res->offset, dst);
}
return 0;
uint32_t ZX0_decompress_bmem_to_vmem_buffer(bmemptr_t src, vmemptr_t dst)
MSX2 Decompress a ZX0 data stream in Banked Memory to VRAM via main RAM page #0 buffer.
Parameters
pathpath/file name of the resource.
dstdestination address of VRAM.
Returns
size of decompressed image.
Note
This is available for MSX1 w/ 64KiB main RAM if main RAM resides in same slot.
But some MSX1 has only 8, 16, or 32 KiB main RAM. Or even if it has 64KiB main RAM, some part of main RAM may resides in different slot. This function does not support such MSX1. So it is described as for MSX2 or later.
See also
ZX0_decompress_bmem_to_vmem_buffer()