@gaialabs/core 0.1.13 → 0.1.15
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2669,11 +2669,15 @@ var RomWriter = class {
|
|
|
2669
2669
|
}
|
|
2670
2670
|
writeChecksum() {
|
|
2671
2671
|
const buf = this.outBuffer;
|
|
2672
|
+
buf[65500] = 255;
|
|
2673
|
+
buf[65501] = 255;
|
|
2674
|
+
buf[65502] = 0;
|
|
2675
|
+
buf[65503] = 0;
|
|
2672
2676
|
let sum = 0;
|
|
2673
|
-
for (let i = 0; i < buf.length; i++) sum += buf[i]
|
|
2677
|
+
for (let i = 0; i < buf.length; i++) sum += buf[i];
|
|
2674
2678
|
buf[65502] = sum & 255;
|
|
2675
2679
|
buf[65503] = sum >> 8 & 255;
|
|
2676
|
-
const comp = ~sum
|
|
2680
|
+
const comp = ~sum;
|
|
2677
2681
|
buf[65500] = comp & 255;
|
|
2678
2682
|
buf[65501] = comp >> 8 & 255;
|
|
2679
2683
|
}
|
|
@@ -3684,7 +3688,7 @@ var RomGenerator = class {
|
|
|
3684
3688
|
}
|
|
3685
3689
|
return false;
|
|
3686
3690
|
}
|
|
3687
|
-
async generateProject(modules, manualFiles) {
|
|
3691
|
+
async generateProject(modules, manualFiles, unshiftManualFiles = false) {
|
|
3688
3692
|
if (!this.dbRoot) throw new Error("Database not initialized");
|
|
3689
3693
|
if (!this.sourceData) throw new Error("Source data not initialized");
|
|
3690
3694
|
const reader = new BlockReader(this.sourceData, this.dbRoot);
|
|
@@ -3695,10 +3699,15 @@ var RomGenerator = class {
|
|
|
3695
3699
|
for (const block of asmFiles) block.textData = writer.generateAsm(block);
|
|
3696
3700
|
for (const chunkFile of this.dbRoot.baseRomFiles) this.applyPatchFile(chunkFile, chunkFiles, asmFiles, patchFiles);
|
|
3697
3701
|
const moduleLookup = this.applyProjectInit(chunkFiles, asmFiles, patchFiles);
|
|
3702
|
+
if (unshiftManualFiles) {
|
|
3703
|
+
for (const file of manualFiles ?? []) this.applyPatchFile(file, chunkFiles, asmFiles, patchFiles);
|
|
3704
|
+
}
|
|
3698
3705
|
for (const module of modules) {
|
|
3699
3706
|
for (const file of moduleLookup.get(module)) this.applyPatchFile(file, chunkFiles, asmFiles, patchFiles);
|
|
3700
3707
|
}
|
|
3701
|
-
|
|
3708
|
+
if (!unshiftManualFiles) {
|
|
3709
|
+
for (const file of manualFiles ?? []) this.applyPatchFile(file, chunkFiles, asmFiles, patchFiles);
|
|
3710
|
+
}
|
|
3702
3711
|
this.assembleCodeFromText(asmFiles);
|
|
3703
3712
|
RomProcessor.applyPatches(asmFiles, patchFiles);
|
|
3704
3713
|
for (const asm of chunkFiles) ChunkFileUtils.calculateSize(asm);
|