@gaialabs/core 0.1.17 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,72 +1,4 @@
1
- import { ICompressionProvider, BinType, DbPath, StatusFlags, DbRoot, AddressType, DbStringType, StringWrapper, Op, OpCode, ChunkFile, AsmBlock, Address, CopDef, DbEntryPoint } from '@gaialabs/shared';
2
-
3
- /**
4
- * QuintetLZ compression algorithm implementation
5
- * Dictionary-based compression used in Quintet games
6
- */
7
- declare class QuintetLZ implements ICompressionProvider {
8
- static readonly DICTIONARY_SIZE = 256;
9
- static readonly DICTIONARY_INIT = 32;
10
- static readonly DICTIONARY_OFFSET = 239;
11
- private static readonly DEFAULT_PAGE_SIZE;
12
- /**
13
- * Expand (decompress) data using QuintetLZ algorithm
14
- * @param srcData Source data buffer
15
- * @param srcPosition Starting position in source data
16
- * @param srcLen Length of source data to process
17
- * @returns Expanded data
18
- */
19
- expand(srcData: Uint8Array, srcPosition?: number, srcLen?: number): Uint8Array;
20
- /**
21
- * Compact (compress) data using QuintetLZ algorithm
22
- * @param srcData Source data to compress
23
- * @returns Compressed data
24
- */
25
- compact(srcData: Uint8Array): Uint8Array;
26
- }
27
-
28
- /**
29
- * Register compression providers with the global registry
30
- */
31
- declare function registerCompressionProviders(): void;
32
-
33
- /**
34
- * Main project management class
35
- * Converted from GaiaLib/ProjectRoot.cs
36
- */
37
- interface ProjectConfig {
38
- name: string;
39
- romPath: string;
40
- baseDir: string;
41
- system?: string;
42
- database: string;
43
- flipsPath?: string;
44
- resources: Record<BinType, DbPath>;
45
- databasePath?: string;
46
- systemPath?: string;
47
- compression?: string;
48
- }
49
- /**
50
- * Project root management
51
- */
52
- declare class ProjectRoot {
53
- config: ProjectConfig;
54
- name: string;
55
- romPath: string;
56
- baseDir: string;
57
- system?: string;
58
- database: string;
59
- flipsPath?: string;
60
- resources: Record<BinType, DbPath>;
61
- databasePath?: string;
62
- systemPath?: string;
63
- compression?: string;
64
- constructor(config: ProjectConfig);
65
- /**
66
- * Load project from file or directory
67
- */
68
- static load(path?: string): Promise<ProjectRoot>;
69
- }
1
+ import { StatusFlags, DbRoot, AddressType, DbStringType, StringWrapper, Op, OpCode, ChunkFile, AsmBlock, Address, CopDef, DbEntryPoint, ICompressionProvider } from '@gaialabs/shared';
70
2
 
71
3
  /**
72
4
  * Lightweight ROM state placeholder used during early development.
@@ -779,6 +711,36 @@ declare class RomGenerator {
779
711
  private writeRom;
780
712
  }
781
713
 
714
+ /**
715
+ * QuintetLZ compression algorithm implementation
716
+ * Dictionary-based compression used in Quintet games
717
+ */
718
+ declare class QuintetLZ implements ICompressionProvider {
719
+ static readonly DICTIONARY_SIZE = 256;
720
+ static readonly DICTIONARY_INIT = 32;
721
+ static readonly DICTIONARY_OFFSET = 239;
722
+ private static readonly DEFAULT_PAGE_SIZE;
723
+ /**
724
+ * Expand (decompress) data using QuintetLZ algorithm
725
+ * @param srcData Source data buffer
726
+ * @param srcPosition Starting position in source data
727
+ * @param srcLen Length of source data to process
728
+ * @returns Expanded data
729
+ */
730
+ expand(srcData: Uint8Array, srcPosition?: number, srcLen?: number): Uint8Array;
731
+ /**
732
+ * Compact (compress) data using QuintetLZ algorithm
733
+ * @param srcData Source data to compress
734
+ * @returns Compressed data
735
+ */
736
+ compact(srcData: Uint8Array): Uint8Array;
737
+ }
738
+
739
+ /**
740
+ * Register compression providers with the global registry
741
+ */
742
+ declare function registerCompressionProviders(): void;
743
+
782
744
  /**
783
745
  * Represents a single frame in a sprite animation sequence
784
746
  */
