Commit Graph

161 Commits

Author SHA1 Message Date
Kevin Bortis
6be36b6bda Add Zstandard compression support
Implements zstd as an alternative to LZMA for data block and
subchannel compression using the allocated compression IDs 4
(kCompressionZstd) and 5 (kCompressionZstdCst).

Adds zstd v1.5.7 as a bundled submodule with a static library
build including x86_64 assembly fast path for decompression.

Write path selects zstd or LZMA based on the zstd option.
Subchannel blocks use zstd+CST instead of LZMA+CST when enabled.
LZMA properties header is only written for LZMA-based compression
types, preventing format corruption in zstd-compressed images.

Activated via options string: "zstd=true;zstd_level=19".
Default remains LZMA for backwards compatibility.

Tested: SHA-256 verified lossless roundtrips across 9 disc systems
(Dreamcast, Saturn, Mega CD, PC Engine CD, Neo Geo CD, PS1, PS2 CD,
PS2 DVD) and PS1 SBI subchannel preservation with zstd+CST.
2026-03-19 08:45:07 +01:00
Kevin Bortis
95908b328a Reserve compression IDs 4 and 5 for Zstandard (zstd)
Adds kCompressionZstd = 4 and kCompressionZstdCst = 5 to the
CompressionType enum, following the existing LZMA/LzmaCst pattern.

Ref: https://github.com/aaru-dps/libaaruformat/issues/5
2026-03-18 22:20:26 +01:00
694601cc63 Enhance Wii junk data handling: reconstruct junk in user data area during read and write operations 2026-03-16 22:54:53 +00:00
5b93c56e7b Add support for Nintendo Wii and GameCube junk map and encryption: implement lazy initialization for NgcwJunkEntry and WiiPartitionRegion 2026-03-16 18:34:24 +00:00
53bbb3c7a6 Add new data types for Nintendo Wii and GameCube: introduce WiiPartitionKeyMap and NgcwJunkMap for enhanced region mapping 2026-03-16 18:31:27 +00:00
7ee97105b5 Add new sector status: introduce SectorStatusGenerable to indicate content that can be generated using a known algorithm 2026-03-16 17:28:54 +00:00
913d0508a2 Add recursion guard for Wii U re-encryption: implement flag to prevent recursive calls during sector processing 2026-03-16 13:28:16 +00:00
93357cbf1f Add Wii U encryption support to context structure and cleanup logic 2026-03-16 11:11:40 +00:00
5857e16662 Add Wii U partition-to-key mapping to enums and media tags 2026-03-16 10:51:17 +00:00
73dac131b8 Implement PS3 encryption support with lazy initialization and error handling 2026-03-15 19:12:59 +00:00
d53faf7a38 Rename track type enums for consistency 2026-03-15 18:18:15 +00:00
3d81f50afe Rename data type enum. 2026-03-14 21:45:02 +00:00
a5b8054a14 Rename compression enum. 2026-03-14 20:39:56 +00:00
6fa82b4dfe Add feature compatibility checks for V2+ images and define new error codes 2026-03-14 18:52:51 +00:00
1516e9ff24 Add PS3 related media tags. 2026-03-09 20:11:07 +00:00
30965a0c94 Add Nintendo Wii U disc key to enums and update related functions 2026-03-08 19:59:28 +00:00
4df22c47ef Add Floppy Write-Protect status to media tag and data type enums 2026-01-06 14:00:55 +00:00
Rebecca Wallander
c412030a8b Use block alignment offset instead of absolute offset 2026-01-01 13:37:21 +01:00
Rebecca Wallander
86b6680e3e Add data type to datastream block 2026-01-01 13:37:20 +01:00
Rebecca Wallander
65d34b1e9a Add flux implementation 2026-01-01 13:35:43 +01:00
3dc11ee8b1 Add static LRU hash map implementation with LRU-like eviction.
Not yet used.
2025-12-31 12:03:16 +00:00
b7e0f60673 Guard against writes of too big sectors. 2025-12-30 20:14:18 +00:00
7f0dea2755 Repurpose two unused header fields to store biggest image sector size. 2025-12-30 20:13:39 +00:00
3385caac5d Fix typo in secondary DDTv2 identifier (back-compatible until out of alpha). 2025-12-30 11:12:00 +00:00
43be8e89dd Change sector parameter types from uint16_t to uint32_t for negative and overflow sectors 2025-12-29 16:19:41 +00:00
2ce7e053e0 Add function to free Compact Disc ECC context and update cleanup logic 2025-12-28 17:04:14 +00:00
a93dcfc3d4 Add cache management functions and implement free callback for cached values 2025-12-28 16:57:19 +00:00
955789a160 Increase size of negative and overflow sectors in DDT2 to 32-bit. 2025-12-26 09:39:13 +00:00
050810c91d Update copyright year to 2026. 2025-12-23 08:23:40 +00:00
ced56fad6c Added second layer DVD PFI structure data type. 2025-12-13 11:59:19 +00:00
03c091fdee Add dirty flags so structures only get rewritten on resume if they are changed. 2025-12-12 12:22:39 +00:00
bbcadedd7e Fix declaration of aaruf_open. 2025-10-21 14:24:56 +01:00
f7da1e27bd Add support for resuming images. 2025-10-21 14:02:47 +01:00
94e44ef304 Do not consider rewinded the first time block 0 is written. 2025-10-20 01:13:14 +01:00
5cfffbcb68 Add function to retrieve readable media tags 2025-10-18 17:53:38 +01:00
0bb3a3376b Add function to retrieve readable sector tags 2025-10-18 17:46:43 +01:00
36be5c9c8a Add functions to retrieve all tape files and partitions from AaruFormat images 2025-10-13 17:02:00 +01:00
556537c79e Add functions to clear various metadata fields in AaruFormat images 2025-10-13 14:24:51 +01:00
e2f3323a04 Sync specification with code. 2025-10-11 13:17:26 +01:00
dde81f6773 Add sector status parameter to read sector functions 2025-10-11 12:42:32 +01:00
b4df385b79 Add AARU_EXPORT and AARU_CALL macros to function implementations for consistency 2025-10-11 03:30:19 +01:00
61850a9520 Update DDT entry documentation to indicate 64-bit values 2025-10-11 01:34:22 +01:00
e9f2dad6bf Fix typo in aaruformatContext structure documentation 2025-10-10 22:37:52 +01:00
c4564b3a0a Use specific block type for secondary level DDTs v2. 2025-10-10 22:18:00 +01:00
ffe9311a74 Fix some places where the DDT was still being used with 32-bit values. 2025-10-10 11:45:18 +01:00
17e1c0f2bd Set DDTv2 as 64-bit and remove concept of multiple sizes of DDTs. 2025-10-10 02:39:57 +01:00
4a915ee152 Add missing include for aaru.h in decls.h 2025-10-09 16:59:41 +01:00
791a7f8879 Add function to retrieve deep copy of ImageInfo structure from AaruFormat image 2025-10-09 15:39:22 +01:00
ef76712380 Add functions to retrieve user, negative, and overflow sectors in AaruFormat images 2025-10-09 14:59:45 +01:00
ac0e2610e1 Refactor context structure for improved padding 2025-10-09 02:37:46 +01:00