@gaialabs/core 0.2.11 → 0.2.13
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.cjs +334 -283
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +743 -736
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +743 -736
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +334 -282
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -124,6 +124,7 @@ declare enum MemberType {
|
|
|
124
124
|
Address = "Address",
|
|
125
125
|
Binary = "Binary",
|
|
126
126
|
Code = "Code",
|
|
127
|
+
Branch = "Branch",
|
|
127
128
|
Location = "Location"
|
|
128
129
|
}
|
|
129
130
|
//#endregion
|
|
@@ -254,6 +255,7 @@ declare class DbFile {
|
|
|
254
255
|
upper?: boolean;
|
|
255
256
|
group?: string;
|
|
256
257
|
scene?: string;
|
|
258
|
+
base?: number;
|
|
257
259
|
constructor(data: Partial<DbFile>);
|
|
258
260
|
}
|
|
259
261
|
declare class DbFileType {
|
|
@@ -264,6 +266,8 @@ declare class DbFileType {
|
|
|
264
266
|
isBlock: boolean;
|
|
265
267
|
header: number;
|
|
266
268
|
compressed?: boolean;
|
|
269
|
+
struct?: string;
|
|
270
|
+
base?: number;
|
|
267
271
|
constructor(data: Partial<DbFileType>);
|
|
268
272
|
}
|
|
269
273
|
//#endregion
|
|
@@ -327,70 +331,126 @@ interface ICompressionProvider {
|
|
|
327
331
|
compact(srcData: Uint8Array, srcPosition?: number, srcLen?: number): Uint8Array;
|
|
328
332
|
}
|
|
329
333
|
//#endregion
|
|
330
|
-
//#region src/
|
|
334
|
+
//#region src/database/entrypoints.d.ts
|
|
331
335
|
/**
|
|
332
|
-
*
|
|
333
|
-
* Converted from GaiaLib/
|
|
336
|
+
* Database entry point definition
|
|
337
|
+
* Converted from GaiaLib/Database/DbEntryPoint.cs
|
|
334
338
|
*/
|
|
335
|
-
|
|
339
|
+
interface DbEntryPoint {
|
|
340
|
+
location: number;
|
|
341
|
+
name: string;
|
|
342
|
+
}
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/database/paths.d.ts
|
|
345
|
+
/**
|
|
346
|
+
* Database path configuration
|
|
347
|
+
* Converted from GaiaLib/Database/DbPath.cs
|
|
348
|
+
*/
|
|
349
|
+
interface DbPath {
|
|
350
|
+
folder: string;
|
|
351
|
+
extension: string;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Creates a default DbPath
|
|
355
|
+
*/
|
|
356
|
+
declare function createDbPath(folder?: string, extension?: string): DbPath;
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region src/database/config.d.ts
|
|
359
|
+
/**
|
|
360
|
+
* Database configuration
|
|
361
|
+
* Converted from GaiaLib/Database/DbConfig.cs
|
|
362
|
+
*/
|
|
363
|
+
interface DbConfig {
|
|
364
|
+
sfxLocation: number;
|
|
365
|
+
sfxCount: number;
|
|
366
|
+
sfxType: string;
|
|
367
|
+
sfxPack: string;
|
|
368
|
+
compression: string;
|
|
369
|
+
uncompress: boolean;
|
|
370
|
+
entryPoints: DbEntryPoint[];
|
|
371
|
+
paths: Record<BinType, DbPath>;
|
|
372
|
+
memoryMode: MemoryMapMode;
|
|
373
|
+
cpuMode: CpuMode;
|
|
374
|
+
chipset: number;
|
|
375
|
+
ramSize: number;
|
|
376
|
+
}
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region src/database/structs.d.ts
|
|
379
|
+
/**
|
|
380
|
+
* Database structure definition
|
|
381
|
+
* Converted from GaiaLib/Database/DbStruct.cs
|
|
382
|
+
*/
|
|
383
|
+
declare class DbStruct {
|
|
384
|
+
name: string;
|
|
385
|
+
types?: string[];
|
|
386
|
+
parent?: string;
|
|
387
|
+
delimiter?: number;
|
|
388
|
+
discriminator?: number;
|
|
389
|
+
constructor(data: Partial<DbStruct>);
|
|
390
|
+
}
|
|
391
|
+
//#endregion
|
|
392
|
+
//#region src/database/addressingMode.d.ts
|
|
393
|
+
declare class DbAddressingMode {
|
|
336
394
|
name: string;
|
|
395
|
+
shorthand: string;
|
|
396
|
+
operands: string[];
|
|
337
397
|
size: number;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
includeLookup?: Map<string, AsmBlock>;
|
|
343
|
-
bank?: number;
|
|
344
|
-
compressed?: boolean;
|
|
345
|
-
upper?: boolean;
|
|
346
|
-
rawData?: Uint8Array | null;
|
|
347
|
-
textData?: string;
|
|
348
|
-
transforms?: {
|
|
349
|
-
key: string;
|
|
350
|
-
value: string;
|
|
351
|
-
}[];
|
|
352
|
-
postProcess?: string;
|
|
353
|
-
mnemonics: Record<number, string>;
|
|
354
|
-
group?: string;
|
|
355
|
-
scene?: string;
|
|
356
|
-
constructor(name: string, size: number, location: number, type: DbFileType);
|
|
398
|
+
formatString?: string;
|
|
399
|
+
parseRegex?: string;
|
|
400
|
+
instructions: Record<string, number>;
|
|
401
|
+
constructor(data: Partial<DbAddressingMode>);
|
|
357
402
|
}
|
|
358
|
-
|
|
359
|
-
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/database/strings.d.ts
|
|
360
405
|
/**
|
|
361
|
-
*
|
|
406
|
+
* Database string command definition
|
|
407
|
+
* Converted from GaiaLib/Database/DbStringCommand.cs
|
|
362
408
|
*/
|
|
363
|
-
declare class
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
409
|
+
declare class DbStringCommand {
|
|
410
|
+
id: number;
|
|
411
|
+
name: string;
|
|
412
|
+
types: string[];
|
|
413
|
+
delimiter?: number;
|
|
414
|
+
halt: boolean;
|
|
415
|
+
dictionary?: DbStringDictionary;
|
|
416
|
+
constructor(data: Partial<DbStringCommand>);
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Database string layer definition
|
|
420
|
+
* Converted from GaiaLib/Database/DbStringLayer.cs
|
|
421
|
+
*/
|
|
422
|
+
interface DbStringLayer {
|
|
423
|
+
base?: number;
|
|
424
|
+
range?: number;
|
|
425
|
+
on?: number;
|
|
426
|
+
shiftBit?: number;
|
|
427
|
+
map: string[];
|
|
428
|
+
}
|
|
429
|
+
declare class DbStringDictionary {
|
|
430
|
+
command?: number;
|
|
431
|
+
commandName?: string;
|
|
432
|
+
name: string;
|
|
433
|
+
entries: string[];
|
|
434
|
+
constructor(data: Partial<DbStringDictionary>);
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Database string type definition
|
|
438
|
+
* Converted from GaiaLib/Database/DbStringType.cs
|
|
439
|
+
*/
|
|
440
|
+
declare class DbStringType {
|
|
441
|
+
name: string;
|
|
442
|
+
delimiter: string;
|
|
443
|
+
terminator: number;
|
|
444
|
+
commands: Record<string, DbStringCommand>;
|
|
445
|
+
commandLookup: Record<number, DbStringCommand>;
|
|
446
|
+
layers: DbStringLayer[];
|
|
447
|
+
greedyTerminator: boolean;
|
|
448
|
+
dictionaries: Record<string, DbStringDictionary>;
|
|
449
|
+
dictionaryLookup: {
|
|
450
|
+
text: string;
|
|
451
|
+
id: number;
|
|
452
|
+
}[];
|
|
453
|
+
constructor(data: Partial<DbStringType>);
|
|
394
454
|
}
|
|
395
455
|
//#endregion
|
|
396
456
|
//#region src/database/cop.d.ts
|
|
@@ -415,492 +475,37 @@ declare class OpCode {
|
|
|
415
475
|
constructor(code: number, mnem: string, mode: string);
|
|
416
476
|
}
|
|
417
477
|
//#endregion
|
|
418
|
-
//#region src/
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
size: number;
|
|
426
|
-
copDef?: CopDef;
|
|
427
|
-
constructor(code: OpCode, location?: number, operands?: unknown[], size?: number);
|
|
478
|
+
//#region src/database/assets.d.ts
|
|
479
|
+
interface DbAsset {
|
|
480
|
+
index: number;
|
|
481
|
+
type: string;
|
|
482
|
+
file: string;
|
|
483
|
+
scene: string;
|
|
484
|
+
meta: any;
|
|
428
485
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
objList: any[];
|
|
438
|
-
structName?: string;
|
|
439
|
-
bank?: number;
|
|
440
|
-
includes?: Set<{
|
|
441
|
-
block: ChunkFile;
|
|
442
|
-
part: AsmBlock;
|
|
443
|
-
}>;
|
|
444
|
-
constructor(location?: number, size?: number, isString?: boolean, label?: string, structName?: string, bank?: number);
|
|
486
|
+
//#endregion
|
|
487
|
+
//#region src/database/scenes.d.ts
|
|
488
|
+
declare class DbScene {
|
|
489
|
+
name: string;
|
|
490
|
+
id: number;
|
|
491
|
+
description?: string;
|
|
492
|
+
assets: DbAsset[];
|
|
493
|
+
constructor(data: Partial<DbScene>);
|
|
445
494
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* Check if a location is outside this part
|
|
456
|
-
*/
|
|
457
|
-
static isOutside(part: AsmBlock, location: number): boolean;
|
|
495
|
+
//#endregion
|
|
496
|
+
//#region src/database/groups.d.ts
|
|
497
|
+
declare class DbGroup {
|
|
498
|
+
name: string;
|
|
499
|
+
prefix: string;
|
|
500
|
+
description?: string;
|
|
501
|
+
scenes: Record<string, DbScene>;
|
|
502
|
+
constructor(data: Partial<DbGroup>);
|
|
458
503
|
}
|
|
459
504
|
//#endregion
|
|
460
|
-
//#region src/types
|
|
505
|
+
//#region src/supabase/types.d.ts
|
|
461
506
|
/**
|
|
462
|
-
*
|
|
463
|
-
*
|
|
464
|
-
*/
|
|
465
|
-
declare class BitStream {
|
|
466
|
-
private static readonly NIBBLE_MASK;
|
|
467
|
-
private static readonly NIBBLE_PERFECT_POSITION;
|
|
468
|
-
private data;
|
|
469
|
-
private position;
|
|
470
|
-
private bitFlag;
|
|
471
|
-
private writeSample;
|
|
472
|
-
constructor(data: Uint8Array, position?: number);
|
|
473
|
-
get dataArray(): Uint8Array;
|
|
474
|
-
get currentPosition(): number;
|
|
475
|
-
set currentPosition(value: number);
|
|
476
|
-
/**
|
|
477
|
-
* Read a byte from the stream
|
|
478
|
-
* @returns The byte read, or -1 if the end of the data has been reached
|
|
479
|
-
*/
|
|
480
|
-
readByte(): number;
|
|
481
|
-
/**
|
|
482
|
-
* Read a ushort from the stream (ignores the current bit flag)
|
|
483
|
-
* @returns The short read, or -1 if the end of the data has been reached
|
|
484
|
-
*/
|
|
485
|
-
readShort(): number;
|
|
486
|
-
/**
|
|
487
|
-
* Read a bit from the stream
|
|
488
|
-
* @returns True if the current bit at bitFlag is set, false otherwise
|
|
489
|
-
*/
|
|
490
|
-
readBit(): boolean;
|
|
491
|
-
/**
|
|
492
|
-
* Read a nibble from the stream
|
|
493
|
-
* @returns The nibble read, or -1 if the end of the data has been reached
|
|
494
|
-
*/
|
|
495
|
-
readNibble(): number;
|
|
496
|
-
/**
|
|
497
|
-
* Write a bit to the stream
|
|
498
|
-
* @param set True if the current bit should be set, false otherwise
|
|
499
|
-
*/
|
|
500
|
-
writeBit(set: boolean): void;
|
|
501
|
-
/**
|
|
502
|
-
* Write a byte to the stream
|
|
503
|
-
* @param value The byte to write
|
|
504
|
-
*/
|
|
505
|
-
writeByte(value: number): void;
|
|
506
|
-
/**
|
|
507
|
-
* Write a nibble to the stream
|
|
508
|
-
* @param value The nibble to write
|
|
509
|
-
*/
|
|
510
|
-
writeNibble(value: number): void;
|
|
511
|
-
flush(): void;
|
|
512
|
-
}
|
|
513
|
-
//#endregion
|
|
514
|
-
//#region src/types/compression-registry.d.ts
|
|
515
|
-
/**
|
|
516
|
-
* Registry for compression providers
|
|
517
|
-
* Allows registration of compression implementations by string ID
|
|
518
|
-
*/
|
|
519
|
-
declare class CompressionRegistry {
|
|
520
|
-
private static providers;
|
|
521
|
-
/**
|
|
522
|
-
* Register a compression provider
|
|
523
|
-
* @param id String identifier for the compression type
|
|
524
|
-
* @param factory Factory function that creates the compression provider
|
|
525
|
-
*/
|
|
526
|
-
static register(id: string, factory: () => ICompressionProvider): void;
|
|
527
|
-
/**
|
|
528
|
-
* Get a compression provider by ID
|
|
529
|
-
* @param id String identifier for the compression type
|
|
530
|
-
* @returns Compression provider instance
|
|
531
|
-
*/
|
|
532
|
-
static get(id: string): ICompressionProvider;
|
|
533
|
-
/**
|
|
534
|
-
* Check if a compression provider is registered
|
|
535
|
-
* @param id String identifier for the compression type
|
|
536
|
-
* @returns True if provider is registered
|
|
537
|
-
*/
|
|
538
|
-
static has(id: string): boolean;
|
|
539
|
-
/**
|
|
540
|
-
* Get list of registered provider IDs
|
|
541
|
-
* @returns Array of registered provider IDs
|
|
542
|
-
*/
|
|
543
|
-
static getRegisteredIds(): string[];
|
|
544
|
-
/**
|
|
545
|
-
* Clear all registered providers (mainly for testing)
|
|
546
|
-
*/
|
|
547
|
-
static clear(): void;
|
|
548
|
-
}
|
|
549
|
-
//#endregion
|
|
550
|
-
//#region src/types/constants.d.ts
|
|
551
|
-
/**
|
|
552
|
-
* ROM processing constants
|
|
553
|
-
* Converted from GaiaLib/Types/RomProcessingConstants.cs
|
|
554
|
-
*/
|
|
555
|
-
declare class RomProcessingConstants {
|
|
556
|
-
static readonly PAGE_SIZE = 32768;
|
|
557
|
-
static readonly SNES_HEADER_SIZE = 80;
|
|
558
|
-
static readonly DICTIONARIES: string[];
|
|
559
|
-
static readonly DICT_COMMANDS: number[];
|
|
560
|
-
static readonly END_CHARS: number[];
|
|
561
|
-
static readonly WHITESPACE: string[];
|
|
562
|
-
static readonly OPERATORS: string[];
|
|
563
|
-
static readonly COMMA_SPACE: string[];
|
|
564
|
-
static readonly ADDRESS_SPACE: string[];
|
|
565
|
-
static readonly SYMBOL_SPACE: string[];
|
|
566
|
-
static readonly LABEL_SPACE: string[];
|
|
567
|
-
static readonly OBJECT_SPACE: string[];
|
|
568
|
-
static readonly COP_SPLIT_CHARS: string[];
|
|
569
|
-
static readonly WHITESPACE_REGEX: RegExp;
|
|
570
|
-
static readonly COMMA_SPACE_REGEX: RegExp;
|
|
571
|
-
static readonly SYMBOL_SPACE_REGEX: RegExp;
|
|
572
|
-
static readonly LABEL_SPACE_REGEX: RegExp;
|
|
573
|
-
static readonly OBJECT_SPACE_REGEX: RegExp;
|
|
574
|
-
static readonly ADDRESS_SPACE_REGEX: RegExp;
|
|
575
|
-
static readonly COP_SPLIT_REGEX: RegExp;
|
|
576
|
-
static readonly COMMA_SPACE_TRIM_REGEX: RegExp;
|
|
577
|
-
/**
|
|
578
|
-
* Gets the size of an object for processing purposes
|
|
579
|
-
* @param obj The object to get the size for
|
|
580
|
-
* @returns Size in bytes
|
|
581
|
-
* @throws Error when unable to determine size
|
|
582
|
-
*/
|
|
583
|
-
static getSize(obj: unknown): number;
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* BlockReader specific constants
|
|
587
|
-
*/
|
|
588
|
-
declare class BlockReaderConstants {
|
|
589
|
-
static readonly REF_SEARCH_MAX_RANGE = 416;
|
|
590
|
-
static readonly BANK_MASK_CHECK = 64;
|
|
591
|
-
static readonly BYTE_DELIMITER_THRESHOLD = 256;
|
|
592
|
-
static readonly BANK_HIGH_MEMORY_1 = 126;
|
|
593
|
-
static readonly BANK_HIGH_MEMORY_2 = 127;
|
|
594
|
-
static readonly POINTER_CHARACTERS: string[];
|
|
595
|
-
static readonly WIDE_STRING_TYPE = "WideString";
|
|
596
|
-
static readonly BINARY_TYPE = "Binary";
|
|
597
|
-
static readonly CODE_TYPE = "Code";
|
|
598
|
-
static readonly LOCATION_FORMAT = "loc_{0:X6}";
|
|
599
|
-
static readonly TYPE_NAME_FORMAT = "{0}_{1:X6}";
|
|
600
|
-
static readonly OFFSET_FORMAT = "+{0:X}";
|
|
601
|
-
static readonly MARKER_FORMAT = "+M";
|
|
602
|
-
static readonly NEGATIVE_OFFSET_FORMAT = "-{0:X}";
|
|
603
|
-
static readonly NEGATIVE_MARKER_FORMAT = "-M";
|
|
604
|
-
}
|
|
605
|
-
//#endregion
|
|
606
|
-
//#region src/types/location.d.ts
|
|
607
|
-
/**
|
|
608
|
-
* Location wrapper for additional metadata
|
|
609
|
-
* Converted from GaiaLib/Types/LocationWrapper.cs
|
|
610
|
-
*/
|
|
611
|
-
declare class LocationWrapper {
|
|
612
|
-
location: number;
|
|
613
|
-
type: AddressType;
|
|
614
|
-
constructor(location: number, type: AddressType);
|
|
615
|
-
}
|
|
616
|
-
//#endregion
|
|
617
|
-
//#region src/database/strings.d.ts
|
|
618
|
-
/**
|
|
619
|
-
* Database string command definition
|
|
620
|
-
* Converted from GaiaLib/Database/DbStringCommand.cs
|
|
621
|
-
*/
|
|
622
|
-
declare class DbStringCommand {
|
|
623
|
-
id: number;
|
|
624
|
-
name: string;
|
|
625
|
-
types: string[];
|
|
626
|
-
delimiter?: number;
|
|
627
|
-
halt: boolean;
|
|
628
|
-
dictionary?: DbStringDictionary;
|
|
629
|
-
constructor(data: Partial<DbStringCommand>);
|
|
630
|
-
}
|
|
631
|
-
/**
|
|
632
|
-
* Database string layer definition
|
|
633
|
-
* Converted from GaiaLib/Database/DbStringLayer.cs
|
|
634
|
-
*/
|
|
635
|
-
interface DbStringLayer {
|
|
636
|
-
base?: number;
|
|
637
|
-
range?: number;
|
|
638
|
-
on?: number;
|
|
639
|
-
shiftBit?: number;
|
|
640
|
-
map: string[];
|
|
641
|
-
}
|
|
642
|
-
declare class DbStringDictionary {
|
|
643
|
-
base?: number;
|
|
644
|
-
range: number;
|
|
645
|
-
command?: number;
|
|
646
|
-
name: string;
|
|
647
|
-
entries: string[];
|
|
648
|
-
constructor(data: Partial<DbStringDictionary>);
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Database string type definition
|
|
652
|
-
* Converted from GaiaLib/Database/DbStringType.cs
|
|
653
|
-
*/
|
|
654
|
-
declare class DbStringType {
|
|
655
|
-
name: string;
|
|
656
|
-
delimiter: string;
|
|
657
|
-
terminator: number;
|
|
658
|
-
commands: Record<string, DbStringCommand>;
|
|
659
|
-
commandLookup: Record<number, DbStringCommand>;
|
|
660
|
-
layers: DbStringLayer[];
|
|
661
|
-
greedyTerminator: boolean;
|
|
662
|
-
dictionaries: Record<string, DbStringDictionary>;
|
|
663
|
-
dictionaryLookup: {
|
|
664
|
-
text: string;
|
|
665
|
-
id: number;
|
|
666
|
-
}[];
|
|
667
|
-
constructor(data: Partial<DbStringType>);
|
|
668
|
-
}
|
|
669
|
-
//#endregion
|
|
670
|
-
//#region src/types/strings.d.ts
|
|
671
|
-
/**
|
|
672
|
-
* String marker for positioning
|
|
673
|
-
* Converted from GaiaLib/Types/StringMarker.cs
|
|
674
|
-
*/
|
|
675
|
-
interface StringMarker {
|
|
676
|
-
offset: number;
|
|
677
|
-
}
|
|
678
|
-
/**
|
|
679
|
-
* String wrapper with type and location information
|
|
680
|
-
* Converted from GaiaLib/Types/StringWrapper.cs
|
|
681
|
-
*/
|
|
682
|
-
interface StringWrapper {
|
|
683
|
-
string: string;
|
|
684
|
-
type: DbStringType;
|
|
685
|
-
marker: number;
|
|
686
|
-
location: number;
|
|
687
|
-
fixedSize: number;
|
|
688
|
-
}
|
|
689
|
-
/**
|
|
690
|
-
* String entry (commented out in original C# code)
|
|
691
|
-
* Converted from GaiaLib/Types/StringEntry.cs
|
|
692
|
-
*/
|
|
693
|
-
interface StringEntry {
|
|
694
|
-
block: AsmBlock;
|
|
695
|
-
index: number;
|
|
696
|
-
size: number;
|
|
697
|
-
data: Uint8Array;
|
|
698
|
-
}
|
|
699
|
-
/**
|
|
700
|
-
* String size comparer utility
|
|
701
|
-
* Converted from GaiaLib/Types/StringSizeComparer.cs
|
|
702
|
-
*/
|
|
703
|
-
declare class StringSizeComparer {
|
|
704
|
-
/**
|
|
705
|
-
* Compare two strings by length
|
|
706
|
-
*/
|
|
707
|
-
static compare(a: string, b: string): number;
|
|
708
|
-
/**
|
|
709
|
-
* Compare two StringWrapper objects by string length
|
|
710
|
-
*/
|
|
711
|
-
static compareWrappers(a: StringWrapper, b: StringWrapper): number;
|
|
712
|
-
}
|
|
713
|
-
//#endregion
|
|
714
|
-
//#region src/types/structs.d.ts
|
|
715
|
-
/**
|
|
716
|
-
* Structure definition
|
|
717
|
-
* Converted from GaiaLib/Types/StructDef.cs
|
|
718
|
-
*/
|
|
719
|
-
interface StructDef {
|
|
720
|
-
name: string;
|
|
721
|
-
parts: unknown[];
|
|
722
|
-
}
|
|
723
|
-
//#endregion
|
|
724
|
-
//#region src/types/tables.d.ts
|
|
725
|
-
declare class TableEntry {
|
|
726
|
-
location: number;
|
|
727
|
-
object: unknown;
|
|
728
|
-
constructor(location: number);
|
|
729
|
-
}
|
|
730
|
-
//#endregion
|
|
731
|
-
//#region src/types/operands.d.ts
|
|
732
|
-
declare class TypedNumber {
|
|
733
|
-
value: number;
|
|
734
|
-
size: number;
|
|
735
|
-
constructor(value: number, size: number);
|
|
736
|
-
}
|
|
737
|
-
declare class Byte extends TypedNumber {
|
|
738
|
-
constructor(value: number);
|
|
739
|
-
}
|
|
740
|
-
declare class Word extends TypedNumber {
|
|
741
|
-
constructor(value: number);
|
|
742
|
-
}
|
|
743
|
-
declare class Long extends TypedNumber {
|
|
744
|
-
constructor(value: number);
|
|
745
|
-
}
|
|
746
|
-
//#endregion
|
|
747
|
-
//#region src/assembly/Registers.d.ts
|
|
748
|
-
/**
|
|
749
|
-
* Manages the 65816 processor registers and status flags
|
|
750
|
-
*/
|
|
751
|
-
declare class Registers {
|
|
752
|
-
value: Record<string, number>;
|
|
753
|
-
stack: Stack;
|
|
754
|
-
mode: MemoryMapMode;
|
|
755
|
-
constructor(mode: MemoryMapMode);
|
|
756
|
-
}
|
|
757
|
-
//#endregion
|
|
758
|
-
//#region src/rom/extraction/processor.d.ts
|
|
759
|
-
declare class MapExt<K, V> extends Map<K, V> {
|
|
760
|
-
constructor();
|
|
761
|
-
tryAdd(key: K, value: V): boolean;
|
|
762
|
-
setFlag(key: K, flag: number, value?: boolean): void;
|
|
763
|
-
clearFlag(key: K, flag: number): void;
|
|
764
|
-
}
|
|
765
|
-
/**
|
|
766
|
-
* Manages CPU processor state during ROM analysis
|
|
767
|
-
* Converted from GaiaLib/Rom/Extraction/ProcessorStateManager.cs
|
|
768
|
-
*/
|
|
769
|
-
declare class ProcessorStateManager {
|
|
770
|
-
readonly stackPositions: MapExt<number, number>;
|
|
771
|
-
private readonly _buckets;
|
|
772
|
-
get(key: string): MapExt<number, number>;
|
|
773
|
-
/**
|
|
774
|
-
* Hydrate processor registers with stored state
|
|
775
|
-
* Uses Registers from gaia-core/assembly for processor state management
|
|
776
|
-
*/
|
|
777
|
-
hydrateRegisters(position: number, reg: Registers): void;
|
|
778
|
-
getStackPosition(location: number): number | undefined;
|
|
779
|
-
setStackPosition(location: number, value: number): void;
|
|
780
|
-
tryAddStackPosition(location: number, value: number): boolean;
|
|
781
|
-
}
|
|
782
|
-
//#endregion
|
|
783
|
-
//#region src/rom/extraction/reader.d.ts
|
|
784
|
-
/**
|
|
785
|
-
* Provides low-level ROM data reading functionality
|
|
786
|
-
* Converted from GaiaLib/Rom/Extraction/RomDataReader.cs
|
|
787
|
-
*/
|
|
788
|
-
declare class RomDataReader {
|
|
789
|
-
readonly romData: Uint8Array;
|
|
790
|
-
position: number;
|
|
791
|
-
constructor(romData: Uint8Array);
|
|
792
|
-
readByte(): number;
|
|
793
|
-
readSByte(): number;
|
|
794
|
-
readUShort(): number;
|
|
795
|
-
readShort(): number;
|
|
796
|
-
readAddress(): number;
|
|
797
|
-
readInt(): number;
|
|
798
|
-
peekByte(): number;
|
|
799
|
-
peekShort(): number;
|
|
800
|
-
peekAddress(): number;
|
|
801
|
-
}
|
|
802
|
-
//#endregion
|
|
803
|
-
//#region src/database/entrypoints.d.ts
|
|
804
|
-
/**
|
|
805
|
-
* Database entry point definition
|
|
806
|
-
* Converted from GaiaLib/Database/DbEntryPoint.cs
|
|
807
|
-
*/
|
|
808
|
-
interface DbEntryPoint {
|
|
809
|
-
location: number;
|
|
810
|
-
name: string;
|
|
811
|
-
}
|
|
812
|
-
//#endregion
|
|
813
|
-
//#region src/database/paths.d.ts
|
|
814
|
-
/**
|
|
815
|
-
* Database path configuration
|
|
816
|
-
* Converted from GaiaLib/Database/DbPath.cs
|
|
817
|
-
*/
|
|
818
|
-
interface DbPath {
|
|
819
|
-
folder: string;
|
|
820
|
-
extension: string;
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* Creates a default DbPath
|
|
824
|
-
*/
|
|
825
|
-
declare function createDbPath(folder?: string, extension?: string): DbPath;
|
|
826
|
-
//#endregion
|
|
827
|
-
//#region src/database/config.d.ts
|
|
828
|
-
/**
|
|
829
|
-
* Database configuration
|
|
830
|
-
* Converted from GaiaLib/Database/DbConfig.cs
|
|
831
|
-
*/
|
|
832
|
-
interface DbConfig {
|
|
833
|
-
sfxLocation: number;
|
|
834
|
-
sfxCount: number;
|
|
835
|
-
sfxType: string;
|
|
836
|
-
sfxPack: string;
|
|
837
|
-
compression: string;
|
|
838
|
-
uncompress: boolean;
|
|
839
|
-
entryPoints: DbEntryPoint[];
|
|
840
|
-
paths: Record<BinType, DbPath>;
|
|
841
|
-
memoryMode: MemoryMapMode;
|
|
842
|
-
cpuMode: CpuMode;
|
|
843
|
-
chipset: number;
|
|
844
|
-
ramSize: number;
|
|
845
|
-
}
|
|
846
|
-
//#endregion
|
|
847
|
-
//#region src/database/structs.d.ts
|
|
848
|
-
/**
|
|
849
|
-
* Database structure definition
|
|
850
|
-
* Converted from GaiaLib/Database/DbStruct.cs
|
|
851
|
-
*/
|
|
852
|
-
declare class DbStruct {
|
|
853
|
-
name: string;
|
|
854
|
-
types?: string[];
|
|
855
|
-
parent?: string;
|
|
856
|
-
delimiter?: number;
|
|
857
|
-
discriminator?: number;
|
|
858
|
-
constructor(data: Partial<DbStruct>);
|
|
859
|
-
}
|
|
860
|
-
//#endregion
|
|
861
|
-
//#region src/database/addressingMode.d.ts
|
|
862
|
-
declare class DbAddressingMode {
|
|
863
|
-
name: string;
|
|
864
|
-
shorthand: string;
|
|
865
|
-
operands: string[];
|
|
866
|
-
size: number;
|
|
867
|
-
formatString?: string;
|
|
868
|
-
parseRegex?: string;
|
|
869
|
-
instructions: Record<string, number>;
|
|
870
|
-
constructor(data: Partial<DbAddressingMode>);
|
|
871
|
-
}
|
|
872
|
-
//#endregion
|
|
873
|
-
//#region src/database/assets.d.ts
|
|
874
|
-
interface DbAsset {
|
|
875
|
-
index: number;
|
|
876
|
-
type: string;
|
|
877
|
-
file: string;
|
|
878
|
-
scene: string;
|
|
879
|
-
meta: any;
|
|
880
|
-
}
|
|
881
|
-
//#endregion
|
|
882
|
-
//#region src/database/scenes.d.ts
|
|
883
|
-
declare class DbScene {
|
|
884
|
-
name: string;
|
|
885
|
-
id: number;
|
|
886
|
-
description?: string;
|
|
887
|
-
assets: DbAsset[];
|
|
888
|
-
constructor(data: Partial<DbScene>);
|
|
889
|
-
}
|
|
890
|
-
//#endregion
|
|
891
|
-
//#region src/database/groups.d.ts
|
|
892
|
-
declare class DbGroup {
|
|
893
|
-
name: string;
|
|
894
|
-
prefix: string;
|
|
895
|
-
description?: string;
|
|
896
|
-
scenes: Record<string, DbScene>;
|
|
897
|
-
constructor(data: Partial<DbGroup>);
|
|
898
|
-
}
|
|
899
|
-
//#endregion
|
|
900
|
-
//#region src/supabase/types.d.ts
|
|
901
|
-
/**
|
|
902
|
-
* TypeScript interfaces for Supabase API responses
|
|
903
|
-
* These types represent the structured data returned from ROM database queries
|
|
507
|
+
* TypeScript interfaces for Supabase API responses
|
|
508
|
+
* These types represent the structured data returned from ROM database queries
|
|
904
509
|
*/
|
|
905
510
|
interface PlatformData {
|
|
906
511
|
id: string;
|
|
@@ -1134,248 +739,650 @@ interface ProjectData {
|
|
|
1134
739
|
updatedAt: string;
|
|
1135
740
|
}
|
|
1136
741
|
/**
|
|
1137
|
-
* Project branch with complete relationship chain
|
|
742
|
+
* Project branch with complete relationship chain
|
|
743
|
+
*/
|
|
744
|
+
interface ProjectBranchData extends BranchBaseData {
|
|
745
|
+
projectId: string;
|
|
746
|
+
baseRomBranchId: string;
|
|
747
|
+
modules: any[];
|
|
748
|
+
project: ProjectData;
|
|
749
|
+
baseRomBranch: BaseRomBranchData;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Project file containing binary data
|
|
753
|
+
*/
|
|
754
|
+
interface ProjectFileData extends FileBaseData {
|
|
755
|
+
module: string | null;
|
|
756
|
+
projectId: string;
|
|
757
|
+
}
|
|
758
|
+
interface ProjectBranchFileRaw {
|
|
759
|
+
id: string;
|
|
760
|
+
branchId: string;
|
|
761
|
+
fileId: string;
|
|
762
|
+
file: ProjectFileRaw;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Raw ProjectFile data as returned from Supabase (before conversion)
|
|
766
|
+
*/
|
|
767
|
+
interface ProjectFileRaw extends FileBaseRaw {
|
|
768
|
+
module: string | null;
|
|
769
|
+
projectId: string;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Complete Project payload containing branch data and files
|
|
773
|
+
*/
|
|
774
|
+
interface ProjectPayload {
|
|
775
|
+
projectBranch: ProjectBranchData;
|
|
776
|
+
projectFiles: ProjectFileData[];
|
|
777
|
+
baseRomBranch: BaseRomBranchData;
|
|
778
|
+
baseRomFiles: BaseRomFileData[];
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Options for loading Project data by name
|
|
782
|
+
*/
|
|
783
|
+
interface FromSupabaseByProjectOptions {
|
|
784
|
+
projectName: string;
|
|
785
|
+
/**
|
|
786
|
+
* Name of the branch to load
|
|
787
|
+
* Set to null to load the main/develop branch
|
|
788
|
+
* Set to undefined to not filter by branch name
|
|
789
|
+
*/
|
|
790
|
+
branchName?: string | null;
|
|
791
|
+
/**
|
|
792
|
+
* Version of the branch to load
|
|
793
|
+
* Set to null to load the latest/main version
|
|
794
|
+
* Set to undefined to not filter by version
|
|
795
|
+
*/
|
|
796
|
+
branchVersion?: number | null;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Query statistics for performance monitoring
|
|
800
|
+
*/
|
|
801
|
+
interface QueryStats {
|
|
802
|
+
branchQueryTime: number;
|
|
803
|
+
fileQueryTime: number;
|
|
804
|
+
totalTime: number;
|
|
805
|
+
fileCount: number;
|
|
806
|
+
}
|
|
807
|
+
//#endregion
|
|
808
|
+
//#region src/database/modules.d.ts
|
|
809
|
+
interface DbGameRomModule {
|
|
810
|
+
supaProjectFiles?: ProjectFileData[];
|
|
811
|
+
supaBaseRomFiles?: BaseRomFileData[];
|
|
812
|
+
mnemonics: Record<number, string>;
|
|
813
|
+
overrides: Record<number, Record<string, number>>;
|
|
814
|
+
rewrites: Record<string, number>;
|
|
815
|
+
blocks: Record<string, Record<string, Partial<DbBlock>>>;
|
|
816
|
+
files: Record<string, Record<string, Record<string, Partial<DbFile>>>>;
|
|
817
|
+
config: DbConfig;
|
|
818
|
+
labels: Record<number, string>;
|
|
819
|
+
structs: Record<string, DbStruct>;
|
|
820
|
+
copdef: Record<string, Partial<CopDef>>;
|
|
821
|
+
strings: Record<string, Partial<DbStringType>>;
|
|
822
|
+
transforms: Record<string, Partial<DbTransform>[]>;
|
|
823
|
+
addrModes: Record<string, Partial<DbAddressingMode>>;
|
|
824
|
+
headers: Partial<DbHeader>[];
|
|
825
|
+
groups: Record<string, Partial<DbGroup>>;
|
|
826
|
+
fileTypes: Record<string, Partial<DbFileType>>;
|
|
827
|
+
}
|
|
828
|
+
interface DbBaseRomModule extends DbGameRomModule {
|
|
829
|
+
baseRomFiles: ChunkFile[];
|
|
830
|
+
}
|
|
831
|
+
interface DbProjectModule extends DbBaseRomModule {
|
|
832
|
+
projectFiles: ChunkFile[];
|
|
833
|
+
}
|
|
834
|
+
//#endregion
|
|
835
|
+
//#region src/database/header.d.ts
|
|
836
|
+
declare class DbHeader {
|
|
837
|
+
bank: number;
|
|
838
|
+
address: number;
|
|
839
|
+
condition?: string;
|
|
840
|
+
parts: DbHeaderPart[];
|
|
841
|
+
constructor(data: Partial<DbHeader>);
|
|
842
|
+
}
|
|
843
|
+
declare class DbHeaderPart {
|
|
844
|
+
name: string;
|
|
845
|
+
size: number;
|
|
846
|
+
type: string;
|
|
847
|
+
value?: any;
|
|
848
|
+
constructor(data: Partial<DbHeaderPart>);
|
|
849
|
+
}
|
|
850
|
+
//#endregion
|
|
851
|
+
//#region src/database/root.d.ts
|
|
852
|
+
/**
|
|
853
|
+
* Main database root class
|
|
854
|
+
* Converted from GaiaLib/Database/DbRoot.cs
|
|
855
|
+
*/
|
|
856
|
+
interface DbRoot {
|
|
857
|
+
copDef: Record<number, CopDef>;
|
|
858
|
+
copLookup: Record<string, CopDef>;
|
|
859
|
+
mnemonics: Record<number, string>;
|
|
860
|
+
structs: Record<string, DbStruct>;
|
|
861
|
+
stringTypes: Record<string, DbStringType>;
|
|
862
|
+
stringDelimiters: string[];
|
|
863
|
+
stringDelimiterLookup: Record<string, DbStringType>;
|
|
864
|
+
headers: DbHeader[];
|
|
865
|
+
files: DbFile[];
|
|
866
|
+
config: DbConfig;
|
|
867
|
+
blocks: DbBlock[];
|
|
868
|
+
overrides: Record<number, Record<string, any>>;
|
|
869
|
+
labels: Record<number, string>;
|
|
870
|
+
rewrites: Record<number, number>;
|
|
871
|
+
entryPoints: DbEntryPoint[];
|
|
872
|
+
opCodes: Record<number, OpCode>;
|
|
873
|
+
opLookup: Record<string, OpCode[]>;
|
|
874
|
+
addrLookup: Record<string, DbAddressingMode>;
|
|
875
|
+
compression?: ICompressionProvider;
|
|
876
|
+
baseRomFiles?: ChunkFile[];
|
|
877
|
+
projectFiles?: ChunkFile[];
|
|
878
|
+
groups: Record<string, DbGroup>;
|
|
879
|
+
scenes: Record<number, DbScene>;
|
|
880
|
+
fileTypes: Record<string, DbFileType>;
|
|
881
|
+
fileExtLookup: Record<string, DbFileType>;
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Database root utilities
|
|
885
|
+
*/
|
|
886
|
+
declare class DbRootUtils {
|
|
887
|
+
/**
|
|
888
|
+
* JSON serialization options
|
|
889
|
+
*/
|
|
890
|
+
static fromGameModule(module: DbGameRomModule): DbRoot;
|
|
891
|
+
static applyFolder(root: DbRoot, folderPath: string, sourceFiles?: ChunkFile[], group?: string): Promise<ChunkFile[]>;
|
|
892
|
+
static extractAllContent(root: DbRoot, romPath: string, outPath: string): Promise<void>;
|
|
893
|
+
static rebuildAllContent(root: DbRoot, inPath: string[], outPath: string): Promise<ChunkFile[]>;
|
|
894
|
+
}
|
|
895
|
+
//#endregion
|
|
896
|
+
//#region src/database/labels.d.ts
|
|
897
|
+
/**
|
|
898
|
+
* Database label definition
|
|
899
|
+
* Converted from GaiaLib/Database/DbLabel.cs
|
|
900
|
+
*/
|
|
901
|
+
interface DbLabel {
|
|
902
|
+
location: number;
|
|
903
|
+
label: string;
|
|
904
|
+
}
|
|
905
|
+
//#endregion
|
|
906
|
+
//#region src/database/mnemonics.d.ts
|
|
907
|
+
/**
|
|
908
|
+
* Database mnemonic definition
|
|
909
|
+
* Converted from GaiaLib/Database/DbMnemonic.cs
|
|
910
|
+
*/
|
|
911
|
+
interface DbMnemonic {
|
|
912
|
+
key: number;
|
|
913
|
+
value: string;
|
|
914
|
+
metadata?: string;
|
|
915
|
+
}
|
|
916
|
+
//#endregion
|
|
917
|
+
//#region src/database/overrides.d.ts
|
|
918
|
+
declare class DbOverride {
|
|
919
|
+
location: number;
|
|
920
|
+
register: string;
|
|
921
|
+
value: number;
|
|
922
|
+
constructor(values: Partial<DbOverride>);
|
|
923
|
+
}
|
|
924
|
+
//#endregion
|
|
925
|
+
//#region src/database/rewrites.d.ts
|
|
926
|
+
/**
|
|
927
|
+
* Database rewrite rule definition
|
|
928
|
+
* Converted from GaiaLib/Database/DbRewrite.cs
|
|
929
|
+
*/
|
|
930
|
+
interface DbRewrite {
|
|
931
|
+
location: number;
|
|
932
|
+
value: number;
|
|
933
|
+
}
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region src/database/sfx.d.ts
|
|
936
|
+
/**
|
|
937
|
+
* Database sound effect definition
|
|
938
|
+
* Converted from GaiaLib/Database/DbSfx.cs
|
|
939
|
+
*/
|
|
940
|
+
interface DbSfx {
|
|
941
|
+
location: number;
|
|
942
|
+
size: number;
|
|
943
|
+
names: string[];
|
|
944
|
+
}
|
|
945
|
+
//#endregion
|
|
946
|
+
//#region src/rom/extraction/references.d.ts
|
|
947
|
+
/**
|
|
948
|
+
* Manages references, chunks, and markers during ROM analysis
|
|
949
|
+
* Converted from GaiaLib/Rom/Extraction/ReferenceManager.cs
|
|
950
|
+
*/
|
|
951
|
+
declare class ReferenceManager {
|
|
952
|
+
readonly structTable: Map<number, string>;
|
|
953
|
+
readonly markerTable: Map<number, number>;
|
|
954
|
+
readonly nameTable: Map<number, string>;
|
|
955
|
+
private readonly root;
|
|
956
|
+
constructor(root: DbRoot);
|
|
957
|
+
tryGetStruct(location: number): {
|
|
958
|
+
found: boolean;
|
|
959
|
+
chunkType?: string;
|
|
960
|
+
};
|
|
961
|
+
tryAddStruct(location: number, chunkType: string): boolean;
|
|
962
|
+
containsStruct(location: number): boolean;
|
|
963
|
+
tryGetName(location: number): {
|
|
964
|
+
found: boolean;
|
|
965
|
+
referenceName?: string;
|
|
966
|
+
};
|
|
967
|
+
tryAddName(location: number, referenceName: string): boolean;
|
|
968
|
+
tryGetMarker(location: number): {
|
|
969
|
+
found: boolean;
|
|
970
|
+
offset?: number;
|
|
971
|
+
};
|
|
972
|
+
setMarker(location: number, offset: number): void;
|
|
973
|
+
createBranchLabel(location: number): string;
|
|
974
|
+
createTypeName(type: string, location: number): string;
|
|
975
|
+
createFallbackName(location: number): string;
|
|
976
|
+
/**
|
|
977
|
+
* Finds a reference location by its assigned name.
|
|
978
|
+
*/
|
|
979
|
+
findLocationByName(name: string): number | undefined;
|
|
980
|
+
resolveName(location: number, type: AddressType, isBranch: boolean): string;
|
|
981
|
+
findClosestReference(location: number): string | null;
|
|
982
|
+
private processRewrite;
|
|
983
|
+
private processClosestMatch;
|
|
984
|
+
}
|
|
985
|
+
//#endregion
|
|
986
|
+
//#region src/types/files.d.ts
|
|
987
|
+
/**
|
|
988
|
+
* Chunk file for ROM processing
|
|
989
|
+
* Converted from GaiaLib/Types/ChunkFile.cs
|
|
990
|
+
*/
|
|
991
|
+
declare class ChunkFile {
|
|
992
|
+
name: string;
|
|
993
|
+
size: number;
|
|
994
|
+
location: number;
|
|
995
|
+
type: DbFileType;
|
|
996
|
+
parts?: AsmBlock[];
|
|
997
|
+
includes?: Set<string>;
|
|
998
|
+
includeLookup?: Map<string, AsmBlock>;
|
|
999
|
+
bank?: number;
|
|
1000
|
+
compressed?: boolean;
|
|
1001
|
+
upper?: boolean;
|
|
1002
|
+
rawData?: Uint8Array | null;
|
|
1003
|
+
textData?: string;
|
|
1004
|
+
transforms?: {
|
|
1005
|
+
key: string;
|
|
1006
|
+
value: string;
|
|
1007
|
+
}[];
|
|
1008
|
+
postProcess?: string;
|
|
1009
|
+
mnemonics: Record<number, string>;
|
|
1010
|
+
group?: string;
|
|
1011
|
+
scene?: string;
|
|
1012
|
+
base?: number;
|
|
1013
|
+
referenceManager?: ReferenceManager;
|
|
1014
|
+
constructor(type: DbFileType, name: string, size?: number, location?: number);
|
|
1015
|
+
enrichWithRawDataFromDbFile(file: DbFile, rom: Uint8Array, compression: ICompressionProvider | undefined): void;
|
|
1016
|
+
enrichWithAsmBlocksFromDbBlock(block: DbBlock, memoryMode: MemoryMapMode): void;
|
|
1017
|
+
}
|
|
1018
|
+
declare function combineHeader(data: Uint8Array, position: number, length: number, header: Uint8Array | null, type: BinType): Uint8Array;
|
|
1019
|
+
/**
|
|
1020
|
+
* Chunk file utilities
|
|
1138
1021
|
*/
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1022
|
+
declare class ChunkFileUtils {
|
|
1023
|
+
/**
|
|
1024
|
+
* Rebase blocks to a new location
|
|
1025
|
+
*/
|
|
1026
|
+
static rebase(chunkFile: ChunkFile, newLocation?: number): void;
|
|
1027
|
+
/**
|
|
1028
|
+
* Calculate the total size of all blocks
|
|
1029
|
+
*/
|
|
1030
|
+
static calculateSize(chunkFile: ChunkFile): number;
|
|
1031
|
+
/**
|
|
1032
|
+
* Check if a location is outside this block and return the part (matches C# IsOutside)
|
|
1033
|
+
* Returns [isOutside, part] where part is the part containing the location
|
|
1034
|
+
*/
|
|
1035
|
+
static isOutsideWithPart(root: ChunkFile[], block: ChunkFile, location: number): [boolean, ChunkFile | null, AsmBlock | null];
|
|
1036
|
+
/**
|
|
1037
|
+
* Check if a location is inside this block and return the part (matches C# IsInside)
|
|
1038
|
+
* Returns [isInside, part] where part is the part containing the location
|
|
1039
|
+
*/
|
|
1040
|
+
static isInsideWithPart(block: ChunkFile, location: number): [boolean, AsmBlock | null];
|
|
1041
|
+
/**
|
|
1042
|
+
* Check if a location is outside this block (shorthand version)
|
|
1043
|
+
*/
|
|
1044
|
+
static isOutside(block: ChunkFile, location: number): boolean;
|
|
1045
|
+
/**
|
|
1046
|
+
* Check if a location is inside this block (shorthand version)
|
|
1047
|
+
*/
|
|
1048
|
+
static isInside(block: ChunkFile, location: number): boolean;
|
|
1049
|
+
/**
|
|
1050
|
+
* Get all included blocks
|
|
1051
|
+
*/
|
|
1052
|
+
static getIncludes(chunkFile: ChunkFile): ChunkFile[];
|
|
1145
1053
|
}
|
|
1054
|
+
//#endregion
|
|
1055
|
+
//#region src/types/assembly.d.ts
|
|
1146
1056
|
/**
|
|
1147
|
-
*
|
|
1057
|
+
* Represents a single assembly operation/instruction
|
|
1148
1058
|
*/
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
branchId: string;
|
|
1156
|
-
fileId: string;
|
|
1157
|
-
file: ProjectFileRaw;
|
|
1059
|
+
declare class Op extends OpCode {
|
|
1060
|
+
location: number;
|
|
1061
|
+
operands: unknown[];
|
|
1062
|
+
size: number;
|
|
1063
|
+
copDef?: CopDef;
|
|
1064
|
+
constructor(code: OpCode, location?: number, operands?: unknown[], size?: number);
|
|
1158
1065
|
}
|
|
1159
1066
|
/**
|
|
1160
|
-
*
|
|
1067
|
+
* Represents a block of assembly code or data
|
|
1161
1068
|
*/
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1069
|
+
declare class AsmBlock {
|
|
1070
|
+
label?: string;
|
|
1071
|
+
location: number;
|
|
1072
|
+
size: number;
|
|
1073
|
+
isString: boolean;
|
|
1074
|
+
objList: any[];
|
|
1075
|
+
structName?: string;
|
|
1076
|
+
bank?: number;
|
|
1077
|
+
includes?: Set<{
|
|
1078
|
+
block: ChunkFile;
|
|
1079
|
+
part: AsmBlock;
|
|
1080
|
+
}>;
|
|
1081
|
+
constructor(location?: number, size?: number, isString?: boolean, label?: string, structName?: string, bank?: number);
|
|
1165
1082
|
}
|
|
1166
1083
|
/**
|
|
1167
|
-
*
|
|
1084
|
+
* Database part utilities
|
|
1168
1085
|
*/
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1086
|
+
declare class AsmBlockUtils {
|
|
1087
|
+
/**
|
|
1088
|
+
* Check if a location is inside this part
|
|
1089
|
+
*/
|
|
1090
|
+
static isInside(part: AsmBlock, location: number): boolean;
|
|
1091
|
+
/**
|
|
1092
|
+
* Check if a location is outside this part
|
|
1093
|
+
*/
|
|
1094
|
+
static isOutside(part: AsmBlock, location: number): boolean;
|
|
1174
1095
|
}
|
|
1096
|
+
//#endregion
|
|
1097
|
+
//#region src/types/bitstream.d.ts
|
|
1175
1098
|
/**
|
|
1176
|
-
*
|
|
1099
|
+
* Bit stream for reading/writing binary data at bit level
|
|
1100
|
+
* Converted from GaiaLib/Types/BitStream.cs
|
|
1177
1101
|
*/
|
|
1178
|
-
|
|
1179
|
-
|
|
1102
|
+
declare class BitStream {
|
|
1103
|
+
private static readonly NIBBLE_MASK;
|
|
1104
|
+
private static readonly NIBBLE_PERFECT_POSITION;
|
|
1105
|
+
private data;
|
|
1106
|
+
private position;
|
|
1107
|
+
private bitFlag;
|
|
1108
|
+
private writeSample;
|
|
1109
|
+
constructor(data: Uint8Array, position?: number);
|
|
1110
|
+
get dataArray(): Uint8Array;
|
|
1111
|
+
get currentPosition(): number;
|
|
1112
|
+
set currentPosition(value: number);
|
|
1180
1113
|
/**
|
|
1181
|
-
*
|
|
1182
|
-
*
|
|
1183
|
-
* Set to undefined to not filter by branch name
|
|
1114
|
+
* Read a byte from the stream
|
|
1115
|
+
* @returns The byte read, or -1 if the end of the data has been reached
|
|
1184
1116
|
*/
|
|
1185
|
-
|
|
1117
|
+
readByte(): number;
|
|
1186
1118
|
/**
|
|
1187
|
-
*
|
|
1188
|
-
*
|
|
1189
|
-
* Set to undefined to not filter by version
|
|
1119
|
+
* Read a ushort from the stream (ignores the current bit flag)
|
|
1120
|
+
* @returns The short read, or -1 if the end of the data has been reached
|
|
1190
1121
|
*/
|
|
1191
|
-
|
|
1122
|
+
readShort(): number;
|
|
1123
|
+
/**
|
|
1124
|
+
* Read a bit from the stream
|
|
1125
|
+
* @returns True if the current bit at bitFlag is set, false otherwise
|
|
1126
|
+
*/
|
|
1127
|
+
readBit(): boolean;
|
|
1128
|
+
/**
|
|
1129
|
+
* Read a nibble from the stream
|
|
1130
|
+
* @returns The nibble read, or -1 if the end of the data has been reached
|
|
1131
|
+
*/
|
|
1132
|
+
readNibble(): number;
|
|
1133
|
+
/**
|
|
1134
|
+
* Write a bit to the stream
|
|
1135
|
+
* @param set True if the current bit should be set, false otherwise
|
|
1136
|
+
*/
|
|
1137
|
+
writeBit(set: boolean): void;
|
|
1138
|
+
/**
|
|
1139
|
+
* Write a byte to the stream
|
|
1140
|
+
* @param value The byte to write
|
|
1141
|
+
*/
|
|
1142
|
+
writeByte(value: number): void;
|
|
1143
|
+
/**
|
|
1144
|
+
* Write a nibble to the stream
|
|
1145
|
+
* @param value The nibble to write
|
|
1146
|
+
*/
|
|
1147
|
+
writeNibble(value: number): void;
|
|
1148
|
+
flush(): void;
|
|
1192
1149
|
}
|
|
1150
|
+
//#endregion
|
|
1151
|
+
//#region src/types/compression-registry.d.ts
|
|
1193
1152
|
/**
|
|
1194
|
-
*
|
|
1153
|
+
* Registry for compression providers
|
|
1154
|
+
* Allows registration of compression implementations by string ID
|
|
1195
1155
|
*/
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1156
|
+
declare class CompressionRegistry {
|
|
1157
|
+
private static providers;
|
|
1158
|
+
/**
|
|
1159
|
+
* Register a compression provider
|
|
1160
|
+
* @param id String identifier for the compression type
|
|
1161
|
+
* @param factory Factory function that creates the compression provider
|
|
1162
|
+
*/
|
|
1163
|
+
static register(id: string, factory: () => ICompressionProvider): void;
|
|
1164
|
+
/**
|
|
1165
|
+
* Get a compression provider by ID
|
|
1166
|
+
* @param id String identifier for the compression type
|
|
1167
|
+
* @returns Compression provider instance
|
|
1168
|
+
*/
|
|
1169
|
+
static get(id: string): ICompressionProvider;
|
|
1170
|
+
/**
|
|
1171
|
+
* Check if a compression provider is registered
|
|
1172
|
+
* @param id String identifier for the compression type
|
|
1173
|
+
* @returns True if provider is registered
|
|
1174
|
+
*/
|
|
1175
|
+
static has(id: string): boolean;
|
|
1176
|
+
/**
|
|
1177
|
+
* Get list of registered provider IDs
|
|
1178
|
+
* @returns Array of registered provider IDs
|
|
1179
|
+
*/
|
|
1180
|
+
static getRegisteredIds(): string[];
|
|
1181
|
+
/**
|
|
1182
|
+
* Clear all registered providers (mainly for testing)
|
|
1183
|
+
*/
|
|
1184
|
+
static clear(): void;
|
|
1201
1185
|
}
|
|
1202
1186
|
//#endregion
|
|
1203
|
-
//#region src/
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1187
|
+
//#region src/types/constants.d.ts
|
|
1188
|
+
/**
|
|
1189
|
+
* ROM processing constants
|
|
1190
|
+
* Converted from GaiaLib/Types/RomProcessingConstants.cs
|
|
1191
|
+
*/
|
|
1192
|
+
declare class RomProcessingConstants {
|
|
1193
|
+
static readonly PAGE_SIZE = 32768;
|
|
1194
|
+
static readonly SNES_HEADER_SIZE = 80;
|
|
1195
|
+
static readonly DICTIONARIES: string[];
|
|
1196
|
+
static readonly DICT_COMMANDS: number[];
|
|
1197
|
+
static readonly END_CHARS: number[];
|
|
1198
|
+
static readonly WHITESPACE: string[];
|
|
1199
|
+
static readonly OPERATORS: string[];
|
|
1200
|
+
static readonly COMMA_SPACE: string[];
|
|
1201
|
+
static readonly ADDRESS_SPACE: string[];
|
|
1202
|
+
static readonly SYMBOL_SPACE: string[];
|
|
1203
|
+
static readonly LABEL_SPACE: string[];
|
|
1204
|
+
static readonly OBJECT_SPACE: string[];
|
|
1205
|
+
static readonly COP_SPLIT_CHARS: string[];
|
|
1206
|
+
static readonly WHITESPACE_REGEX: RegExp;
|
|
1207
|
+
static readonly COMMA_SPACE_REGEX: RegExp;
|
|
1208
|
+
static readonly SYMBOL_SPACE_REGEX: RegExp;
|
|
1209
|
+
static readonly LABEL_SPACE_REGEX: RegExp;
|
|
1210
|
+
static readonly OBJECT_SPACE_REGEX: RegExp;
|
|
1211
|
+
static readonly ADDRESS_SPACE_REGEX: RegExp;
|
|
1212
|
+
static readonly COP_SPLIT_REGEX: RegExp;
|
|
1213
|
+
static readonly COMMA_SPACE_TRIM_REGEX: RegExp;
|
|
1214
|
+
/**
|
|
1215
|
+
* Gets the size of an object for processing purposes
|
|
1216
|
+
* @param obj The object to get the size for
|
|
1217
|
+
* @returns Size in bytes
|
|
1218
|
+
* @throws Error when unable to determine size
|
|
1219
|
+
*/
|
|
1220
|
+
static getSize(obj: unknown): number;
|
|
1222
1221
|
}
|
|
1223
|
-
|
|
1224
|
-
|
|
1222
|
+
/**
|
|
1223
|
+
* BlockReader specific constants
|
|
1224
|
+
*/
|
|
1225
|
+
declare class BlockReaderConstants {
|
|
1226
|
+
static readonly REF_SEARCH_MAX_RANGE = 416;
|
|
1227
|
+
static readonly BANK_MASK_CHECK = 64;
|
|
1228
|
+
static readonly BYTE_DELIMITER_THRESHOLD = 256;
|
|
1229
|
+
static readonly BANK_HIGH_MEMORY_1 = 126;
|
|
1230
|
+
static readonly BANK_HIGH_MEMORY_2 = 127;
|
|
1231
|
+
static readonly POINTER_CHARACTERS: string[];
|
|
1232
|
+
static readonly WIDE_STRING_TYPE = "WideString";
|
|
1233
|
+
static readonly BINARY_TYPE = "Binary";
|
|
1234
|
+
static readonly CODE_TYPE = "Code";
|
|
1235
|
+
static readonly LOCATION_FORMAT = "loc_{0:X6}";
|
|
1236
|
+
static readonly TYPE_NAME_FORMAT = "{0}_{1:X6}";
|
|
1237
|
+
static readonly OFFSET_FORMAT = "+{0:X}";
|
|
1238
|
+
static readonly MARKER_FORMAT = "+M";
|
|
1239
|
+
static readonly NEGATIVE_OFFSET_FORMAT = "-{0:X}";
|
|
1240
|
+
static readonly NEGATIVE_MARKER_FORMAT = "-M";
|
|
1225
1241
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1242
|
+
//#endregion
|
|
1243
|
+
//#region src/types/location.d.ts
|
|
1244
|
+
/**
|
|
1245
|
+
* Location wrapper for additional metadata
|
|
1246
|
+
* Converted from GaiaLib/Types/LocationWrapper.cs
|
|
1247
|
+
*/
|
|
1248
|
+
declare class LocationWrapper {
|
|
1249
|
+
location: number;
|
|
1250
|
+
type: AddressType;
|
|
1251
|
+
constructor(location: number, type: AddressType);
|
|
1228
1252
|
}
|
|
1229
1253
|
//#endregion
|
|
1230
|
-
//#region src/
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1254
|
+
//#region src/types/strings.d.ts
|
|
1255
|
+
/**
|
|
1256
|
+
* String marker for positioning
|
|
1257
|
+
* Converted from GaiaLib/Types/StringMarker.cs
|
|
1258
|
+
*/
|
|
1259
|
+
interface StringMarker {
|
|
1260
|
+
offset: number;
|
|
1237
1261
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1262
|
+
/**
|
|
1263
|
+
* String wrapper with type and location information
|
|
1264
|
+
* Converted from GaiaLib/Types/StringWrapper.cs
|
|
1265
|
+
*/
|
|
1266
|
+
interface StringWrapper {
|
|
1267
|
+
string: string;
|
|
1268
|
+
type: DbStringType;
|
|
1269
|
+
marker: number;
|
|
1270
|
+
location: number;
|
|
1271
|
+
fixedSize: number;
|
|
1244
1272
|
}
|
|
1245
|
-
//#endregion
|
|
1246
|
-
//#region src/database/root.d.ts
|
|
1247
1273
|
/**
|
|
1248
|
-
*
|
|
1249
|
-
* Converted from GaiaLib/
|
|
1274
|
+
* String entry (commented out in original C# code)
|
|
1275
|
+
* Converted from GaiaLib/Types/StringEntry.cs
|
|
1250
1276
|
*/
|
|
1251
|
-
interface
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
stringTypes: Record<string, DbStringType>;
|
|
1257
|
-
stringDelimiters: string[];
|
|
1258
|
-
stringDelimiterLookup: Record<string, DbStringType>;
|
|
1259
|
-
headers: DbHeader[];
|
|
1260
|
-
files: DbFile[];
|
|
1261
|
-
config: DbConfig;
|
|
1262
|
-
blocks: DbBlock[];
|
|
1263
|
-
overrides: Record<number, Record<string, any>>;
|
|
1264
|
-
labels: Record<number, string>;
|
|
1265
|
-
rewrites: Record<number, number>;
|
|
1266
|
-
entryPoints: DbEntryPoint[];
|
|
1267
|
-
opCodes: Record<number, OpCode>;
|
|
1268
|
-
opLookup: Record<string, OpCode[]>;
|
|
1269
|
-
addrLookup: Record<string, DbAddressingMode>;
|
|
1270
|
-
compression?: ICompressionProvider;
|
|
1271
|
-
baseRomFiles?: ChunkFile[];
|
|
1272
|
-
projectFiles?: ChunkFile[];
|
|
1273
|
-
groups: Record<string, DbGroup>;
|
|
1274
|
-
scenes: Record<number, DbScene>;
|
|
1275
|
-
fileTypes: Record<string, DbFileType>;
|
|
1276
|
-
fileExtLookup: Record<string, DbFileType>;
|
|
1277
|
+
interface StringEntry {
|
|
1278
|
+
block: AsmBlock;
|
|
1279
|
+
index: number;
|
|
1280
|
+
size: number;
|
|
1281
|
+
data: Uint8Array;
|
|
1277
1282
|
}
|
|
1278
1283
|
/**
|
|
1279
|
-
*
|
|
1284
|
+
* String size comparer utility
|
|
1285
|
+
* Converted from GaiaLib/Types/StringSizeComparer.cs
|
|
1280
1286
|
*/
|
|
1281
|
-
declare class
|
|
1287
|
+
declare class StringSizeComparer {
|
|
1282
1288
|
/**
|
|
1283
|
-
*
|
|
1289
|
+
* Compare two strings by length
|
|
1284
1290
|
*/
|
|
1285
|
-
static
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1291
|
+
static compare(a: string, b: string): number;
|
|
1292
|
+
/**
|
|
1293
|
+
* Compare two StringWrapper objects by string length
|
|
1294
|
+
*/
|
|
1295
|
+
static compareWrappers(a: StringWrapper, b: StringWrapper): number;
|
|
1289
1296
|
}
|
|
1290
1297
|
//#endregion
|
|
1291
|
-
//#region src/
|
|
1298
|
+
//#region src/types/structs.d.ts
|
|
1292
1299
|
/**
|
|
1293
|
-
*
|
|
1294
|
-
* Converted from GaiaLib/
|
|
1300
|
+
* Structure definition
|
|
1301
|
+
* Converted from GaiaLib/Types/StructDef.cs
|
|
1295
1302
|
*/
|
|
1296
|
-
interface
|
|
1297
|
-
|
|
1298
|
-
|
|
1303
|
+
interface StructDef {
|
|
1304
|
+
name: string;
|
|
1305
|
+
parts: unknown[];
|
|
1299
1306
|
}
|
|
1300
1307
|
//#endregion
|
|
1301
|
-
//#region src/
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
interface DbMnemonic {
|
|
1307
|
-
key: number;
|
|
1308
|
-
value: string;
|
|
1309
|
-
metadata?: string;
|
|
1308
|
+
//#region src/types/tables.d.ts
|
|
1309
|
+
declare class TableEntry {
|
|
1310
|
+
location: number;
|
|
1311
|
+
object: unknown;
|
|
1312
|
+
constructor(location: number);
|
|
1310
1313
|
}
|
|
1311
1314
|
//#endregion
|
|
1312
|
-
//#region src/
|
|
1313
|
-
declare class
|
|
1314
|
-
location: number;
|
|
1315
|
-
register: string;
|
|
1315
|
+
//#region src/types/operands.d.ts
|
|
1316
|
+
declare class TypedNumber {
|
|
1316
1317
|
value: number;
|
|
1317
|
-
|
|
1318
|
+
size: number;
|
|
1319
|
+
constructor(value: number, size: number);
|
|
1320
|
+
}
|
|
1321
|
+
declare class Byte extends TypedNumber {
|
|
1322
|
+
constructor(value: number);
|
|
1323
|
+
}
|
|
1324
|
+
declare class Word extends TypedNumber {
|
|
1325
|
+
constructor(value: number);
|
|
1326
|
+
}
|
|
1327
|
+
declare class Long extends TypedNumber {
|
|
1328
|
+
constructor(value: number);
|
|
1318
1329
|
}
|
|
1319
1330
|
//#endregion
|
|
1320
|
-
//#region src/
|
|
1331
|
+
//#region src/assembly/Registers.d.ts
|
|
1321
1332
|
/**
|
|
1322
|
-
*
|
|
1323
|
-
* Converted from GaiaLib/Database/DbRewrite.cs
|
|
1333
|
+
* Manages the 65816 processor registers and status flags
|
|
1324
1334
|
*/
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1335
|
+
declare class Registers {
|
|
1336
|
+
value: Record<string, number>;
|
|
1337
|
+
stack: Stack;
|
|
1338
|
+
mode: MemoryMapMode;
|
|
1339
|
+
constructor(mode: MemoryMapMode);
|
|
1328
1340
|
}
|
|
1329
1341
|
//#endregion
|
|
1330
|
-
//#region src/
|
|
1342
|
+
//#region src/rom/extraction/processor.d.ts
|
|
1343
|
+
declare class MapExt<K, V> extends Map<K, V> {
|
|
1344
|
+
constructor();
|
|
1345
|
+
tryAdd(key: K, value: V): boolean;
|
|
1346
|
+
setFlag(key: K, flag: number, value?: boolean): void;
|
|
1347
|
+
clearFlag(key: K, flag: number): void;
|
|
1348
|
+
}
|
|
1331
1349
|
/**
|
|
1332
|
-
*
|
|
1333
|
-
* Converted from GaiaLib/
|
|
1350
|
+
* Manages CPU processor state during ROM analysis
|
|
1351
|
+
* Converted from GaiaLib/Rom/Extraction/ProcessorStateManager.cs
|
|
1334
1352
|
*/
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1353
|
+
declare class ProcessorStateManager {
|
|
1354
|
+
readonly stackPositions: MapExt<number, number>;
|
|
1355
|
+
private readonly _buckets;
|
|
1356
|
+
get(key: string): MapExt<number, number>;
|
|
1357
|
+
/**
|
|
1358
|
+
* Hydrate processor registers with stored state
|
|
1359
|
+
* Uses Registers from gaia-core/assembly for processor state management
|
|
1360
|
+
*/
|
|
1361
|
+
hydrateRegisters(position: number, reg: Registers): void;
|
|
1362
|
+
getStackPosition(location: number): number | undefined;
|
|
1363
|
+
setStackPosition(location: number, value: number): void;
|
|
1364
|
+
tryAddStackPosition(location: number, value: number): boolean;
|
|
1339
1365
|
}
|
|
1340
1366
|
//#endregion
|
|
1341
|
-
//#region src/rom/extraction/
|
|
1367
|
+
//#region src/rom/extraction/reader.d.ts
|
|
1342
1368
|
/**
|
|
1343
|
-
*
|
|
1344
|
-
* Converted from GaiaLib/Rom/Extraction/
|
|
1369
|
+
* Provides low-level ROM data reading functionality
|
|
1370
|
+
* Converted from GaiaLib/Rom/Extraction/RomDataReader.cs
|
|
1345
1371
|
*/
|
|
1346
|
-
declare class
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
referenceName?: string;
|
|
1361
|
-
};
|
|
1362
|
-
tryAddName(location: number, referenceName: string): boolean;
|
|
1363
|
-
tryGetMarker(location: number): {
|
|
1364
|
-
found: boolean;
|
|
1365
|
-
offset?: number;
|
|
1366
|
-
};
|
|
1367
|
-
setMarker(location: number, offset: number): void;
|
|
1368
|
-
createBranchLabel(location: number): string;
|
|
1369
|
-
createTypeName(type: string, location: number): string;
|
|
1370
|
-
createFallbackName(location: number): string;
|
|
1371
|
-
/**
|
|
1372
|
-
* Finds a reference location by its assigned name.
|
|
1373
|
-
*/
|
|
1374
|
-
findLocationByName(name: string): number | undefined;
|
|
1375
|
-
resolveName(location: number, type: AddressType, isBranch: boolean): string;
|
|
1376
|
-
findClosestReference(location: number): string | null;
|
|
1377
|
-
private processRewrite;
|
|
1378
|
-
private processClosestMatch;
|
|
1372
|
+
declare class RomDataReader {
|
|
1373
|
+
romData: Uint8Array;
|
|
1374
|
+
position: number;
|
|
1375
|
+
offset: number;
|
|
1376
|
+
constructor(romData: Uint8Array, offset?: number);
|
|
1377
|
+
readByte(): number;
|
|
1378
|
+
readSByte(): number;
|
|
1379
|
+
readUShort(): number;
|
|
1380
|
+
readShort(): number;
|
|
1381
|
+
readAddress(): number;
|
|
1382
|
+
readInt(): number;
|
|
1383
|
+
peekByte(): number;
|
|
1384
|
+
peekShort(): number;
|
|
1385
|
+
peekAddress(): number;
|
|
1379
1386
|
}
|
|
1380
1387
|
//#endregion
|
|
1381
1388
|
//#region src/rom/extraction/strings.d.ts
|
|
@@ -1452,10 +1459,10 @@ declare class BlockReader {
|
|
|
1452
1459
|
readonly _root: DbRoot;
|
|
1453
1460
|
readonly _stringReader: StringReader;
|
|
1454
1461
|
readonly _asmReader: AsmReader;
|
|
1455
|
-
|
|
1456
|
-
|
|
1462
|
+
_typeParser: TypeParser;
|
|
1463
|
+
_romDataReader: RomDataReader;
|
|
1457
1464
|
readonly _stateManager: ProcessorStateManager;
|
|
1458
|
-
|
|
1465
|
+
_referenceManager: ReferenceManager;
|
|
1459
1466
|
_partEnd: number;
|
|
1460
1467
|
_currentChunk: ChunkFile | null;
|
|
1461
1468
|
_currentAsmBlock: AsmBlock | null;
|
|
@@ -1476,7 +1483,6 @@ declare class BlockReader {
|
|
|
1476
1483
|
/**
|
|
1477
1484
|
* Resolves name for a location (delegated to ReferenceManager)
|
|
1478
1485
|
*/
|
|
1479
|
-
resolveName(location: number, type: AddressType, isBranch: boolean): string;
|
|
1480
1486
|
/**
|
|
1481
1487
|
* Resolves include for a location
|
|
1482
1488
|
*/
|
|
@@ -1505,7 +1511,7 @@ declare class BlockReader {
|
|
|
1505
1511
|
/**
|
|
1506
1512
|
* Processes a single part
|
|
1507
1513
|
*/
|
|
1508
|
-
|
|
1514
|
+
processPart(part: AsmBlock): void;
|
|
1509
1515
|
/**
|
|
1510
1516
|
* Processes a continuous entry (same type as previous)
|
|
1511
1517
|
*/
|
|
@@ -1755,7 +1761,7 @@ declare class RomWriter {
|
|
|
1755
1761
|
private romSize?;
|
|
1756
1762
|
readonly root: DbRoot;
|
|
1757
1763
|
constructor(root: DbRoot);
|
|
1758
|
-
repack(files: ChunkFile[]): Promise<Uint8Array>;
|
|
1764
|
+
repack(files: ChunkFile[], modules?: string[]): Promise<Uint8Array>;
|
|
1759
1765
|
allocate(pages: number): void;
|
|
1760
1766
|
writeHeaders(masterLookup: Map<string, number>): void;
|
|
1761
1767
|
prepareHeaderValues(): any;
|
|
@@ -1768,16 +1774,16 @@ declare class RomWriter {
|
|
|
1768
1774
|
* Parse assembly blocks and write binary data to output buffer
|
|
1769
1775
|
* Converted from ext/GaiaLib/Rom/Rebuild/RomWriter.cs ParseAssembly method
|
|
1770
1776
|
*/
|
|
1771
|
-
|
|
1777
|
+
static parseAssembly(root: DbRoot, blocks: AsmBlock[], fileLookup: Map<string, number>, includeLookup: Map<string, AsmBlock>, outBuffer: Uint8Array, addrOffset?: number): void;
|
|
1772
1778
|
/**
|
|
1773
1779
|
* Helper method to find index of any character from an array in a string
|
|
1774
1780
|
*/
|
|
1775
|
-
|
|
1781
|
+
static indexOfAny(str: string, chars: string[]): number;
|
|
1776
1782
|
/**
|
|
1777
1783
|
* Helper method to check if an object is a StringMarker
|
|
1778
1784
|
*/
|
|
1779
|
-
|
|
1780
|
-
|
|
1785
|
+
static isStringMarker(obj: unknown): obj is StringMarker;
|
|
1786
|
+
static isTableEntry(obj: unknown): obj is TableEntry;
|
|
1781
1787
|
}
|
|
1782
1788
|
//#endregion
|
|
1783
1789
|
//#region src/rom/rebuild/processor.d.ts
|
|
@@ -1788,7 +1794,7 @@ declare class RomWriter {
|
|
|
1788
1794
|
declare class RomProcessor {
|
|
1789
1795
|
private readonly writer;
|
|
1790
1796
|
constructor(writer: RomWriter);
|
|
1791
|
-
repack(allFiles: ChunkFile[]): Promise<Map<string, number>>;
|
|
1797
|
+
repack(allFiles: ChunkFile[], modules?: string[]): Promise<Map<string, number>>;
|
|
1792
1798
|
static applyPatches(asmFiles: ChunkFile[], patches: ChunkFile[]): void;
|
|
1793
1799
|
}
|
|
1794
1800
|
//#endregion
|
|
@@ -1908,6 +1914,7 @@ declare class RomGenerator {
|
|
|
1908
1914
|
dbRoot: DbRoot;
|
|
1909
1915
|
private sourceData;
|
|
1910
1916
|
constructor(projectName: string, crc: number);
|
|
1917
|
+
validateAndLoad(sourceData: Uint8Array, gameModule: DbGameRomModule, baseRomPath: string, modulePath: string): Promise<boolean>;
|
|
1911
1918
|
validateAndDownload(sourceData: Uint8Array): Promise<boolean>;
|
|
1912
1919
|
generateProject(modules: string[], manualFiles?: ChunkFile[], unshiftManualFiles?: boolean): Promise<Uint8Array>;
|
|
1913
1920
|
private applyProjectInit;
|
|
@@ -3158,5 +3165,5 @@ declare const snes: {
|
|
|
3158
3165
|
};
|
|
3159
3166
|
declare const isPlatformNode: string | false;
|
|
3160
3167
|
//#endregion
|
|
3161
|
-
export { Address, AddressSpace, AddressType, AddressingModeHandler, AsmBlock, AsmBlockUtils, AsmReader, Assembler, AssemblerState, BaseRomBranchData, BaseRomBranchFileRaw, BaseRomData, BaseRomFileData, BaseRomFileRaw, BaseRomPayload, BinType, BitStream, BlockReader, BlockReaderConstants, BlockWriter, BranchBaseData, Byte, ChunkFile, ChunkFileUtils, CollaborationConfig, CompressionAlgorithms, CompressionRegistry, CopCommandProcessor, CopDef, CpuMode, Database, DbAddressingMode, DbAsset, DbBaseRomModule, DbBlock, DbConfig, DbEntryPoint, DbFile, DbFileType, DbGameRomModule, DbGroup, DbHeader, DbHeaderPart, DbLabel, DbMnemonic, DbOverride, DbPart, DbPath, DbProjectModule, DbRewrite, DbRoot, DbRootUtils, DbScene, DbSfx, DbStringCommand, DbStringDictionary, DbStringLayer, DbStringType, DbStruct, DbTransform, DeveloperData, DirectoryEntry, FileBaseData, FileBaseRaw, FileReadOptions, FromSupabaseByNameOptions, FromSupabaseByProjectOptions, GameData, GameDeveloperData, GameRomArtifactData, GameRomArtifactRaw, GameRomBranchArtifactRaw, GameRomBranchData, GameRomData, ICompressionProvider, LocationWrapper, Long, MapExt, MemberType, MemoryMapMode, ObjectType, Op, OpCode, OperationContext, PlatformBranchData, PlatformData, PostProcessor, ProcessorStateManager, ProjectBranchData, ProjectBranchFileRaw, ProjectConfig, ProjectData, ProjectFileData, ProjectFileRaw, ProjectPayload, QueryStats, QuintetLZ, ReferenceManager, RegionData, RegisterType, Registers, RomDataReader, RomGenerator, RomLayout, RomProcessingConstants, RomProcessor, RomState, RomStateUtils, RomWriter, SortedMap, SpriteFrame, SpriteGroup, SpriteMap, SpritePart, Stack, StackOperations, StatusFlags, StringEntry, StringMarker, StringProcessor, StringReader, StringSizeComparer, StringWrapper, StructDef, SupabaseErrorCode, SupabaseFromError, SupabaseResult, TableEntry, TransformProcessor, TypeParser, TypedNumber, Word, XformDef, XformType, base64ToUint8Array, binaryToUtf8String, bytesToHex, clamp, crc32_buffer, crc32_text_utf16, crc32_text_utf8,
|
|
3168
|
+
export { Address, AddressSpace, AddressType, AddressingModeHandler, AsmBlock, AsmBlockUtils, AsmReader, Assembler, AssemblerState, BaseRomBranchData, BaseRomBranchFileRaw, BaseRomData, BaseRomFileData, BaseRomFileRaw, BaseRomPayload, BinType, BitStream, BlockReader, BlockReaderConstants, BlockWriter, BranchBaseData, Byte, ChunkFile, ChunkFileUtils, CollaborationConfig, CompressionAlgorithms, CompressionRegistry, CopCommandProcessor, CopDef, CpuMode, Database, DbAddressingMode, DbAsset, DbBaseRomModule, DbBlock, DbConfig, DbEntryPoint, DbFile, DbFileType, DbGameRomModule, DbGroup, DbHeader, DbHeaderPart, DbLabel, DbMnemonic, DbOverride, DbPart, DbPath, DbProjectModule, DbRewrite, DbRoot, DbRootUtils, DbScene, DbSfx, DbStringCommand, DbStringDictionary, DbStringLayer, DbStringType, DbStruct, DbTransform, DeveloperData, DirectoryEntry, FileBaseData, FileBaseRaw, FileReadOptions, FromSupabaseByNameOptions, FromSupabaseByProjectOptions, GameData, GameDeveloperData, GameRomArtifactData, GameRomArtifactRaw, GameRomBranchArtifactRaw, GameRomBranchData, GameRomData, ICompressionProvider, LocationWrapper, Long, MapExt, MemberType, MemoryMapMode, ObjectType, Op, OpCode, OperationContext, PlatformBranchData, PlatformData, PostProcessor, ProcessorStateManager, ProjectBranchData, ProjectBranchFileRaw, ProjectConfig, ProjectData, ProjectFileData, ProjectFileRaw, ProjectPayload, QueryStats, QuintetLZ, ReferenceManager, RegionData, RegisterType, Registers, RomDataReader, RomGenerator, RomLayout, RomProcessingConstants, RomProcessor, RomState, RomStateUtils, RomWriter, SortedMap, SpriteFrame, SpriteGroup, SpriteMap, SpritePart, Stack, StackOperations, StatusFlags, StringEntry, StringMarker, StringProcessor, StringReader, StringSizeComparer, StringWrapper, StructDef, SupabaseErrorCode, SupabaseFromError, SupabaseResult, TableEntry, TransformProcessor, TypeParser, TypedNumber, Word, XformDef, XformType, base64ToUint8Array, binaryToUtf8String, bytesToHex, clamp, combineHeader, crc32_buffer, crc32_text_utf16, crc32_text_utf8, createDbPath, createSupabaseClient, createTempDirectory, decodeBase64, decodeBase64String, decodeDataString, encodeBase64, encodeBase64String, fileExists, fromSupabaseByGameRom, fromSupabaseById, fromSupabaseByName, fromSupabaseByProject, getDirectory, getEnvVar, getNestedProperty, getSupabaseClient, hexToBytes, hexToUint8Array, indexOfAny, isPlatformNode, isValidBase64, listDirectory, readFileAsBinary, readFileAsText, readJsonFile, removeDirectory, resetSupabaseClient, saveFileAsBinary, saveFileAsText, snes, summaryFromSupabaseByProject, uint8ArrayToBase64, validateEnvironmentVariables };
|
|
3162
3169
|
//# sourceMappingURL=index.d.mts.map
|