@@ -870,4 +832,4 @@ declare const isPlatformBrowser: boolean;
870
832
  declare const isPlatformNode: string | false;
871
833
  declare const isPlatformWebWorker: boolean;
872
834
 
873
- export { AddressingModeHandler, AsmReader, Assembler, type AssemblerContext, AssemblerState, BlockReader, BlockWriter, CopCommandProcessor, GAIA_CORE_VERSION, ObjectType, OperationContext, PostProcessor, ProcessorStateManager, type ProjectConfig, ProjectRoot, QuintetLZ, ReferenceManager, Registers, RomDataReader, RomGenerator, RomLayout, RomProcessor, RomState, RomStateUtils, RomWriter, SortedMap, SpriteFrame, SpriteGroup, SpriteMap, SpritePart, Stack, StackOperations, StringProcessor, StringReader, TransformProcessor, TypeParser, isPlatformBrowser, isPlatformNode, isPlatformWebWorker, registerCompressionProviders };
835
+ export { AddressingModeHandler, AsmReader, Assembler, type AssemblerContext, AssemblerState, BlockReader, BlockWriter, CopCommandProcessor, GAIA_CORE_VERSION, ObjectType, OperationContext, PostProcessor, ProcessorStateManager, QuintetLZ, ReferenceManager, Registers, RomDataReader, RomGenerator, RomLayout, RomProcessor, RomState, RomStateUtils, RomWriter, SortedMap, SpriteFrame, SpriteGroup, SpriteMap, SpritePart, Stack, StackOperations, StringProcessor, StringReader, TransformProcessor, TypeParser, isPlatformBrowser, isPlatformNode, isPlatformWebWorker, registerCompressionProviders };
package/dist/index.d.ts CHANGED
@@ -1,72 +1,4 @@
1
- import { ICompressionProvider, BinType, DbPath, StatusFlags, DbRoot, AddressType, DbStringType, StringWrapper, Op, OpCode, ChunkFile, AsmBlock, Address, CopDef, DbEntryPoint } from '@gaialabs/shared';
2
-
3
- /**
4
- * QuintetLZ compression algorithm implementation
5
- * Dictionary-based compression used in Quintet games
6
- */
7
- declare class QuintetLZ implements ICompressionProvider {
8
- static readonly DICTIONARY_SIZE = 256;
9
- static readonly DICTIONARY_INIT = 32;
10
- static readonly DICTIONARY_OFFSET = 239;
11
- private static readonly DEFAULT_PAGE_SIZE;
12
- /**
13
- * Expand (decompress) data using QuintetLZ algorithm
14
- * @param srcData Source data buffer
15
- * @param srcPosition Starting position in source data
16
- * @param srcLen Length of source data to process
17
- * @returns Expanded data
18
- */
19
- expand(srcData: Uint8Array, srcPosition?: number, srcLen?: number): Uint8Array;
20
- /**
21
- * Compact (compress) data using QuintetLZ algorithm
22
- * @param srcData Source data to compress
23
- * @returns Compressed data
24
- */
25
- compact(srcData: Uint8Array): Uint8Array;
26
- }
27
-
28
- /**
29
- * Register compression providers with the global registry
30
- */
31
- declare function registerCompressionProviders(): void;
32
-
33
- /**
34
- * Main project management class
35
- * Converted from GaiaLib/ProjectRoot.cs
36
- */
37
- interface ProjectConfig {
38
- name: string;
39
- romPath: string;
40
- baseDir: string;
41
- system?: string;
42
- database: string;
43
- flipsPath?: string;
44
- resources: Record<BinType, DbPath>;
45
- databasePath?: string;
46
- systemPath?: string;
47
- compression?: string;
48
- }
49
- /**
50
- * Project root management
51
- */
52
- declare class ProjectRoot {
53
- config: ProjectConfig;
54
- name: string;
55
- romPath: string;
56
- baseDir: string;
57
- system?: string;
58
- database: string;
59
- flipsPath?: string;
60
- resources: Record<BinType, DbPath>;
61
- databasePath?: string;
62
- systemPath?: string;
63
- compression?: string;
64
- constructor(config: ProjectConfig);
65
- /**
66
- * Load project from file or directory
67
- */
68
- static load(path?: string): Promise<ProjectRoot>;
69
- }
1
+ import { StatusFlags, DbRoot, AddressType, DbStringType, StringWrapper, Op, OpCode, ChunkFile, AsmBlock, Address, CopDef, DbEntryPoint, ICompressionProvider } from '@gaialabs/shared';
70
2
 
