@gaialabs/core 0.1.14 → 0.1.16
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 +8 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -3688,7 +3688,7 @@ var RomGenerator = class {
|
|
|
3688
3688
|
}
|
|
3689
3689
|
return false;
|
|
3690
3690
|
}
|
|
3691
|
-
async generateProject(modules, manualFiles) {
|
|
3691
|
+
async generateProject(modules, manualFiles, unshiftManualFiles = false) {
|
|
3692
3692
|
if (!this.dbRoot) throw new Error("Database not initialized");
|
|
3693
3693
|
if (!this.sourceData) throw new Error("Source data not initialized");
|
|
3694
3694
|
const reader = new BlockReader(this.sourceData, this.dbRoot);
|
|
@@ -3699,10 +3699,15 @@ var RomGenerator = class {
|
|
|
3699
3699
|
for (const block of asmFiles) block.textData = writer.generateAsm(block);
|
|
3700
3700
|
for (const chunkFile of this.dbRoot.baseRomFiles) this.applyPatchFile(chunkFile, chunkFiles, asmFiles, patchFiles);
|
|
3701
3701
|
const moduleLookup = this.applyProjectInit(chunkFiles, asmFiles, patchFiles);
|
|
3702
|
+
if (unshiftManualFiles) {
|
|
3703
|
+
for (const file of manualFiles ?? []) this.applyPatchFile(file, chunkFiles, asmFiles, patchFiles);
|
|
3704
|
+
}
|
|
3702
3705
|
for (const module of modules) {
|
|
3703
3706
|
for (const file of moduleLookup.get(module)) this.applyPatchFile(file, chunkFiles, asmFiles, patchFiles);
|
|
3704
3707
|
}
|
|
3705
|
-
|
|
3708
|
+
if (!unshiftManualFiles) {
|
|
3709
|
+
for (const file of manualFiles ?? []) this.applyPatchFile(file, chunkFiles, asmFiles, patchFiles);
|
|
3710
|
+
}
|
|
3706
3711
|
this.assembleCodeFromText(asmFiles);
|
|
3707
3712
|
RomProcessor.applyPatches(asmFiles, patchFiles);
|
|
3708
3713
|
for (const asm of chunkFiles) ChunkFileUtils.calculateSize(asm);
|
|
@@ -3775,7 +3780,7 @@ var RomGenerator = class {
|
|
|
3775
3780
|
}
|
|
3776
3781
|
async writeRom(blockLookup, entryPoints, chunkFiles, asmFiles) {
|
|
3777
3782
|
const romWriter = new RomWriter(entryPoints, "GAIALABS", "01JG ");
|
|
3778
|
-
for (const file of chunkFiles) await romWriter.writeFile(file, blockLookup);
|
|
3783
|
+
for (const file of chunkFiles.sort((a, b) => a.location - b.location)) await romWriter.writeFile(file, blockLookup);
|
|
3779
3784
|
romWriter.writeHeader();
|
|
3780
3785
|
romWriter.writeEntryPoints(asmFiles);
|
|
3781
3786
|
romWriter.writeChecksum();
|