71
3
  /**
72
4
  * Lightweight ROM state placeholder used during early development.
@@ -779,6 +711,36 @@ declare class RomGenerator {
779
711
  private writeRom;
780
712
  }
781
713
 
714
+ /**
715
+ * QuintetLZ compression algorithm implementation
716
+ * Dictionary-based compression used in Quintet games
717
+ */
718
+ declare class QuintetLZ implements ICompressionProvider {
719
+ static readonly DICTIONARY_SIZE = 256;
720
+ static readonly DICTIONARY_INIT = 32;
721
+ static readonly DICTIONARY_OFFSET = 239;
722
+ private static readonly DEFAULT_PAGE_SIZE;
723
+ /**
724
+ * Expand (decompress) data using QuintetLZ algorithm
725
+ * @param srcData Source data buffer
726
+ * @param srcPosition Starting position in source data
727
+ * @param srcLen Length of source data to process
728
+ * @returns Expanded data
729
+ */
730
+ expand(srcData: Uint8Array, srcPosition?: number, srcLen?: number): Uint8Array;
731
+ /**
732
+ * Compact (compress) data using QuintetLZ algorithm
733
+ * @param srcData Source data to compress
734
+ * @returns Compressed data
735
+ */
736
+ compact(srcData: Uint8Array): Uint8Array;
737
+ }
738
+
739
+ /**
740
+ * Register compression providers with the global registry
741
+ */
742
+ declare function registerCompressionProviders(): void;
743
+
782
744
  /**
783
745
  * Represents a single frame in a sprite animation sequence
784
746
  */
@@ -870,4 +832,4 @@ declare const isPlatformBrowser: boolean;
870
832
  declare const isPlatformNode: string | false;
871
833
  declare const isPlatformWebWorker: boolean;
872
834
 
873
- export { AddressingModeHandler, AsmReader, Assembler, type AssemblerContext, AssemblerState, BlockReader, BlockWriter, CopCommandProcessor, GAIA_CORE_VERSION, ObjectType, OperationContext, PostProcessor, ProcessorStateManager, type ProjectConfig, ProjectRoot, QuintetLZ, ReferenceManager, Registers, RomDataReader, RomGenerator, RomLayout, RomProcessor, RomState, RomStateUtils, RomWriter, SortedMap, SpriteFrame, SpriteGroup, SpriteMap, SpritePart, Stack, StackOperations, StringProcessor, StringReader, TransformProcessor, TypeParser, isPlatformBrowser, isPlatformNode, isPlatformWebWorker, registerCompressionProviders };
835
+ export { AddressingModeHandler, AsmReader, Assembler, type AssemblerContext, AssemblerState, BlockReader, BlockWriter, CopCommandProcessor, GAIA_CORE_VERSION, ObjectType, OperationContext, PostProcessor, ProcessorStateManager, QuintetLZ, ReferenceManager, Registers, RomDataReader, RomGenerator, RomLayout, RomProcessor, RomState, RomStateUtils, RomWriter, SortedMap, SpriteFrame, SpriteGroup, SpriteMap, SpritePart, Stack, StackOperations, StringProcessor, StringReader, TransformProcessor, TypeParser, isPlatformBrowser, isPlatformNode, isPlatformWebWorker, registerCompressionProviders };
package/dist/index.js CHANGED
@@ -2,200 +2,6 @@
2
2
 
3
3
  var shared = require('@gaialabs/shared');
4
4
 
5
- // src/rom/project.ts
6
- var QuintetLZ = class _QuintetLZ {
7
- static {
8
- this.DICTIONARY_SIZE = 256;
9
- }
10
- static {
11
- this.DICTIONARY_INIT = 32;
12
- }
13
- static {
14
- this.DICTIONARY_OFFSET = 239;
15
- }
16
- static {
17
- this.DEFAULT_PAGE_SIZE = 32768;
18
- }
19
- /**
20
- * Expand (decompress) data using QuintetLZ algorithm
21
- * @param srcData Source data buffer
22
- * @param srcPosition Starting position in source data
23
- * @param srcLen Length of source data to process
24
- * @returns Expanded data
25
- */
26
- expand(srcData, srcPosition = 0, srcLen = _QuintetLZ.DEFAULT_PAGE_SIZE) {
27
- const bitStream = new shared.BitStream(srcData, srcPosition);
28
- const srcStop = srcPosition + srcLen;
29
- const dictionary = new Uint8Array(_QuintetLZ.DICTIONARY_SIZE);
30
- dictionary.fill(_QuintetLZ.DICTIONARY_INIT);
31
- let dictPosition = _QuintetLZ.DICTIONARY_OFFSET;
32
- let outPosition = 0;
33
- const dstLen = bitStream.readShort();
34
- const outBuffer = new Uint8Array(dstLen);
35
- while (bitStream.currentPosition < srcStop && outPosition < dstLen) {
36
- if (bitStream.readBit()) {
37
- const sample = bitStream.readByte();
38
- if (outPosition < dstLen) {
39
- outBuffer[outPosition++] = sample;
40
- }
41
- dictionary[dictPosition] = sample;
42
- dictPosition = dictPosition + 1 & 255;
43
- } else {
44
- let wordIndex = bitStream.readByte();
45
- let wordLength = bitStream.readNibble() + 2;
46
- while (wordLength-- > 0) {
47
- const sample = dictionary[wordIndex];
48
- wordIndex = wordIndex + 1 & 255;
49
- if (outPosition < dstLen) {
50
- outBuffer[outPosition++] = sample;
51
- }
52
- dictionary[dictPosition] = sample;
53
- dictPosition = dictPosition + 1 & 255;
54
- }
55
- }
56
- }
57
- if (outPosition < dstLen) {
58
- return outBuffer.slice(0, outPosition);
59
- }
60
- return outBuffer;
61
- }
62
- /**
63
- * Compact (compress) data using QuintetLZ algorithm
64
- * @param srcData Source data to compress
65
- * @returns Compressed data
66
- */
67
- compact(srcData) {
68
- const dictionary = new Uint8Array(_QuintetLZ.DICTIONARY_SIZE);
69
- dictionary.fill(_QuintetLZ.DICTIONARY_INIT);
70
- let offset = _QuintetLZ.DICTIONARY_OFFSET;
71
- let srcIx = 0;
72
- let dstIx = 0;
73
- const srcLen = srcData.length;
74
- const outputBuffer = new Uint8Array(srcLen * 2);
75
- outputBuffer[dstIx++] = srcLen & 255;
76
- outputBuffer[dstIx++] = srcLen >> 8 & 255;
77
- const bitStream = new shared.BitStream(outputBuffer, 2);
78
- const getCommand = () => {
79
- const maxLen = Math.min(srcLen - srcIx, 17);
80
- if (maxLen < 2) {
81
- return [0, 0];
82
- }
83
- let startByte = 0;
84
- let bestLen = 0;
85
- let bx = offset;
86
- for (let i = 0; i < 256; i++, bx = bx + 1 & 255) {
87
- let size = 0;
88
- let bix = bx;
89
- while (size < maxLen && dictionary[bix] === srcData[srcIx + size]) {
90
- bix = bix + 1 & 255;
91
- if (bix === offset) {
92
- bix = bx;
93
- }
94
- size++;
95
- }
96
- if (size > bestLen) {
97
- startByte = bx;
98
- bestLen = size;
99
- if (bestLen >= maxLen) {
100
- break;
101
- }
102
- }
103
- }
104
- return [startByte, bestLen];
105
- };
106
- while (srcIx < srcLen) {
107
- const [cmdStart, cmdLen] = getCommand();
108
- if (cmdLen >= 2) {
109
- bitStream.writeBit(false);
110
- bitStream.writeByte(cmdStart);
111
- bitStream.writeNibble(cmdLen - 2);
112
- for (let i = 0; i < cmdLen; i++) {
113
- dictionary[offset] = srcData[srcIx++];
114
- offset = offset + 1 & 255;
115
- }
116
- } else {
117
- bitStream.writeBit(true);
118
- const val = srcData[srcIx++];
119
- bitStream.writeByte(val);
120
- dictionary[offset] = val;
121
- offset = offset + 1 & 255;
122
- }
123
- }
124
- bitStream.flush();
125
- const finalSize = Math.max(dstIx, bitStream.currentPosition);
126
- return outputBuffer.slice(0, finalSize);
127
- }
128
- };
129
- function registerCompressionProviders() {
130
- shared.CompressionRegistry.register("QuintetLZ", () => new QuintetLZ());
131
- }
132
- registerCompressionProviders();
133
-
134
- // src/rom/project.ts
135
- var ProjectRoot = class _ProjectRoot {
136
- constructor(config) {
137
- this.config = config;
138
- this.name = config.name;
139
- this.romPath = config.romPath;
140
- this.baseDir = config.baseDir;
141
- this.system = config.system;
142
- this.database = config.database;
143
- this.flipsPath = config.flipsPath;
144
- this.resources = config.resources;
145
- this.databasePath = config.databasePath;
146
- this.systemPath = config.systemPath;
147
- this.compression = config.compression;
148
- }
149
- /**
150
- * Load project from file or directory
151
- */
152
- static async load(path) {
153
- path = path || "./project.json";
154
- try {
155
- const config = await shared.readJsonFile(path);
156
- if (!config.baseDir) {
157
- config.baseDir = await shared.getDirectory(path);
158
- }
159
- return new _ProjectRoot(config);
160
- } catch (error) {
161
- console.warn(`Failed to load project file: ${error}. Using directory-based configuration.`);
162
- }
163
- const defaultConfig = {
164
- name: "GaiaLabs",
165
- baseDir: path,
166
- flipsPath: process?.env?.flips_path,
167
- romPath: process?.env?.rom_path || "",
168
- database: "us",
169
- databasePath: `${path}/db/us`,
170
- systemPath: `${path}/db/snes`,
171
- resources: {}
172
- };
173
- return new _ProjectRoot(defaultConfig);
174
- }
175
- // /**
176
- // * Build the ROM (simplified)
177
- // */
178
- // public async build(files: ChunkFile[], entryPoints: DbEntryPoint[]): Promise<void> {
179
- // // Build ROM using rebuild writer
180
- // const writer = new RomWriter(entryPoints, this.config.cartName, this.config.makerCode);
181
- // await writer.repack(files);
182
- // }
183
- /**
184
- * Dump database and extract ROM data with comprehensive assembly processing
185
- */
186
- // public async dumpDatabase(): Promise<ChunkFile[]> {
187
- // // Load database and ROM data
188
- // const root = await DbRootUtils.fromFolder(this.databasePath!, this.systemPath!);
189
- // const rom = await readFileAsBinary(this.romPath);
190
- // //root.paths = this.resources;
191
- // const chunkReader = new BlockReader(rom, root);
192
- // const chunkFiles = chunkReader.analyzeAndResolve();
193
- // const blockWriter = new BlockWriter(chunkReader);
194
- // const writtenFiles = blockWriter.generateAllAsm(chunkFiles);
195
- // return chunkFiles;
196
- // }
197
- };
198
-
199
5
  // src/rom/state.ts
200
6
  var RomState = class _RomState {
201
7
  constructor() {
@@ -1452,6 +1258,142 @@ var Registers = class {
1452
1258
  this.stack.reset();
1453
1259
  }
1454
1260
  };
1261
+ var QuintetLZ = class _QuintetLZ {
1262
+ static {
1263
+ this.DICTIONARY_SIZE = 256;
1264
+ }
1265
+ static {
1266
+ this.DICTIONARY_INIT = 32;
1267
+ }
1268
+ static {
1269
+ this.DICTIONARY_OFFSET = 239;
1270
+ }
1271
+ static {
1272
+ this.DEFAULT_PAGE_SIZE = 32768;
1273
+ }
1274
+ /**
1275
+ * Expand (decompress) data using QuintetLZ algorithm
1276
+ * @param srcData Source data buffer
1277
+ * @param srcPosition Starting position in source data
1278
+ * @param srcLen Length of source data to process
1279
+ * @returns Expanded data
1280
+ */
1281
+ expand(srcData, srcPosition = 0, srcLen = _QuintetLZ.DEFAULT_PAGE_SIZE) {
1282
+ const bitStream = new shared.BitStream(srcData, srcPosition);
1283
+ const srcStop = srcPosition + srcLen;
1284
+ const dictionary = new Uint8Array(_QuintetLZ.DICTIONARY_SIZE);
1285
+ dictionary.fill(_QuintetLZ.DICTIONARY_INIT);
1286
+ let dictPosition = _QuintetLZ.DICTIONARY_OFFSET;
1287
+ let outPosition = 0;
1288
+ let dstLen = bitStream.readShort();
1289
+ if (dstLen === 0) {
1290
+ return srcData.slice(srcPosition + 2, srcStop);
1291
+ } else if (dstLen & 32768) {
1292
+ dstLen = 65536 - dstLen;
1293
+ }
1294
+ const outBuffer = new Uint8Array(dstLen);
1295
+ while (bitStream.currentPosition < srcStop && outPosition < dstLen) {
1296
+ if (bitStream.readBit()) {
1297
+ const sample = bitStream.readByte();
1298
+ if (outPosition < dstLen) {
1299
+ outBuffer[outPosition++] = sample;
1300
+ }
1301
+ dictionary[dictPosition] = sample;
1302
+ dictPosition = dictPosition + 1 & 255;
1303
+ } else {
1304
+ let wordIndex = bitStream.readByte();
1305
+ let wordLength = bitStream.readNibble() + 2;
1306
+ while (wordLength-- > 0) {
1307
+ const sample = dictionary[wordIndex];
1308
+ wordIndex = wordIndex + 1 & 255;
1309
+ if (outPosition < dstLen) {
1310
+ outBuffer[outPosition++] = sample;
1311
+ }
1312
+ dictionary[dictPosition] = sample;
1313
+ dictPosition = dictPosition + 1 & 255;
1314
+ }
1315
+ }
1316
+ }
1317
+ if (outPosition < dstLen) {
1318
+ return outBuffer.slice(0, outPosition);
1319
+ }
1320
+ return outBuffer;
1321
+ }
1322
+ /**
1323
+ * Compact (compress) data using QuintetLZ algorithm
1324
+ * @param srcData Source data to compress
1325
+ * @returns Compressed data
1326
+ */
1327
+ compact(srcData) {
1328
+ const dictionary = new Uint8Array(_QuintetLZ.DICTIONARY_SIZE);
1329
+ dictionary.fill(_QuintetLZ.DICTIONARY_INIT);
1330
+ let offset = _QuintetLZ.DICTIONARY_OFFSET;
1331
+ let srcIx = 0;
1332
+ let dstIx = 0;
1333
+ const srcLen = srcData.length;
1334
+ const outputBuffer = new Uint8Array(srcLen * 2);
1335
+ outputBuffer[dstIx++] = srcLen & 255;
1336
+ outputBuffer[dstIx++] = srcLen >> 8 & 255;
1337
+ const bitStream = new shared.BitStream(outputBuffer, 2);
1338
+ const getCommand = () => {
1339
+ const maxLen = Math.min(srcLen - srcIx, 17);
1340
+ if (maxLen < 2) {
1341
+ return [0, 0];
1342
+ }
1343
+ let startByte = 0;
1344
+ let bestLen = 0;
1345
+ let bx = offset;
1346
+ for (let i = 0; i < 256; i++, bx = bx + 1 & 255) {
1347
+ let size = 0;
1348
+ let bix = bx;
1349
+ while (size < maxLen && dictionary[bix] === srcData[srcIx + size]) {
1350
+ bix = bix + 1 & 255;
1351
+ if (bix === offset) {
1352
+ bix = bx;
1353
+ }
1354
+ size++;
1355
+ }
1356
+ if (size > bestLen) {
1357
+ startByte = bx;
1358
+ bestLen = size;
1359
+ if (bestLen >= maxLen) {
1360
+ break;
1361
+ }
1362
+ }
1363
+ }
1364
+ return [startByte, bestLen];
1365
+ };
1366
+ while (srcIx < srcLen) {
1367
+ const [cmdStart, cmdLen] = getCommand();
1368
+ if (cmdLen >= 2) {
1369
+ bitStream.writeBit(false);
1370
+ bitStream.writeByte(cmdStart);
1371
+ bitStream.writeNibble(cmdLen - 2);
1372
+ for (let i = 0; i < cmdLen; i++) {
1373
+ dictionary[offset] = srcData[srcIx++];
1374
+ offset = offset + 1 & 255;
1375
+ }
1376
+ } else {
1377
+ bitStream.writeBit(true);
1378
+ const val = srcData[srcIx++];
1379
+ bitStream.writeByte(val);
1380
+ dictionary[offset] = val;
1381
+ offset = offset + 1 & 255;
1382
+ }
1383
+ }
1384
+ bitStream.flush();
1385
+ const finalSize = Math.max(dstIx, bitStream.currentPosition);
1386
+ return outputBuffer.slice(0, finalSize);
1387
+ }
1388
+ };
1389
+
1390
+ // src/compression/registry.ts
1391
+ function registerCompressionProviders() {
1392
+ shared.CompressionRegistry.register("QuintetLZ", () => new QuintetLZ());
1393
+ }
1394
+ registerCompressionProviders();
1395
+
1396
+ // src/rom/extraction/blocks.ts
1455
1397
  registerCompressionProviders();
1456
1398
  var BlockReader = class {
1457
1399
  constructor(romData, root) {
@@ -4006,7 +3948,6 @@ exports.ObjectType = ObjectType;
4006
3948
  exports.OperationContext = OperationContext;
4007
3949
  exports.PostProcessor = PostProcessor;
4008
3950
  exports.ProcessorStateManager = ProcessorStateManager;
4009
- exports.ProjectRoot = ProjectRoot;
4010
3951
  exports.QuintetLZ = QuintetLZ;
4011
3952
  exports.ReferenceManager = ReferenceManager;
4012
3953
  exports.Registers = Registers;